private void RetriveData() { try { if (dataResult == null) { dataResult = new sp_MAS309_GetToolAnalysis_Result(); dataResult.CRT_DATE = DateTime.Now; this.ToolBarSwitch = "2122222222"; } else if (dataResult.DEL_ID.IsNull()) { this.ToolBarSwitch = "2122222102"; } else { this.ToolBarSwitch = "2022222012"; } CtrlUtil.EnableControls(dataResult.DEL_ID.IsNull(), txtName, txtSeq); bdSource.DataSource = dataResult; } catch (Exception ex) { rMessageBox.ShowException(this, ex); } }
public void InitialScreen(string strSearch) { try { gvDetail.SetOISStyle(); gvDetail.MappingEnum(typeof(eCol)); dataList = vmMas.GetToolAnalysis(); SortableBindingList <sp_MAS309_GetToolAnalysis_Result> result = new SortableBindingList <sp_MAS309_GetToolAnalysis_Result>(); result.AddRange(dataList); gvDetail.DataSource = result; txtSearch.Text = strSearch; if (id > 0) { SelectedData = result.Where(x => x.ID == id).FirstOrDefault(); } } catch (Exception ex) { throw 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.CancelToolAnalysis(dataResult, isCancel); if (isCancel) { rMessageBox.ShowInfomation(this, MessageCode.INF0004); } else { rMessageBox.ShowInfomation(this, MessageCode.INF0005); } this.IsDataChange = true; dataResult = vmMas.GetToolAnalysis(dataResult.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.SaveToolAnalysis(dataResult); rMessageBox.ShowInfomation(this, MessageCode.INF0002); this.IsDataChange = true; dataResult = vmMas.GetToolAnalysis(ID); RetriveData(); } } } catch (Exception ex) { rMessageBox.ShowException(this, ex); } finally { this.Cursor = Cursors.Default; } }
private void gvDetail_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { SelectedData = gvDetail.GetDataBound(e.RowIndex) as sp_MAS309_GetToolAnalysis_Result; this.DialogResult = DialogResult.OK; } }
private void EditData(DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { sp_MAS309_GetToolAnalysis_Result row = gvResult.Rows[e.RowIndex].DataBoundItem as sp_MAS309_GetToolAnalysis_Result; using (MAS309_ToolAnalysisEntry dlg = new MAS309_ToolAnalysisEntry(row)) { if (dlg.ShowDialog(this) == DialogResult.OK) { LoadData(); } } } }
private void txtSearch_TextChanged(object sender, EventArgs e) { string txt = txtSearch.Text.ToUpper(); var result = dataList.Where(x => x.NAME.ToUpper().Contains(txt)).ToList(); gvDetail.DataSource = new SortableBindingList <sp_MAS309_GetToolAnalysis_Result>(result); if (result.Count == 1) { SelectedData = result[0]; } else { SelectedData = null; } }
public void CancelToolAnalysis(sp_MAS309_GetToolAnalysis_Result data, bool ISCANCEL) { service.CancelToolAnalysis(data, ISCANCEL); }
public int SaveToolAnalysis(sp_MAS309_GetToolAnalysis_Result data) { return(service.SaveToolAnalysis(data)); }
public MAS309_ToolAnalysisEntry(sp_MAS309_GetToolAnalysis_Result data) { InitializeComponent(); this.dataResult = data; }