示例#1
0
 public IActionResult Create([Bind("ClubName, ResponsibleName, ResponsibleCellullar, ResponsibleEmail, ClubNumber")] Club club)
 {
     if (ModelState.IsValid)
     {
         ClubServices services = new ClubServices(_context);
         services.SaveClub(club);
         return(RedirectToAction("WhatToDoNow", "Verify", new { clubID = club.ClubID }));
     }
     return(View(club));
 }
示例#2
0
        public IActionResult CheckRegistration()
        {
            ClubServices service = new ClubServices(_context);
            Club         club    = service.CheckRegistration(User.Identity.Name);

            //Console.WriteLine(User.Identity.Name);

            if (club == null)
            {
                return(RedirectToAction("Create", "Club"));
            }
            else
            {
                return(RedirectToAction("WhatToDoNow", new { clubID = club.ClubID }));
            }
        }
示例#3
0
        public IActionResult Edit([Bind("ClubID, ClubName, ResponsibleName, ResponsibleCellullar, ResponsibleEmail, ClubNumber")] Club club)
        {
            if (ModelState.IsValid)
            {
                SecurityServices services = new SecurityServices(_context);
                bool             isValid  = services.IsClubIDValidToClubNumber(club.ClubID, User.Identity.Name);

                if (isValid == true)
                {
                    ClubServices clubServices = new ClubServices(_context);
                    clubServices.UpdateClub(club);
                    return(RedirectToAction("WhatToDoNow", "Verify", new { clubID = club.ClubID }));
                }
                else
                {
                    return(RedirectToAction("YouCanOnlyLookUpYourOwnData", "Verify"));
                }
            }
            return(View(club));
        }
示例#4
0
        // GET: Club/Edit/5
        public IActionResult Edit(int clubID)
        {
            SecurityServices services = new SecurityServices(_context);
            bool             isValid  = services.IsClubIDValidToClubNumber(clubID, User.Identity.Name);

            if (isValid == true)
            {
                ClubServices clubServices = new ClubServices(_context);
                Club         club         = clubServices.GetClub(clubID);
                if (club == null)
                {
                    return(NotFound());
                }
                return(View(club));
            }
            else
            {
                return(RedirectToAction("YouCanOnlyLookUpYourOwnData", "Verify"));
            }
        }