Exemplo n.º 1
0
 public ActionResult AllEvents()
 {
     using (var context = new StripeEntities())
     {
         UserProfile userProfile = new UserProfile();
         int id = Convert.ToInt32(Session["loginid"]);
         var refereeProfile = userProfile.getUserProfile(id, context);
         Event allEvents = new Event(context);
         var allEventsList = allEvents.GetAllEvents("N")
             .Where(sptId => sptId.Sport_Name_spt_Sport_Name_ID == refereeProfile.Sport_Name_spt_Sport_Name_ID)
             .ToList();
         return View(allEventsList);
     }
 }
Exemplo n.º 2
0
        public ActionResult Profile(User_Profile refProfile)
        {
            using (var context = new StripeEntities())
            {
                UserProfileExistCheck profileCheck = new UserProfileExistCheck();
                UserProfile userProfile = new UserProfile();
                if (profileCheck.UserProfileExistence(refProfile.userProfile_ID, context))
                {
                    userProfile.UserProfileUpdate(context, refProfile);
                }
                else
                {
                    //Inserting Profile
                    userProfile.UserProfileInsert(context, refProfile);
                }

                return RedirectToAction("Profile");
            }
        }
Exemplo n.º 3
0
 public ActionResult Profile()
 {
     using (var context = new StripeEntities())
     {
         try
         {
             UserProfile userProfile = new UserProfile();
             int id = Convert.ToInt32(Session["loginid"]);
             var refereeProfile = userProfile.getUserProfile(id, context);
             GetGameList getGameList = new GetGameList(context);
             ViewBag.GameList = getGameList.getGameTypeList();
             if (refereeProfile != null)
                 ViewBag.RefList = getGameList.getRefTypeList(refereeProfile.Sport_Name_spt_Sport_Name_ID);
             return View(refereeProfile);
         }
         catch (Exception exception)
         {
             Console.Write(exception.Message);
             ViewBag.ErrorMessage = "There is something wrong with the account. Please contact admin";
             return View("Error");
         }
     }
 }
Exemplo n.º 4
0
        public ActionResult Profile(User_Profile refProfile)
        {
            using (var context = new StripeEntities())
            {
                UserProfileExistCheck profileCheck = new UserProfileExistCheck();
                UserProfile userProfile = new UserProfile();
                if (profileCheck.UserProfileExistence(refProfile.userProfile_ID, context))
                {

                    userProfile.UserProfileUpdate(context, refProfile);

                    context.SP_USER_PROFILE_REFEREE_UPDATE(refProfile.ref_Game_Specialization_Type,
                        refProfile.userProfile_ID,
                        refProfile.Sport_Name_spt_Sport_Name_ID);
                    context.SaveChanges();

                }
                else
                {
                    //Inserting Profile
                    userProfile.UserProfileInsert(context, refProfile);

                    context.SP_USER_PROFILE_REFEREE_INSERT(refProfile.ref_Game_Specialization_Type,
                        refProfile.userProfile_ID,
                        refProfile.Sport_Name_spt_Sport_Name_ID);
                    context.SaveChanges();
                }

                return RedirectToAction("Profile");
            }
        }