Exemplo n.º 1
0
 public bool UpdateFromInfo(TipoDeAlimentosEntityKey EntityKey, TipoDeAlimentosEntityInfo EntityInfo)
 {
     try
     {
         TipoDeAlimentosEntityUpdate EntityUpdate = new TipoDeAlimentosEntityUpdate();
         EntityUpdate.LoadFromInfo(EntityInfo);
         return(this.Update(EntityKey, EntityUpdate));
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
Exemplo n.º 2
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;
     }
 }
Exemplo n.º 3
0
 public TipoDeAlimentosEntityInfo.TipoDeAlimentosEntityInfoList DataTableToListOfEntityInfo(DataTable dt)
 {
     TipoDeAlimentosEntityInfo[] pArray = new TipoDeAlimentosEntityInfo[dt.Rows.Count];
     try
     {
         for (int index = 0; index < dt.Rows.Count; ++index)
         {
             pArray[index] = this.DataRowToEntityInfo(dt.Rows[index]);
         }
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
     return(new TipoDeAlimentosEntityInfo.TipoDeAlimentosEntityInfoList(pArray));
 }
Exemplo n.º 4
0
        public TipoDeAlimentosEntityInfo DataRowToEntityInfo(DataRow dr)
        {
            TipoDeAlimentosEntityInfo alimentosEntityInfo = new TipoDeAlimentosEntityInfo();

            try
            {
                alimentosEntityInfo.TipoDeAlimentoId     = (int)dr["TipoDeAlimentoId"];
                alimentosEntityInfo.TipoDeAlimento       = (string)dr["TipoDeAlimento"];
                alimentosEntityInfo.OrdenDeVisualizacion = (int)dr["OrdenDeVisualizacion"];
                alimentosEntityInfo.Estado = Convert.IsDBNull(dr["Estado"]) ? (string)null : (string)dr["Estado"];
            }
            catch (Exception ex)
            {
                Helpers.Logger.Logger.LogExceptionStatic(ex);
                throw ex;
            }
            return(alimentosEntityInfo);
        }