public bool DeleteUserTeamPickAutomaticSub(int userTeamPickAutomaticSubid, SqlConnection db) { try { bool rowsDeleted = false; var userTeamPickAutomaticSub = new UserTeamPickAutomaticSub(); userTeamPickAutomaticSub = db.Get <UserTeamPickAutomaticSub>(userTeamPickAutomaticSubid); rowsDeleted = db.Delete(new UserTeamPickAutomaticSub() { id = userTeamPickAutomaticSubid }); if (rowsDeleted == true) { Logger.Out("UserTeamPickAutomaticSub: " + Convert.ToString(userTeamPickAutomaticSubid) + " - deleted"); return(true); } return(false); } catch (Exception ex) { Logger.Error("UserTeamPickAutomaticSub Repository (DeleteUserTeamPickAutomaticSub) error: " + ex.Message); throw ex; } }
public bool UpdateUserTeamPickAutomaticSub(UserTeamPickAutomaticSub userTeamPickAutomaticSub, SqlConnection db) { try { bool rowsUpdated = false; rowsUpdated = db.Update(userTeamPickAutomaticSub, commandTimeout: 0); if (rowsUpdated == true) { Logger.Out("UserTeamPickAutomaticSubId: " + Convert.ToString(userTeamPickAutomaticSub.id) + " - updated"); return(true); } return(false); } catch (Exception ex) { Logger.Error("UserTeamPickAutomaticSub Repository (update) error: " + ex.Message); throw ex; } }