示例#1
0
        public ActionResult EventDetails(int id = 0)
        {
            EventDetailsVM vm = new EventDetailsVM();
            Event          ev = repoEvent.GetById((int)id);

            if (ev == null)
            {
                return(HttpNotFound());
            }

            vm.Event = ev;

            // Get Utilisateur.
            var currentUserId = User.Identity.GetUserId();

            vm.Utilisateur = repoUtilisateur.getByUserId(currentUserId);

            return(PartialView(vm));
        }
        public IActionResult Details(int?id)
        {
            TempData["controllerName"] = this.ControllerContext.RouteData.Values["controller"].ToString();

            EventDetailsVM eventDetailsVM = new EventDetailsVM
            {
                WorkShops = _context.WorkShops.Where(ws => ws.IsDeleted == false && ws.EventId == id)
                            .Include(ws => ws.Event).ToList(),
                Events      = _context.Events.Where(e => e.IsDeleted == false && e.Id == id).Include(e => e.WorkShop).ToList(),
                Speakers    = _context.Speakers.Where(s => s.IsDeleted == false).ToList(),
                BlogBanner  = _context.BlogBanners.Where(bb => bb.IsDeleted == false).FirstOrDefault(),
                Categories  = _context.Categories.Where(ctg => ctg.IsDeleted == false).ToList(),
                Tags        = _context.Tags.Where(t => t.IsDeleted == false).ToList(),
                BlogDetails = _context.BlogDetails.Where(bd => bd.IsDeleted == false && bd.LatestFromBlogId == id)
                              .Include(bd => bd.LatestFromBlog).ToList(),
                LatestFromBlogs = _context.LatestFromBlogs.Where(lfb => lfb.IsDeleted == false).ToList()
            };

            return(View(eventDetailsVM));
        }
        // GET: Events/Details/5
        // Loads event details based on event id with full breakdown of event, venue, menu
        // costing and all guests and staff
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var @event = await _context.Events
                         .Where(e => e.IsActive == true)
                         .FirstOrDefaultAsync(m => m.Id == id);

            if (@event == null)
            {
                return(NotFound());
            }
            var eventVM   = new EventVM(@event);
            var bookings  = _context.Guests.Include(g => g.Customer).Where(g => g.EventId == id);
            var customers = await _context.Customers.Where(c => c.Deleted == false).Where(e => bookings.Any(b => b.CustomerId.Equals(e.Id))).OrderBy(c => c.Surname).ToListAsync();

            List <CustomerVM> customersVM = new List <CustomerVM>();

            foreach (Customer c in customers)
            {
                customersVM.Add(new CustomerVM(c));
            }
            var staffing = _context.Staffing.Include(g => g.Staff).Where(g => g.EventId == id);
            var staff    = await _context.Staff.Where(e => staffing.Any(b => b.StaffId.Equals(e.Id))).OrderBy(s => s.Surname).ToListAsync();

            List <StaffVM> staffVM = new List <StaffVM>();

            foreach (Staff s in staff)
            {
                staffVM.Add(new StaffVM(s));
            }
            MenuDto menuDto = await getMenu(eventVM.MenuId);

            // view model of view models used to pass multiple self contained groups of data to a customised view as required by the brief
            // instead of creating one view model which contains every field of data requited
            EventDetailsVM eventDetailsVM = new EventDetailsVM(eventVM, customersVM, staffVM, menuDto);

            return(View(eventDetailsVM));
        }
示例#4
0
        public async Task <IActionResult> AddPayment(int EventID)
        {
            var _searchResult = await mediator.Send(new SearchEventByIdQuery
            {
                EventId = EventID
            });


            var _eventDetails = new EventDetailsVM {
                EventName        = _searchResult.EventName,
                EventStatus      = _searchResult.EventStatus,
                EventDate        = _searchResult.EventDate,
                BookingDate      = _searchResult.BookingDate,
                Description      = _searchResult.Description,
                Remarks          = _searchResult.Remarks,
                EntryTime        = _searchResult.EntryTime,
                Location         = _searchResult.Location,
                LocationType     = _searchResult.LocationType,
                NumberOfGuests   = _searchResult.NumberOfGuests,
                ProgramStart     = _searchResult.ProgramStart,
                PackageDetailsID = _searchResult.PackageDetailsID,
                UserID           = _searchResult.UserID,
                EventClientID    = _searchResult.EventClientID,
                Theme            = _searchResult.Theme,
                ServingType      = _searchResult.ServingType,
                ServingTime      = _searchResult.ServingTime,
                ID   = _searchResult.ID,
                Type = _searchResult.Type,

                VenueType = _searchResult.VenueType,
            };

            var eventDetails = new EventPaymentCVM {
                EventDetailsID = EventID,
                EventDetails   = _eventDetails
            };

            return(View(eventDetails));
        }
示例#5
0
        // GET: Events/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var events = await _context.Events
                         .FirstOrDefaultAsync(m => m.EventId == id);

            if (events == null)
            {
                return(NotFound());
            }

            var packages = await _context.Packages.ToListAsync();

            if (packages == null)
            {
                return(NotFound());
            }

            var packageLocations = new Packages();

            var eventPackages = new EventDetailsVM
            {
                Events = events,
                GetPackageLocations = packageLocations,
                Packages            = packages
            };

            ViewData["EventId"]       = new SelectList(_context.Events, "EventId", "EventName", packageLocations.EventId);
            ViewData["TransactionId"] = new SelectList(_context.Transactions, "TransactionId", "TransactionId", packageLocations.TransactionId);

            return(View(eventPackages));
        }
示例#6
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     EventDetails = DatabaseOperations.GetEventDetails(Event);
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("EventDetails"));
 }
示例#7
0
        public async Task <IActionResult> Update(int EventID)
        {
            var _eventDetails = await mediator.Send(new SearchEventByIdQuery { EventId = EventID });

            var _packageNames = await mediator.Send(new GetEventPackageQuery());

            var _clientNames = await mediator.Send(new GetClientListQuery());

            List <SelectListItem> _packagelist = new List <SelectListItem>();

            foreach (var item in _packageNames)
            {
                _packagelist.Add(new SelectListItem
                {
                    Value = item.ID.ToString(),
                    Text  = item.Name,
                });
            }
            var _packageSelectList = new SelectList(_packagelist, "Value", "Text", _eventDetails.PackageDetailsID);

            List <SelectListItem> _clientlist = new List <SelectListItem>();

            foreach (var item in _clientNames)
            {
                _clientlist.Add(new SelectListItem
                {
                    Value = item.ID.ToString(),
                    Text  = item.Name,
                });
            }
            var _clientSelectList = new SelectList(_clientlist, "Value", "Text", _eventDetails.EventClientID);


            var _details = new EventDetailsVM
            {
                EventName        = _eventDetails.EventName,
                Type             = _eventDetails.Type,
                Description      = _eventDetails.Description,
                EventClientID    = _eventDetails.EventClientID,
                Client           = _eventDetails.Client,
                EventDate        = _eventDetails.EventDate,
                PackageDetailsID = _eventDetails.PackageDetailsID,
                Package          = _eventDetails.Package,
                Location         = _eventDetails.Location,
                Remarks          = _eventDetails.Remarks,
                UserID           = _eventDetails.UserID,
                EventStatus      = _eventDetails.EventStatus,
                EntryTime        = _eventDetails.EntryTime,
                NumberOfGuests   = _eventDetails.NumberOfGuests,
                ProgramStart     = _eventDetails.ProgramStart,
                ServingTime      = _eventDetails.ServingTime,
                LocationType     = _eventDetails.LocationType,
                ServingType      = _eventDetails.ServingType,
                Theme            = _eventDetails.Theme,
                VenueType        = _eventDetails.VenueType,
                BookingDate      = _eventDetails.BookingDate,
                ID = _eventDetails.ID
            };


            List <SelectListItem> OccasionType = new List <SelectListItem>()
            {
                new SelectListItem {
                    Text = "Baptismal", Value = "Baptismal"
                },
                new SelectListItem {
                    Text = "Birthday", Value = "Birthday"
                },
                new SelectListItem {
                    Text = "Graduation", Value = "Graduation"
                },
                new SelectListItem {
                    Text = "Meeting", Value = "Meeting"
                },
                new SelectListItem {
                    Text = "Wedding", Value = "Wedding"
                },
                new SelectListItem {
                    Text = "Others", Value = "Others"
                },
            };
            List <SelectListItem> VenueType = new List <SelectListItem>()
            {
                new SelectListItem {
                    Text = "Yes", Value = "1"
                },
                new SelectListItem {
                    Text = "No", Value = "0"
                },
            };

            List <SelectListItem> LocationType = new List <SelectListItem>()
            {
                new SelectListItem {
                    Text = "North Area", Value = "1"
                },
                new SelectListItem {
                    Text = "South Area", Value = "2"
                },
            };

            List <SelectListItem> ServingType = new List <SelectListItem>()
            {
                new SelectListItem {
                    Text = "Manage Buffet", Value = "ManageBuffet"
                },
                new SelectListItem {
                    Text = "Self-Service Buffet", Value = "SelfServiceBuffet"
                },
            };

            @ViewBag.OccasionType = new SelectList(OccasionType, "Value", "Text", _details.Type);
            @ViewBag.VenueType    = new SelectList(VenueType, "Value", "Text", _details.VenueType);
            @ViewBag.LocationType = new SelectList(LocationType, "Value", "Text", _details.LocationType);
            @ViewBag.ServingType  = new SelectList(ServingType, "Value", "Text", _details.ServingType);

            @ViewBag.Clients = new SelectList(_clientNames, "ID", "Name", _details.Client.ID);

            @ViewBag.Packages = new SelectList(_packageNames, "ID", "Name", _details.Package.ID);
            var _addEventList = new ViewEventCVM();

            _addEventList.Package      = _packageSelectList;
            _addEventList.Client       = _clientSelectList;
            _addEventList.EventDetails = _details;
            return(View(_addEventList));
        }
示例#8
0
        public async Task <IActionResult> Record(int EventID)
        {
            var _searchResult = await mediator.Send(new SearchEventByIdQuery
            {
                EventId = EventID
            });

            var _eventDetails = new EventDetailsVM
            {
                EventName        = _searchResult.EventName,
                EventStatus      = _searchResult.EventStatus,
                EventDate        = _searchResult.EventDate,
                BookingDate      = _searchResult.BookingDate,
                Description      = _searchResult.Description,
                Remarks          = _searchResult.Remarks,
                EntryTime        = _searchResult.EntryTime,
                Location         = _searchResult.Location,
                LocationType     = _searchResult.LocationType,
                NumberOfGuests   = _searchResult.NumberOfGuests,
                ProgramStart     = _searchResult.ProgramStart,
                PackageDetailsID = _searchResult.PackageDetailsID,
                UserID           = _searchResult.UserID,
                EventClientID    = _searchResult.EventClientID,
                Theme            = _searchResult.Theme,
                ServingType      = _searchResult.ServingType,
                ServingTime      = _searchResult.ServingTime,
                ID   = _searchResult.ID,
                Type = _searchResult.Type,

                VenueType = _searchResult.VenueType,
            };

            var _payments = await mediator.Send(new GetPaymentStatusByEventIDQuery { EventID = EventID });

            var _charges = await mediator.Send(new GetEventAdditionalChargesQuery { EventID = EventID });

            decimal totalPayments = 0;

            foreach (var item in _payments)
            {
                totalPayments = totalPayments + item.Amount;
            }

            decimal totalCharges = 0;

            foreach (var item in _charges)
            {
                totalCharges = totalCharges + item.TotalPrice;
            }


            var eventDetails = new EventPaymentCVM
            {
                PaymentStatus = _payments,
                EventDetails  = _eventDetails,
                TotalPayment  = totalPayments,
                TotalCharges  = totalCharges
            };


            return(View(eventDetails));
        }