The below contract deploys fine but the method cannot be executed. I just want to assign a long member number to each member like 12345 and maybe look through the array with that ID. Is this possible?
contract MembersMODDED {
mapping (address => uint) public memberId;
Member[] public members;
struct Member {
string Name;
string SurName;
address MemberAccountNo;
bool IsActive;
int AccountType;
uint MemberNo;
uint memberSince;
}
function Members( ) {
}
function changeMembership(address memberAccountNo, bool isActive, string name, string surName,int accountType,uint memberNo) {
uint id;
if (memberId[memberAccountNo] == 0) {
memberId[memberAccountNo] = memberNo;
id = memberNo;
members[id] = Member({MemberAccountNo: memberAccountNo, IsActive: isActive, memberSince: now, Name: name, SurName: surName, AccountType: accountType, MemberNo: memberNo});
} else {
id = memberId[memberAccountNo];
Member m = members[id];
m.IsActive = isActive;
m.Name = name;
m.SurName = surName;
}
}
}