Ejemplo n.º 1
0
 public async Task <ActionResult> RequestOrder(int?mobileId, List <int> sellerIds, int shippingAddressId)
 {
     //if (mobileId == null)
     //{
     //    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     //}
     try
     {
         var personnelId = UserPersonnelId;
         //var personnel = await _personnelBusinessService.RetrievePersonnel(personnelId);
         return(this.JsonNet(await _orderBusinessService.CreateOrder(mobileId.Value, personnelId, sellerIds, shippingAddressId)));
     }
     catch (Exception e)
     {
         return(this.JsonNet(""));
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// The AddressAndPayment
        /// </summary>
        /// <param name="orderViewModel">The orderViewModel<see cref="OrderViewModel"/></param>
        /// <param name="httpContextBase">The httpContextBase<see cref="HttpContextBase"/></param>
        /// <returns>The <see cref="int"/></returns>
        public int AddressAndPayment(OrderViewModel orderViewModel, HttpContextBase httpContextBase)
        {
            var order = new Order();

            order.CustomerAddress = orderViewModel.CustomerAddress;
            order.CustomerMessage = orderViewModel.CustomerMessage;
            order.CustomerMobile  = orderViewModel.CustomerMobile;
            order.PaymentMethod   = orderViewModel.PaymentMethod;
            order.CreatedBy       = httpContextBase.User.Identity.Name;
            order.CreatedDate     = DateTime.Now;
            order.CustomerName    = orderViewModel.CustomerName;
            order.CustomerEmail   = orderViewModel.CustomerEmail;
            order.Status          = true;
            order.PaymentStatus   = "Chưa thanh toán";

            _oderBusinessService.CreateOrder(order, httpContextBase.User.Identity.Name, out TransactionalInformation transactionalInformation);

            return(order.ID);
        }