コード例 #1
0
        private void Button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            RegisteredMember f1 = new RegisteredMember();

            f1.Show();
        }
コード例 #2
0
        private void UpdateButtonClick(object sender, EventArgs e)
        {
            if (textBoxAddress.Text == null && textBoxEmail.Text == null && textBoxMobileNumber.Text == null)
            {
                MessageBox.Show("All text field are empty", "Alert");
            }
            else
            {
                if (textBoxMobileNumber.Text.Length != 11 && textBoxMobileNumber.Text != null)
                {
                    MessageBox.Show("Invalid Phone Number", "Alert");
                }
                else
                {
                    string mobile  = (textBoxMobileNumber.Text == null) ? mem.Mobile_Number : textBoxMobileNumber.Text;
                    string gmail   = (textBoxEmail.Text == null) ? mem.Gmail : textBoxEmail.Text;
                    string address = (textBoxAddress.Text == null) ? mem.Address : textBoxAddress.Text;

                    var res = ResisterController.ResisterUpdateMember(mobile, gmail, address, mem.Username);
                    if (res != null)
                    {
                        this.mem = res;
                        MessageBox.Show("Information Updated Successfully", "Message");
                        this.Hide();
                        RegisteredMember a = new RegisteredMember(mem);
                        a.Show();
                    }
                }
            }
        }
コード例 #3
0
        private void BackButtonClicked(object sender, EventArgs e)
        {
            this.Hide();
            RegisteredMember f1 = new RegisteredMember(mem);

            f1.Show();
        }
コード例 #4
0
 private void ConfirmButtonClick(object sender, EventArgs e)
 {
     if (textBoxNewPassword.Text == textBoxRepass.Text)
     {
         string errors = "";
         errors += textBoxNewPassword.Text.Length == 0 ? "\nPlease Provide New Password" : "";
         errors += textBoxRepass.Text.Length == 0 ? "\nPlease provide Retype Password" : "";
         errors += textBoxOldPassword.Text.Length == 0 ? "\nPlease Provide Old Password" : "";
         if (errors.Length == 0)
         {
             var result = ResisterController.VerifyPassword(mem.Username);
             if (result == textBoxOldPassword.Text)
             {
                 ResisterController.UpdatePassword(mem.Username, textBoxNewPassword.Text);
                 MessageBox.Show("Password Changed Succesfully", "Message");
                 this.Hide();
                 RegisteredMember a = new RegisteredMember(mem);
                 a.Show();
             }
             else
             {
                 MessageBox.Show("Your password is incorrect", "Alert");
             }
         }
         else
         {
             MessageBox.Show(errors, "Filled the flowing!");
             return;
         }
     }
     else
     {
         MessageBox.Show("New password and re-Enter pasword doesn't match", "Alert");
     }
 }
コード例 #5
0
        private void SubmitButtonClicked(object sender, EventArgs e)
        {
            BloodDonorController.InsertDonateInfo(mem);
            BloodStockController.UpdateStock(mem.Blood_Group);
            MessageBox.Show("Thank you for your donation", "Message");
            //buttonBack.PerformClick();
            this.Hide();
            RegisteredMember f1 = new RegisteredMember(mem);

            f1.Show();
        }