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 AlimentoNutrienteEntityInfo SearchOne(AlimentoNutrienteEntityKey EntityKey, bool NoUtilizar) { try { if (!EntityKey.Validate()) { throw new Exception(EntityKey.ErroresQueInvalidanLaEntidad); } return(this.DataRowToEntityInfo(this.CreateDataAccess().SearchOne(EntityKey).Rows[0])); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public DataTable SearchOne(AlimentoNutrienteEntityKey EntityKey) { try { if (!EntityKey.Validate()) { throw new Exception(EntityKey.ErroresQueInvalidanLaEntidad); } return(this.CreateDataAccess().SearchOne(EntityKey)); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public bool UpdateNull(AlimentoNutrienteEntityKey EntityKey, AlimentoNutrienteEntityUpdateNullFields EntityUpdateNullFields) { try { if (!EntityKey.Validate()) { return(false); } return(this.CreateDataAccess().UpdateNull(EntityKey, EntityUpdateNullFields)); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public bool Delete(AlimentoNutrienteEntityKey EntityKey) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("AlimentoNutriente_Delete"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "AlimentoId", DbType.Int32, (object)EntityKey.AlimentoId); this.DataBase.AddInParameter(storedProcCommand, "NutrienteId", DbType.Int32, (object)EntityKey.NutrienteId); return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand))); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public DataTable SearchOne(AlimentoNutrienteEntityKey EntityKey) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("AlimentoNutriente_Search"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "OpeAlimentoId", DbType.String, (object)"="); this.DataBase.AddInParameter(storedProcCommand, "AlimentoId", DbType.Int32, (object)EntityKey.AlimentoId); this.DataBase.AddInParameter(storedProcCommand, "OpeNutrienteId", DbType.String, (object)"="); this.DataBase.AddInParameter(storedProcCommand, "NutrienteId", DbType.Int32, (object)EntityKey.NutrienteId); return(this.DataBase.ExecuteDataSet(storedProcCommand).Tables[0]); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public bool UpdateNull(AlimentoNutrienteEntityKey EntityKey, AlimentoNutrienteEntityUpdateNullFields EntityUpdateNullFields) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("AlimentoNutriente_UpdateNulls"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "AlimentoId", DbType.Int32, (object)EntityKey.AlimentoId); this.DataBase.AddInParameter(storedProcCommand, "NutrienteId", DbType.Int32, (object)EntityKey.NutrienteId); this.DataBase.AddInParameter(storedProcCommand, "FieldList", DbType.String, (object)EntityUpdateNullFields.FieldList); this.DataBase.AddInParameter(storedProcCommand, "WhereExtendido", DbType.String, (object)EntityUpdateNullFields.WhereExtendido); return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand))); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public bool Update(AlimentoNutrienteEntityKey EntityKey, AlimentoNutrienteEntityUpdate EntityUpdate) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("AlimentoNutriente_UpdateOptionalFields"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "AlimentoId", DbType.Int32, (object)EntityKey.AlimentoId); this.DataBase.AddInParameter(storedProcCommand, "NutrienteId", DbType.Int32, (object)EntityKey.NutrienteId); this.DataBase.AddInParameter(storedProcCommand, "Cantidad", DbType.Decimal, (object)EntityUpdate.Cantidad); this.DataBase.AddInParameter(storedProcCommand, "FntID", DbType.AnsiString, (object)EntityUpdate.FntID); return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand))); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }