예제 #1
0
        public IActionResult AddServiceCharge(int id)
        {
            var ServiceFee = new AdditionalEventFeeVM
            {
                EventID = id
            };

            return(View(ServiceFee));
        }
예제 #2
0
        public async Task <IActionResult> ApproveEvent(int EventID)
        {
            var response = await mediator.Send(new ApproveEventRequestCommand { EventID = EventID });

            await mediator.Send(new AddEventNotificationCommand
            {
                Message      = "Your request has been Approved",
                TargetUserID = response.Coordinator.ID,
                MethodName   = "/Events/Details",
                RequestID    = response.ID
            });

            var inventoryManagerList = await mediator.Send(new GetInventoryManagerListQuery());

            foreach (var item in inventoryManagerList)
            {
                await mediator.Send(new AddEventNotificationCommand
                {
                    Message      = "An event has been Approved",
                    TargetUserID = item.ID,
                    MethodName   = "/Events/Details",
                    RequestID    = response.ID
                });;
            }

            var _eventDetails = await mediator.Send(new SearchEventByIdQuery { EventId = response.ID });

            var _initialFee = new AdditionalEventFeeVM
            {
                Description      = "Initial Fee (Package * No. of Guest)",
                EventID          = response.ID,
                Item             = "Package-" + _eventDetails.Package.Name,
                Quantity         = _eventDetails.NumberOfGuests,
                PricePerQuantity = _eventDetails.Package.RatePerHead,
            };

            var _rVal = await mediator.Send(new AddAdditionalEventChargeCommand { MyAdditionalEventFeeVM = _initialFee });

            if (_eventDetails.VenueType == VenueType.BuildingOrCondo)
            {
                var _serviceFee = new AdditionalEventFeeVM
                {
                    Description      = "Service Fee for Venue in Condominium or Bldg.",
                    Item             = "Service Fee",
                    EventID          = response.ID,
                    Quantity         = 1,
                    PricePerQuantity = 3500,
                };

                var _rValue = await mediator.Send(new AddAdditionalEventChargeCommand { MyAdditionalEventFeeVM = _serviceFee });
            }

            if (_eventDetails.AdditionalEquipment != null)
            {
                foreach (var item in _eventDetails.AdditionalEquipment)
                {
                    var _additionalEquipmentFee = new AdditionalEventFeeVM
                    {
                        EventID          = response.ID,
                        Description      = "Additional Equipment Fee",
                        Item             = item.EquipmentDetails.Name,
                        Quantity         = item.Quantity,
                        PricePerQuantity = item.EquipmentDetails.RentalFee
                    };

                    var _retVal = await mediator.Send(new AddAdditionalEventChargeCommand { MyAdditionalEventFeeVM = _additionalEquipmentFee });
                }
            }

            if (_eventDetails.AdditionalDish != null)
            {
                foreach (var item in _eventDetails.AdditionalDish)
                {
                    var _additionalDishFee = new AdditionalEventFeeVM
                    {
                        EventID          = response.ID,
                        Description      = "Additional Dish Fee",
                        Item             = item.Dish.Name,
                        PricePerQuantity = 2500,
                        Quantity         = item.Quantity,
                    };

                    var _retVal = await mediator.Send(new AddAdditionalEventChargeCommand { MyAdditionalEventFeeVM = _additionalDishFee });
                }
            }

            if (_eventDetails.AdditionalDuration != null)
            {
                foreach (var item in _eventDetails.AdditionalDuration)
                {
                    var _additionalDurationFee = new AdditionalEventFeeVM
                    {
                        EventID          = response.ID,
                        Description      = "Additional Duration Fee",
                        Item             = "Service Hour",
                        PricePerQuantity = 1500,
                        Quantity         = item.Duration.Hours,
                    };

                    var _retVal = await mediator.Send(new AddAdditionalEventChargeCommand { MyAdditionalEventFeeVM = _additionalDurationFee });
                }
            }

            return(RedirectToAction("Details", new { EventID = EventID }));
        }
예제 #3
0
        public async Task <IActionResult> AddServiceCharge(AdditionalEventFeeVM data)
        {
            var _rVal = await mediator.Send(new AddAdditionalEventChargeCommand { MyAdditionalEventFeeVM = data });

            return(Json(true));
        }