public CPerson(string firstName, string lastName, UInt32 id, CCommunicationDetails commDetails) { FirstName = firstName; LastName = lastName; ID = id; CommDetails = commDetails; }
private string checkFormFillingValidity(CCommunicationDetails commDet, out UInt32 id) { UInt32 num = 0; const UInt32 idMaxNum = 999999999; string res = ""; id = 0; if (UInt32.TryParse(tbID.Text, out num)) { if (num > idMaxNum) { res += "מספר ת.ז אינו חוקי \n"; } else { id = num; } } else { res += "מספר ת.ז אינו חוקי \n"; } if (UInt32.TryParse(tbHouseNo.Text, out num)) { commDet.houseNo = num; } else { res += "מספר בית אינו חוקי \n"; } if (UInt32.TryParse(tbPhone1.Text, out num)) { commDet.phoneNo1 = num; } else { res += "טלפון 1 אינו חוקי \n"; } if (UInt32.TryParse(tbPhone2.Text, out num)) { commDet.phoneNo2 = num; } else { res += "טלפון 2 אינו חוקי \n"; } return(res); }
public string addPlayer(string firstName, string lastName, UInt32 id, CCommunicationDetails commDet) { string res = ""; if (!playerExists(id)) { Players.Add(new CPlayer(firstName, lastName, id, commDet)); } else { res += "שחקן בעל ת.ז זהה קיים במערכת \n"; } return(res); }
public string addPlayer(string firstName, string lastName, UInt32 id,CCommunicationDetails commDet) { string res=""; if (!playerExists(id)) { Players.Add(new CPlayer(firstName, lastName, id, commDet)); } else { res += "שחקן בעל ת.ז זהה קיים במערכת \n"; } return res; }
private void buttOk_Click(object sender, EventArgs e) { UInt32 id = 0; CCommunicationDetails commDet = new CCommunicationDetails(); string error = checkFormFilling(); error = ""; //debug have to remove if (error != "") { MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { error = checkFormFillingValidity(commDet, out id); //debug have to restore if (error != "") { MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { commDet.city = tbCity.Text; commDet.street = tbStreet.Text; commDet.email = tbEmail.Text; error = cgai.addNewPlayer(tbFirstName.Text, tbLastName.Text, id, commDet); if (error == "") { this.pChooseTeam.Visible = true; this.lplayerName.Text = tbFirstName.Text + " " + tbLastName.Text; this.bPersonalDetCheck.Visible = true; } else { MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }
public string addNewPlayer(string firstName, string lastName, UInt32 id, CCommunicationDetails commDet) { m_teams.getDefultTeam().addPlayer(new CPlayer(firstName, lastName, id, commDet)); return "";//TBD have to check which test i missed }
public CPlayer(string firstName, string lastName, UInt32 id, CCommunicationDetails commDet) : base(firstName, lastName, id, commDet) { }
private string checkFormFillingValidity(CCommunicationDetails commDet, out UInt32 id) { UInt32 num = 0; const UInt32 idMaxNum = 999999999; string res = ""; id = 0; if (UInt32.TryParse(tbID.Text, out num)) { if (num > idMaxNum) { res += "מספר ת.ז אינו חוקי \n"; } else { id = num; } } else { res += "מספר ת.ז אינו חוקי \n"; } if (UInt32.TryParse(tbHouseNo.Text, out num)) { commDet.houseNo = num; } else { res += "מספר בית אינו חוקי \n"; } if (UInt32.TryParse(tbPhone1.Text, out num)) { commDet.phoneNo1 = num; } else { res += "טלפון 1 אינו חוקי \n"; } if (UInt32.TryParse(tbPhone2.Text, out num)) { commDet.phoneNo2 = num; } else { res += "טלפון 2 אינו חוקי \n"; } return res; }
private void buttOk_Click(object sender, EventArgs e) { UInt32 id = 0; CCommunicationDetails commDet = new CCommunicationDetails(); string error = checkFormFilling(); error = ""; //debug have to remove if (error != "") { MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { error = checkFormFillingValidity(commDet,out id); //debug have to restore if (error != "") { MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { commDet.city = tbCity.Text; commDet.street = tbStreet.Text; commDet.email = tbEmail.Text; error = cgai.addNewPlayer( tbFirstName.Text, tbLastName.Text, id, commDet); if (error == "") { this.pChooseTeam.Visible = true; this.lplayerName.Text = tbFirstName.Text + " " + tbLastName.Text; this.bPersonalDetCheck.Visible = true; } else { MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }
public string addNewPlayer(string firstName, string lastName, UInt32 id, CCommunicationDetails commDet) { m_teams.getDefultTeam().addPlayer(new CPlayer(firstName, lastName, id, commDet)); return("");//TBD have to check which test i missed }