public bool SaveTypeAnalysis(int? pIdtemplate_method) { CTemplate_method_vcFactory faTemplate_method_gr = new CTemplate_method_vcFactory(); IDTemplate_Method = pIdtemplate_method; if (IDTemplate_Method != null && IDTemplate_Method > 0) { bool result_template_method_aa = false; CTemplate_method_vc oTemplate_method_vc = new CTemplate_method_vc(); oTemplate_method_vc.Idtemplate_method = Convert.ToInt32(IDTemplate_Method); oTemplate_method_vc.Weight = tbWeight.Value; oTemplate_method_vc.Weight_incertitude = tbWeight_incertitude.Value; oTemplate_method_vc.Reading_min = tbReading_min.Value; oTemplate_method_vc.Reading_max = tbReading_max.Value; oTemplate_method_vc.Reason_rep = tbReason_rep.Value; oTemplate_method_vc.Error_allowed = tbError_allowed.Value; oTemplate_method_vc.Symbol = tbSymbol.Text; oTemplate_method_vc.Law_limit_bottom = tbLaw_limit_bottom.Value; oTemplate_method_vc.Law_limit_top = tbLaw_limit_top.Value; oTemplate_method_vc.Num_decimal = Convert.ToInt16(tbNum_decimal.Value); oTemplate_method_vc.Date_allowed_error = Convert.ToDateTime(deDate_allowed_error.EditValue); oTemplate_method_vc.Idunit_result = Convert.ToInt16(cbUnit_result.EditValue); oTemplate_method_vc.Num_days = Convert.ToInt16(tbNum_days.Value); oTemplate_method_vc.Num_samples = Convert.ToInt16(tbNum_samples.Value); oTemplate_method_vc.Limit_samples = Convert.ToInt16(tbLimit_samples.Value); oTemplate_method_vc.Flag_mr = paMaterialReference.Enabled; if (paMaterialReference.Enabled) { oTemplate_method_vc.Idmr_detail = Convert.ToInt16(cbMaterialRef.EditValue); oTemplate_method_vc.Blk_max = tbBlk_max.Value; oTemplate_method_vc.Reason_rep = tbReason_rep.Value; oTemplate_method_vc.Reproducibility = tbReproducibility.Value; } oTemplate_method_vc.Flagblkfortify = paBlkFortification.Enabled; if (paBlkFortification.Enabled) { oTemplate_method_vc.Blkfortisol = tbBlkFortiSolution.Value; oTemplate_method_vc.Blkfortialiquot = tbBlkFortiAliquot.Value; oTemplate_method_vc.Blkfortireproducibility = tbBlkFortiReproducibility.Value; } oTemplate_method_vc.Flagsamfortify = paSampleFortification.Enabled; if (paSampleFortification.Enabled) { oTemplate_method_vc.Samfortisol = tbSamFortiSolution.Value; oTemplate_method_vc.Samfortialiquot = tbSamFortiAliquot.Value; oTemplate_method_vc.Samfortireproducibility = tbSamFortiReproducibility.Value; } if (!(result_template_method_aa = faTemplate_method_gr.Update(oTemplate_method_vc))) { oTemplate_method_vc.Date_allowed_error = DateTime.Now; result_template_method_aa = faTemplate_method_gr.Insert(oTemplate_method_vc); } } return true; }
public bool SaveTypeAnalysis(int?pIdtemplate_method) { CTemplate_method_vcFactory faTemplate_method_gr = new CTemplate_method_vcFactory(); IDTemplate_Method = pIdtemplate_method; if (IDTemplate_Method != null && IDTemplate_Method > 0) { bool result_template_method_aa = false; CTemplate_method_vc oTemplate_method_vc = new CTemplate_method_vc(); oTemplate_method_vc.Idtemplate_method = Convert.ToInt32(IDTemplate_Method); oTemplate_method_vc.Weight = tbWeight.Value; oTemplate_method_vc.Weight_incertitude = tbWeight_incertitude.Value; oTemplate_method_vc.Reading_min = tbReading_min.Value; oTemplate_method_vc.Reading_max = tbReading_max.Value; oTemplate_method_vc.Reason_rep = tbReason_rep.Value; oTemplate_method_vc.Error_allowed = tbError_allowed.Value; oTemplate_method_vc.Symbol = tbSymbol.Text; oTemplate_method_vc.Law_limit_bottom = tbLaw_limit_bottom.Value; oTemplate_method_vc.Law_limit_top = tbLaw_limit_top.Value; oTemplate_method_vc.Num_decimal = Convert.ToInt16(tbNum_decimal.Value); oTemplate_method_vc.Date_allowed_error = Convert.ToDateTime(deDate_allowed_error.EditValue); oTemplate_method_vc.Idunit_result = Convert.ToInt16(cbUnit_result.EditValue); oTemplate_method_vc.Num_days = Convert.ToInt16(tbNum_days.Value); oTemplate_method_vc.Num_samples = Convert.ToInt16(tbNum_samples.Value); oTemplate_method_vc.Limit_samples = Convert.ToInt16(tbLimit_samples.Value); oTemplate_method_vc.Flag_mr = paMaterialReference.Enabled; if (paMaterialReference.Enabled) { oTemplate_method_vc.Idmr_detail = Convert.ToInt16(cbMaterialRef.EditValue); oTemplate_method_vc.Blk_max = tbBlk_max.Value; oTemplate_method_vc.Reason_rep = tbReason_rep.Value; oTemplate_method_vc.Reproducibility = tbReproducibility.Value; } oTemplate_method_vc.Flagblkfortify = paBlkFortification.Enabled; if (paBlkFortification.Enabled) { oTemplate_method_vc.Blkfortisol = tbBlkFortiSolution.Value; oTemplate_method_vc.Blkfortialiquot = tbBlkFortiAliquot.Value; oTemplate_method_vc.Blkfortireproducibility = tbBlkFortiReproducibility.Value; } oTemplate_method_vc.Flagsamfortify = paSampleFortification.Enabled; if (paSampleFortification.Enabled) { oTemplate_method_vc.Samfortisol = tbSamFortiSolution.Value; oTemplate_method_vc.Samfortialiquot = tbSamFortiAliquot.Value; oTemplate_method_vc.Samfortireproducibility = tbSamFortiReproducibility.Value; } if (!(result_template_method_aa = faTemplate_method_gr.Update(oTemplate_method_vc))) { oTemplate_method_vc.Date_allowed_error = DateTime.Now; result_template_method_aa = faTemplate_method_gr.Insert(oTemplate_method_vc); } } return(true); }
public void RetrieveTypeAnalysis() { try { InitData(); // --- recuperate head if (IDTemplate_Method != null && IDTemplate_Method > 0) { CTemplate_method_vc oTemplate_method_vc = new CTemplate_method_vc(); CTemplate_method_vcFactory faTemplate_method_aa = new CTemplate_method_vcFactory(); oTemplate_method_vc = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_vcKeys(Convert.ToInt32(IDTemplate_Method))); if (oTemplate_method_vc != null) { oTemplate_method_vc.Idtemplate_method = Convert.ToInt32(IDTemplate_Method); cbUnit_result.EditValue = oTemplate_method_vc.Idunit_result; tbNum_samples.Value = Convert.ToDecimal(oTemplate_method_vc.Num_samples); tbNum_days.Value = Convert.ToDecimal(oTemplate_method_vc.Num_days); tbLimit_samples.Value = Convert.ToInt16(oTemplate_method_vc.Limit_samples); tbWeight.Value = Convert.ToDecimal(oTemplate_method_vc.Weight); tbWeight_incertitude.Value = Convert.ToDecimal(oTemplate_method_vc.Weight_incertitude); tbReading_min.Value = Convert.ToDecimal(oTemplate_method_vc.Reading_min); tbReading_max.Value = Convert.ToDecimal(oTemplate_method_vc.Reading_max); tbReason_rep.Value = Convert.ToDecimal(oTemplate_method_vc.Reason_rep); tbError_allowed.Value = Convert.ToDecimal(oTemplate_method_vc.Error_allowed); tbSymbol.Text = oTemplate_method_vc.Symbol; tbLaw_limit_bottom.Value = Convert.ToDecimal(oTemplate_method_vc.Law_limit_bottom); tbLaw_limit_top.Value = Convert.ToDecimal(oTemplate_method_vc.Law_limit_top); tbNum_decimal.Value = Convert.ToDecimal(oTemplate_method_vc.Num_decimal); deDate_allowed_error.DateTime = Convert.ToDateTime(oTemplate_method_vc.Date_allowed_error); tbNum_days.Value = Convert.ToInt16(oTemplate_method_vc.Num_days); tbNum_samples.Value = Convert.ToInt16(oTemplate_method_vc.Num_samples); cbUnit_result.EditValue = oTemplate_method_vc.Idunit_result; tbLimit_samples.EditValue = oTemplate_method_vc.Limit_samples; rbMR.Checked = false; rbSamplesFortification.Checked = false; rbBlkFortification.Checked = false; rbMR.Checked = Convert.ToBoolean(oTemplate_method_vc.Flag_mr); rbSamplesFortification.Checked = Convert.ToBoolean(oTemplate_method_vc.Flagsamfortify); rbBlkFortification.Checked = Convert.ToBoolean(oTemplate_method_vc.Flagblkfortify); //paMaterialReference.Enabled = Convert.ToBoolean(oTemplate_method_vc.Flag_mr); //paBlkFortification.Enabled = Convert.ToBoolean(oTemplate_method_vc.Flagblkfortify); //paSampleFortification.Enabled = Convert.ToBoolean(oTemplate_method_vc.Flagsamfortify); if (paMaterialReference.Enabled) { tbReproducibility.Value = Convert.ToDecimal(oTemplate_method_vc.Reproducibility); cbMaterialRef.EditValue = oTemplate_method_vc.Idmr_detail; tbBlk_max.Value = Convert.ToDecimal(oTemplate_method_vc.Blk_max); } if (paBlkFortification.Enabled) { tbBlkFortiSolution.Value = Convert.ToDecimal(oTemplate_method_vc.Blkfortisol); tbBlkFortiAliquot.Value = Convert.ToDecimal(oTemplate_method_vc.Blkfortialiquot); tbBlkFortiReproducibility.Value = Convert.ToDecimal(oTemplate_method_vc.Blkfortireproducibility); } if (paSampleFortification.Enabled) { tbSamFortiSolution.Value = Convert.ToDecimal(oTemplate_method_vc.Samfortisol); tbSamFortiAliquot.Value = Convert.ToDecimal(oTemplate_method_vc.Samfortialiquot); tbSamFortiReproducibility.Value = Convert.ToDecimal(oTemplate_method_vc.Samfortireproducibility); } } else { // limpiar campos Limpiar_Campos(); } } } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } }