Beispiel #1
0
        public async Task <IActionResult> Detail(string orderId)
        {
            var user = _appUserParser.Parse(HttpContext.User);

            var order = await _orderSvc.GetOrder(user, orderId);

            return(View(order));
        }
Beispiel #2
0
        public async Task <IActionResult> Detail(string orderId)
        {
            var order = await _orderSvc.GetOrder(orderId);

            order.OrderItems.ForEach(i => i.ConvertedPrice = i.UnitPrice * order.CurrencyRate);

            return(View(order));
        }
        public async Task <IActionResult> GetOrder(int id)
        {
            var res = await _orderService.GetOrder(id);

            var resDTO = _mapper.Map <IEnumerable <OrdersDTO> >(res);

            return(Ok(resDTO));
        }
        private async Task PostOrderDetailAsync(IDialogContext context, string orderNumber)
        {
            var authUser = await identityService.GetAuthUserAsync(context);

            var order = await orderingService.GetOrder(orderNumber, authUser.AccessToken);

            await OrderReceipt(context, order);
        }
Beispiel #5
0
        protected async Task <RequestContext> LoadContext(OrderRequestBase requst)
        {
            var ctx = new RequestContext
            {
                Member = await service.GetMemberById(requst.MemberId),
                Order  = await service.GetOrder(requst.OrderId)
            };

            return(ctx);
        }
Beispiel #6
0
        async Task <int[]> GetMembers(int orderId, SendTarget target)
        {
            var order = await orderingService.GetOrder(orderId);

            switch (target)
            {
            case OrderOpener _: return(new[] { order.RequestingMemberId });

            case MemberTarget mt:
                var unitId  = mt.OrderSide == OrderSide.Lending ? order.LendingUnitId : order.RequestingUnitId;
                var members = await orderingService.GetMembers(unitId, mt.Permission);

                return(members.Select(a => a.Id).ToArray());
            }

            return(new int[0]);
        }