private void OKButton_Click(object sender, EventArgs e) { try { float Price = float.Parse(textBox1.Text.ToString().Replace(".", ",")); float Count = float.Parse(textBox2.Text.ToString().Replace(".", ",")); float Summ = Price * Count; ProductTableLoadder ProdTable = new ProductTableLoadder(); ShopMaterialsNamesList MatNames = new ShopMaterialsNamesList("ShopProductsList.data", "Shop"); ShopMaterialsStep2 ShopTable = new ShopMaterialsStep2(); ResidueShopMaterials ResidShopTable = new ResidueShopMaterials(); //RemovedRawMaterialsForm RemRawShopTable = new RemovedRawMaterialsForm(); ProdTable.TableName = LoadString; ProdTable.LoadRecords(); //RemRawShopTable.InsertRecords(titlebox.Text, textBox3.Text, textBox1.Text, textBox2.Text, textBox4.Text, Summ.ToString().Replace(",", "."), Date, textBoxPost.Text, textBoxPoluch.Text); ResidShopTable.InsertRecords(titlebox.Text, textBox3.Text, textBox1.Text, textBox2.Text, textBox4.Text, Date, textBoxPost.Text, textBoxPoluch.Text); General.DeleteFromSQLDataBase("RawMaterialsResidue", "Имя", titlebox.Text); ShopTable.InsertRecords(titlebox.Text, textBox3.Text, textBox1.Text, textBox2.Text, textBox4.Text, Date, textBoxPost.Text, textBoxPoluch.Text); ProdTable.InsertRecordsShop(titlebox.Text, textBox3.Text, textBox1.Text, textBox2.Text, textBox4.Text, Date, textBoxPost.Text, textBoxPoluch.Text); //RemRawShopTable.Close(); ShopTable.Close(); ResidShopTable.Close(); MatNames.LoadRecords(); MatNames.ShowDialog(this); ProdTable.Close(); } catch (Exception ex) { General.ShowErrorBox(ex); General.Connection.Close(); } }
private void OKButton_Click(object sender, EventArgs e) { /* * try * { * RawMatFormStep2 R = new RawMatFormStep2(); * ResidueRawMaterials RRM = new ResidueRawMaterials(); * R.LoadRecords(); * RRM.InsertRecords(titlebox.Text, textBox3.Text, textBox1.Text, textBox2.Text, textBox5.Text, textBox4.Text, DateTime, textBoxPost.Text, textBoxPoluch.Text); * R.InsertRecords(titlebox.Text, textBox3.Text, textBox1.Text, textBox2.Text, textBox5.Text, textBox4.Text, DateTime, textBoxPost.Text, textBoxPoluch.Text); * R.ShowDialog(this); * RRM.Close(); * } * catch (Exception) { } */ try { RawMatFormStep2 RawTable = new RawMatFormStep2(); RawTable.LoadRecords(); RawTable.InsertRecords(titlebox.Text, textBox3.Text, textBox1.Text, textBox2.Text, textBox5.Text, textBox4.Text, DateTime, textBoxPost.Text, textBoxPoluch.Text); ProductTableLoadder R = new ProductTableLoadder(); R.TableName = LoadString; R.Text = "RawTable"; ResidueRawMaterials RRM = new ResidueRawMaterials(); R.LoadRecords(); RRM.InsertRecords(titlebox.Text, textBox3.Text, textBox1.Text, textBox2.Text, textBox5.Text, textBox4.Text, DateTime, textBoxPost.Text, textBoxPoluch.Text); R.InsertRecords(titlebox.Text, textBox3.Text, textBox1.Text, textBox2.Text, textBox5.Text, textBox4.Text, DateTime, textBoxPost.Text, textBoxPoluch.Text); R.ShowDialog(this); RRM.Close(); RawTable.Close(); } catch (Exception ex) { General.ShowErrorBox(ex); General.Connection.Close(); } }