public ActionResult CustomerEventList(int eventId, string groupName) { //Get all customer events for this group and event CameleoCustomerEventListViewModel customerEventListViewModel = _customerEventService.GetCustomerEventListViewModel(eventId, groupName); CameleoEventViewModel eventViewModel = _eventService.GetEventViewModel(eventId); //Get remaining event users that did not answer var noAnswerEventUsers = _eventUserService.GetNoAnswerEventUsers(eventId, groupName); foreach (var tmpEventUser in noAnswerEventUsers.Reverse()) { CameleoCustomerEventViewModel tmpCustomerEvent = new CameleoCustomerEventViewModel(); tmpCustomerEvent.Id = -1; tmpCustomerEvent.EventUserId = tmpEventUser.Id; tmpCustomerEvent.CustomerId = -1; tmpCustomerEvent.CustomerUserName = ""; tmpCustomerEvent.Paid = false; tmpCustomerEvent.Accepted = false; tmpCustomerEvent.AcceptedStatus = (int)AcceptedStatus.ToBeCompleted; tmpCustomerEvent.AcceptedStatusString = _localizationService.GetResource(AcceptedStatusStrings.LocalizedStringValues[tmpCustomerEvent.AcceptedStatus]); tmpCustomerEvent.AcceptedImageUse = false; tmpCustomerEvent.CameleoEvent = eventViewModel; tmpCustomerEvent.CameleoEventUser = new CameleoEventUserViewModel(tmpEventUser, 0, 0); customerEventListViewModel.CameleoCustomerEventList.Insert(0, tmpCustomerEvent); } //Return view return(PartialView("~/Plugins/Cameleo.CameleoEvents/Views/CameleoEvents/GroupDetails/CustomerEventList.cshtml", customerEventListViewModel)); }
public ActionResult GroupDetails(int customerEventId) { //Get details for this event var tmpCustomerEvent = _customerEventService.GetCustomerEventById(customerEventId); var tmpEvent = _eventService.GetEventByEventUserId(tmpCustomerEvent.EventUserId); var tmpEventUser = _eventUserService.GetEventUserById(tmpCustomerEvent.EventUserId); CameleoEventViewModel eventViewModel = new CameleoEventViewModel(tmpEvent, _eventService.GetAllGroupsForEvent(tmpEvent.Id), _localizationService.GetResource(CameleoEventStatusStrings.LocalizedStringValues[tmpEvent.Status])); //Find group to show details foreach (var tmpGroup in eventViewModel.Groups) { if (tmpGroup.Text == tmpEventUser.Group) { eventViewModel.GroupDetails = tmpGroup; } } eventViewModel.DetailedGroupName = tmpEventUser.Group; eventViewModel.ShowGroupDetails = true; eventViewModel.CustomerEventId = customerEventId; ViewBag.CustomerEventId = customerEventId; ViewBag.CustomerId = tmpCustomerEvent.CustomerId; return(View("~/Plugins/Cameleo.CameleoEvents/Views/CameleoEvents/GroupDetails/GroupDetails.cshtml", eventViewModel)); }
public ActionResult EventUserList(int eventId) { //Event model CameleoEventViewModel model = _eventService.GetEventViewModel(eventId); //Groups for editor ViewData["groups"] = model.Groups.ToList(); //Return view return(View("~/Plugins/Cameleo.CameleoEvents/Views/Admin/EventUser/EventUserList.cshtml", model)); }
/// <summary> /// Get EventViewModel from a CameleoEvent /// </summary> public CameleoEventViewModel GetEventViewModel(int eventId) { var tmpEvent = GetEventById(eventId); if (tmpEvent == null) { return(null); } else { CameleoEventViewModel eventViewModel = new CameleoEventViewModel(tmpEvent, GetAllGroupsForEvent(tmpEvent.Id), _localizationService.GetResource(CameleoEventStatusStrings.LocalizedStringValues[tmpEvent.Status])); //var tmpEventUser = _eventUserService.GetEventUserById(tmpEvent.Id); return(eventViewModel); } }
/// <summary> /// Get EventListViewModel for all events /// </summary> public CameleoEventListViewModel GetEventListViewModel() { var records = GetAllEvents(); var eventsModel = records .Select(x => { var m = new CameleoEventViewModel() { Id = x.Id, EventName = x.EventName, EventCode = x.EventCode, ClientName = x.ClientName, CreatedOnUtc = x.CreatedOnUtc, ShootedOnUtc = x.ShootedOnUtc, AcceptReminderDateUtc = x.AcceptReminderDateUtc, AcceptMinimumPercentage = x.AcceptMinimumPercentage, AcceptReminderDelay = x.AcceptReminderDelay, PayReminderDateUtc = x.PayReminderDateUtc, PayMinimumPercentage = x.PayMinimumPercentage, PayReminderDelay = x.PayReminderDelay, Status = x.Status, StatusString = _localizationService.GetResource(CameleoEventStatusStrings.LocalizedStringValues[x.Status]), ClientLogo = x.ClientLogo, IntroLogo = x.IntroLogo, ParticipationFee = x.ParticipationFee, Groups = GetAllGroupsForEvent(x.Id), }; return(m); }) .ToList(); var model = new CameleoEventListViewModel(); model.CameleoEventList = eventsModel; return(model); }
public ActionResult ImportExcel(CameleoEventViewModel model) { try { var file = Request.Files["importexcelfile"]; if (file != null && file.ContentLength > 0) { //Import ImportEventUsersFromXlsx(file.InputStream, model.Id); } else { ErrorNotification(_localizationService.GetResource("Admin.Common.UploadFile")); return(EventUserList(model.Id)); } SuccessNotification(_localizationService.GetResource("Plugins.Cameleo.CameleoEventUSers.Admin.EventUserImport.Imported")); return(EventUserList(model.Id)); } catch (Exception exc) { ErrorNotification(exc); return(EventUserList(model.Id)); } }