Exemplo n.º 1
0
        public void deleteuser(Credential_DB cDB)
        {
            string         query = String.Format("delete from credential where username = '******'", cDB.UserName);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
Exemplo n.º 2
0
        public void changemypassword(Credential_DB cDB)
        {
            string         query = String.Format("UPDATE [credential] SET [password] = '{0}' where [username] = '{1}' and [usertype] = '{2}'", cDB.Password, cDB.UserName, cDB.UserType);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
Exemplo n.º 3
0
        public void createnewuser(Credential_DB cDB)
        {
            string         query = String.Format("Insert into Credential Values('{0}','{1}','{2}','{3}','{4}')", cDB.UserName, cDB.Password, cDB.UserType, cDB.name, cDB.city);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
Exemplo n.º 4
0
        public void FillGrid(DataGridView GV)
        {
            string         query = "select * from credential";
            Business_Logic BL    = new Business_Logic();
            DataSet        ds    = BL.Adapter(query);

            GV.DataSource = ds.Tables[0];               //adapter return dataset
        }
Exemplo n.º 5
0
        public void fillcombobox(ComboBox CB)
        {
            //   ComboBox CB = new ComboBox();
            string          query = "Select username from credential where usertype = 'user'";
            Business_Logic  BL    = new Business_Logic();
            OleDbDataReader rec   = BL.SelectQuery(query);

            while (rec.Read())
            {
                CB.Items.Add(rec[0].ToString());
            }
            //   return CB;
        }
Exemplo n.º 6
0
        public bool Authenticate(Credential_DB cDB)
        {
            string          query = String.Format("select * from Credential where username = '******' and password = '******' and usertype ='{2}'", cDB.UserName, cDB.Password, cDB.UserType);
            Business_Logic  BL    = new Business_Logic();
            OleDbDataReader rec   = BL.SelectQuery(query);

            if (rec.Read())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }