private void RetriveData() { try { if (divResult == null) { divResult = new sp_MAS102_GetDivision_Result(); divResult.CRT_DATE = DateTime.Now; this.ToolBarSwitch = "2122222222"; } else if (divResult.DEL_ID.IsNull()) { this.ToolBarSwitch = "2122222102"; } else { this.ToolBarSwitch = "2022222012"; } CtrlUtil.EnableControls(divResult.DEL_ID.IsNull(), txtNameTh, txtNameEn, txtSeq); bs.DataSource = divResult; } catch (Exception ex) { rMessageBox.ShowException(this, ex); } }
private void CancelData(bool isCancel) { try { string msg; if (isCancel) { msg = MessageCode.CFM0003; } else { msg = MessageCode.CFM0004; } if (rMessageBox.ShowConfirmation(this, msg) == DialogResult.Yes) { vmMas.CancelDivision(divResult, isCancel); if (isCancel) { rMessageBox.ShowInfomation(this, MessageCode.INF0004); } else { rMessageBox.ShowInfomation(this, MessageCode.INF0005); } this.IsDataChange = true; divResult = vmMas.GetDivision(divResult.ID); RetriveData(); } } catch (Exception ex) { rMessageBox.ShowException(this, ex); } }
private void SaveData() { try { this.Cursor = Cursors.WaitCursor; if (ValidateBeforeSave()) { if (rMessageBox.ShowConfirmation(this, MessageCode.CFM0001) == DialogResult.Yes) { int ID = vmMas.SaveDivision(divResult); rMessageBox.ShowInfomation(this, MessageCode.INF0002); this.IsDataChange = true; divResult = vmMas.GetDivision(ID); RetriveData(); } } } catch (Exception ex) { rMessageBox.ShowException(this, ex); } finally { this.Cursor = Cursors.Default; } }
private void EditData(DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { sp_MAS102_GetDivision_Result row = gvResult.Rows[e.RowIndex].DataBoundItem as sp_MAS102_GetDivision_Result; using (MAS102_DivisionEntry dlg = new MAS102_DivisionEntry(row)) { if (dlg.ShowDialog(this) == DialogResult.OK) { LoadData(); } } } }
public int SaveDivision(sp_MAS102_GetDivision_Result data) { return(service.SaveDivision(data)); }
public void CancelDivision(sp_MAS102_GetDivision_Result data, bool ISCANCEL) { service.CancelDivision(data, ISCANCEL); }
public MAS102_DivisionEntry(sp_MAS102_GetDivision_Result data) { InitializeComponent(); divResult = data; }