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