public void DeleteUser(User_db udb)
        {
            string        query = String.Format("Delete from signup where Username='******'", udb.Username);
            Businesslogic BL    = new Businesslogic();

            BL.Nonquery(query);
        }
        public void changepassword(User_db udb)
        {
            string        query = String.Format("update [signup] set [Password]='{0}' where [Username]='{1}'", udb.Password, udb.Username);
            Businesslogic BL    = new Businesslogic();

            BL.Nonquery(query);
        }
Beispiel #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txtbox_pass.Text == txtbox_confpass.Text)
     {
         User_db udb = new User_db();
         udb.Username = txtbox_Username.Text;
         udb.Names    = txtbox_name.Text;
         udb.Password = txtbox_pass.Text;
         udb.Usertype = combobox_usertype.Text;
         udb.Insertuser(udb);
         if (txtbox_Username.Text != "" && txtbox_name.Text != "" && txtbox_pass.Text != "")
         {
             if (combobox_usertype.Text == "Admin")
             {
                 mainpage mp = new mainpage();
                 mp.Show();
             }
             else if (combobox_usertype.Text == "Teacher")
             {
                 Home hm = new Home();
                 hm.Show();
             }
             MessageBox.Show("Signup successful!!");
         }
         else
         {
             MessageBox.Show("Please fill all the entries....!!!");
         }
     }
 }
        public void Insertuser(User_db udb)
        {
            string query = String.Format("insert into signup values ('{0}','{1}','{2}','{3}')",
                                         udb.Username, udb.Names, udb.Password, udb.Usertype);
            Businesslogic BL = new Businesslogic();

            BL.Nonquery(query);
        }
        public void Addcourse(User_db udb)
        {
            string query = String.Format("insert into courses values ('{0}','{1}','{2}')",
                                         udb.Names, udb.Fees, udb.Course);
            Businesslogic BL = new Businesslogic();

            BL.Nonquery(query);
        }
Beispiel #6
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            User_db udb = new User_db();

            udb.Username = combobox_deleteuser.Text;
            udb.DeleteUser(udb);
            MessageBox.Show("User Deleted succesfully!!!");
        }
Beispiel #7
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            User_db udb = new User_db();

            udb.Addcourse(udb);
            Signup sign = new Signup();

            sign.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            User_db udb = new User_db();

            udb.Username = txtbox_username.Text;
            udb.Password = txtbox_oldpassword.Text;

            if (txtbox_newpassword.Text == txtbox_conpassword.Text)
            {
                udb.Password = txtbox_conpassword.Text;
                udb.changepassword(udb);
                MessageBox.Show("Password succesfully changed!!!");
            }
        }
        public bool Authenticated(User_db udb)
        {
            string          query = string.Format("select * from signup where Username='******' and Password='******' and Usertype='{2}'", udb.Username, udb.Password, udb.Usertype);
            Businesslogic   BL    = new Businesslogic();
            OleDbDataReader rec   = BL.SelectQuery(query);

            if (rec.Read())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #10
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            User_db udb = new User_db();

            if (rbtn_admin.Checked)
            {
                udb.Usertype = "Admin";
            }
            else if (rbtn_user.Checked)
            {
                udb.Usertype = "Teacher";
            }
            udb.Username = txtbox_username.Text;
            udb.Password = txtbox_password.Text;

/*
 *
 *          if (udb.Username == txtbox_username.Text)
 *          {
 *              if (udb.Password == txtbox_password.Text)
 *              {
 *
 *              }
 *          }
 */
            if (udb.Authenticated(udb))
            {
                if (rbtn_admin.Checked)
                {
                    mainpage ud = new mainpage();
                    ud.Show();
                }
                else if (rbtn_user.Checked)
                {
                    userdisplay hform = new userdisplay();
                    hform.Show();
                }
            }
            else
            {
                MessageBox.Show("Something has gone wrong,please fill the entries again!!");
            }
        }
Beispiel #11
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            User_db udb = new User_db();

            udb.getdatabysearch(dataGridView1, textBox1.Text);
        }
Beispiel #12
0
        private void userdisplay_Load(object sender, EventArgs e)
        {
            User_db udb = new User_db();

            udb.getdata(dataGridView1);
        }
Beispiel #13
0
        private void Home_Load(object sender, EventArgs e)
        {
            User_db udb = new User_db();

            udb.Getdata(dataGridView1);
        }
Beispiel #14
0
        public void fillcbo()
        {
            User_db udb = new User_db();

            udb.fillcombo(combobox_deleteuser);
        }