private void btnDelete_Click(object sender, EventArgs e) { if (_parentId < 0) { MessageBox.Show("اطلاعات پایه ریشه قابل حذف نیست"); return; } DialogResult dialogResult = MessageBox.Show("آیا جهت حذف مطمئن هستید !", "اطلاعات پایه", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.No) { return; } if (dataGridView1.SelectedRows.Count > 0) { DataGridViewRow dr = dataGridView1.SelectedRows[0]; int id = int.Parse(dr.Cells[BasicInfoEntity.FIELD_ID].Value.ToString()); BasicInfoForm form = new BasicInfoForm(); form.Id = id; form.Mode = Constants.DELETE_MODE; form.intiForm(); form.ShowDialog(); fillGrid(_parentId); } }
private void btnDisplay_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { DataGridViewRow dr = dataGridView1.SelectedRows[0]; int id = int.Parse(dr.Cells[BasicInfoEntity.FIELD_ID].Value.ToString()); BasicInfoForm form = new BasicInfoForm(); form.Id = id; form.intiForm(); form.ShowDialog(); fillGrid(_parentId); } }
private void btnNew_Click(object sender, EventArgs e) { if (_parentId < 0) { MessageBox.Show("هیچ آیتمی انتخاب نشده است"); return; } BasicInfoForm form = new BasicInfoForm(); form.ParentId = _parentId; form.intiForm(); form.ShowDialog(); fillGrid(_parentId); }