Exemplo n.º 1
0
        public bool DeleteUserTeamPick(int userTeamid, SqlConnection db)
        {
            try
            {
                bool rowsDeleted  = false;
                var  userTeamPick = new UserTeamPick();

                userTeamPick = db.Get <UserTeamPick>(userTeamid);
                rowsDeleted  = db.Delete(new UserTeamPick()
                {
                    userteamid = userTeamid
                });

                if (rowsDeleted == true)
                {
                    Logger.Out("UserTeamPick: Position:" + Convert.ToString(userTeamPick.position) + " PlayerId: " + Convert.ToString(userTeamPick.element) + " - deleted");
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("UserTeamPick Repository (DeleteUserTeamPick) error: " + ex.Message);
                throw ex;
            }
        }
Exemplo n.º 2
0
        public bool UpdateUserTeamPick(UserTeamPick userTeamPick, SqlConnection db)
        {
            try
            {
                bool rowsUpdated = false;

                rowsUpdated = db.Update(userTeamPick, commandTimeout: 0);

                if (rowsUpdated == true)
                {
                    Logger.Out("UserTeamPick: Position:" + Convert.ToString(userTeamPick.position) + " PlayerId: " + Convert.ToString(userTeamPick.element) + " - updated");
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("UserTeamPick Repository (update) error: " + ex.Message);
                throw ex;
            }
        }