예제 #1
0
        public async Task <IActionResult> ConfirmReference(OrderConfirmReferenceModel input)
        {
            await this.ordersService.SetOrderReferenceFromAsync(input);

            // this.notyfService.Error(this.localizer["Order failed!"]);
            return(this.RedirectToAction(GlobalConstants.Index));
        }
예제 #2
0
        public async Task <string> SetOrderReferenceFromAsync(OrderConfirmReferenceModel input)
        {
            var order = this.orders.All().FirstOrDefault(o => o.Id == input.Id);

            if (order is null)
            {
                return(null);
            }

            if (!string.IsNullOrWhiteSpace(input.OrderFromReferenceNum))
            {
                order.OrderFrom.ReferenceNum = input.OrderFromReferenceNum;
            }

            order.OrderFrom.ReceiveDate = DateTime.UtcNow;

            await this.UpdateOrderStatus(input.Id, OrderStatusNames.InProgress.ToString());

            return(order.Id);
        }