public void InitialScreen(string strSearch) { try { gvDetail.SetOISStyle(); gvDetail.MappingEnum(typeof(eCol)); dataList = vmMas.GetParameterAnalysis(); SortableBindingList <sp_MAS305_GetParameterAnalysis_Result> result = new SortableBindingList <sp_MAS305_GetParameterAnalysis_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 RetriveData() { try { if (ParameterResult == null) { ParameterResult = new sp_MAS305_GetParameterAnalysis_Result(); ParameterResult.CRT_DATE = DateTime.Now; this.ToolBarSwitch = "2122222222"; } else if (ParameterResult.DEL_ID.IsNull()) { this.ToolBarSwitch = "2122222102"; } else { this.ToolBarSwitch = "2022222012"; } CtrlUtil.EnableControls(ParameterResult.DEL_ID.IsNull(), txtName, txtMethod, cboUnit, txtStandardThai, txtStandardACGIH, txtToolPick, txtToolAnalysis, txtSeq); CtrlUtil.EnableControls(ParameterResult.DEL_ID.IsNull(), txtMethodRef, txtMethodRemark, txtMRLValue, cboLabExt, txtAnalysisDetail, chkCeilingLimit); bdSource.DataSource = ParameterResult; } 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.CancelParameterAnalysis(ParameterResult, isCancel); if (isCancel) { rMessageBox.ShowInfomation(this, MessageCode.INF0004); } else { rMessageBox.ShowInfomation(this, MessageCode.INF0005); } this.IsDataChange = true; ParameterResult = vmMas.GetParameterAnalysis(ParameterResult.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.SaveParameterAnalysis(ParameterResult); rMessageBox.ShowInfomation(this, MessageCode.INF0002); this.IsDataChange = true; ParameterResult = vmMas.GetParameterAnalysis(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_MAS305_GetParameterAnalysis_Result; this.DialogResult = DialogResult.OK; } }
private void EditData(DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { sp_MAS305_GetParameterAnalysis_Result row = gvResult.Rows[e.RowIndex].DataBoundItem as sp_MAS305_GetParameterAnalysis_Result; using (MAS305_ParameterAnalysisEntry dlg = new MAS305_ParameterAnalysisEntry(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) || x.METHOD_NAME.GetValueOrDefault().ToUpper().Contains(txt) || x.TOOL_PICK_NAME.GetValueOrDefault().ToUpper().Contains(txt) || x.TOOL_ANALYSIS_NAME.GetValueOrDefault().ToUpper().Contains(txt) || x.METHOD_REF.GetValueOrDefault().ToUpper().Contains(txt)).ToList(); gvDetail.DataSource = new SortableBindingList <sp_MAS305_GetParameterAnalysis_Result>(result); if (result.Count == 1) { SelectedData = result[0]; } else { SelectedData = null; } }
private void txtParameter_OnSelected(object sender, EventArgs e) { try { if (txtParameter.IntValue.HasValue) { sp_MAS305_GetParameterAnalysis_Result p = txtParameter.SelectedData as sp_MAS305_GetParameterAnalysis_Result; if (p != null) { txtStdThai.NullableDecimalValue = p.STANDARD_THAI; txtStdAcgih.NullableDecimalValue = p.STANDARD_ACGIH; txtMRL.NullableDecimalValue = p.MRL_VALUE_DIV; txtRemark.Text = p.LAB_REMARK; cboUnit.NullableIntValue = p.UNIT_ID; chkC.Checked = p.CEILING_LIMIT; } } } catch (Exception ex) { rMessageBox.ShowException(this, ex); } }
private void SetDataToControl(sp_RPT002_GetWorkPlaceAirDt_Result data) { try { txtLocationLV3.Text = data.LOC_NAME_LV3; txtLocationLV2.Text = data.LOC_NAME_LV2; txtLocationName.Text = data.LOC_NAME; dtSamplingDate.DateValue = data.SAMPLING_DATE; txtParameter.IntValue = data.PARAMETER_ID; dtSamplingTime.TimeValue = data.SAMPLING_TIME; txtSamplingMins.NullableIntValue = data.SAMPLING_MINS; txtAirFlow.NullableDecimalValue = data.AIR_FLOW; txtResult.NullableDecimalValue = data.RESULT_VALUE; chkLess.Checked = data.LESS_RESULT_VALUE; cboUnit.NullableIntValue = data.UNIT_ID; txtStdThai.NullableDecimalValue = data.STANDARD_THAI; txtStdAcgih.NullableDecimalValue = data.STANDARD_ACGIH; chkC.Checked = data.CEILING_LIMIT; chkWaitResult.Checked = data.WAIT_RESULT; txtRemark.Text = data.REMARK; txtMRL.NullableDecimalValue = data.MRL_VALUE; if (txtParameter.IntValue.HasValue) { sp_MAS305_GetParameterAnalysis_Result p = (txtParameter.SelectedData as sp_MAS305_GetParameterAnalysis_Result); if (p.MRL_VALUE_DIV.HasValue && p.MRL_VALUE_DIV != txtMRL.NullableDecimalValue) { txtMRL.NullableDecimalValue = p.MRL_VALUE_DIV; } } } catch (Exception ex) { rMessageBox.ShowException(this, ex); } }
public void CancelParameterAnalysis(sp_MAS305_GetParameterAnalysis_Result data, bool ISCANCEL) { service.CancelParameterAnalysis(data, ISCANCEL); }
public int SaveParameterAnalysis(sp_MAS305_GetParameterAnalysis_Result data) { return(service.SaveParameterAnalysis(data)); }
public MAS305_ParameterAnalysisEntry(sp_MAS305_GetParameterAnalysis_Result data) { InitializeComponent(); ParameterResult = data; }