示例#1
0
        public ActionResult CheckOut(CartViewModel cartViewModel)
        {
            string          username = AuthManager.User.Identity.Name;
            ApplicationUser user     = UserManager.FindByName(username);


            OrderDto order = new OrderDto();

            order.Id              = Guid.NewGuid();
            order.OrderItems      = cartViewModel.OrderItems;
            order.UserEmail       = user.Email;
            order.UserId          = user.Id;
            order.UserAddress     = user.Address;
            order.UserCity        = user.City;
            order.UserCityState   = user.CityState;
            order.UserCompany     = user.Company;
            order.UserFirstName   = user.FirstName;
            order.UserLastName    = user.LastName;
            order.UserPhoneNumber = user.PhoneNumber;
            order.UserPostalCode  = user.PostalCode;

            PutOrderInSession(order);

            ViewBag.ShipmentCosts  = _shipmentCostService.Get(s => s.DestinationCity == user.City).ToList();
            ViewBag.IsPeykable     = (user.City.Contains("کرج") || user.City.Contains("تهران"));
            ViewBag.PaymentMethods = _paymentMethodService.Get().ToList();
            return(View("~/Areas/Store/Views/Orders/CheckOut.cshtml", order));
        }
示例#2
0
        public ActionResult Delete(int[] ids)
        {
            try
            {
                if (ids.Length != 0)
                {
                    var paymentMethod =
                        from id in ids
                        select _paymentMethodService.Get(x => x.Id == id);

                    _paymentMethodService.BatchDelete(paymentMethod);
                }
            }
            catch (Exception ex)
            {
                ExtentionUtils.Log(string.Concat("PaymentMethod.Delete: ", ex.Message));
            }

            return(RedirectToAction("Index"));
        }
        public async Task <PaymentMethodDetail_PaymentMethodDTO> Get([FromBody] PaymentMethodDetail_PaymentMethodDTO PaymentMethodDetail_PaymentMethodDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new MessageException(ModelState);
            }

            PaymentMethod PaymentMethod = await PaymentMethodService.Get(PaymentMethodDetail_PaymentMethodDTO.Id);

            return(new PaymentMethodDetail_PaymentMethodDTO(PaymentMethod));
        }
 public ActionResult List()
 {
     return(View(_paymentMethodService.Get().ToList()));
 }