public ActionResult Rate(int eventid, FormCollection frm)
        {
            var rating = new Services.Rate();

            rating.UserID         = CurrentUser.ID;
            rating.EventID        = eventid;
            rating.RateSignin     = int.Parse(frm["RateSignin"]);
            rating.RateSwag       = int.Parse(frm["RateSwag"]);
            rating.RateFood       = int.Parse(frm["RateFood"]);
            rating.ReferralSource = int.Parse(frm["RefSource"]);
            rating.Comments       = frm["Comments"];

            var rateSessions = new List <Services.RateSession>();

            for (int i = 0; i < 7; i++)
            {
                if (frm[string.Format("SessionID_{0}", i)] == null)
                {
                    continue;
                }

                int sessionID = int.Parse(frm[string.Format("SessionID_{0}", i)]);

                int    timeslotID  = int.Parse(frm[string.Format("Timeslot_{0}", i)]);
                int    rankSession = int.Parse(frm[string.Format("RateSession_{0}", i)]);
                string comments    = frm[string.Format("Comments_{0}", i)];
                if (rankSession > 0)
                {
                    var rateSession = new Services.RateSession();
                    rateSession.Rating     = rankSession;
                    rateSession.SessionID  = sessionID;
                    rateSession.TimeSlotID = timeslotID;
                    rateSession.Comments   = comments;
                    rateSessions.Add(rateSession);
                }
            }
            rating.RatedSessions = rateSessions.ToList();
            service.CreateRateSession(rating);
            return(RedirectToAction("Index"));
        }
        public ActionResult Rate(int eventid, FormCollection frm)
        {
            var rating = new Services.Rate();
            rating.UserID = CurrentUser.ID;
            rating.EventID = eventid;
            rating.RateSignin = int.Parse(frm["RateSignin"]);
            rating.RateSwag = int.Parse(frm["RateSwag"]);
            rating.RateFood = int.Parse(frm["RateFood"]);
            rating.ReferralSource = int.Parse(frm["RefSource"]);
            rating.Comments = frm["Comments"];

            var rateSessions = new List<Services.RateSession>();
            for (int i = 0; i < 7; i++)
            {
                if (frm[string.Format("SessionID_{0}", i)] == null)
                    continue;

                int sessionID = int.Parse(frm[string.Format("SessionID_{0}", i)]);

                int timeslotID = int.Parse(frm[string.Format("Timeslot_{0}", i)]);
                int rankSession = int.Parse(frm[string.Format("RateSession_{0}", i)]);
                string comments = frm[string.Format("Comments_{0}", i)];
                if (rankSession > 0)
                {
                    var rateSession = new Services.RateSession();
                    rateSession.Rating = rankSession;
                    rateSession.SessionID = sessionID;
                    rateSession.TimeSlotID = timeslotID;
                    rateSession.Comments = comments;
                    rateSessions.Add(rateSession);
                }
            }
            rating.RatedSessions = rateSessions.ToList();
            service.CreateRateSession(rating);
            return RedirectToAction("Index");
        }