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