Esempio n. 1
0
 public static TournamentAssignment GetTournamentAssignmentFromSession()
 {
     TournamentAssignment result = null;
     if (HttpContext.Current.Session["tournamentAssignmentId"] != null)
     {
         result = new TournamentAssignment
         {
             Id = (int)HttpContext.Current.Session["tournamentAssignmentId"]
         };
     }
     return result;
 }
Esempio n. 2
0
        public static void SetSession(Tournament t, TournamentAssignment ta, Assignment a, AssignmentEnrollment ae)
        {
            if (t != null)
            {
                HttpContext.Current.Session["tournamentId"] = t.Id;
                HttpContext.Current.Session["tournamentName"] = t.Name;

            }
            else
            {
                HttpContext.Current.Session.Remove("tournamentId");
                HttpContext.Current.Session.Remove("tournamentName");
            }
            if (ta != null)
            {
                HttpContext.Current.Session["tournamentAssignmentId"] = ta.Id;
            }
            else
            {
                HttpContext.Current.Session.Remove("tournamentAssignmentId");
            }

            if (a != null)
            {
                HttpContext.Current.Session["assignmentId"] = a.Id;
                HttpContext.Current.Session["assignmentName"] = a.Name;
            }
            else
            {
                HttpContext.Current.Session.Remove("assignmentId");
                HttpContext.Current.Session.Remove("assignmentName");
            }

            if (ae != null)
            {
                HttpContext.Current.Session["assignmentEnrollmentId"] = ae.Id;
                HttpContext.Current.Session["assignmentEnrollmentStartDate"] = ae.StartDate;
            }
            else
            {
                HttpContext.Current.Session.Remove("assignmentEnrollmentId");
                HttpContext.Current.Session.Remove("assignmentEnrollmentStartDate");

            }
        }
Esempio n. 3
0
 private TournamentAssignment CreateIdTournamentAssignment(TournamentAssignment ta)
 {
     TournamentAssignment result = new TournamentAssignment
     {
         Id = ta.Id,
         AssignmentOrder = 0,
         CreateDate = DateTime.Now,
         IsActive = true,
         Tournament = CreateIdTournament(ta.Tournament),
         Assignment = CreateIdAssignment(ta.Assignment),
         Points1 = 0,
         Points2 = 0,
         Points3 = 0
     };
     return result;
 }