private void btnEdit_Click(object sender, EventArgs e) { try { if (this.dgvManagerAction.SelectedRows.Count != 0) { pStatusAddNew = false; string pActionsID = this.dgvManagerAction.SelectedRows[0].Cells[0].Value.ToString(); frmUpdateAction frmUpAction = new frmUpdateAction(); getData getDB = new getData(frmUpAction.WriteData); getDB(pActionsID); frmUpAction.ShowDialog(); //Reload data LoadData(); } else { CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("CRM369"), Common.clsLanguages.GetResource("CRM11"), Common.Config.CUSTOM_MESSAGEBOX_ICON.Information, Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK); } } catch (Exception) { CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("CRM292"), Common.clsLanguages.GetResource("CRM12"), Common.Config.CUSTOM_MESSAGEBOX_ICON.Information, Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK); return; } }
/// <summary> /// Event raise when user click button add new /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddNew_Click(object sender, EventArgs e) { //Ghi nhận đây là trạng thái thêm mới pStatusAddNew = true; frmUpdateAction frm = new frmUpdateAction(); frm.ShowDialog(); }