Beispiel #1
0
        public ActionResult ViewEvent(int eventId)
        {
            EventBL    evt        = new EventBL();
            EventModel eventModel = new EventToEventModelHelper().EventToEventModelMapping(evt.GetEvent(eventId));

            if (eventModel.InviteByEmail != null)
            {
                eventModel.Count = eventModel.InviteByEmail.Split(',').Length;
            }
            else
            {
                eventModel.Count = 0;
            }
            ViewBag.DisplayDescription  = (eventModel.Description != null) ? true : false;
            ViewBag.DisplayOtherDetails = (eventModel.OtherDetails != null) ? true : false;
            ViewBag.DisplayDuration     = (eventModel.Duration != null) ? true : false;
            ViewBag.DisplayCount        = (eventModel.Count != 0) ? true : false;
            ViewBag.DisplayEditLink     = ((eventModel.Date.Date > DateTime.Now.Date.Date) ||
                                           ((eventModel.Date.Date == DateTime.Now.Date.Date) && (eventModel.StartTime.Date.TimeOfDay > DateTime.Now.Date.TimeOfDay))) &&
                                          (eventModel.UserId.Equals(User.Identity.Name, StringComparison.OrdinalIgnoreCase) || User.IsInRole("Admin"))
                ? true : false;

            return(View(eventModel));
        }
Beispiel #2
0
        public ActionResult EditEvent(int eventId)
        {
            EventBL    eventBL = new EventBL();
            EventModel model   = new EventToEventModelHelper().EventToEventModelMapping(eventBL.GetEvent(eventId));

            return(View(model));
        }