Exemplo n.º 1
0
        /// <summary>
        ///  ثبت اطلاعات کاربری از سمت پیش فاکتور
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <IActionResult> UserAddressFromInvoice(int id, string title)
        {
            ViewBag.UserAddress = await _userAddressRepository.GetByConditionAsync(a => a.UserId == UserId);

            ViewBag.OrderId          = id;
            ViewBag.TitleUserAddress = title;
            ViewBag.UserInfo         = await _userRepository.GetByIdAsync(UserId);

            ViewBag.Ostans = await _ostanRepository.GetAll();

            return(View());
        }
        public async Task <IActionResult> Result(string orderId, int shopOrderId)
        {
            var shopOrderPayment = await _shopOrderPaymentRepository
                                   .GetByConditionAsync(a => a.ShopOrderId == shopOrderId && a.OrderId == orderId);

            var userInfo = await _userRepository.GetByConditionAsync(a => a.Id == UserId);

            //var model = await _shopOrderRepository.GetByConditionAsync(a => a.OrderId == orderId && a.UserId == UserId);
            ViewBag.Order = await _shopProductRepository.GetListAsync(a => a.ShopOrderId == shopOrderId && a.UserId == UserId, null, "Product,ProductPackage");

            ViewBag.PhoneNumber = userInfo.PhoneNumber;
            ViewBag.FullName    = userInfo.FirstName + " " + userInfo.LastName;
            ViewBag.UserAddress = await _userAddressRepository.GetByConditionAsync(a => a.UserId == UserId);

            return(View(shopOrderPayment));
        }
        public async Task <IActionResult> OrderDetail(int id)
        {
            var reloadPrice = await _shopOrderRepository.ReloadPrice(id);

            if (!reloadPrice.Succeed)
            {
                TempData.AddResult(reloadPrice);

                return(RedirectToAction(nameof(Orders)));
            }

            var model = await _shopProductRepository.GetListAsync(a => a.ShopOrderId == id && a.IsFactorSubmited, null, "Product");

            var order = await _shopOrderRepository.GetByConditionAsync(a => a.Id == id && !a.IsDeleted);

            if (order == null || model == null)
            {
                return(NotFound());
            }

            // لیست تراکنش های کاربر برای این فاکتور
            var payment = await _shopOrderPaymentRepository.GetListAsync(a => a.ShopOrderId == id);

            // اطلاعات کاربر
            ViewBag.UserInfo = await _userRepository.GetByConditionAsync(a => a.Id == order.UserId);

            ViewBag.Order       = order;
            ViewBag.payment     = payment;
            ViewBag.UserAddress = await _userAddressRepository.GetByConditionAsync(a => a.UserId == order.UserId);

            ViewBag.Model          = _userRepository.GetByCondition(a => a.Id == UserId);
            ViewBag.SidebarActive  = ProfileSidebarSSOT.Orders;
            ViewBag.Unit           = _productUnitRepository.GetList();
            ViewBag.Amount         = order?.PaymentAmount;
            ViewBag.TransferAmount = order?.TransferProductPrice;

            return(View(model));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> OrderDetail(int id, int userId)
        {
            var model = _shopProductRepository.GetList(a => a.ShopOrderId == id, includes: "Product");

            // اطلاعات فاکتور
            var info = await _shopOrderRepository.GetByIdAsync(id);

            // اطلاعات کاربر
            ViewBag.UserInfo = await _userRepository.GetByConditionAsync(a => a.Id == info.UserId);

            // اطلاعات آدرس کاربر
            //ViewBag.UserAddress = await _userAddressRepository.GetByConditionAsync(a => a.UserId == a.UserId);
            ViewBag.Order = info;

            // روند نمایی وضعیت فاکتور
            ViewBag.shopOrderStatuses = await _shopOrderStatusRepository.GetItemsByOrderId(id);

            ViewBag.UserAddress = await _userAddressRepository.GetByConditionAsync(a => a.ShopOrderId == info.Id);

            ViewBag.Order = info;
            ViewBag.Unit  = await _productUnitRepository.GetListAsync();

            return(View(model));
        }