private void Serach_Click(object sender, EventArgs e)
 {
     try
     {
         p = new PartyMember();
         DataRow t = p.SerachMember(int.Parse(idNumberCode.Text));
         p = new PartyMember(t);
         numberCode.Text      = p.MemberCode.ToString();
         namePartyMember.Text = p.PartyName;
         name.Text            = p.FName;
         lastName.Text        = p.LName;
         brithDay.Text        = p.GetDobstring();
         expirence.Text       = p.Experience;
         education.Text       = p.Education;
         numberOfList.Text    = p.ListPlace.ToString();
     }
     catch
     {
         MessageBox.Show("Doesn't Exist such code in System");
     }
 }
示例#2
0
 /// <summary>
 /// The function search if the member exist or not.If the member exists ,his details are presented to the screen if not error messege
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void nbtn_Click(object sender, EventArgs e)
 {
     try
     {
         p = new PartyMember();
         DataRow t = p.SerachMember(int.Parse(memberCode1.Text));
         p                = new PartyMember(t);
         party.Text       = p.PartyName;
         memberName.Text  = p.FName;
         memberLName.Text = p.LName;
         dob.Text         = p.GetDobstring();
         expe.Text        = p.Experience;
         educ.Text        = p.Education;
         mode.Text        = p.Mode.ToString();
         listplace.Text   = p.ListPlace.ToString();
     }
     catch
     {
         MessageBox.Show("The member code not exist in the system");
     }
 }
        /// <summary>
        /// The Elections Manager removes the party member
        /// </summary>
        /// <param name="partyName"></param>
        /// <param name="mode"></param>
        /// <returns></returns> The removed party member
        public void removePartyMember(int code, string nameParty, string name, string lastname, DateTime brithDate, int sizeMemberSize, string exp, string education)
        {
            PartyMember p = new PartyMember(code, nameParty, name, lastname, brithDate, sizeMemberSize, exp, education); //Creating Party Member object

            p.RemoveMember();                                                                                            //Using the RemoveMember function in PartyMember class
        }
        /// <summary>
        /// The Elections Manager add new party member.
        /// </summary>
        /// <returns></returns> The new party.
        public string newPartyMember(int code, string nameParty, string name, string lastName, DateTime brithDate, int listPlac, string expirence, string educasion)
        {
            PartyMember party = new PartyMember(code, nameParty, name, lastName, brithDate, listPlac, expirence, educasion);

            return(party.AddPartyMember());
        }
        /// <summary>
        /// The Elections Manager updates memeber party details
        /// </summary>
        /// <returns></returns> The updated party member
        public string UpdateMemberParty(int code, string exp, string edu, int numOfList, string namePartyMember, DateTime BD, string name, string laseName)
        {
            PartyMember partyMem = new PartyMember(code, namePartyMember, name, laseName, BD, numOfList, exp, edu);

            return(partyMem.UpdateMemberParty());
        }