示例#1
0
 public int InsertFromInfo(TipoDeAlimentosEntityInfo EntityInfo)
 {
     try
     {
         TipoDeAlimentosEntityInsert EntityInsert = new TipoDeAlimentosEntityInsert();
         EntityInsert.LoadFromInfo(EntityInfo);
         return(this.Insert_Return_Scalar(EntityInsert));
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
示例#2
0
 public int Insert_Return_Scalar(TipoDeAlimentosEntityInsert 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;
     }
 }
示例#3
0
        public int Insert_Return_Scalar(TipoDeAlimentosEntityInsert EntityInsert)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeAlimentos_Insert_Return_Scalar");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "TipoDeAlimento", DbType.AnsiString, (object)EntityInsert.TipoDeAlimento);
                    this.DataBase.AddInParameter(storedProcCommand, "OrdenDeVisualizacion", DbType.Int32, (object)EntityInsert.OrdenDeVisualizacion);
                    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;
            }
        }