//public BindingList<CSolution> GetLstChildSolution(int idsolution) //{ // List<CSolution> lst = new CSolutionFactory() // .GetAll().Where(c => c.Idpattern == idsolution && c.Status == true).ToList(); // return new BindingList<CSolution>(lst); //} //public BindingList<CSolution> GetLstChildMr(short idmr) //{ // List<CSolution> lst = new CSolutionFactory() // .GetAll().Where(c => c.Idpattern_mr == idmr && c.Status == true).ToList(); // return new BindingList<CSolution>(lst); //} public decimal?GetConcentrationPPM(short idmr_detail) { CMr_detailFactory faMr_detail = new CMr_detailFactory(); CMr_detail oMr_detail = faMr_detail.GetByPrimaryKey(new CMr_detailKeys(idmr_detail)); CSettings oSettings = new CSettings(); CConvert_unit_measurementFactory faCConvert_unit_measurement = new CConvert_unit_measurementFactory(); var query = ( from t in faCConvert_unit_measurement.GetAll() where t.Idunit2 == oSettings.GetUnitMeasureSolution() && t.Idunit1 == oMr_detail.Idunit1 select new { Concentration = oMr_detail.Nominal_value * t.Factor }).ToList(); foreach (var item in query) { if (item.Concentration != null) { return(Math.Round(Convert.ToDecimal(item.Concentration), 4)); } } decimal?num = null; return(num); }
void GetDetailMaterialReference() { CMr_detailFactory faMr_detail = new CMr_detailFactory(); lstMr_detail = new BindingList <CMr_detail>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().SelectByMr(IDMr)); gcMaterialReference.DataSource = lstMr_detail; }
private void cbCod_method_ProcessNewValue(object sender, DevExpress.XtraEditors.Controls.ProcessNewValueEventArgs e) { DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit Edit; Edit = ((DevExpress.XtraEditors.LookUpEdit)sender).Properties; if (e.DisplayValue == null || Edit.NullText.Equals(e.DisplayValue) || string.Empty.Equals(e.DisplayValue)) { return; } List <CMr> lstMr = (List <CMr>)cbCodMR.Properties.DataSource; CMr oMr = new CMr(); oMr.Cod_mr = e.DisplayValue.ToString(); oMr.Idmr = -100; lstMr.Add(oMr); cbCodMR.Properties.DataSource = lstMr; // --- referencia material detail CMr_detail oMr_detail = new CMr_detail(); CMr_detailFactory faMr_detail = new CMr_detailFactory(); BindingList <CMr_detail> lstMr_detail = new BindingList <CMr_detail>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().SelectByMr(0)); gcMaterialReference.DataSource = lstMr_detail; // --- jar detail CMr_jarFactory faMr_jar = new CMr_jarFactory(); CMr_jar oMr_jar = new CMr_jar(); BindingList <CMr_jar> lstMr_jar = new BindingList <CMr_jar>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().GetJarByMr(0)); gcOpenCloseJar.DataSource = lstMr_jar; e.Handled = true; }
protected override void Recuperar_Registro() { CMr oMr = new CMr(); CMrFactory faMr = new CMrFactory(); if ((oMr = faMr.GetByPrimaryKey(new CMrKeys(IDMr))) != null) { tbLot.Text = oMr.Lot; cbTypeMr.EditValue = Convert.ToChar(oMr.Type_mr); cbDescription.EditValue = oMr.Type_material; cbManufacturer.EditValue = oMr.Manufaturer; cbCertifier.EditValue = oMr.Certifier; cbStatus.EditValue = oMr.Status_mr; deBegin.DateTime = Convert.ToDateTime(oMr.Fbegin_validity); deEnd.DateTime = Convert.ToDateTime(oMr.Fend_validity); CMr_detail oMr_detail = new CMr_detail(); CMr_detailFactory faMr_detail = new CMr_detailFactory(); BindingList <CMr_detail> lstMr_detail = new BindingList <CMr_detail>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().SelectByMr(oMr.Idmr)); gcMaterialReference.DataSource = lstMr_detail; CMr_jarFactory faMr_jar = new CMr_jarFactory(); CMr_jar oMr_jar = new CMr_jar(); BindingList <CMr_jar> lstMr_jar = new BindingList <CMr_jar>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().GetJarByMr(IDMr)); gcOpenCloseJar.DataSource = lstMr_jar; } }
bool IsSolidSolutionPattern() { CMr_detail oMr_detail = new CMr_detailFactory() .GetByPrimaryKey(new CMr_detailKeys(Convert.ToInt16(template_method_aa.Std_mrorpattern))); CMr oMr = new CMrFactory().GetByPrimaryKey(new CMrKeys(Convert.ToInt16(oMr_detail.Idmr))); return(Convert.ToBoolean(oMr.Solid)); }
private void cbMaterialRef_EditValueChanged(object sender, EventArgs e) { CMr_detailFactory faMr_detail = new CMr_detailFactory(); CMr_detail oMr_detail = faMr_detail.GetByPrimaryKey( new CMr_detailKeys(Convert.ToInt16(cbMaterialRef.EditValue))); if (oMr_detail != null) { tbLawMri.Text = oMr_detail.Nominal_value.ToString(); } }
bool IsSolidSolutionPattern() { TreeListNode nodeParent = treeSolInterm.FocusedNode.ParentNode; short Root_idmr_detail = Convert.ToInt16(nodeParent["Root_idmr_detail"]); CMr_detail oMr_detail = new CMr_detailFactory() .GetByPrimaryKey(new CMr_detailKeys(Convert.ToInt16(Root_idmr_detail))); CMr oMr = new CMrFactory().GetByPrimaryKey(new CMrKeys(Convert.ToInt16(oMr_detail.Idmr))); return(Convert.ToBoolean(oMr.Solid)); }
public IList GetConcentration_By_TypeMr(Comun.TypeMr typeMr, short idelement) { List <CMr_detail> lstMr_detail = new CMr_detailFactory().GetAll().Where(c => c.Analyte == idelement).ToList(); List <CMr> lstMr = new CMrFactory().GetAll().Where(x => x.Type_mr == Convert.ToChar(typeMr)).ToList(); // get reference material var query1 = (from t1 in lstMr_detail from t2 in lstMr.Where(x => x.Idmr == t1.Idmr) select new { t1.Nominal_value }).Distinct().ToList(); return(query1); }
public IList GetBy_Element(short idelement) { List <CMr> lstMr = new CMrFactory().GetAll().Where(c => c.Status_mr == true).ToList(); List <CMr_detail> lstMr_detail = new CMr_detailFactory().GetAll().Where(c => c.Analyte == idelement).ToList(); var lst = (from t1 in lstMr join t2 in lstMr_detail on t1.Idmr equals t2.Idmr select new CCustomMr_detail { Cod_mr = t1.Cod_mr, Idmr = t1.Idmr, Idmr_detail = t2.Idmr_detail }).ToList(); return(lst); }
public List <CCustom_solution> GetLstPatternSolution(short idelement) { CSettings oSettings = new CSettings(); List <CConvert_unit_measurement> lstConvertUnit = new CConvert_unit_measurementFactory().GetAll().Where(c => c.Idunit2 == oSettings.GetUnitMeasureSolution()).ToList(); List <CMr_detail> lstMr_detail = new CMr_detailFactory().GetAll().Where(c => c.Analyte == idelement).ToList(); List <CMr> lstMr = new CMrFactory().GetAll(); List <CSolution> lstSolution = new CSolutionFactory().GetAll().Where(c => c.Idelement == idelement).ToList(); // get reference material List <CCustom_solution> query1 = (from t1 in lstMr_detail join t2 in lstMr on t1.Idmr equals t2.Idmr join t3 in lstConvertUnit on t1.Idunit1 equals t3.Idunit1 select new CCustom_solution { Idmr = t2.Idmr, Idmr_detail = t1.Idmr_detail, Code = t2.Cod_mr, Lote = t2.Lot, Name = t2.Cod_mr, Purity = 100, IsPattern = true, Concentration = Convert.ToDecimal(t1.Nominal_value) * Convert.ToDecimal(t3.Factor), Name_group = "Material de Referencia y Sales" }).ToList <CCustom_solution>(); // get solutions List <CCustom_solution> query2 = (from t3 in lstSolution select new CCustom_solution { Idsolution = t3.Idsolution, Code = t3.Cod_solution, Name = t3.Solution_name, Lote = t3.Lote, Purity = Convert.ToDecimal(t3.Purity), IsPattern = false, Concentration = Convert.ToDecimal(t3.Concentration), Name_group = "Soluciones" }).ToList <CCustom_solution>(); List <CCustom_solution> lst = new List <CCustom_solution>(query1.Union(query2)); return(lst); }
public void InitConfiguration() { Mri_measured = 0; Lrb_measured = 0; Flag_correct_mri = null; Flag_correct_lrb = null; CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Idtemplate_method)); Max_value_blk = Convert.ToDecimal(oTemplate_method_aa.Blk_max); Factor_repetibility = Convert.ToDecimal(oTemplate_method_aa.Reason_rep); Factor_reproducibility = Convert.ToDecimal(oTemplate_method_aa.Reproducibility); CMr_detailFactory faMr_detail = new CMr_detailFactory(); CMr_detail oMr_detail = faMr_detail.GetByPrimaryKey(new CMr_detailKeys(Convert.ToInt16(oTemplate_method_aa.Idmr_detail))); Law_fixed = Convert.ToDecimal(oMr_detail.Nominal_value); }
public IList GetBy_TypeMr_And_Element(Comun.TypeMr typeMr, short idelement) { List <CMr_detail> lstMr_detail = new CMr_detailFactory().GetAll().Where(c => c.Analyte == idelement).ToList(); List <CMr> lstMr = new CMrFactory().GetAll(); // get reference material var query1 = (from t1 in lstMr_detail join t2 in lstMr on t1.Idmr equals t2.Idmr where t2.Type_mr == Convert.ToChar(typeMr) select new { t2.Idmr, t1.Idmr_detail, t2.Cod_mr, t1.Nominal_value }).Distinct().ToList(); return(query1); }
public List <CCustom_solution> GetLstMrc(Comun.TypeMr typeMr, short idelement) { CSettings oSettings = new CSettings(); List <CMr_detail> lstMr_detail = new CMr_detailFactory().GetAll().Where(c => c.Analyte == idelement).ToList(); List <CMr> lstMr = new CMrFactory().GetAll(); // get reference material List <CCustom_solution> query1 = (from t1 in lstMr_detail join t2 in lstMr on t1.Idmr equals t2.Idmr where t2.Type_mr == Convert.ToChar(typeMr) select new CCustom_solution { Idmr = t2.Idmr, Idmr_detail = t1.Idmr_detail, Code = t2.Cod_mr, Name = t2.Cod_mr }).ToList <CCustom_solution>(); return(query1); }
bool IsSolidSolutionPattern() { TreeListNode nodeParent = treeSolInterm.FocusedNode.ParentNode; short Root_idmr_detail = Convert.ToInt16(nodeParent["Root_idmr_detail"]); CMr_detail oMr_detail = new CMr_detailFactory() .GetByPrimaryKey(new CMr_detailKeys(Convert.ToInt16(Root_idmr_detail))); CMr oMr = new CMrFactory().GetByPrimaryKey(new CMrKeys(Convert.ToInt16(oMr_detail.Idmr))); return Convert.ToBoolean(oMr.Solid); }
protected override bool Grabar_Registro() { bool result = false; try { CMrFactory faMr = new CMrFactory(); CMr oMr = new CMr(); oMr.Cod_mr = cbCodMR.Text; oMr.Idmr = IDMr; oMr.Lot = tbLot.Text; oMr.Type_material = Convert.ToChar(cbDescription.EditValue); oMr.Type_mr = Convert.ToChar(cbTypeMr.EditValue); oMr.Status_mr = Convert.ToBoolean(cbStatus.EditValue); oMr.Type_material = Convert.ToChar(cbDescription.EditValue); oMr.Manufaturer = Convert.ToInt16(cbManufacturer.EditValue); oMr.Certifier = Convert.ToInt16(cbCertifier.EditValue); oMr.Fbegin_validity = deBegin.DateTime; oMr.Fend_validity = deEnd.DateTime; if (!(result = faMr.Update(oMr))) result = faMr.Insert(oMr); if (result) { IDMr = oMr.Idmr; // --- detail elements CMr_detailFactory faMr_detail = new CMr_detailFactory(); CMr_detail oMr_detail = new CMr_detail(); for (int i = 0; i < gvMaterialReference.RowCount; i++) { oMr_detail = (CMr_detail)gvMaterialReference.GetRow(i); oMr_detail.Idmr = IDMr; if (!faMr_detail.Update(oMr_detail)) faMr_detail.Insert(oMr_detail); } // --- detail jars CMr_jarFactory faMr_jar = new CMr_jarFactory(); CMr_jar oMr_jar = new CMr_jar(); for (int i = 0; i < gvOpenCloseJar.RowCount; i++) { oMr_jar = (CMr_jar)gvOpenCloseJar.GetRow(i); oMr_jar.Idmr = IDMr; if (!faMr_jar.Update(oMr_jar)) faMr_jar.Insert(oMr_jar); } } } catch (Exception ex) { result = false; ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } return result; }
void GetDetailMaterialReference() { CMr_detailFactory faMr_detail = new CMr_detailFactory(); lstMr_detail = new BindingList<CMr_detail>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().SelectByMr(IDMr)); gcMaterialReference.DataSource = lstMr_detail; }
private void cbCod_method_ProcessNewValue(object sender, DevExpress.XtraEditors.Controls.ProcessNewValueEventArgs e) { DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit Edit; Edit = ((DevExpress.XtraEditors.LookUpEdit)sender).Properties; if (e.DisplayValue == null || Edit.NullText.Equals(e.DisplayValue) || string.Empty.Equals(e.DisplayValue)) { return; } List<CMr> lstMr = (List<CMr>)cbCodMR.Properties.DataSource; CMr oMr = new CMr(); oMr.Cod_mr = e.DisplayValue.ToString(); oMr.Idmr = -100; lstMr.Add(oMr); cbCodMR.Properties.DataSource = lstMr; // --- referencia material detail CMr_detail oMr_detail = new CMr_detail(); CMr_detailFactory faMr_detail = new CMr_detailFactory(); BindingList<CMr_detail> lstMr_detail = new BindingList<CMr_detail>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().SelectByMr(0)); gcMaterialReference.DataSource = lstMr_detail; // --- jar detail CMr_jarFactory faMr_jar = new CMr_jarFactory(); CMr_jar oMr_jar = new CMr_jar(); BindingList<CMr_jar> lstMr_jar = new BindingList<CMr_jar>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().GetJarByMr(0)); gcOpenCloseJar.DataSource = lstMr_jar; e.Handled = true; }
protected override void Recuperar_Registro() { CMr oMr = new CMr(); CMrFactory faMr = new CMrFactory(); if ((oMr = faMr.GetByPrimaryKey(new CMrKeys(IDMr))) != null) { tbLot.Text = oMr.Lot; cbTypeMr.EditValue = Convert.ToChar(oMr.Type_mr); cbDescription.EditValue = oMr.Type_material; cbManufacturer.EditValue = oMr.Manufaturer; cbCertifier.EditValue = oMr.Certifier; cbStatus.EditValue = oMr.Status_mr; deBegin.DateTime = Convert.ToDateTime(oMr.Fbegin_validity); deEnd.DateTime = Convert.ToDateTime(oMr.Fend_validity); CMr_detail oMr_detail = new CMr_detail(); CMr_detailFactory faMr_detail = new CMr_detailFactory(); BindingList<CMr_detail> lstMr_detail = new BindingList<CMr_detail>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().SelectByMr(oMr.Idmr)); gcMaterialReference.DataSource = lstMr_detail; CMr_jarFactory faMr_jar = new CMr_jarFactory(); CMr_jar oMr_jar = new CMr_jar(); BindingList<CMr_jar> lstMr_jar = new BindingList<CMr_jar>(new LimsProject.BusinessLayer.Modules.ModMaterialReference().GetJarByMr(IDMr)); gcOpenCloseJar.DataSource = lstMr_jar; } }
bool IsSolidSolutionPattern() { CMr_detail oMr_detail = new CMr_detailFactory() .GetByPrimaryKey(new CMr_detailKeys(Convert.ToInt16(template_method_aa.Std_mrorpattern))); CMr oMr = new CMrFactory().GetByPrimaryKey(new CMrKeys(Convert.ToInt16(oMr_detail.Idmr))); return Convert.ToBoolean(oMr.Solid); }
void Show_batch() { // --- show trace groups gbApprove.Visible = false; gbReview.Visible = false; gv2col_Qaqc_approve.ImageIndex = 0; gv2col_Qaqc_review.ImageIndex = 0; // --- show template method ShowDilution(); // --- show description method CBatchFactory faBatch = new CBatchFactory(); CBatch oBatch = faBatch.GetByPrimaryKey(new CBatchKeys(Idbatch)); laTitleModule.Text = String.Format("Bandeja {0} en Espera", Comun.FormatCorrelativeCode("B-", Convert.ToInt64(oBatch.Num_tray), 5)); if (oBatch.Status_process == 'W') { ucSignCloseTray.Title = "Cerrar bandeja"; ucSignCloseTray.Enabled = true; bgvBatchCalc2.OptionsBehavior.Editable = false; } if (oBatch.Status_process == 'P') { ucSignCloseTray.Title = "Cerrado("+oBatch.User_close_tray+")"; ucSignCloseTray.Enabled = false; bgvBatchCalc2.OptionsBehavior.Editable = true; } CTemplate_methodFactory faTemplate_method = new CTemplate_methodFactory(); oTemplate_method_current = faTemplate_method.GetByPrimaryKey(new CTemplate_methodKeys(Idtemplate_method)); tbCodMethod.Text = oTemplate_method_current.Cod_template_method; tbTitle.Text = oTemplate_method_current.Title; tbAbbreviation.Text = oTemplate_method_current.Abbreviation; #region <optimizar> CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa_current = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Idtemplate_method)); deDate_allowed_error.DateTime = Convert.ToDateTime(oTemplate_method_aa_current.Date_allowed_error); CMr_detailFactory faMr_detail = new CMr_detailFactory(); CMr_detail oMr_detail = faMr_detail.GetByPrimaryKey(new CMr_detailKeys(Convert.ToInt16(oTemplate_method_aa_current.Idmr_detail))); tbLawMri.Text = oMr_detail.Nominal_value.ToString(); CMrFactory faMr = new CMrFactory(); CMr oMr = faMr.GetByPrimaryKey(new CMrKeys( Convert.ToInt16(oMr_detail.Idmr) )); tbMri.Text = oMr.Cod_mr; CMeasurement_unitFactory faMeasure = new CMeasurement_unitFactory(); CMeasurement_unit oMeasurement_unit = faMeasure.GetByPrimaryKey(new CMeasurement_unitKeys(Convert.ToInt16(oMr_detail.Idunit1))); tbUnitMeasure.Text = oMeasurement_unit.Name_unit; #endregion // --- clear columns gcBachCalc.DataSource = null; // --- format the datatable with the number of repetitions oDataBatch = new CDataBatch(Idbatch, Idtemplate_method, Comun.StatusWork.Waiting, Comun.CriteriaSort.BySample); gcBachCalc.DataSource = oDataBatch.ListSamples; // --- show sd tbAbs.Value = oDataBatch.Absorbance; tbStd.Value = oDataBatch.StdVerification; tbAbs.BackColor = oDataBatch.ColorAbsorbance; tbStd.BackColor = oDataBatch.ColorStd; tbSdBlk.Text = oDataBatch.LrbMeasured.ToString(); tbSdBlk.BackColor = oDataBatch.ColorLrbMeasured; tbSdMr.Text = oDataBatch.MriMeasured.ToString(); tbSdMr.BackColor = oDataBatch.ColorMriMeasured; // --- show empty sample ShowParityEmptySample(false); }
void Show_batch_finished() { gbApprove.Visible = true; gbReview.Visible = true; gv2col_Qaqc_approve.ImageIndex = 0; gv2col_Qaqc_review.ImageIndex = 0; // --- show template method ShowDilution(); // --- show description method CTemplate_methodFactory faTemplate_method = new CTemplate_methodFactory(); CTemplate_method oTemplate_method = faTemplate_method.GetByPrimaryKey(new CTemplate_methodKeys(Idtemplate_method)); tbCodMethod.Text = oTemplate_method.Cod_template_method; tbTitle.Text = oTemplate_method.Title; tbAbbreviation.Text = oTemplate_method.Abbreviation; // --- get batch trace_batch CTrace_batchFactory faTrace_batch = new CTrace_batchFactory(); Dictionary<string, string> dtTrace_batch = new BusinessLayer.Modules.ModProcessBatch().GetCurrentAndBelow(Idbatch, LimsProcess.PROCESS_IN_READING); CBatchFactory faBatch = new CBatchFactory(); CBatch oBatch = faBatch.GetByPrimaryKey(new CBatchKeys(Idbatch)); laTitleModule.Text = String.Format("Bandeja {0} Aprobada\n ({1})" , "B-" + oBatch.Num_tray.ToString().PadLeft(5, '0') , dtTrace_batch["User_approved"].ToString()); laUser_approved.Text = dtTrace_batch["User_approved"].ToString(); laDate_approved.Text = dtTrace_batch["Date_approved"].ToString(); laUser_revised.Text = dtTrace_batch["User_revised"].ToString(); laDate_revised.Text = dtTrace_batch["Date_revised"].ToString(); #region <optimizar> CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); CTemplate_method_aa oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Idtemplate_method)); deDate_allowed_error.DateTime = Convert.ToDateTime(oTemplate_method_aa.Date_allowed_error); CMr_detailFactory faMr_detail = new CMr_detailFactory(); CMr_detail oMr_detail = faMr_detail.GetByPrimaryKey(new CMr_detailKeys(Convert.ToInt16(oTemplate_method_aa.Idmr_detail))); tbLawMri.Text = oMr_detail.Nominal_value.ToString(); CMrFactory faMr = new CMrFactory(); CMr oMr = faMr.GetByPrimaryKey(new CMrKeys( Convert.ToInt16(oMr_detail.Idmr) )); tbMri.Text = oMr.Cod_mr; CMeasurement_unitFactory faMeasure = new CMeasurement_unitFactory(); CMeasurement_unit oMeasurement_unit = faMeasure.GetByPrimaryKey(new CMeasurement_unitKeys(Convert.ToInt16(oMr_detail.Idunit1))); tbUnitMeasure.Text = oMeasurement_unit.Name_unit; #endregion // --- clear columns gcBachCalc.DataSource = null; // --- format the datatable with the number of repetitions if (cbAuthorizationApproved.EditValue.ToString() == "0000") oDataBatch = new CDataBatch(Idbatch, Idtemplate_method, Comun.StatusWork.Saved, Comun.CriteriaSort.BySample); else oDataBatch = new CDataBatch(Idbatch, Idtemplate_method, Comun.StatusWork.Management, Comun.CriteriaSort.BySample); gcBachCalc.DataSource = oDataBatch.ListSamples; // --- show sd tbAbs.Value = oDataBatch.Absorbance; tbStd.Value = oDataBatch.StdVerification; tbAbs.BackColor = oDataBatch.ColorAbsorbance; tbStd.BackColor = oDataBatch.ColorStd; tbSdBlk.Text = oDataBatch.LrbMeasured.ToString(); tbSdBlk.BackColor = oDataBatch.ColorLrbMeasured; tbSdMr.Text = oDataBatch.MriMeasured.ToString(); tbSdMr.BackColor = oDataBatch.ColorMriMeasured; // --- OPTIMIZAR A USER CONTROL paAuthorization.Visible = true; // --- show empty sample ShowParityEmptySample(true); }
private void cbMaterialRef_EditValueChanged(object sender, EventArgs e) { CMr_detailFactory faMr_detail = new CMr_detailFactory(); CMr_detail oMr_detail = faMr_detail.GetByPrimaryKey( new CMr_detailKeys(Convert.ToInt16(cbMaterialRef.EditValue))); if (oMr_detail != null) tbLawMri.Text = oMr_detail.Nominal_value.ToString(); }
protected override bool Grabar_Registro() { bool result = false; try { CMrFactory faMr = new CMrFactory(); CMr oMr = new CMr(); oMr.Cod_mr = cbCodMR.Text; oMr.Idmr = IDMr; oMr.Lot = tbLot.Text; oMr.Type_material = Convert.ToChar(cbDescription.EditValue); oMr.Type_mr = Convert.ToChar(cbTypeMr.EditValue); oMr.Status_mr = Convert.ToBoolean(cbStatus.EditValue); oMr.Type_material = Convert.ToChar(cbDescription.EditValue); oMr.Manufaturer = Convert.ToInt16(cbManufacturer.EditValue); oMr.Certifier = Convert.ToInt16(cbCertifier.EditValue); oMr.Fbegin_validity = deBegin.DateTime; oMr.Fend_validity = deEnd.DateTime; if (!(result = faMr.Update(oMr))) { result = faMr.Insert(oMr); } if (result) { IDMr = oMr.Idmr; // --- detail elements CMr_detailFactory faMr_detail = new CMr_detailFactory(); CMr_detail oMr_detail = new CMr_detail(); for (int i = 0; i < gvMaterialReference.RowCount; i++) { oMr_detail = (CMr_detail)gvMaterialReference.GetRow(i); oMr_detail.Idmr = IDMr; if (!faMr_detail.Update(oMr_detail)) { faMr_detail.Insert(oMr_detail); } } // --- detail jars CMr_jarFactory faMr_jar = new CMr_jarFactory(); CMr_jar oMr_jar = new CMr_jar(); for (int i = 0; i < gvOpenCloseJar.RowCount; i++) { oMr_jar = (CMr_jar)gvOpenCloseJar.GetRow(i); oMr_jar.Idmr = IDMr; if (!faMr_jar.Update(oMr_jar)) { faMr_jar.Insert(oMr_jar); } } } } catch (Exception ex) { result = false; ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } return(result); }