/// <summary> /// Populate business objects from the data reader /// </summary> /// <param name="dataReader">data reader</param> /// <returns>list of CTemplate_method_gr</returns> internal List <CTemplate_method_gr> PopulateObjectsFromReader(IDataReader dataReader) { List <CTemplate_method_gr> list = new List <CTemplate_method_gr>(); while (dataReader.Read()) { CTemplate_method_gr businessObject = new CTemplate_method_gr(); PopulateBusinessObjectFromReader(businessObject, dataReader); list.Add(businessObject); } return(list); }
/// <summary> /// Select by primary key /// </summary> /// <param name="keys">primary keys</param> /// <returns>CTemplate_method_gr business object</returns> public CTemplate_method_gr SelectByPrimaryKey(CTemplate_method_grKeys keys) { NpgsqlCommand sqlCommand = new NpgsqlCommand(); sqlCommand.CommandText = "public.sp_template_method_gr_SelectByPrimaryKey"; sqlCommand.CommandType = CommandType.StoredProcedure; // Use connection object of base class sqlCommand.Connection = MainConnection; try { sqlCommand.Parameters.Add(new NpgsqlParameter("p_idtemplate_method", NpgsqlDbType.Integer, 4, "", ParameterDirection.Input, false, 0, 0, DataRowVersion.Proposed, keys.Idtemplate_method)); MainConnection.Open(); NpgsqlDataReader dataReader = sqlCommand.ExecuteReader(); if (dataReader.Read()) { CTemplate_method_gr businessObject = new CTemplate_method_gr(); PopulateBusinessObjectFromReader(businessObject, dataReader); return(businessObject); } else { return(null); } } catch (Exception ex) { throw new Exception("CTemplate_method_gr::SelectByPrimaryKey::Error occured.", ex); } finally { MainConnection.Close(); sqlCommand.Dispose(); } }
public bool SaveTypeAnalysis(int? pIdtemplate_method) { CTemplate_method_grFactory faTemplate_method_gr = new CTemplate_method_grFactory(); IDTemplate_Method = pIdtemplate_method; if (IDTemplate_Method != null && IDTemplate_Method > 0) { bool result_template_method_aa = false; CTemplate_method_gr oTemplate_method_gr = new CTemplate_method_gr(); oTemplate_method_gr.Idtemplate_method = Convert.ToInt32(IDTemplate_Method); oTemplate_method_gr.Weight = tbWeight.Value; oTemplate_method_gr.Weight_incertitude = tbWeight_incertitude.Value; oTemplate_method_gr.Reading_min = tbReading_min.Value; oTemplate_method_gr.Reading_max = tbReading_max.Value; oTemplate_method_gr.Reason_rep = tbReason_rep.Value; oTemplate_method_gr.Error_allowed = tbError_allowed.Value; oTemplate_method_gr.Symbol = tbSymbol.Text; oTemplate_method_gr.Law_limit_bottom = tbLaw_limit_bottom.Value; oTemplate_method_gr.Law_limit_top = tbLaw_limit_top.Value; oTemplate_method_gr.Num_decimal = Convert.ToInt16(tbNum_decimal.Value); oTemplate_method_gr.Date_allowed_error = Convert.ToDateTime(deDate_allowed_error.EditValue); oTemplate_method_gr.Idunit_result = Convert.ToInt16(cbUnit_result.EditValue); oTemplate_method_gr.Num_days = Convert.ToInt16(tbNum_days.Value); oTemplate_method_gr.Num_samples = Convert.ToInt16(tbNum_samples.Value); oTemplate_method_gr.Limit_samples = Convert.ToInt16(tbLimit_samples.Value); oTemplate_method_gr.Idfactor_estequiometrico = Convert.ToInt32(cbPrecipitado.EditValue); oTemplate_method_gr.Flag_mr = paMaterialReference.Enabled; if (paMaterialReference.Enabled) { oTemplate_method_gr.Idmr_detail = Convert.ToInt16(cbMaterialRef.EditValue); oTemplate_method_gr.Blk_max = tbBlk_max.Value; oTemplate_method_gr.Reason_rep = tbReason_rep.Value; oTemplate_method_gr.Reproducibility = tbReproducibility.Value; } oTemplate_method_gr.Flagblkfortify = paBlkFortification.Enabled; if (paBlkFortification.Enabled) { oTemplate_method_gr.Blkfortisol = tbBlkFortiSolution.Value; oTemplate_method_gr.Blkfortialiquot = tbBlkFortiAliquot.Value; oTemplate_method_gr.Blkfortireproducibility = tbBlkFortiReproducibility.Value; } oTemplate_method_gr.Flagsamfortify = paSampleFortification.Enabled; if (paSampleFortification.Enabled) { oTemplate_method_gr.Samfortisol = tbSamFortiSolution.Value; oTemplate_method_gr.Samfortialiquot = tbSamFortiAliquot.Value; oTemplate_method_gr.Samfortireproducibility = tbSamFortiReproducibility.Value; } if (!(result_template_method_aa = faTemplate_method_gr.Update(oTemplate_method_gr))) { oTemplate_method_gr.Date_allowed_error = DateTime.Now; result_template_method_aa = faTemplate_method_gr.Insert(oTemplate_method_gr); } } return true; }
public void RetrieveTypeAnalysis() { try { InitData(); // --- recuperate head if (IDTemplate_Method != null && IDTemplate_Method > 0) { CTemplate_method_gr oTemplate_method_gr = new CTemplate_method_gr(); CTemplate_method_grFactory faTemplate_method_aa = new CTemplate_method_grFactory(); oTemplate_method_gr = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_grKeys(Convert.ToInt32(IDTemplate_Method))); if (oTemplate_method_gr != null) { oTemplate_method_gr.Idtemplate_method = Convert.ToInt32(IDTemplate_Method); cbUnit_result.EditValue = oTemplate_method_gr.Idunit_result; tbNum_samples.Value = Convert.ToDecimal(oTemplate_method_gr.Num_samples); tbNum_days.Value = Convert.ToDecimal(oTemplate_method_gr.Num_days); tbLimit_samples.Value = Convert.ToInt16(oTemplate_method_gr.Limit_samples); tbWeight.Value = Convert.ToDecimal(oTemplate_method_gr.Weight); tbWeight_incertitude.Value = Convert.ToDecimal(oTemplate_method_gr.Weight_incertitude); tbReading_min.Value = Convert.ToDecimal(oTemplate_method_gr.Reading_min); tbReading_max.Value = Convert.ToDecimal(oTemplate_method_gr.Reading_max); tbReason_rep.Value = Convert.ToDecimal(oTemplate_method_gr.Reason_rep); tbError_allowed.Value = Convert.ToDecimal(oTemplate_method_gr.Error_allowed); tbSymbol.Text = oTemplate_method_gr.Symbol; tbLaw_limit_bottom.Value = Convert.ToDecimal(oTemplate_method_gr.Law_limit_bottom); tbLaw_limit_top.Value = Convert.ToDecimal(oTemplate_method_gr.Law_limit_top); tbNum_decimal.Value = Convert.ToDecimal(oTemplate_method_gr.Num_decimal); deDate_allowed_error.DateTime = Convert.ToDateTime(oTemplate_method_gr.Date_allowed_error); tbNum_days.Value = Convert.ToInt16(oTemplate_method_gr.Num_days); tbNum_samples.Value = Convert.ToInt16(oTemplate_method_gr.Num_samples); cbUnit_result.EditValue = oTemplate_method_gr.Idunit_result; tbLimit_samples.EditValue = oTemplate_method_gr.Limit_samples; rbMR.Checked = false; rbSamplesFortification.Checked = false; rbBlkFortification.Checked = false; rbMR.Checked = Convert.ToBoolean(oTemplate_method_gr.Flag_mr); rbSamplesFortification.Checked = Convert.ToBoolean(oTemplate_method_gr.Flagsamfortify); rbBlkFortification.Checked = Convert.ToBoolean(oTemplate_method_gr.Flagblkfortify); //paMaterialReference.Enabled = Convert.ToBoolean(oTemplate_method_gr.Flag_mr); //paBlkFortification.Enabled = Convert.ToBoolean(oTemplate_method_gr.Flagblkfortify); //paSampleFortification.Enabled = Convert.ToBoolean(oTemplate_method_gr.Flagsamfortify); if (paMaterialReference.Enabled) { tbReproducibility.Value = Convert.ToDecimal(oTemplate_method_gr.Reproducibility); cbMaterialRef.EditValue = oTemplate_method_gr.Idmr_detail; tbBlk_max.Value = Convert.ToDecimal(oTemplate_method_gr.Blk_max); } if (paBlkFortification.Enabled) { tbBlkFortiSolution.Value = Convert.ToDecimal(oTemplate_method_gr.Blkfortisol); tbBlkFortiAliquot.Value = Convert.ToDecimal(oTemplate_method_gr.Blkfortialiquot); tbBlkFortiReproducibility.Value = Convert.ToDecimal(oTemplate_method_gr.Blkfortireproducibility); } if (paSampleFortification.Enabled) { tbSamFortiSolution.Value = Convert.ToDecimal(oTemplate_method_gr.Samfortisol); tbSamFortiAliquot.Value = Convert.ToDecimal(oTemplate_method_gr.Samfortialiquot); tbSamFortiReproducibility.Value = Convert.ToDecimal(oTemplate_method_gr.Samfortireproducibility); } cbPrecipitado.EditValue = oTemplate_method_gr.Idfactor_estequiometrico; } else { // limpiar campos Limpiar_Campos(); } } } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } }
public bool SaveTypeAnalysis(int?pIdtemplate_method) { CTemplate_method_grFactory faTemplate_method_gr = new CTemplate_method_grFactory(); IDTemplate_Method = pIdtemplate_method; if (IDTemplate_Method != null && IDTemplate_Method > 0) { bool result_template_method_aa = false; CTemplate_method_gr oTemplate_method_gr = new CTemplate_method_gr(); oTemplate_method_gr.Idtemplate_method = Convert.ToInt32(IDTemplate_Method); oTemplate_method_gr.Weight = tbWeight.Value; oTemplate_method_gr.Weight_incertitude = tbWeight_incertitude.Value; oTemplate_method_gr.Reading_min = tbReading_min.Value; oTemplate_method_gr.Reading_max = tbReading_max.Value; oTemplate_method_gr.Reason_rep = tbReason_rep.Value; oTemplate_method_gr.Error_allowed = tbError_allowed.Value; oTemplate_method_gr.Symbol = tbSymbol.Text; oTemplate_method_gr.Law_limit_bottom = tbLaw_limit_bottom.Value; oTemplate_method_gr.Law_limit_top = tbLaw_limit_top.Value; oTemplate_method_gr.Num_decimal = Convert.ToInt16(tbNum_decimal.Value); oTemplate_method_gr.Date_allowed_error = Convert.ToDateTime(deDate_allowed_error.EditValue); oTemplate_method_gr.Idunit_result = Convert.ToInt16(cbUnit_result.EditValue); oTemplate_method_gr.Num_days = Convert.ToInt16(tbNum_days.Value); oTemplate_method_gr.Num_samples = Convert.ToInt16(tbNum_samples.Value); oTemplate_method_gr.Limit_samples = Convert.ToInt16(tbLimit_samples.Value); oTemplate_method_gr.Idfactor_estequiometrico = Convert.ToInt32(cbPrecipitado.EditValue); oTemplate_method_gr.Flag_mr = paMaterialReference.Enabled; if (paMaterialReference.Enabled) { oTemplate_method_gr.Idmr_detail = Convert.ToInt16(cbMaterialRef.EditValue); oTemplate_method_gr.Blk_max = tbBlk_max.Value; oTemplate_method_gr.Reason_rep = tbReason_rep.Value; oTemplate_method_gr.Reproducibility = tbReproducibility.Value; } oTemplate_method_gr.Flagblkfortify = paBlkFortification.Enabled; if (paBlkFortification.Enabled) { oTemplate_method_gr.Blkfortisol = tbBlkFortiSolution.Value; oTemplate_method_gr.Blkfortialiquot = tbBlkFortiAliquot.Value; oTemplate_method_gr.Blkfortireproducibility = tbBlkFortiReproducibility.Value; } oTemplate_method_gr.Flagsamfortify = paSampleFortification.Enabled; if (paSampleFortification.Enabled) { oTemplate_method_gr.Samfortisol = tbSamFortiSolution.Value; oTemplate_method_gr.Samfortialiquot = tbSamFortiAliquot.Value; oTemplate_method_gr.Samfortireproducibility = tbSamFortiReproducibility.Value; } if (!(result_template_method_aa = faTemplate_method_gr.Update(oTemplate_method_gr))) { oTemplate_method_gr.Date_allowed_error = DateTime.Now; result_template_method_aa = faTemplate_method_gr.Insert(oTemplate_method_gr); } } return(true); }
/// <summary> /// Populate business object from data reader /// </summary> /// <param name="businessObject">business object</param> /// <param name="dataReader">data reader</param> internal void PopulateBusinessObjectFromReader(CTemplate_method_gr businessObject, IDataReader dataReader) { businessObject.Idtemplate_method = dataReader.GetInt32(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Idtemplate_method.ToString())); if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Weight.ToString()))) { businessObject.Weight = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Weight.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Weight_incertitude.ToString()))) { businessObject.Weight_incertitude = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Weight_incertitude.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Reading_min.ToString()))) { businessObject.Reading_min = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Reading_min.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Reading_max.ToString()))) { businessObject.Reading_max = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Reading_max.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Reason_rep.ToString()))) { businessObject.Reason_rep = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Reason_rep.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Error_allowed.ToString()))) { businessObject.Error_allowed = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Error_allowed.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Symbol.ToString()))) { businessObject.Symbol = dataReader.GetString(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Symbol.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Law_limit_bottom.ToString()))) { businessObject.Law_limit_bottom = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Law_limit_bottom.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Law_limit_top.ToString()))) { businessObject.Law_limit_top = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Law_limit_top.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Num_decimal.ToString()))) { businessObject.Num_decimal = (short?)dataReader.GetInt16(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Num_decimal.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Flag_mr.ToString()))) { businessObject.Flag_mr = dataReader.GetBoolean(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Flag_mr.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Idmr_detail.ToString()))) { businessObject.Idmr_detail = (short?)dataReader.GetInt16(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Idmr_detail.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Mr_incertitude.ToString()))) { businessObject.Mr_incertitude = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Mr_incertitude.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Blk_max.ToString()))) { businessObject.Blk_max = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Blk_max.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Reproducibility.ToString()))) { businessObject.Reproducibility = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Reproducibility.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Flagsamfortify.ToString()))) { businessObject.Flagsamfortify = dataReader.GetBoolean(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Flagsamfortify.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Samfortisol.ToString()))) { businessObject.Samfortisol = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Samfortisol.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Samfortialiquot.ToString()))) { businessObject.Samfortialiquot = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Samfortialiquot.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Samfortireproducibility.ToString()))) { businessObject.Samfortireproducibility = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Samfortireproducibility.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Flagblkfortify.ToString()))) { businessObject.Flagblkfortify = dataReader.GetBoolean(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Flagblkfortify.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Blkfortisol.ToString()))) { businessObject.Blkfortisol = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Blkfortisol.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Blkfortialiquot.ToString()))) { businessObject.Blkfortialiquot = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Blkfortialiquot.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Blkfortireproducibility.ToString()))) { businessObject.Blkfortireproducibility = dataReader.GetDecimal(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Blkfortireproducibility.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Date_allowed_error.ToString()))) { businessObject.Date_allowed_error = dataReader.GetDateTime(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Date_allowed_error.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Idunit_result.ToString()))) { businessObject.Idunit_result = (short?)dataReader.GetInt16(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Idunit_result.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Num_samples.ToString()))) { businessObject.Num_samples = (short?)dataReader.GetInt16(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Num_samples.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Num_days.ToString()))) { businessObject.Num_days = (short?)dataReader.GetInt16(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Num_days.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Limit_samples.ToString()))) { businessObject.Limit_samples = (short?)dataReader.GetInt16(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Limit_samples.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Idfactor_estequiometrico.ToString()))) { businessObject.Idfactor_estequiometrico = dataReader.GetInt32(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Idfactor_estequiometrico.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Usernew.ToString()))) { businessObject.Usernew = dataReader.GetString(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Usernew.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Datenew.ToString()))) { businessObject.Datenew = dataReader.GetDateTime(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Datenew.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Useredit.ToString()))) { businessObject.Useredit = dataReader.GetString(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Useredit.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Dateedit.ToString()))) { businessObject.Dateedit = dataReader.GetDateTime(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Dateedit.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Status.ToString()))) { businessObject.Status = dataReader.GetBoolean(dataReader.GetOrdinal(CTemplate_method_gr.CTemplate_method_grFields.Status.ToString())); } }
/// <summary> /// insert new row in the table /// </summary> /// <param name="businessObject">business object</param> /// <returns>true of successfully insert</returns> public bool Insert(CTemplate_method_gr businessObject) { NpgsqlCommand sqlCommand = new NpgsqlCommand(); sqlCommand.CommandText = "public.sp_template_method_gr_Insert"; sqlCommand.CommandType = CommandType.StoredProcedure; // Use connection object of base class sqlCommand.Connection = MainConnection; try { sqlCommand.Parameters.AddWithValue("p_idtemplate_method", businessObject.Idtemplate_method); sqlCommand.Parameters["p_idtemplate_method"].NpgsqlDbType = NpgsqlDbType.Integer; sqlCommand.Parameters.AddWithValue("p_weight", businessObject.Weight); sqlCommand.Parameters["p_weight"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_weight_incertitude", businessObject.Weight_incertitude); sqlCommand.Parameters["p_weight_incertitude"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_reading_min", businessObject.Reading_min); sqlCommand.Parameters["p_reading_min"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_reading_max", businessObject.Reading_max); sqlCommand.Parameters["p_reading_max"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_reason_rep", businessObject.Reason_rep); sqlCommand.Parameters["p_reason_rep"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_error_allowed", businessObject.Error_allowed); sqlCommand.Parameters["p_error_allowed"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_symbol", businessObject.Symbol); sqlCommand.Parameters["p_symbol"].NpgsqlDbType = NpgsqlDbType.Varchar; sqlCommand.Parameters.AddWithValue("p_law_limit_bottom", businessObject.Law_limit_bottom); sqlCommand.Parameters["p_law_limit_bottom"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_law_limit_top", businessObject.Law_limit_top); sqlCommand.Parameters["p_law_limit_top"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_num_decimal", businessObject.Num_decimal); sqlCommand.Parameters["p_num_decimal"].NpgsqlDbType = NpgsqlDbType.Smallint; sqlCommand.Parameters.AddWithValue("p_flag_mr", businessObject.Flag_mr); sqlCommand.Parameters["p_flag_mr"].NpgsqlDbType = NpgsqlDbType.Boolean; sqlCommand.Parameters.AddWithValue("p_idmr_detail", businessObject.Idmr_detail); sqlCommand.Parameters["p_idmr_detail"].NpgsqlDbType = NpgsqlDbType.Smallint; sqlCommand.Parameters.AddWithValue("p_mr_incertitude", businessObject.Mr_incertitude); sqlCommand.Parameters["p_mr_incertitude"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_blk_max", businessObject.Blk_max); sqlCommand.Parameters["p_blk_max"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_reproducibility", businessObject.Reproducibility); sqlCommand.Parameters["p_reproducibility"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_flagsamfortify", businessObject.Flagsamfortify); sqlCommand.Parameters["p_flagsamfortify"].NpgsqlDbType = NpgsqlDbType.Boolean; sqlCommand.Parameters.AddWithValue("p_samfortisol", businessObject.Samfortisol); sqlCommand.Parameters["p_samfortisol"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_samfortialiquot", businessObject.Samfortialiquot); sqlCommand.Parameters["p_samfortialiquot"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_samfortireproducibility", businessObject.Samfortireproducibility); sqlCommand.Parameters["p_samfortireproducibility"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_flagblkfortify", businessObject.Flagblkfortify); sqlCommand.Parameters["p_flagblkfortify"].NpgsqlDbType = NpgsqlDbType.Boolean; sqlCommand.Parameters.AddWithValue("p_blkfortisol", businessObject.Blkfortisol); sqlCommand.Parameters["p_blkfortisol"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_blkfortialiquot", businessObject.Blkfortialiquot); sqlCommand.Parameters["p_blkfortialiquot"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_blkfortireproducibility", businessObject.Blkfortireproducibility); sqlCommand.Parameters["p_blkfortireproducibility"].NpgsqlDbType = NpgsqlDbType.Numeric; sqlCommand.Parameters.AddWithValue("p_date_allowed_error", businessObject.Date_allowed_error); sqlCommand.Parameters["p_date_allowed_error"].NpgsqlDbType = NpgsqlDbType.Date; sqlCommand.Parameters.AddWithValue("p_idunit_result", businessObject.Idunit_result); sqlCommand.Parameters["p_idunit_result"].NpgsqlDbType = NpgsqlDbType.Smallint; sqlCommand.Parameters.AddWithValue("p_num_samples", businessObject.Num_samples); sqlCommand.Parameters["p_num_samples"].NpgsqlDbType = NpgsqlDbType.Smallint; sqlCommand.Parameters.AddWithValue("p_num_days", businessObject.Num_days); sqlCommand.Parameters["p_num_days"].NpgsqlDbType = NpgsqlDbType.Smallint; sqlCommand.Parameters.AddWithValue("p_limit_samples", businessObject.Limit_samples); sqlCommand.Parameters["p_limit_samples"].NpgsqlDbType = NpgsqlDbType.Smallint; sqlCommand.Parameters.AddWithValue("p_idfactor_estequiometrico", businessObject.Idfactor_estequiometrico); sqlCommand.Parameters["p_idfactor_estequiometrico"].NpgsqlDbType = NpgsqlDbType.Integer; sqlCommand.Parameters.AddWithValue("p_usernew", businessObject.Usernew); sqlCommand.Parameters["p_usernew"].NpgsqlDbType = NpgsqlDbType.Varchar; sqlCommand.Parameters.AddWithValue("p_datenew", businessObject.Datenew); sqlCommand.Parameters["p_datenew"].NpgsqlDbType = NpgsqlDbType.Date; sqlCommand.Parameters.AddWithValue("p_useredit", businessObject.Useredit); sqlCommand.Parameters["p_useredit"].NpgsqlDbType = NpgsqlDbType.Varchar; sqlCommand.Parameters.AddWithValue("p_dateedit", businessObject.Dateedit); sqlCommand.Parameters["p_dateedit"].NpgsqlDbType = NpgsqlDbType.Date; sqlCommand.Parameters.AddWithValue("p_status", businessObject.Status); sqlCommand.Parameters["p_status"].NpgsqlDbType = NpgsqlDbType.Boolean; MainConnection.Open(); sqlCommand.ExecuteNonQuery(); return(true); } catch (Exception ex) { throw new Exception("CTemplate_method_gr::Insert::Error occured.", ex); } finally { MainConnection.Close(); sqlCommand.Dispose(); } }