Example #1
0
        public void SetDataBase_CompletionProcedures(IDprocedure data)
        {
            con.Open();
            SQLiteCommand cmd = con.CreateCommand();

            cmd.CommandText = "INSERT INTO CompletionProcedures ('IDshop_class', 'IDuser_class', 'Chek') VALUES ('" + data.IDshop_class + "', '" + data.IDuser_class + "', '" + data.Chek + "')";
            cmd.ExecuteNonQuery();
            con.Close();
        }
Example #2
0
        public int GetSale(int IDproc)
        {
            IDprocedure iDprocedure_sale = new IDprocedure();

            iDprocedure_sale = baseManager.GetDataBase_procedur(IDproc);
            DataBase dataBase = new DataBase();

            dataBase = baseManager.GetDataBase(iDprocedure_sale.IDuser_class);
            //iDprocedure_sale = iDproceduresList.Find(x => x.IDproc_class == IDproc);
            return(int.Parse(dataBase.Sale_User.ToString()));
        }
Example #3
0
        public int GetIDprocedure(int IDshop, int IDuser)
        {
            Random      rnd1        = new Random();
            IDprocedure iDprocedure = new IDprocedure {
                IDshop_class = IDshop, IDuser_class = IDuser, IDproc_class = rnd1.Next()
            };

            baseManager.SetDataBase_procedur(iDprocedure);
            //iDproceduresList.Add(iDprocedure);
            return(iDprocedure.IDproc_class);
        }
Example #4
0
        public void PostShopResult(int IDproc)
        {
            IDprocedure iDprocedure_sale = new IDprocedure();

            iDprocedure_sale = baseManager.GetDataBase_procedur(IDproc);
            baseManager.SetDataBase_procedur(IDproc, "Shop_result");
            if (iDprocedure_sale.User_result == 1)
            {
                baseManager.SetDataBase_CompletionProcedures(iDprocedure_sale);
                baseManager.DelDataBase_procedur(IDproc);
            }
        }
Example #5
0
        public IDprocedure GetDataBase_procedur(int IDproc)
        {
            DataTable returnTable = new DataTable();

            con.Open();
            SQLiteCommand cmd = con.CreateCommand();

            cmd.CommandText = "SELECT * FROM Procedures where IDproc_class =" + IDproc.ToString();
            SQLiteDataAdapter adapter = new SQLiteDataAdapter(cmd);

            adapter.Fill(returnTable);
            con.Close();
            IDprocedure ValueBase = new IDprocedure();

            ValueBase.IDproc_class = int.Parse(returnTable.Rows[0][0].ToString());
            ValueBase.IDshop_class = int.Parse(returnTable.Rows[0][1].ToString());
            ValueBase.IDuser_class = int.Parse(returnTable.Rows[0][2].ToString());
            ValueBase.User_result  = int.Parse(returnTable.Rows[0][3].ToString());
            ValueBase.Shop_result  = int.Parse(returnTable.Rows[0][4].ToString());
            ValueBase.Chek         = double.Parse(returnTable.Rows[0][5].ToString());
            return(ValueBase);
        }