Beispiel #1
0
 public vAlimentoNutrienteParaAgregarEntityInfo.vAlimentoNutrienteParaAgregarEntityInfoList DataTableToListOfEntityInfo(DataTable dt)
 {
     vAlimentoNutrienteParaAgregarEntityInfo[] pArray = new vAlimentoNutrienteParaAgregarEntityInfo[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 vAlimentoNutrienteParaAgregarEntityInfo.vAlimentoNutrienteParaAgregarEntityInfoList(pArray));
 }
Beispiel #2
0
        public vAlimentoNutrienteParaAgregarEntityInfo DataRowToEntityInfo(DataRow dr)
        {
            vAlimentoNutrienteParaAgregarEntityInfo agregarEntityInfo = new vAlimentoNutrienteParaAgregarEntityInfo();

            try
            {
                agregarEntityInfo.AlimentoId                = (int)dr["AlimentoId"];
                agregarEntityInfo.NutrienteId               = (int)dr["NutrienteId"];
                agregarEntityInfo.NutrienteNombre           = Convert.IsDBNull(dr["NutrienteNombre"]) ? (string)null : (string)dr["NutrienteNombre"];
                agregarEntityInfo.AlimentoNutrienteCantidad = (int)dr["AlimentoNutrienteCantidad"];
                agregarEntityInfo.NutrienteUDMId            = Convert.IsDBNull(dr["NutrienteUDMId"]) ? (string)null : (string)dr["NutrienteUDMId"];
            }
            catch (Exception ex)
            {
                Helpers.Logger.Logger.LogExceptionStatic(ex);
                throw ex;
            }
            return(agregarEntityInfo);
        }