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(); }
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())); }
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); }
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); } }
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); }