コード例 #1
0
ファイル: CPerson.cs プロジェクト: mano55/fcm
 public CPerson(string firstName, string lastName, UInt32 id, CCommunicationDetails commDetails)
 {
     FirstName   = firstName;
     LastName    = lastName;
     ID          = id;
     CommDetails = commDetails;
 }
コード例 #2
0
ファイル: CPerson.cs プロジェクト: mano55/fcm
 public CPerson(string firstName, string lastName, UInt32 id, CCommunicationDetails commDetails)
 {
     FirstName = firstName;
     LastName = lastName;
     ID = id;
     CommDetails = commDetails;
 }
コード例 #3
0
ファイル: FormPlayer.cs プロジェクト: mano55/fcm
        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);
        }
コード例 #4
0
ファイル: CTeam.cs プロジェクト: mano55/fcm
        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);
        }
コード例 #5
0
ファイル: CTeam.cs プロジェクト: mano55/fcm
        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;
        }
コード例 #6
0
ファイル: FormPlayer.cs プロジェクト: mano55/fcm
        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);
                    }
                }
            }
        }
コード例 #7
0
 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
 }
コード例 #8
0
 public CPlayer(string firstName, string lastName, UInt32 id, CCommunicationDetails commDet) : base(firstName, lastName, id, commDet)
 {
 }
コード例 #9
0
ファイル: FormPlayer.cs プロジェクト: mano55/fcm
        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;
        }
コード例 #10
0
ファイル: FormPlayer.cs プロジェクト: mano55/fcm
        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);
                    }

                }
            }
        }
コード例 #11
0
ファイル: CPlayer.cs プロジェクト: mano55/fcm
 public CPlayer(string firstName, string lastName, UInt32 id, CCommunicationDetails commDet)
     : base(firstName, lastName, id, commDet)
 {
 }
コード例 #12
0
 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
 }