public bool Is_law_right() { 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)); // --- recorring law columns for (int i = 0; i < ListSamples.Count; i++) { CBatch_detail_aa_twofold row = ListSamples[i]; decimal law1 = Convert.ToDecimal(row.Law1); decimal law2 = Convert.ToDecimal(row.Law2); if (law1 <= oTemplate_method_aa.Law_limit_bottom || law1 >= oTemplate_method_aa.Law_limit_top) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la ley esta fuera de los límites permitidos."); return(false); } if (law2 <= oTemplate_method_aa.Law_limit_bottom || law1 >= oTemplate_method_aa.Law_limit_top) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la ley esta fuera de los límites permitidos."); return(false); } } return(true); }
Comun.MethodSaveProperty GetResultTestHeader() { // --- registro anterior if (IDTemplate_Method <= 0) { return(Comun.MethodSaveProperty.NewMethod); } else { CTemplate_methodFactory faTemplate_method = new CTemplate_methodFactory(); CTemplate_method oTemplate_method = new CTemplate_method(); oTemplate_method = faTemplate_method.GetByPrimaryKey(new CTemplate_methodKeys(IDTemplate_Method)); CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(IDTemplate_Method)); // --- change inside head, require new method if (oTemplate_method.Idelement != Convert.ToInt16(cbElement.EditValue)) { return(Comun.MethodSaveProperty.InspectionNewMethod); } if (oTemplate_method.Cod_type_sample != cbTypeSample.EditValue.ToString()) { return(Comun.MethodSaveProperty.InspectionNewMethod); } if (oTemplate_method.Type_analisys != Convert.ToChar(cbTypeAnalysis.EditValue)) { return(Comun.MethodSaveProperty.InspectionNewMethod); } if (oTemplate_method.Cod_template_method != gluCod_method.Text) { return(Comun.MethodSaveProperty.InspectionNewMethod); } //if (oTemplate_method.Abbreviation != tbAbreviation.Text) // return Comun.MethodSaveProperty.InspectionNewMethod; //if (oTemplate_method.Title != tbTitle.Text) // return Comun.MethodSaveProperty.InspectionNewMethod; //if (oTemplate_method.Recognized != ckRecognized.Checked) // return Comun.MethodSaveProperty.InspectionNewMethod; if (oTemplate_method.Cod_digestion_method != cbDigestion.EditValue.ToString()) { return(Comun.MethodSaveProperty.InspectionNewMethod); } //if (Convert.ToDecimal(oTemplate_method.Cost_method) != tbCost_Method.Value) // return Comun.MethodSaveProperty.InspectionNewMethod; if (Convert.ToInt16(oTemplate_method.Cod_repetition) != Convert.ToInt16(cbRepetition.EditValue)) { return(Comun.MethodSaveProperty.InspectionNewMethod); } return(Comun.MethodSaveProperty.Nothing); } }
Comun.MethodSaveProperty GetResultTestHeader() { // --- registro anterior if (IDTemplate_Method <= 0) { return Comun.MethodSaveProperty.NewMethod; } else { CTemplate_methodFactory faTemplate_method = new CTemplate_methodFactory(); CTemplate_method oTemplate_method = new CTemplate_method(); oTemplate_method = faTemplate_method.GetByPrimaryKey(new CTemplate_methodKeys(IDTemplate_Method)); CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(IDTemplate_Method)); // --- change inside head, require new method if (oTemplate_method.Idelement != Convert.ToInt16(cbElement.EditValue)) return Comun.MethodSaveProperty.InspectionNewMethod; if (oTemplate_method.Cod_type_sample != cbTypeSample.EditValue.ToString()) return Comun.MethodSaveProperty.InspectionNewMethod; if (oTemplate_method.Type_analisys != Convert.ToChar(cbTypeAnalysis.EditValue)) return Comun.MethodSaveProperty.InspectionNewMethod; if (oTemplate_method.Cod_template_method != gluCod_method.Text) return Comun.MethodSaveProperty.InspectionNewMethod; //if (oTemplate_method.Abbreviation != tbAbreviation.Text) // return Comun.MethodSaveProperty.InspectionNewMethod; //if (oTemplate_method.Title != tbTitle.Text) // return Comun.MethodSaveProperty.InspectionNewMethod; //if (oTemplate_method.Recognized != ckRecognized.Checked) // return Comun.MethodSaveProperty.InspectionNewMethod; if (oTemplate_method.Cod_digestion_method != cbDigestion.EditValue.ToString()) return Comun.MethodSaveProperty.InspectionNewMethod; //if (Convert.ToDecimal(oTemplate_method.Cost_method) != tbCost_Method.Value) // return Comun.MethodSaveProperty.InspectionNewMethod; if (Convert.ToInt16(oTemplate_method.Cod_repetition) != Convert.ToInt16(cbRepetition.EditValue)) return Comun.MethodSaveProperty.InspectionNewMethod; return Comun.MethodSaveProperty.Nothing; } }
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); }
void InitData() { CReactiveFactory faReactive = new CReactiveFactory(); List <CReactive> lstReactive = faReactive.GetAll(); lstReactive.Add(new CReactive() { Idreactive = 0, Reactive_name = "---", Chemical_formula = "---" }); cbMedium.Properties.DataSource = lstReactive; cbMedium.Properties.ValueMember = "Idreactive"; cbMedium.Properties.DisplayMember = "Reactive_name"; cbModif.Properties.DataSource = lstReactive; cbModif.Properties.ValueMember = "Idreactive"; cbModif.Properties.DisplayMember = "Reactive_name"; CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(idtemplate_method)); idreactive_medium = oTemplate_method_aa.Medium; idreactive_modif = oTemplate_method_aa.Modif; LstAllCalibs = oModCalibStd.GetCustomCalibStd(idelement, idmr_detail, idreactive_medium, idreactive_modif); gcCalibStd.DataSource = LstAllCalibs; gvCalibStd.ExpandAllGroups(); //oGroup_solution = oModCalibStd.GetMethodCalib(idelement, idmr_detail, idreactive_medium, idreactive_modif); CElement oElement = new CElementFactory() .GetByPrimaryKey(new CElementKeys(Convert.ToInt16(idelement))); ucTraceUser1.UserSign = Comun.GetUser(); ucTraceUser1.DateSign = Comun.GetDate(); }
public void InitConfiguration() { CCalibFactory faCalib = new CCalibFactory(); lstCalibrations = faCalib.GetAll().Where(x => x.Idtemplate_method == idtemplate_method).ToList(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(idtemplate_method)); NumDecimalsCalib = Convert.ToInt16(oTemplate_method_aa.Num_decimal); Limit_bottom_law = Convert.ToDouble(oTemplate_method_aa.Law_limit_bottom); Limit_top_law = Convert.ToDouble(oTemplate_method_aa.Law_limit_top); Reading_min = Convert.ToDouble(oTemplate_method_aa.Reading_min); Reading_max = Convert.ToDouble(oTemplate_method_aa.Reading_max); CreateListRanksCalibAA(); CreateListRanksFactorAA(); }
public bool Is_reading_right() { 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)); // --- recorring reading columns for (int i = 0; i < ListSamples.Count; i++) { decimal reading1 = Convert.ToDecimal(ListSamples[i].Reading1); decimal reading2 = Convert.ToDecimal(ListSamples[i].Reading2); if (reading1 <= oTemplate_method_aa.Reading_min || reading1 >= oTemplate_method_aa.Reading_max) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la lectura esta fuera de los límites permitidos."); return(false); } if (reading2 <= oTemplate_method_aa.Reading_min || reading2 >= oTemplate_method_aa.Reading_max) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la lectura esta fuera de los límites permitidos."); return(false); } } return(true); }
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); }
void ShowDilution() { // --- get method 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)); // --- assign visibility columns // dilution 2 if (oTemplate_method_aa.Dilution2 == 1) { gv2col_Dilua1.Visible = false; gv2col_Flag_dila1.Visible = false; } else { gv2col_Dilua1.Visible = true; gv2col_Flag_dila1.Visible = true; } // dilution 3 if (oTemplate_method_aa.Dilution3 == 1) { gv2col_Dilub1.Visible = false; gv2col_Flag_dilb1.Visible = false; } else { gv2col_Dilub1.Visible = true; gv2col_Flag_dilb1.Visible = true; } if (oTemplate_method_aa.Dilution2 == 1 && oTemplate_method_aa.Dilution3 == 1) gbDilution.Visible = false; else gbDilution.Visible = true; }
public void RetrieveTypeAnalysis() { try { InitData(); // --- recuperate head if (IDTemplate_Method != null && IDTemplate_Method > 0) { CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Convert.ToInt32(IDTemplate_Method))); if (oTemplate_method_aa != null) { cbUnit_result.EditValue = oTemplate_method_aa.Idunit_result; tbNum_samples.Value = Convert.ToDecimal(oTemplate_method_aa.Num_samples); tbNum_days.Value = Convert.ToDecimal(oTemplate_method_aa.Num_days); tbLimit_samples.Value = Convert.ToInt16(oTemplate_method_aa.Limit_samples); tbWeight.Value = Convert.ToDecimal(oTemplate_method_aa.Weight); tbWeight_incertitude.Value = Convert.ToDecimal(oTemplate_method_aa.Weight_incertitude); tbVolumen.Value = Convert.ToDecimal(oTemplate_method_aa.Volumen); tbReading_min.Value = Convert.ToDecimal(oTemplate_method_aa.Reading_min); tbReading_max.Value = Convert.ToDecimal(oTemplate_method_aa.Reading_max); tbDilution2.Value = Convert.ToDecimal(oTemplate_method_aa.Dilution2); tbDilution3.Value = Convert.ToDecimal(oTemplate_method_aa.Dilution3); tbReason_rep.Value = Convert.ToDecimal(oTemplate_method_aa.Reason_rep); tbError_allowed.Value = Convert.ToDecimal(oTemplate_method_aa.Error_allowed); tbSymbol.Text = oTemplate_method_aa.Symbol; tbLaw_limit_bottom.Value = Convert.ToDecimal(oTemplate_method_aa.Law_limit_bottom); tbLaw_limit_top.Value = Convert.ToDecimal(oTemplate_method_aa.Law_limit_top); tbAbs.Value = Convert.ToDecimal(oTemplate_method_aa.Absorvance); tbAbs_incertitude.Value = Convert.ToDecimal(oTemplate_method_aa.Abs_incertitude); tbStd_verif.Value = Convert.ToDecimal(oTemplate_method_aa.Std_verif); tbStd_verif_incertitude.Value = Convert.ToDecimal(oTemplate_method_aa.Std_verif_incertitude); tbWave_long.Value = Convert.ToDecimal(oTemplate_method_aa.Wave_long); tbReproducibility.Value = Convert.ToDecimal(oTemplate_method_aa.Reproducibility); tbNum_decimal.Value = Convert.ToDecimal(oTemplate_method_aa.Num_decimal); tbBlk_max.Value = Convert.ToDecimal(oTemplate_method_aa.Blk_max); deDate_allowed_error.DateTime = Convert.ToDateTime(oTemplate_method_aa.Date_allowed_error); cbMaterialRef.EditValue = oTemplate_method_aa.Idmr_detail; cbUnit_calib.EditValue = oTemplate_method_aa.Idunit_calib; cbMrcOrPattern.EditValue = oTemplate_method_aa.Mrorpattern; tbRexp2.Value = Convert.ToDecimal(oTemplate_method_aa.Rexp2); tbNum_days.Value = Convert.ToInt16(oTemplate_method_aa.Num_days); tbNum_samples.Value = Convert.ToInt16(oTemplate_method_aa.Num_samples); cbUnit_result.EditValue = oTemplate_method_aa.Idunit_result; tbLimit_samples.EditValue = oTemplate_method_aa.Limit_samples; tbCalibConcen.EditValue = oTemplate_method_aa.Sol_concentration; /// medio de matriz cbMedium.EditValue = oTemplate_method_aa.Medium; if (oTemplate_method_aa.Medium == null) { tbMediumConc.Enabled = false; tbMediumConc.Value = 0; } else { tbMediumConc.Enabled = true; tbMediumConc.Value = Convert.ToDecimal(oTemplate_method_aa.Medium_conc); } /// modificador de matriz cbModif.EditValue = oTemplate_method_aa.Modif; if (oTemplate_method_aa.Modif == null) { tbModifConc.Enabled = false; tbModifConc.Value = Convert.ToDecimal(oTemplate_method_aa.Modif_conc); } else { tbModifConc.Enabled = true; tbModifConc.Value = Convert.ToDecimal(oTemplate_method_aa.Modif_conc); } tbValidity_calib.Value = Convert.ToDecimal(oTemplate_method_aa.Validity_calib); cbTypePattern.EditValue = oTemplate_method_aa.Type_pattern; deCalibDateExpir.DateTime = Convert.ToDateTime(oTemplate_method_aa.Sol_date_expiration); cbStdType_pattern.EditValue = oTemplate_method_aa.Std_type_pattern; cbStdMrcOrPattern.EditValue = oTemplate_method_aa.Std_mrorpattern; ckStdSolIntermOne.Checked = Convert.ToBoolean(oTemplate_method_aa.Std_flag_sol_intermedia1); ckStdSolIntermTwo.Checked = Convert.ToBoolean(oTemplate_method_aa.Std_flag_sol_intermedia2); tbStdConcentration.EditValue = oTemplate_method_aa.Std_concentration; tbStdConcenOne.EditValue = oTemplate_method_aa.Std_concentration_sol1; tbStdConcenTwo.EditValue = oTemplate_method_aa.Std_concentration_sol2; tbMediumSol1.Value = Convert.ToDecimal(oTemplate_method_aa.Std_sol1_medium); tbMediumSol2.Value = Convert.ToDecimal(oTemplate_method_aa.Std_sol2_medium); tbMediumStdVerif.Value = Convert.ToDecimal(oTemplate_method_aa.Std_stdverif_medium); tbValiditySI1.Value = Convert.ToInt16(oTemplate_method_aa.Std_validity_sol1); tbValiditySI2.Value = Convert.ToInt16(oTemplate_method_aa.Std_validity_sol2); tbValiditySV.Value = Convert.ToInt16(oTemplate_method_aa.Std_validity_sv); tbValiditySI1.Enabled = Convert.ToBoolean(oTemplate_method_aa.Std_flag_sol_intermedia1); tbValiditySI2.Enabled = Convert.ToBoolean(oTemplate_method_aa.Std_flag_sol_intermedia2); tbValiditySV.Enabled = true; // --- recuperate CCalibFactory faCalib = new CCalibFactory(); List<CCalib> lst = new CCalibFactory().GetAll(); gcCalibracion.DataSource = new BindingList<CCalib>( faCalib .GetAll() .Where(x => x.Idtemplate_method == oTemplate_method_aa.Idtemplate_method).ToList()); // --- recuperar soluciones List<CSolution_interm> lstSim = new ModSolInterm().GetLstSolution_intermByMethod(Convert.ToInt32(IDTemplate_Method)); foreach (CSolution_interm item in lstSim) { if (item.Type_sol == 1) {//solución intermedia 1 tbCodSol1.Text = item.Cod_solution; deExpSolInterm1.DateTime = Convert.ToDateTime(item.Date_end); } else if (item.Type_sol == 2) {//solución intermedia 2 tbCodSol2.Text = item.Cod_solution; deExpSolInterm2.DateTime = Convert.ToDateTime(item.Date_end); } else if (item.Type_sol == 3) {//estandar de calibración tbCodStdVer.Text = item.Cod_solution; deExpSV.DateTime = Convert.ToDateTime(item.Date_end); } else if (item.Type_sol == 4) {//calibraciones cbSolCalib.EditValue = item.Idsolution_interm; deCalibDateExpir.DateTime = Convert.ToDateTime(item.Date_end); } } } } else { // --- recuperate CCalibFactory faCalib = new CCalibFactory(); gcCalibracion.DataSource = new BindingList<CCalib>(faCalib.GetAll().Where(x => x.Idtemplate_method == 0).ToList()); } } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } }
public Comun.MethodSaveProperty GetResultTestAA() { // --- registro anterior if (IDTemplate_Method <= 0) { return Comun.MethodSaveProperty.NewMethod; } else { CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Convert.ToInt32(IDTemplate_Method))); if (oTemplate_method_aa.Wave_long != tbWave_long.Value) return Comun.MethodSaveProperty.InspectionNewMethod; // --- change inside details, require new version if (oTemplate_method_aa.Abs_incertitude != tbAbs_incertitude.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Absorvance != tbAbs.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Blk_max != tbBlk_max.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Date_allowed_error != deDate_allowed_error.DateTime) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Dilution2 != tbDilution2.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Dilution3 != tbDilution3.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Idmr_detail != Convert.ToInt16(cbMaterialRef.EditValue)) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Idunit_calib != Convert.ToInt16(cbUnit_calib.EditValue)) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Idunit_result != Convert.ToInt16(cbUnit_result.EditValue)) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Law_limit_bottom != tbLaw_limit_bottom.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Law_limit_top != tbLaw_limit_top.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Reproducibility != tbReproducibility.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Std_verif != tbStd_verif.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Std_verif_incertitude != tbStd_verif_incertitude.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Symbol != tbSymbol.Text) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Weight != tbWeight.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Weight_incertitude != tbWeight_incertitude.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Reason_rep != tbReason_rep.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Reading_min != tbReading_min.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Reading_max != tbReading_max.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Volumen != tbVolumen.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Num_decimal != tbNum_decimal.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Num_days != tbNum_days.Value) return Comun.MethodSaveProperty.InspectionNewVersion; if (oTemplate_method_aa.Num_samples != tbNum_samples.Value) return Comun.MethodSaveProperty.InspectionNewVersion; return Comun.MethodSaveProperty.Nothing; } }
public bool Is_law_right() { 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)); // --- recorring law columns for (int i = 0; i < ListSamples.Count; i++) { CBatch_detail_aa_twofold row = ListSamples[i]; decimal law1 = Convert.ToDecimal(row.Law1); decimal law2 = Convert.ToDecimal(row.Law2); if (law1 <= oTemplate_method_aa.Law_limit_bottom || law1 >= oTemplate_method_aa.Law_limit_top) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la ley esta fuera de los límites permitidos."); return false; } if (law2 <= oTemplate_method_aa.Law_limit_bottom || law1 >= oTemplate_method_aa.Law_limit_top) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la ley esta fuera de los límites permitidos."); return false; } } return true; }
void InitData() { CReactiveFactory faReactive = new CReactiveFactory(); List<CReactive> lstReactive = faReactive.GetAll(); lstReactive.Add(new CReactive() { Idreactive = 0, Reactive_name = "---", Chemical_formula = "---" }); cbMedium.Properties.DataSource = lstReactive; cbMedium.Properties.ValueMember = "Idreactive"; cbMedium.Properties.DisplayMember = "Reactive_name"; cbModif.Properties.DataSource = lstReactive; cbModif.Properties.ValueMember = "Idreactive"; cbModif.Properties.DisplayMember = "Reactive_name"; CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(idtemplate_method)); idreactive_medium = oTemplate_method_aa.Medium; idreactive_modif = oTemplate_method_aa.Modif; LstAllCalibs = oModCalibStd.GetCustomCalibStd(idelement, idmr_detail, idreactive_medium, idreactive_modif); gcCalibStd.DataSource = LstAllCalibs; gvCalibStd.ExpandAllGroups(); //oGroup_solution = oModCalibStd.GetMethodCalib(idelement, idmr_detail, idreactive_medium, idreactive_modif); CElement oElement = new CElementFactory() .GetByPrimaryKey(new CElementKeys(Convert.ToInt16(idelement))); ucTraceUser1.UserSign = Comun.GetUser(); ucTraceUser1.DateSign = Comun.GetDate(); }
public void RetrieveTypeAnalysis() { try { InitData(); // --- recuperate head if (IDTemplate_Method != null && IDTemplate_Method > 0) { CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Convert.ToInt32(IDTemplate_Method))); if (oTemplate_method_aa != null) { cbUnit_result.EditValue = oTemplate_method_aa.Idunit_result; tbNum_samples.Value = Convert.ToDecimal(oTemplate_method_aa.Num_samples); tbNum_days.Value = Convert.ToDecimal(oTemplate_method_aa.Num_days); tbLimit_samples.Value = Convert.ToInt16(oTemplate_method_aa.Limit_samples); tbWeight.Value = Convert.ToDecimal(oTemplate_method_aa.Weight); tbWeight_incertitude.Value = Convert.ToDecimal(oTemplate_method_aa.Weight_incertitude); tbVolumen.Value = Convert.ToDecimal(oTemplate_method_aa.Volumen); tbReading_min.Value = Convert.ToDecimal(oTemplate_method_aa.Reading_min); tbReading_max.Value = Convert.ToDecimal(oTemplate_method_aa.Reading_max); tbDilution2.Value = Convert.ToDecimal(oTemplate_method_aa.Dilution2); tbDilution3.Value = Convert.ToDecimal(oTemplate_method_aa.Dilution3); tbReason_rep.Value = Convert.ToDecimal(oTemplate_method_aa.Reason_rep); tbError_allowed.Value = Convert.ToDecimal(oTemplate_method_aa.Error_allowed); tbSymbol.Text = oTemplate_method_aa.Symbol; tbLaw_limit_bottom.Value = Convert.ToDecimal(oTemplate_method_aa.Law_limit_bottom); tbLaw_limit_top.Value = Convert.ToDecimal(oTemplate_method_aa.Law_limit_top); tbAbs.Value = Convert.ToDecimal(oTemplate_method_aa.Absorvance); tbAbs_incertitude.Value = Convert.ToDecimal(oTemplate_method_aa.Abs_incertitude); tbStd_verif.Value = Convert.ToDecimal(oTemplate_method_aa.Std_verif); tbStd_verif_incertitude.Value = Convert.ToDecimal(oTemplate_method_aa.Std_verif_incertitude); tbWave_long.Value = Convert.ToDecimal(oTemplate_method_aa.Wave_long); tbReproducibility.Value = Convert.ToDecimal(oTemplate_method_aa.Reproducibility); tbNum_decimal.Value = Convert.ToDecimal(oTemplate_method_aa.Num_decimal); tbBlk_max.Value = Convert.ToDecimal(oTemplate_method_aa.Blk_max); deDate_allowed_error.DateTime = Convert.ToDateTime(oTemplate_method_aa.Date_allowed_error); cbMaterialRef.EditValue = oTemplate_method_aa.Idmr_detail; cbUnit_calib.EditValue = oTemplate_method_aa.Idunit_calib; cbMrcOrPattern.EditValue = oTemplate_method_aa.Mrorpattern; tbRexp2.Value = Convert.ToDecimal(oTemplate_method_aa.Rexp2); tbNum_days.Value = Convert.ToInt16(oTemplate_method_aa.Num_days); tbNum_samples.Value = Convert.ToInt16(oTemplate_method_aa.Num_samples); cbUnit_result.EditValue = oTemplate_method_aa.Idunit_result; tbLimit_samples.EditValue = oTemplate_method_aa.Limit_samples; tbCalibConcen.EditValue = oTemplate_method_aa.Sol_concentration; /// medio de matriz cbMedium.EditValue = oTemplate_method_aa.Medium; if (oTemplate_method_aa.Medium == null) { tbMediumConc.Enabled = false; tbMediumConc.Value = 0; } else { tbMediumConc.Enabled = true; tbMediumConc.Value = Convert.ToDecimal(oTemplate_method_aa.Medium_conc); } /// modificador de matriz cbModif.EditValue = oTemplate_method_aa.Modif; if (oTemplate_method_aa.Modif == null) { tbModifConc.Enabled = false; tbModifConc.Value = Convert.ToDecimal(oTemplate_method_aa.Modif_conc); } else { tbModifConc.Enabled = true; tbModifConc.Value = Convert.ToDecimal(oTemplate_method_aa.Modif_conc); } tbValidity_calib.Value = Convert.ToDecimal(oTemplate_method_aa.Validity_calib); cbTypePattern.EditValue = oTemplate_method_aa.Type_pattern; deCalibDateExpir.DateTime = Convert.ToDateTime(oTemplate_method_aa.Sol_date_expiration); cbStdType_pattern.EditValue = oTemplate_method_aa.Std_type_pattern; cbStdMrcOrPattern.EditValue = oTemplate_method_aa.Std_mrorpattern; ckStdSolIntermOne.Checked = Convert.ToBoolean(oTemplate_method_aa.Std_flag_sol_intermedia1); ckStdSolIntermTwo.Checked = Convert.ToBoolean(oTemplate_method_aa.Std_flag_sol_intermedia2); tbStdConcentration.EditValue = oTemplate_method_aa.Std_concentration; tbStdConcenOne.EditValue = oTemplate_method_aa.Std_concentration_sol1; tbStdConcenTwo.EditValue = oTemplate_method_aa.Std_concentration_sol2; tbMediumSol1.Value = Convert.ToDecimal(oTemplate_method_aa.Std_sol1_medium); tbMediumSol2.Value = Convert.ToDecimal(oTemplate_method_aa.Std_sol2_medium); tbMediumStdVerif.Value = Convert.ToDecimal(oTemplate_method_aa.Std_stdverif_medium); tbValiditySI1.Value = Convert.ToInt16(oTemplate_method_aa.Std_validity_sol1); tbValiditySI2.Value = Convert.ToInt16(oTemplate_method_aa.Std_validity_sol2); tbValiditySV.Value = Convert.ToInt16(oTemplate_method_aa.Std_validity_sv); tbValiditySI1.Enabled = Convert.ToBoolean(oTemplate_method_aa.Std_flag_sol_intermedia1); tbValiditySI2.Enabled = Convert.ToBoolean(oTemplate_method_aa.Std_flag_sol_intermedia2); tbValiditySV.Enabled = true; // --- recuperate CCalibFactory faCalib = new CCalibFactory(); List <CCalib> lst = new CCalibFactory().GetAll(); gcCalibracion.DataSource = new BindingList <CCalib>( faCalib .GetAll() .Where(x => x.Idtemplate_method == oTemplate_method_aa.Idtemplate_method).ToList()); // --- recuperar soluciones List <CSolution_interm> lstSim = new ModSolInterm().GetLstSolution_intermByMethod(Convert.ToInt32(IDTemplate_Method)); foreach (CSolution_interm item in lstSim) { if (item.Type_sol == 1) {//solución intermedia 1 tbCodSol1.Text = item.Cod_solution; deExpSolInterm1.DateTime = Convert.ToDateTime(item.Date_end); } else if (item.Type_sol == 2) {//solución intermedia 2 tbCodSol2.Text = item.Cod_solution; deExpSolInterm2.DateTime = Convert.ToDateTime(item.Date_end); } else if (item.Type_sol == 3) {//estandar de calibración tbCodStdVer.Text = item.Cod_solution; deExpSV.DateTime = Convert.ToDateTime(item.Date_end); } else if (item.Type_sol == 4) {//calibraciones cbSolCalib.EditValue = item.Idsolution_interm; deCalibDateExpir.DateTime = Convert.ToDateTime(item.Date_end); } } } } else { // --- recuperate CCalibFactory faCalib = new CCalibFactory(); gcCalibracion.DataSource = new BindingList <CCalib>(faCalib.GetAll().Where(x => x.Idtemplate_method == 0).ToList()); } } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } }
public bool Is_reading_right() { 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)); // --- recorring reading columns for (int i = 0; i < ListSamples.Count; i++) { decimal reading1 = Convert.ToDecimal(ListSamples[i].Reading1); decimal reading2 = Convert.ToDecimal(ListSamples[i].Reading2); if (reading1 <= oTemplate_method_aa.Reading_min || reading1 >= oTemplate_method_aa.Reading_max) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la lectura esta fuera de los límites permitidos."); return false; } if (reading2 <= oTemplate_method_aa.Reading_min || reading2 >= oTemplate_method_aa.Reading_max) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la lectura esta fuera de los límites permitidos."); return false; } } return true; }
public Comun.MethodSaveProperty GetResultTestAA() { // --- registro anterior if (IDTemplate_Method <= 0) { return(Comun.MethodSaveProperty.NewMethod); } else { CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Convert.ToInt32(IDTemplate_Method))); if (oTemplate_method_aa.Wave_long != tbWave_long.Value) { return(Comun.MethodSaveProperty.InspectionNewMethod); } // --- change inside details, require new version if (oTemplate_method_aa.Abs_incertitude != tbAbs_incertitude.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Absorvance != tbAbs.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Blk_max != tbBlk_max.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Date_allowed_error != deDate_allowed_error.DateTime) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Dilution2 != tbDilution2.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Dilution3 != tbDilution3.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Idmr_detail != Convert.ToInt16(cbMaterialRef.EditValue)) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Idunit_calib != Convert.ToInt16(cbUnit_calib.EditValue)) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Idunit_result != Convert.ToInt16(cbUnit_result.EditValue)) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Law_limit_bottom != tbLaw_limit_bottom.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Law_limit_top != tbLaw_limit_top.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Reproducibility != tbReproducibility.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Std_verif != tbStd_verif.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Std_verif_incertitude != tbStd_verif_incertitude.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Symbol != tbSymbol.Text) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Weight != tbWeight.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Weight_incertitude != tbWeight_incertitude.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Reason_rep != tbReason_rep.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Reading_min != tbReading_min.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Reading_max != tbReading_max.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Volumen != tbVolumen.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Num_decimal != tbNum_decimal.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Num_days != tbNum_days.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } if (oTemplate_method_aa.Num_samples != tbNum_samples.Value) { return(Comun.MethodSaveProperty.InspectionNewVersion); } return(Comun.MethodSaveProperty.Nothing); } }