// load main form private void Form1_Load(object sender, EventArgs e) { oradb = "Data Source=localhost:1521/XE; User Id=SYSTEM;Password=1"; //; DBA Privilege=default oc = new OracleConnection(oradb); oc.Open(); ds = new DataSet(); comboBox1.SelectedIndex = 0; textBox7.Text = System.Convert.ToString(10); MyOracleConnect.Update("commit"); }
static public void subtractProduct(int _ID_product, int _existence, int _quantitySubtracted) { string query = "update store_products set existence = " + (_existence - _quantitySubtracted) + " where id_product = " + _ID_product; if (MyOracleConnect.Insert(query)) { System.Windows.Forms.MessageBox.Show("Запись о товаре обновлена."); MyOracleConnect.Update("commit"); } }
public void addDistributor() { string query = "insert into store_distributors values(" + ID_distributor + ",'" + distributorName + "'," + distributorTelephone + ")"; if (MyOracleConnect.Insert(query)) { System.Windows.Forms.MessageBox.Show("Запись о цехе добавлена."); MyOracleConnect.Update("commit"); } }
public void addClient() { string query = "insert into store_clients values(" + ID_client + ",'" + fio + "'," + clientTelephone + ")"; if (MyOracleConnect.Insert(query)) { System.Windows.Forms.MessageBox.Show("Запись о клиента добавлена."); MyOracleConnect.Update("commit"); } }
public void fillProduct(int _quantityAdded) { string query = "update store_products set date_pr = TO_DATE('" + dateDistribution.Year.ToString() + "." + dateDistribution.Month.ToString() + "." + dateDistribution.Day.ToString() + "', 'yyyy/mm/dd hh24:mi:ss'), existence = " + (existence + _quantityAdded) + ", id_distrib_fk = " + ID_distrib + " where id_product = " + ID_product; if (MyOracleConnect.Insert(query)) { System.Windows.Forms.MessageBox.Show("Запись о товаре обновлена."); MyOracleConnect.Update("commit"); } }
public void insertBooking() { string query = "INSERT INTO STORE_BOOKINGS VALUES(" + ID_booking + "," + ID_client + "," + ID_product + "," + sum + "," + quantity + ",TO_DATE('" + date.Year.ToString() + "." + date.Month.ToString() + "." + date.Day.ToString() + "', 'yyyy/mm/dd hh24:mi:ss'))"; if (MyOracleConnect.Insert(query)) { System.Windows.Forms.MessageBox.Show("Запись о продаже добавлена."); MyOracleConnect.Update("commit"); } }
public void addEmptyProduct() { string query = "INSERT INTO STORE_PRODUCTS VALUES(" + ID_product + "," + ID_distrib + ",'" + name_pr + "'," + cost + "," + "TO_DATE('" + dateDistribution.Year.ToString() + "." + dateDistribution.Month.ToString() + "." + dateDistribution.Day.ToString() + "', 'yyyy/mm/dd hh24:mi:ss')," + storage + "," + existence + ")"; if (MyOracleConnect.Insert(query)) { System.Windows.Forms.MessageBox.Show("Запись о товаре добавлена."); MyOracleConnect.Update("commit"); } }