public bool UpdateFromInfo(AlimentoNutrienteEntityKey EntityKey, AlimentoNutrienteEntityInfo EntityInfo) { try { AlimentoNutrienteEntityUpdate EntityUpdate = new AlimentoNutrienteEntityUpdate(); EntityUpdate.LoadFromInfo(EntityInfo); return(this.Update(EntityKey, EntityUpdate)); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
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; } }
public AlimentoNutrienteEntityInfo DataRowToEntityInfo(DataRow dr) { AlimentoNutrienteEntityInfo nutrienteEntityInfo = new AlimentoNutrienteEntityInfo(); try { nutrienteEntityInfo.AlimentoId = (int)dr["AlimentoId"]; nutrienteEntityInfo.NutrienteId = (int)dr["NutrienteId"]; nutrienteEntityInfo.Cantidad = Convert.IsDBNull(dr["Cantidad"]) ? new Decimal?() : (Decimal?)dr["Cantidad"]; } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } return(nutrienteEntityInfo); }
public AlimentoNutrienteEntityInfo.AlimentoNutrienteEntityInfoList DataTableToListOfEntityInfo(DataTable dt) { AlimentoNutrienteEntityInfo[] pArray = new AlimentoNutrienteEntityInfo[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 AlimentoNutrienteEntityInfo.AlimentoNutrienteEntityInfoList(pArray)); }