public void InitData() { #region init combos try { cbUnit_result.Bind(); cbUnit_calib.Bind(); cbMedium.Bind(); cbModif.Bind(); cbSolCalib.BindSolCalib(); cbMaterialRef.Bind(Convert.ToInt16(IDElement)); List <CCalib> lst = new CCalibFactory().GetAll(); gcCalibracion.DataSource = new BindingList <CCalib>( new CCalibFactory() .GetAll() .Where(x => x.Idtemplate_method == 0).ToList()); } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } #endregion }
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 SaveTypeAnalysis(int?pIdtemplate_method) { CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); IDTemplate_Method = pIdtemplate_method; if (IDTemplate_Method != null && IDTemplate_Method > 0) { bool result_template_method_aa = false; CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aaFactory().GetByPrimaryKey(new CTemplate_method_aaKeys(Convert.ToInt32(IDTemplate_Method))); if (oTemplate_method_aa == null) { oTemplate_method_aa = new CTemplate_method_aa(); } oTemplate_method_aa.Idtemplate_method = Convert.ToInt32(IDTemplate_Method); oTemplate_method_aa.Weight = tbWeight.Value; oTemplate_method_aa.Weight_incertitude = tbWeight_incertitude.Value; oTemplate_method_aa.Volumen = tbVolumen.Value; oTemplate_method_aa.Reading_min = tbReading_min.Value; oTemplate_method_aa.Reading_max = tbReading_max.Value; oTemplate_method_aa.Dilution2 = tbDilution2.Value; oTemplate_method_aa.Dilution3 = tbDilution3.Value; oTemplate_method_aa.Reason_rep = tbReason_rep.Value; oTemplate_method_aa.Error_allowed = tbError_allowed.Value; oTemplate_method_aa.Symbol = tbSymbol.Text; oTemplate_method_aa.Law_limit_bottom = tbLaw_limit_bottom.Value; oTemplate_method_aa.Law_limit_top = tbLaw_limit_top.Value; oTemplate_method_aa.Idunit_calib = Convert.ToInt16(cbUnit_calib.EditValue); oTemplate_method_aa.Absorvance = tbAbs.Value; oTemplate_method_aa.Abs_incertitude = tbAbs_incertitude.Value; oTemplate_method_aa.Std_verif = tbStd_verif.Value; oTemplate_method_aa.Std_verif_incertitude = tbStd_verif_incertitude.Value; oTemplate_method_aa.Wave_long = tbWave_long.Value; oTemplate_method_aa.Idmr_detail = Convert.ToInt16(cbMaterialRef.EditValue); oTemplate_method_aa.Blk_max = tbBlk_max.Value; oTemplate_method_aa.Reason_rep = tbReason_rep.Value; oTemplate_method_aa.Reproducibility = tbReproducibility.Value; oTemplate_method_aa.Num_decimal = Convert.ToInt16(tbNum_decimal.Value); oTemplate_method_aa.Date_allowed_error = Convert.ToDateTime(deDate_allowed_error.EditValue); oTemplate_method_aa.Rexp2 = tbRexp2.Value; oTemplate_method_aa.Validity_calib = Convert.ToInt16(tbValidity_calib.Value); oTemplate_method_aa.Sol_concentration = Convert.ToDecimal(tbCalibConcen.Text); oTemplate_method_aa.Std_validity_sol1 = Convert.ToInt16(tbValiditySI1.Value); oTemplate_method_aa.Std_validity_sol2 = Convert.ToInt16(tbValiditySI2.Value); oTemplate_method_aa.Std_validity_sv = Convert.ToInt16(tbValiditySV.Value); if (cbTypePattern.EditValue != null) { oTemplate_method_aa.Type_pattern = Convert.ToInt32(cbTypePattern.EditValue); } //if (oTemplate_method_aa.Type_pattern == 1) // mrc // oTemplate_method_aa.Mrorpattern = Convert.ToInt16(cbMrcOrPattern.EditValue); //else if (oTemplate_method_aa.Type_pattern == 2) // solucion // oTemplate_method_aa.Flag_sol_intermedia = true; if (cbMedium.EditValue != null) { oTemplate_method_aa.Medium = Convert.ToInt32(cbMedium.EditValue); oTemplate_method_aa.Medium_conc = Convert.ToDecimal(tbMediumConc.Value); } if (cbModif.EditValue != null) { oTemplate_method_aa.Modif = Convert.ToInt32(cbModif.EditValue); oTemplate_method_aa.Modif_conc = Convert.ToDecimal(tbModifConc.Value); } if (cbStdMrcOrPattern.EditValue != null) { oTemplate_method_aa.Std_mrorpattern = Convert.ToInt32(cbStdMrcOrPattern.EditValue); } oTemplate_method_aa.Std_type_pattern = Convert.ToInt32(cbStdType_pattern.EditValue); oTemplate_method_aa.Std_flag_sol_intermedia1 = ckStdSolIntermOne.Checked; oTemplate_method_aa.Std_flag_sol_intermedia2 = ckStdSolIntermTwo.Checked; oTemplate_method_aa.Std_concentration = Convert.ToDecimal(tbStdConcentration.EditValue); oTemplate_method_aa.Std_concentration_sol1 = Convert.ToDecimal(tbStdConcenOne.EditValue); oTemplate_method_aa.Std_concentration_sol2 = Convert.ToDecimal(tbStdConcenTwo.EditValue); oTemplate_method_aa.Std_sol1_medium = tbMediumSol1.Value; oTemplate_method_aa.Std_sol2_medium = tbMediumSol2.Value; oTemplate_method_aa.Std_stdverif_medium = tbMediumStdVerif.Value; oTemplate_method_aa.Idunit_result = Convert.ToInt16(cbUnit_result.EditValue); oTemplate_method_aa.Num_days = Convert.ToInt16(tbNum_days.Value); oTemplate_method_aa.Num_samples = Convert.ToInt16(tbNum_samples.Value); oTemplate_method_aa.Limit_samples = Convert.ToInt16(tbLimit_samples.Value); if (!(result_template_method_aa = faTemplate_method_aa.Update(oTemplate_method_aa))) { oTemplate_method_aa.Date_allowed_error = DateTime.Now; result_template_method_aa = faTemplate_method_aa.Insert(oTemplate_method_aa); } if (result_template_method_aa) { for (int i = 0; i < gvCalibracion.RowCount; i++) { CCalibFactory faCalib = new CCalibFactory(); CCalib oCalib = gvCalibracion.GetRow(i) as CCalib; oCalib.Idtemplate_method = IDTemplate_Method; if (!faCalib.Update(oCalib)) { faCalib.Insert(oCalib); } } } } return(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 bool SaveTypeAnalysis(int? pIdtemplate_method) { CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); IDTemplate_Method = pIdtemplate_method; if (IDTemplate_Method != null && IDTemplate_Method > 0) { bool result_template_method_aa = false; CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aaFactory().GetByPrimaryKey(new CTemplate_method_aaKeys(Convert.ToInt32(IDTemplate_Method))); if (oTemplate_method_aa == null) oTemplate_method_aa = new CTemplate_method_aa(); oTemplate_method_aa.Idtemplate_method = Convert.ToInt32(IDTemplate_Method); oTemplate_method_aa.Weight = tbWeight.Value; oTemplate_method_aa.Weight_incertitude = tbWeight_incertitude.Value; oTemplate_method_aa.Volumen = tbVolumen.Value; oTemplate_method_aa.Reading_min = tbReading_min.Value; oTemplate_method_aa.Reading_max = tbReading_max.Value; oTemplate_method_aa.Dilution2 = tbDilution2.Value; oTemplate_method_aa.Dilution3 = tbDilution3.Value; oTemplate_method_aa.Reason_rep = tbReason_rep.Value; oTemplate_method_aa.Error_allowed = tbError_allowed.Value; oTemplate_method_aa.Symbol = tbSymbol.Text; oTemplate_method_aa.Law_limit_bottom = tbLaw_limit_bottom.Value; oTemplate_method_aa.Law_limit_top = tbLaw_limit_top.Value; oTemplate_method_aa.Idunit_calib = Convert.ToInt16(cbUnit_calib.EditValue); oTemplate_method_aa.Absorvance = tbAbs.Value; oTemplate_method_aa.Abs_incertitude = tbAbs_incertitude.Value; oTemplate_method_aa.Std_verif = tbStd_verif.Value; oTemplate_method_aa.Std_verif_incertitude = tbStd_verif_incertitude.Value; oTemplate_method_aa.Wave_long = tbWave_long.Value; oTemplate_method_aa.Idmr_detail = Convert.ToInt16(cbMaterialRef.EditValue); oTemplate_method_aa.Blk_max = tbBlk_max.Value; oTemplate_method_aa.Reason_rep = tbReason_rep.Value; oTemplate_method_aa.Reproducibility = tbReproducibility.Value; oTemplate_method_aa.Num_decimal = Convert.ToInt16(tbNum_decimal.Value); oTemplate_method_aa.Date_allowed_error = Convert.ToDateTime(deDate_allowed_error.EditValue); oTemplate_method_aa.Rexp2 = tbRexp2.Value; oTemplate_method_aa.Validity_calib = Convert.ToInt16(tbValidity_calib.Value); oTemplate_method_aa.Sol_concentration = Convert.ToDecimal(tbCalibConcen.Text); oTemplate_method_aa.Std_validity_sol1 = Convert.ToInt16(tbValiditySI1.Value); oTemplate_method_aa.Std_validity_sol2 = Convert.ToInt16(tbValiditySI2.Value); oTemplate_method_aa.Std_validity_sv = Convert.ToInt16(tbValiditySV.Value); if (cbTypePattern.EditValue != null) oTemplate_method_aa.Type_pattern = Convert.ToInt32(cbTypePattern.EditValue); //if (oTemplate_method_aa.Type_pattern == 1) // mrc // oTemplate_method_aa.Mrorpattern = Convert.ToInt16(cbMrcOrPattern.EditValue); //else if (oTemplate_method_aa.Type_pattern == 2) // solucion // oTemplate_method_aa.Flag_sol_intermedia = true; if (cbMedium.EditValue != null) { oTemplate_method_aa.Medium = Convert.ToInt32(cbMedium.EditValue); oTemplate_method_aa.Medium_conc = Convert.ToDecimal(tbMediumConc.Value); } if (cbModif.EditValue != null) { oTemplate_method_aa.Modif = Convert.ToInt32(cbModif.EditValue); oTemplate_method_aa.Modif_conc = Convert.ToDecimal(tbModifConc.Value); } if (cbStdMrcOrPattern.EditValue != null) oTemplate_method_aa.Std_mrorpattern = Convert.ToInt32(cbStdMrcOrPattern.EditValue); oTemplate_method_aa.Std_type_pattern = Convert.ToInt32(cbStdType_pattern.EditValue); oTemplate_method_aa.Std_flag_sol_intermedia1 = ckStdSolIntermOne.Checked; oTemplate_method_aa.Std_flag_sol_intermedia2 = ckStdSolIntermTwo.Checked; oTemplate_method_aa.Std_concentration = Convert.ToDecimal(tbStdConcentration.EditValue); oTemplate_method_aa.Std_concentration_sol1 = Convert.ToDecimal(tbStdConcenOne.EditValue); oTemplate_method_aa.Std_concentration_sol2 = Convert.ToDecimal(tbStdConcenTwo.EditValue); oTemplate_method_aa.Std_sol1_medium = tbMediumSol1.Value; oTemplate_method_aa.Std_sol2_medium = tbMediumSol2.Value; oTemplate_method_aa.Std_stdverif_medium = tbMediumStdVerif.Value; oTemplate_method_aa.Idunit_result = Convert.ToInt16(cbUnit_result.EditValue); oTemplate_method_aa.Num_days = Convert.ToInt16(tbNum_days.Value); oTemplate_method_aa.Num_samples = Convert.ToInt16(tbNum_samples.Value); oTemplate_method_aa.Limit_samples = Convert.ToInt16(tbLimit_samples.Value); if (!(result_template_method_aa = faTemplate_method_aa.Update(oTemplate_method_aa))) { oTemplate_method_aa.Date_allowed_error = DateTime.Now; result_template_method_aa = faTemplate_method_aa.Insert(oTemplate_method_aa); } if (result_template_method_aa) { for (int i = 0; i < gvCalibracion.RowCount; i++) { CCalibFactory faCalib = new CCalibFactory(); CCalib oCalib = gvCalibracion.GetRow(i) as CCalib; oCalib.Idtemplate_method = IDTemplate_Method; if (!faCalib.Update(oCalib)) faCalib.Insert(oCalib); } } } return 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 void InitData() { #region init combos try { cbUnit_result.Bind(); cbUnit_calib.Bind(); cbMedium.Bind(); cbModif.Bind(); cbSolCalib.BindSolCalib(); cbMaterialRef.Bind(Convert.ToInt16(IDElement)); List<CCalib> lst = new CCalibFactory().GetAll(); gcCalibracion.DataSource = new BindingList<CCalib>( new CCalibFactory() .GetAll() .Where(x => x.Idtemplate_method == 0).ToList()); } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } #endregion }