Exemple #1
0
        public IActionResult UpdateClubStatus([FromBody] ClubStatusQO newClubStatus)
        {
            var exist = _adminService.UpdateClubStatus(newClubStatus);

            if (exist)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #2
0
        public bool UpdateClubStatus(ClubStatusQO newClubStatus)
        {
            var Club = _context.Clubs.Find(newClubStatus.ClubId);

            if (Club == null)
            {
                return(false);
            }
            if (Club.Status != 2)
            {
                return(false);
            }
            _context.Clubs.Attach(Club);
            Club.Status = newClubStatus.Status;
            _context.SaveChanges();
            return(true);
        }