private void BtnUpd_Click(object sender, EventArgs e) { if (this.dataGridView1 != null && this.dataGridView1.Rows.Count > 0) { if (dataGridView1.CurrentRow != null) { string _Company_Id = ""; string _Csv_Id = ""; DataGridViewRow _dr = this.dataGridView1.Rows[dataGridView1.CurrentRow.Index]; if (_dr != null) { _Company_Id = string.IsNullOrEmpty(_dr.Cells["Company_Id"].Value.ToString()) ? "" : (_dr.Cells["Company_Id"].Value.ToString()).ToString(); _Csv_Id = string.IsNullOrEmpty((_dr.Cells["Csv_Id"].Value.ToString()).ToString()) ? "" : (_dr.Cells["Csv_Id"].Value.ToString()).ToString(); } CsvManage _Manage = new CsvManage(); _Manage.Edit = "UPD"; _Manage.Company_Id = _Company_Id; _Manage.Csv_Id = _Csv_Id; if (_Manage.ShowDialog() != DialogResult.OK) { string _where = " Where 1=1 and Company_Id='" + LoginInfo._Usr_Company + "'"; QueryData(_where); } } } }
private void BtnAdd_Click(object sender, EventArgs e) { CsvManage _Manage = new CsvManage(); _Manage.Edit = "ADD"; if (_Manage.ShowDialog() != DialogResult.OK) { string _where = " Where 1=1 and Company_Id='" + LoginInfo._Usr_Company + "'"; QueryData(_where); } }