Beispiel #1
0
        public void Insert(AlimentoNutrienteEntityInsert EntityInsert)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("AlimentoNutriente_Insert");

            try
            {
                using (storedProcCommand)
                {
                    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.AddInParameter(storedProcCommand, "FntID", DbType.AnsiString, (object)EntityInsert.FntID);

                    this.DataBase.ExecuteNonQuery(storedProcCommand);
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
 public void InsertFromInfo(AlimentoNutrienteEntityInfo EntityInfo)
 {
     try
     {
         AlimentoNutrienteEntityInsert EntityInsert = new AlimentoNutrienteEntityInsert();
         EntityInsert.LoadFromInfo(EntityInfo);
         this.Insert(EntityInsert);
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
Beispiel #3
0
 public void Insert(AlimentoNutrienteEntityInsert EntityInsert)
 {
     try
     {
         if (!EntityInsert.Validate())
         {
             throw new Exception(EntityInsert.ErroresQueInvalidanLaEntidad);
         }
         this.CreateDataAccess().Insert(EntityInsert);
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }