Esempio n. 1
0
 private void btnsignup_Click(object sender, EventArgs e)
 {
     if (bunifuCheckbox1.Checked == true)
     {
         Admin admin = new Admin();
         admin.first_name = txtfname.Text;
         admin.last_name  = txtlname.Text;
         admin.password   = txtpassword.Text;
         admin.email      = txtemail.Text;
         if (admin.validateConfPassword(admin.password, txtrepassord.Text))
         {
             if (admin.validateAll())
             {
                 Admin_Data data = new Admin_Data();
                 data.addadmin(admin);
                 Login login = new Login();
                 this.Hide();
                 login.Show();
             }
             else
             {
                 //MessageBox.Show("email is not valid!");
             }
         }
         else
         {
             MessageBox.Show("Password does not match!");
         }
     }
     else
     {
         MessageBox.Show("ACCEPT THE TERM AND CONDITION");
     }
 }
Esempio n. 2
0
        private void btnsaveadmin_Click(object sender, EventArgs e)
        {
            Admin tempadmin = new Admin();

            tempadmin.email      = txtemail.Text;
            tempadmin.first_name = txtfname.Text;
            tempadmin.last_name  = txtlname.Text;
            tempadmin.password   = txtpassword.Text;
            if (tempadmin.validateConfPassword(tempadmin.password, txtconfpassword.Text))
            {
                if (tempadmin.validateAll())
                {
                    Admin_Data data = new Admin_Data();
                    data.editadmin(tempadmin);
                }
                else
                {
                    //MessageBox.Show("email is not valid!");
                }
            }
            else
            {
                MessageBox.Show("Password does not match!");
            }
        }
Esempio n. 3
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            Admin admin = new Admin();

            admin.password = txtpassword.Text;
            admin.email    = txtid.Text;

            Admin_Data admin_Data   = new Admin_Data();
            Admin      currentAdmin = new Admin();

            currentAdmin = admin_Data.adminLogin(admin);
            if (currentAdmin != null)
            {
                //MessageBox.Show(currentAdmin.email + currentAdmin.first_name);
                Dashboard dashboard = new Dashboard(currentAdmin);
                this.Hide();
                dashboard.Show();
            }
            else
            {
                MessageBox.Show("User Not Found");
            }
        }