Пример #1
0
        public IActionResult ChangeService(int eventServiceId, ServiceType eventType, DateTime eventDate)
        {
            var eventService    = eventServiceService.GetById(eventServiceId);
            var serviceWrappers = GetServiceWrapperViewModels(eventDate, eventType.ToString(), 0, eventService.ServicePackageId);

            TempData.Put("ServiceWrappers", serviceWrappers);

            var viewModel = new ChangeServiceViewModel()
            {
                ServiceType     = eventType,
                ServiceWrappers = serviceWrappers
            };

            return(View(viewModel));
        }
Пример #2
0
        public void AcceptAndUpdateEventService(int id)
        {
            var eventServiceItem = eventServiceService.GetById(id);

            eventServiceItem.Status = DataLayer.Enumerations.RequestStatus.Accepted;
            eventServiceService.Update(eventServiceItem);

            var allServices         = eventServiceService.GetByEventId(eventServiceItem.EventId);
            var allServicesAccepted = true;

            foreach (var service in allServices)
            {
                if (eventServiceItem.Status != DataLayer.Enumerations.RequestStatus.Accepted)
                {
                    allServicesAccepted = false;
                }
            }
            if (allServicesAccepted)
            {
                UpdateToBeDoneStatusById(eventServiceItem.EventId);
            }
        }