private void BackButton(object sender, EventArgs e)
        {
            this.Hide();
            RegisteredMember r = new RegisteredMember(u);

            r.Show();
        }
Ejemplo n.º 2
0
 private void ComfirmClick(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)
         {
             int result = ResisterController.UpdatePassword(u.Username, textBoxOldPassword.Text, textBoxNewPassword.Text);
             if (result != 0)
             {
                 MessageBox.Show("Password Changed Succesfully", "Message");
                 this.Hide();
                 RegisteredMember a = new RegisteredMember(u);
                 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");
     }
 }
Ejemplo n.º 3
0
        private void BackClick(object sender, EventArgs e)
        {
            this.Hide();
            RegisteredMember f1 = new RegisteredMember(u);

            f1.Show();
        }
Ejemplo n.º 4
0
        private void LoginButtonClicked(object sender, EventArgs e)
        {
            User a = new User();

            if (textBoxUser.Text == "")
            {
                MessageBox.Show("Username Can not be empty!", "Alert");
            }

            else if (textBoxPass.Text == "")
            {
                MessageBox.Show("Password Can not be empty!", "Alert");
            }

            else
            {
                var res = LoginController.ValidateMember(textBoxUser.Text);
                a = res;
                if (res == null)
                {
                    textBoxUser.Text = "";
                    textBoxPass.Text = "";
                    MessageBox.Show("User does no exist", "Alert");
                }
                else
                {
                    if (a.Password != textBoxPass.Text)
                    {
                        textBoxPass.Text = "";
                        MessageBox.Show("Invalid  Password", "Alert");
                    }
                    else if (a.Permission.Equals("Invalid"))
                    {
                        textBoxUser.Text = "";
                        textBoxPass.Text = "";
                        MessageBox.Show("Your account is blocked.Contact with [email protected]", "Alert");
                    }
                    else
                    {
                        if (a.Type == "User")
                        {
                            this.Hide();
                            RegisteredMember r = new RegisteredMember(a);
                            r.Show();
                        }
                        else if (a.Type == "Admin")
                        {
                            this.Hide();
                            Admin r = new Admin();
                            r.Show();
                        }
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private void buttonSubmit_Click(object sender, EventArgs e)
        {
            BloodDonerController.InsertDonateInfo(u);
            BloodStckController.UpdateStock(ResisterController.GetInfo(u.Info_Id));
            MessageBox.Show("Thank you for your donation", "Message");
            //buttonBack.PerformClick();
            this.Hide();
            RegisteredMember f1 = new RegisteredMember(u);

            f1.Show();
        }