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