public int InsertFromInfo(TipoDeDietaEntityInfo EntityInfo)
 {
     try
     {
         TipoDeDietaEntityInsert EntityInsert = new TipoDeDietaEntityInsert();
         EntityInsert.LoadFromInfo(EntityInfo);
         return(this.Insert_Return_Scalar(EntityInsert));
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
 public int Insert_Return_Scalar(TipoDeDietaEntityInsert 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;
     }
 }
Esempio n. 3
0
        public int Insert_Return_Scalar(TipoDeDietaEntityInsert EntityInsert)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeDieta_Insert_Return_Scalar");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "TipoDeDieta", DbType.AnsiString, (object)EntityInsert.TipoDeDieta);
                    return((int)this.DataBase.ExecuteScalar(storedProcCommand));
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }