private void AccountTableList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (t_Type == "Imported") { string DataName = AccountTableList.Rows[e.RowIndex].Cells[0].Value.ToString(); ProductTableLoadder pTable = new ProductTableLoadder(); pTable.TableName = DataName; if (f_FileName == Application.StartupPath + "//RawProductsList.data") { pTable.Text = "RawTable"; } else if (f_FileName == Application.StartupPath + "//ShopProductsList.data") { pTable.Text = "ShopTable"; } pTable.ShowDialog(this); } else if (t_Type == "Shop") { string DataName = AccountTableList.Rows[e.RowIndex].Cells[0].Value.ToString(); ProductTableLoadder pTable = new ProductTableLoadder(); pTable.TableName = DataName; pTable.Text = "ShopTable"; pTable.ShowDialog(this); } }
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(); } }