private void RetriveData() { try { if (subdivResult == null) { subdivResult = new sp_MAS103_GetSubDivision_Result(); subdivResult.CRT_DATE = DateTime.Now; this.ToolBarSwitch = "2122222222"; } else if (subdivResult.DEL_ID.IsNull()) { this.ToolBarSwitch = "2122222102"; } else { this.ToolBarSwitch = "2022222012"; } CtrlUtil.EnableControls(subdivResult.DEL_ID.IsNull(), txtNameTh, txtNameEn, cboDivision, txtSeq); bs.DataSource = subdivResult; } 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.CancelSubDivision(subdivResult, isCancel); if (isCancel) { rMessageBox.ShowInfomation(this, MessageCode.INF0004); } else { rMessageBox.ShowInfomation(this, MessageCode.INF0005); } this.IsDataChange = true; subdivResult = vmMas.GetSubDivision(subdivResult.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.SaveSubDivision(subdivResult); rMessageBox.ShowInfomation(this, MessageCode.INF0002); this.IsDataChange = true; subdivResult = vmMas.GetSubDivision(ID); RetriveData(); } } } catch (Exception ex) { rMessageBox.ShowException(this, ex); } finally { this.Cursor = Cursors.Default; } }
private void EditData(DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { sp_MAS103_GetSubDivision_Result row = gvResult.Rows[e.RowIndex].DataBoundItem as sp_MAS103_GetSubDivision_Result; using (MAS103_SubDivisionEntry dlg = new MAS103_SubDivisionEntry(row)) { if (dlg.ShowDialog(this) == DialogResult.OK) { LoadData(); } } } }
public void CancelSubDivision(sp_MAS103_GetSubDivision_Result data, bool ISCANCEL) { service.CancelSubDivision(data, ISCANCEL); }
public int SaveSubDivision(sp_MAS103_GetSubDivision_Result data) { return(service.SaveSubDivision(data)); }
public MAS103_SubDivisionEntry(sp_MAS103_GetSubDivision_Result data) { InitializeComponent(); subdivResult = data; }