Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            controllerObj = new Controller();
            DataRow res = controllerObj.ViewAdmins(44444).Rows[0];

            if (oldpassTextBox.Text == (string)res["pass_word"])
            {
                int ch0 = controllerObj.UpdateAdminPass(44444, newpassTextBox2.Text);
                if (ch0 > 0)
                {
                    MessageBox.Show("Your password has been changed");
                }
            }
            else
            {
                MessageBox.Show("The password you entered is not correct. Please renter your password");
            }
        }
Ejemplo n.º 2
0
 private void loginingbutton_Click(object sender, EventArgs e)
 {
     controllerObj = new Controller();
     if (int.Parse(IDtextBox.Text) >= 44444 && int.Parse(IDtextBox.Text) <= 44999)
     {
         DataRow res = controllerObj.ViewAdmins(int.Parse(IDtextBox.Text)).Rows[0];
         if (PasswordtextBox.Text == (string)res["pass_word"])
         {
             Datacontainer.LoginAID = (int)res["ID"];
             Admin_Form A1 = new Admin_Form();
             A1.Show();
             Hide();
             //this.Close();
         }
         else
         {
             MessageBox.Show("The password you entered is not correct. Please renter your password and log in");
         }
     }
     else
     {
         MessageBox.Show("Please enter a valid Admin ID");
     }
 }