public void fillcomboboxquantity(ComboBox CB, String item) { string query = String.Format("select quantity from StorageInfo where item= '{0}'", item); Business_Logic BL = new Business_Logic(); OleDbDataReader rec = BL.SelectQuery(query); while (rec.Read()) { CB.Items.Add(rec[0].ToString()); } }
public void fillcombobox(ComboBox CB) { string query = "select item from StorageInfo"; Business_Logic BL = new Business_Logic(); OleDbDataReader rec = BL.SelectQuery(query); while (rec.Read()) { CB.Items.Add(rec[0].ToString()); } }
public void fillcombobox(ComboBox CB) { string query = "select username from UserDetails where usertype= 'Staff'"; //direct query so , simply used. Business_Logic BL = new Business_Logic(); OleDbDataReader rec = BL.SelectQuery(query); // datareader only fetches one record at a time, so loop used. while (rec.Read()) { CB.Items.Add(rec[0].ToString()); } }
public int getprice(string item) { string query = String.Format("select price from StorageInfo where item= '{0}'", item); Business_Logic BL = new Business_Logic(); OleDbDataReader rec = BL.SelectQuery(query); // datareader only fetches one record at a time, so loop used. while (rec.Read()) { return(Convert.ToInt32(rec[0].ToString())); } return(0); }
public int summer() { string query = "select SUM(PayPrice) from CurrentTransaction"; Business_Logic BL = new Business_Logic(); OleDbDataReader rec = BL.SelectQuery(query); // datareader only fetches one record at a time, so loop used. while (rec.Read()) { return(Convert.ToInt32(rec[0].ToString())); } return(0); }
public bool Authenticate(Credential_DB cDB) { string query = String.Format("select * from UserDetails where name = '{0}' and username = '******' and password ='******' and usertype ='{3}'", cDB.Name, 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); } }