public int InsertFromInfo(NutrienteEntityInfo EntityInfo) { try { NutrienteEntityInsert EntityInsert = new NutrienteEntityInsert(); EntityInsert.LoadFromInfo(EntityInfo); return(this.Insert_Return_Scalar(EntityInsert)); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public int Insert_Return_Scalar(NutrienteEntityInsert EntityInsert) { try { if (!EntityInsert.Validate()) { throw new Exception(EntityInsert.ErroresQueInvalidanLaEntidad); } return(this.CreateDataAccess().Insert_Return_Scalar(EntityInsert)); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public int Insert_Return_Scalar(NutrienteEntityInsert EntityInsert) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("Nutriente_Insert_Return_Scalar"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "Nombre", DbType.AnsiString, (object)EntityInsert.Nombre); this.DataBase.AddInParameter(storedProcCommand, "UDMId", DbType.AnsiString, (object)EntityInsert.UDMId); this.DataBase.AddInParameter(storedProcCommand, "PerteneceA", DbType.Int32, (object)EntityInsert.PerteneceA); this.DataBase.AddInParameter(storedProcCommand, "Estado", DbType.AnsiString, (object)EntityInsert.Estado); return((int)this.DataBase.ExecuteScalar(storedProcCommand)); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }