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; } }
public TipoDeAlimentosEntityInfo SearchOne(TipoDeAlimentosEntityKey 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(TipoDeAlimentosEntityKey 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(TipoDeAlimentosEntityKey EntityKey, TipoDeAlimentosEntityUpdateNullFields 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(TipoDeAlimentosEntityKey EntityKey) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeAlimentos_Delete"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "TipoDeAlimentoId", DbType.Int32, (object)EntityKey.TipoDeAlimentoId); return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand))); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public DataTable SearchOne(TipoDeAlimentosEntityKey EntityKey) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeAlimentos_Search"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "OpeTipoDeAlimentoId", DbType.String, (object)"="); this.DataBase.AddInParameter(storedProcCommand, "TipoDeAlimentoId", DbType.Int32, (object)EntityKey.TipoDeAlimentoId); return(this.DataBase.ExecuteDataSet(storedProcCommand).Tables[0]); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public bool UpdateNull(TipoDeAlimentosEntityKey EntityKey, TipoDeAlimentosEntityUpdateNullFields EntityUpdateNullFields) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeAlimentos_UpdateNulls"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "TipoDeAlimentoId", DbType.Int32, (object)EntityKey.TipoDeAlimentoId); 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(TipoDeAlimentosEntityKey EntityKey, TipoDeAlimentosEntityUpdate EntityUpdate) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeAlimentos_UpdateOptionalFields"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "TipoDeAlimentoId", DbType.Int32, (object)EntityKey.TipoDeAlimentoId); this.DataBase.AddInParameter(storedProcCommand, "TipoDeAlimento", DbType.AnsiString, (object)EntityUpdate.TipoDeAlimento); this.DataBase.AddInParameter(storedProcCommand, "OrdenDeVisualizacion", DbType.Int32, (object)EntityUpdate.OrdenDeVisualizacion); this.DataBase.AddInParameter(storedProcCommand, "Estado", DbType.AnsiString, (object)EntityUpdate.Estado); return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand))); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }