public bool UpdateFromInfo(NutrienteEntityKey EntityKey, NutrienteEntityInfo EntityInfo) { try { NutrienteEntityUpdate EntityUpdate = new NutrienteEntityUpdate(); EntityUpdate.LoadFromInfo(EntityInfo); return(this.Update(EntityKey, EntityUpdate)); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public int InsertFromInfo(NutrienteEntityInfo EntityInfo) { try { NutrienteEntityInsert EntityInsert = new NutrienteEntityInsert(); EntityInsert.LoadFromInfo(EntityInfo); return(this.Insert_Return_Scalar(EntityInsert)); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public NutrienteEntityInfo.NutrienteEntityInfoList DataTableToListOfEntityInfo(DataTable dt) { NutrienteEntityInfo[] pArray = new NutrienteEntityInfo[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 NutrienteEntityInfo.NutrienteEntityInfoList(pArray)); }
public NutrienteEntityInfo DataRowToEntityInfo(DataRow dr) { NutrienteEntityInfo nutrienteEntityInfo = new NutrienteEntityInfo(); try { nutrienteEntityInfo.NutrienteId = (int)dr["NutrienteId"]; nutrienteEntityInfo.Nombre = Convert.IsDBNull(dr["Nombre"]) ? (string)null : (string)dr["Nombre"]; nutrienteEntityInfo.UDMId = Convert.IsDBNull(dr["UDMId"]) ? (string)null : (string)dr["UDMId"]; nutrienteEntityInfo.PerteneceA = Convert.IsDBNull(dr["PerteneceA"]) ? new int?() : (int?)dr["PerteneceA"]; nutrienteEntityInfo.Estado = Convert.IsDBNull(dr["Estado"]) ? (string)null : (string)dr["Estado"]; } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } return(nutrienteEntityInfo); }