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