public void InsertFromInfo(EncuestaAliNutEntityInfo EntityInfo) { try { EncuestaAliNutEntityInsert EntityInsert = new EncuestaAliNutEntityInsert(); EntityInsert.LoadFromInfo(EntityInfo); this.Insert(EntityInsert); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public void Insert(EncuestaAliNutEntityInsert EntityInsert) { try { if (!EntityInsert.Validate()) { throw new Exception(EntityInsert.ErroresQueInvalidanLaEntidad); } this.CreateDataAccess().Insert(EntityInsert); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public void Insert(EncuestaAliNutEntityInsert EntityInsert) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("EncuestaAliNut_Insert"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "EncuestaNro", DbType.Int32, (object)EntityInsert.EncuestaNro); this.DataBase.AddInParameter(storedProcCommand, "AlimentoId", DbType.Int32, (object)EntityInsert.AlimentoId); this.DataBase.AddInParameter(storedProcCommand, "NutrienteId", DbType.Int32, (object)EntityInsert.NutrienteId); this.DataBase.AddInParameter(storedProcCommand, "Cantidad", DbType.Decimal, (object)EntityInsert.Cantidad); this.DataBase.ExecuteNonQuery(storedProcCommand); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }