Exemplo n.º 1
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     try
     {
         bool result = businessLogicClass.manageMembers(memberId, txtFname.Text, txtAdd.Text, tctContact.Text, txtEmail.Text, cmbGender.Text, Convert.ToDateTime(dateDOB.Text), Convert.ToDateTime(dateDOJ.Text), txtDescription.Text, AssistantClass.imageConverter(picBrowse), 3);
         if (result == true)
         {
             MessageBox.Show("MEMBER HAS BEEN SUCCESSFULLY DELETED");
             dgvMemberInformation.DataSource = memberClass.getAllMembers();
             AssistantClass.makeFieldsBlank(gbMemberDetails);
             picBrowse.Image = null;
         }
         else
         {
             MessageBox.Show("ERROR IN DELETING MEMBER");
             dgvMemberInformation.DataSource = memberClass.getAllMembers();
             AssistantClass.makeFieldsBlank(gbMemberDetails);
             picBrowse.Image = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     try
     {
         bool result = businessLogicClass.manageUsers(userId, Convert.ToInt32(cmbUserRole.SelectedValue.ToString()), Convert.ToInt32(cmbFullName.SelectedValue.ToString()), txtUserName.Text, txtPassword.Text, 3);
         if (result == true)
         {
             MessageBox.Show("NEW USER HAS BEEN DELETED");
             dgvUserInformation.DataSource = userClass.getAllUsers();
             AssistantClass.makeFieldsBlank(groupBox1);
         }
         else
         {
             MessageBox.Show("ERROR ON ADDING NEW DELETED");
             dgvUserInformation.DataSource = userClass.getAllUsers();
             AssistantClass.makeFieldsBlank(groupBox1);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 3
0
        // Update Member Details
        private void btnUpdate_Click_1(object sender, EventArgs e)
        {
            if (txtFname.Text == "")
            {
                MessageBox.Show("Please Select Full Name");
            }
            else if (txtAdd.Text == "")
            {
                MessageBox.Show("Please Provide Address");
            }
            else if (tctContact.Text == "")
            {
                MessageBox.Show("Please Provide Contact Details");
            }
            else if (txtDescription.Text == "")
            {
                MessageBox.Show("Please Provide Description");
            }
            else if (txtEmail.Text == "")
            {
                MessageBox.Show("Please Provide Email Address");
            }
            else if (cmbGender.Text == "")
            {
                MessageBox.Show("Please Select Gender");
            }
            else if (dateDOB.Text == "")
            {
                MessageBox.Show("Please Provide Date of Birth");
            }
            else if (dateDOJ.Text == "")
            {
                MessageBox.Show("Please Provide DAte of Join");
            }
            else if (picBrowse.Image == null)
            {
                MessageBox.Show("Please Upload");
            }

            else
            {
                try
                {
                    bool result = businessLogicClass.manageMembers(memberId, txtFname.Text, txtAdd.Text, tctContact.Text, txtEmail.Text, cmbGender.Text, Convert.ToDateTime(dateDOB.Text), Convert.ToDateTime(dateDOJ.Text), txtDescription.Text, AssistantClass.imageConverter(picBrowse), 2);
                    if (result == true)
                    {
                        MessageBox.Show("MEMBER HAS BEEN SUCCESSFULLY UPDATED");
                        dgvMemberInformation.DataSource = memberClass.getAllMembers();
                        AssistantClass.makeFieldsBlank(gbMemberDetails);
                        picBrowse.Image = null;
                    }
                    else
                    {
                        MessageBox.Show("ERROR IN UPDATING MEMBER");
                        dgvMemberInformation.DataSource = memberClass.getAllMembers();
                        AssistantClass.makeFieldsBlank(gbMemberDetails);
                        picBrowse.Image = null;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }