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")); } }
public ActionResult CreateEvent(Sport_Event sportEventDetails) { if (ModelState.IsValid) { using (var context = new StripeEntities()) { int id = Convert.ToInt32(Session["loginid"]); SchoolClass schoolRecord = new SchoolClass(context); sportEventDetails.School_Home_sch_ID = schoolRecord.getSchoolDetailsFromDirector(id).sch_ID; if (sportEventDetails.School_Away_sch_ID == sportEventDetails.School_Home_sch_ID) { ModelState.AddModelError("", "Cannot select same away and home team"); return(View()); } else { sportEventDetails.event_Completion = "N"; context.Sport_Event.Add(sportEventDetails); context.SaveChanges(); return(RedirectToAction("Home")); } } } else { return(View("Error")); } }
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")); } } }
public ActionResult List() { using (var context = new StripeEntities()) { var eventList = context.Sport_Event.ToList(); return(View(eventList)); } }
public ActionResult ViewApplications(int eventId) { using (var context = new StripeEntities()) { var eventDetails = context.SP_GET_APPLICATION_STATUS_BY_EVENTID(eventId).ToList(); return(View(eventDetails)); } }
public PartialViewResult GetRefList(int GameCode) { using (var context = new StripeEntities()) { GetGameList getRefList = new GetGameList(context); ViewBag.RefList = getRefList.getRefTypeList(GameCode); return(PartialView("_RefList")); } }
public ActionResult Index() { using (var context = new StripeEntities()) { Session["loginid"] = null; ViewBag.UserTypeList = getUserTypeList(context); } return(View()); }
public ActionResult UpdateStatus(int refereeId, int eventId, string status) { using (var context = new StripeEntities()) { context.SP_UPDATE_REFEREE_STATUS_BY_EVENTID(eventId, refereeId, status); context.SaveChanges(); return(RedirectToAction("ViewApplications", "Director", new { eventid = eventId })); } }
public ActionResult CreateEvent() { using (var context = new StripeEntities()) { ViewBag.SchoolList = SchoolClass.getSchoolList(context); GetGameList getGameList = new GetGameList(context); ViewBag.GameList = getGameList.getGameTypeList(); } return(View()); }
public ActionResult RequestStatus() { using (var context = new StripeEntities()) { int refereeId = Convert.ToInt32(Session["loginid"]); var requestStatus = context.SP_GET_APPLICATION_STATUS_BY_REFEREEID(refereeId).ToList(); return(View(requestStatus)); } }
public ActionResult UpdateScores(int eventId) { using (var context = new StripeEntities()) { Event getEventDetails = new Event(context); var eventDetails = getEventDetails.GetEventByEventId(eventId) .SingleOrDefault(); return(View(eventDetails)); } }
public ActionResult SchoolDetails() { using (var context = new StripeEntities()) { int id = Convert.ToInt32(Session["loginid"]); SchoolClass schoolClass = new SchoolClass(context); var schoolDetails = schoolClass.getSchoolDetailsFromDirector(id); return(View("SchoolDetails", schoolDetails)); } }
public ActionResult SignUp(Login login) { using (var context = new StripeEntities()) { EncryptDecrypt encrypt = new EncryptDecrypt(); login.login_random_string = encrypt.Encrypt(login.login_username, "r0b1nr0y"); context.Logins.Add(login); context.SaveChanges(); return(View("SignUpConfirmation")); } }
public ActionResult ViewEvents() { using (var context = new StripeEntities()) { int id = Convert.ToInt32(Session["loginid"]); SchoolClass schoolRecord = new SchoolClass(context); var schoolDetails = schoolRecord.getSchoolDetailsFromDirector(id); var eventList = context.SP_GET_EVENT_BY_SCHOOLID(schoolDetails.sch_ID).ToList(); return(View(eventList)); } }
public ActionResult EditEvent(Sport_Event sportDetails) { using (var context = new StripeEntities()) { context.SP_EVENT_DETAILS_UPDATE(sportDetails.event_Date, sportDetails.event_Time, sportDetails.event_School_Field_Name, sportDetails.Sport_Name_spt_Sport_Name_ID, sportDetails.event_ID); context.SaveChanges(); return(RedirectToAction("ViewEvents", "Director")); } }
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)); } }
public ActionResult UpdateScores(SP_GET_EVENT_BY_EVENTID_Result eventScores) { using (var context = new StripeEntities()) { Event updateEventScores = new Event(context); if (updateEventScores.UpdateEventScores(eventScores)) { return(RedirectToAction("ViewEvents", "Director")); } else { return(View("Error")); } } }
public ActionResult EditEvent(int eventId) { using (var context = new StripeEntities()) { Event getEventDetails = new Event(context); var eventDetails = getEventDetails.GetEventByEventId(eventId) .SingleOrDefault(); ViewBag.SchoolList = SchoolClass.getSchoolList(context); GetGameList getGameList = new GetGameList(context); ViewBag.GameList = getGameList.getGameTypeList(); return(View(eventDetails)); } }
public ActionResult Apply(FormCollection formCollection) { using (var context = new StripeEntities()) { int eventId = Convert.ToInt32(formCollection["event_ID"]); int refereeType = Convert.ToInt32(formCollection["ref_Game_Specialization_Type"]); int homeSchoolId = Convert.ToInt32(formCollection["School_Home_sch_ID"]); int refereeId = Convert.ToInt32(Session["loginid"]); SchoolClass schoolRecord = new SchoolClass(context); var schoolDetails = schoolRecord.GetDirectorIdFromSchoolId(homeSchoolId); context.SP_EVENT_REFEREE_APPLY(eventId, refereeId, schoolDetails.User_Profile_Director_Profile_ID, "P", refereeType); context.SaveChanges(); return(RedirectToAction("AllEvents")); } }
public ActionResult Profile() { using (var context = new StripeEntities()) { try { int id = Convert.ToInt32(Session["loginid"]); var refereeProfile = context.User_Profile.Where(userid => userid.userProfile_ID == id).SingleOrDefault(); 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")); } } }
public ActionResult SchoolDetails(SP_SCHOOL_DETAILS_FROM_DIRECTOR_Result schoolDetails) { using (var context = new StripeEntities()) { SchoolClass schoolClass = new SchoolClass(context); var schoolRecord = schoolClass.getSchoolDetailsFromDirector(schoolDetails.User_Profile_Director_Profile_ID); if (schoolRecord == null) { schoolClass.InsertUpdateSchoolRecords(true, context, schoolDetails); } else { schoolClass.InsertUpdateSchoolRecords(false, context, schoolDetails); } return(RedirectToAction("SchoolDetails")); } }
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")); } }
public List <SelectListItem> getUserTypeList(StripeEntities context) { List <SelectListItem> userTypeList = new List <SelectListItem>(); userTypeList.Add(new SelectListItem() { Text = "Please select User Type", Value = "default" }); var result = context.User_Type.ToList(); foreach (var item in result) { userTypeList.Add(new SelectListItem() { Text = item.userType_Name, Value = item.userType_ID }); } return(userTypeList); }
public ActionResult Apply(int eventId) { using (var context = new StripeEntities()) { int refereeId = Convert.ToInt32(Session["loginid"]); EventReferee eventReferee = new EventReferee(context); if (eventReferee.CheckRefereeEligibilityForApplication(eventId, refereeId)) { Event allEvents = new Event(context); var eventDetails = allEvents.GetEventByEventId(eventId).SingleOrDefault(); GetGameList getRefList = new GetGameList(context); ViewBag.RefereeList = getRefList.getRefTypeList(eventDetails.Sport_Name_spt_Sport_Name_ID); return(View(eventDetails)); } else { ViewBag.ErrorMessage = "You've already applied for this event. Please wait for any further notification."; return(View("Error")); } } }
public ActionResult Login(Login login) { using (var context = new StripeEntities()) { var loginCheck = context.SP_LOGIN(login.login_username, login.login_password).SingleOrDefault(); if (loginCheck == null) { ModelState.AddModelError("", "Log in credentials invalid"); return(View(login)); } else { FormsAuthentication.SetAuthCookie(loginCheck.login_username, false); Session["loginid"] = loginCheck.login_ID; switch (loginCheck.User_Type_userType_ID) { case "R": return(RedirectToAction("Home", "Referee")); break; case "S": return(RedirectToAction("Home", "Director")); break; case "A": return(RedirectToAction("Home", "Admin", new { id = loginCheck.login_ID })); break; default: return(RedirectToAction("Index", "Home")); break; } } } }