예제 #1
0
        public void deletetransaction(CurrentTransaction_DB sDB)
        {
            string         query = String.Format("delete from CurrentTransaction where item = '{0}'", sDB.Item);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
예제 #2
0
        public void empty()
        {
            string         query = "DELETE * FROM [CurrentTransaction]";
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
예제 #3
0
        public void createnewuser(Credential_DB cDB)
        {
            string         query = String.Format("Insert into UserDetails Values('{0}','{1}','{2}', '{3}')", cDB.Name, cDB.UserName, cDB.Password, cDB.UserType);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
예제 #4
0
        public void addproduct(Storage_DB sDB)
        {
            string         query = String.Format("Insert into StorageInfo Values('{0}','{1}','{2}', '{3}')", sDB.Item, sDB.Manufacturer, sDB.Quantity, sDB.Price);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
예제 #5
0
        public void deleteproduct(Storage_DB sDB)
        {
            string         query = String.Format("delete from StorageInfo where item = '{0}'", sDB.Item);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
예제 #6
0
        public void addtransaction(Transaction_DB sDB)
        {
            string         query = String.Format("Insert into [Transaction] Values('{0}','{1}','{2}', '{3}')", sDB.CustomerName, sDB.Mobile, sDB.PurchaseDate, sDB.TotalBill);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
예제 #7
0
        public void deleteuser(Credential_DB cDB)
        {
            string         query = String.Format("delete from UserDetails where username = '******'", cDB.UserName);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
예제 #8
0
        public void changemypassword(Credential_DB cDB)
        {
            string         query = String.Format("UPDATE [UserDetails] SET [PASSWORD] = '{0}' WHERE [USERNAME] = '{1}' AND [USERTYPE] = '{2}' ", cDB.Password, cDB.UserName, cDB.UserType);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
예제 #9
0
        public void addtransaction(CurrentTransaction_DB sDB)
        {
            string         query = String.Format("Insert into CurrentTransaction Values('{0}','{1}',{2}, {3})", sDB.Item, sDB.Quantity, sDB.Price, sDB.PayPrice);
            Business_Logic BL    = new Business_Logic();

            BL.NonQuery(query);
        }
예제 #10
0
        public void FillGrid(DataGridView GV)
        {
            string         query = "select * from StorageInfo";
            Business_Logic BBL   = new Business_Logic();
            DataSet        ds    = BBL.Adapter(query);

            GV.DataSource = ds.Tables[0];
        }
예제 #11
0
        public void FillGrid(DataGridView GV)
        {
            string         query = "select * from [CurrentTransaction]";
            Business_Logic BBL   = new Business_Logic();
            DataSet        ds    = BBL.Adapter(query);

            GV.DataSource = ds.Tables[0];
        }
예제 #12
0
        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());
            }
        }
예제 #13
0
        public void updateFillGrid(DataGridView GV)
        {
            string              query   = "update values into table StorageInfo * from StorageInfo";
            Business_Logic      BBL     = new Business_Logic();
            OleDbDataAdapter    adapter = new OleDbDataAdapter();
            OleDbCommandBuilder build   = new OleDbCommandBuilder(adapter);
            DataSet             ds      = BBL.Adapter(query);

            adapter.Update(ds);
            GV.DataSource = ds.Tables[0];
        }
예제 #14
0
        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());
            }
        }
예제 #15
0
        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());
            }
        }
예제 #16
0
        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);
        }
예제 #17
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);
        }
예제 #18
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);
            }
        }
예제 #19
0
 public void searchFillGrid(DataGridView GV, Storage_DB sDB, String se)
 {
     if (se == "***All***")
     {
         string         query = "select * from StorageInfo";
         Business_Logic BBL   = new Business_Logic();
         DataSet        ds    = BBL.Adapter(query);
         GV.DataSource = ds.Tables[0];
     }
     else
     {
         string         query = String.Format("select * from StorageInfo where item = '{0}'", se);
         Business_Logic BBL   = new Business_Logic();
         DataSet        ds    = BBL.Adapter(query);
         GV.DataSource = ds.Tables[0];
     }
 }