Ejemplo n.º 1
0
        /// <summary>
        /// Created a Partial View to trigger the data from the drop down
        /// </summary>
        /// <param name="monthYear"></param>
        /// <returns></returns>
        public PartialViewResult GetSession(string monthYear)
        {
            string month = "";
            int    year  = DateTime.Now.Year;

            string[] MonYr = monthYear.Split(',');
            month = MonYr[0];
            year  = Convert.ToInt32(MonYr[1]);
            EventBL    _evBl   = new EventBL();
            EventModel evModel = new EventModel();

            List <decimal> eventIds = new List <decimal>();

            eventIds = _evBl.GetEventModelByMonYear(month, Convert.ToDecimal(year));
            var wslxId = Session["w_user"].ToString();


            GuestSessionLookupModel guest = new GuestSessionLookupModel();
            GuestBL bl = new GuestBL();

            List <GuestSessionLookupModel> lstSession = new List <GuestSessionLookupModel>();

            evModel.SessionLookupList       = bl.GetAll(eventIds);
            evModel.SessionLookupListByUser = bl.GetAllby(eventIds, wslxId);
            foreach (GuestSessionLookupModel item in evModel.SessionLookupList)
            {
                foreach (GuestSessionLookupModel itemUser in evModel.SessionLookupListByUser)
                {
                    if (itemUser.SESSION_ID == item.SESSION_ID)
                    {
                        item.REGISTERED_SESSION = itemUser.SESSION_ID;
                        break;
                    }
                    else
                    {
                        item.REGISTERED_SESSION = 0;
                    }
                }
            }


            Session["Lookuplist"] = evModel.SessionLookupList;
            //ViewBag.SessionList = bl.GetSessionByWSLX(Session["w_user"].ToString());



            return(PartialView("_Sessions", evModel));
        }