Ejemplo n.º 1
0
        /// <summary>
        /// Get buyer orders
        /// </summary>
        /// <param name="sortBy">The column name to sort the orders</param>
        /// <param name="sortOrder">Sort order(asc, desc)</param>
        /// <param name="orderStatus">Order status to sort the orders</param>
        /// <returns>Orders for the given user guid</returns>
        public ActionResult MyOrders(string sortBy, string sortOrder, OrderStatus?orderStatus, string activeTab)
        {
            OrderDomainLogic orderDomainLogic = new OrderDomainLogic();
            MyOrder          myOrder          = new MyOrder();

            ViewBag.ActiveTab = activeTab;

            int Currentpage = 0;

            TempData["CurrentPage"] = null;

            if (Request.Url.AbsoluteUri.Contains("?") && Request.Url.AbsoluteUri.Contains("page"))
            {
                var queryStringArray = Request.Url.AbsoluteUri.Split('&');//[4].Split('=')[1].Split('&')[0];
                var pageString       = queryStringArray[queryStringArray.Length - 1];
                var pageSize         = pageString.Split('=')[1];
                TempData["CurrentPage"] = pageSize;
                Currentpage             = TempData["CurrentPage"] == null ? 0 : Convert.ToInt32(TempData["CurrentPage"]);
                TempData.Keep();
            }

            if (UserVariables.UserRole == Domain.Enums.User.UserRoles.Buyer)
            {
                myOrder = orderDomainLogic.GetBuyerOrders(UserVariables.LoggedInUserGuid, orderStatus, sortBy, sortOrder, activeTab, Currentpage);
            }

            else if (UserVariables.UserRole == Domain.Enums.User.UserRoles.Merchant)
            {
                return(View("MyOrders", myOrder));
            }

            return(View("MyOrders", myOrder));
        }
Ejemplo n.º 2
0
        public ActionResult OrderConfirmation(Guid orderGuid)
        {
            OrderDomainLogic orderDomainLogic = new OrderDomainLogic();
            var model = orderDomainLogic.GetOrderDetails(orderGuid);

            return(View("OrderConfirmation", model));
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult Dashboard()
        {
            UserDomainLogic   userdomainLogic   = new UserDomainLogic();
            Dashboard         dashboard         = new Dashboard();
            OrderDomainLogic  orderDomainLogic  = new OrderDomainLogic();
            WalletDomainLogic walletDomainLogic = new WalletDomainLogic();

            dashboard.MyMessage = userdomainLogic.GetMyMessages(UserVariables.LoggedInUserGuid);

            if (UserVariables.UserRole == Bringly.Domain.Enums.User.UserRoles.Buyer)
            {
                dashboard.MyFavourites = userdomainLogic.FavouriteLocations(2);
            }

            else
            {
                dashboard.MyFavourites = null;
            }

            if (UserVariables.UserRole == Bringly.Domain.Enums.User.UserRoles.Merchant)
            {
                MyReview myreview = new MyReview();
                myreview.UserGuid  = UserVariables.LoggedInUserGuid;
                dashboard.MyReview = userdomainLogic.GetMyReviewMerchant(myreview);
                dashboard.MyReview.GivenBusinessReviews = dashboard.MyReview.GivenBusinessReviews.Count > 0 ? dashboard.MyReview.GivenBusinessReviews.Take(2).ToList() : dashboard.MyReview.GivenBusinessReviews;
            }

            dashboard.Wallet  = walletDomainLogic.GetWallet(UserVariables.LoggedInUserGuid);
            dashboard.MyOrder = orderDomainLogic.GetMyOrderCounts(UserVariables.LoggedInUserGuid, UserVariables.UserRole);

            return(View(dashboard));
        }
Ejemplo n.º 4
0
        public ActionResult PaymentOption(Guid orderGuid)
        {
            OrderDomainLogic orderDomainLogic = new OrderDomainLogic();
            var model = orderDomainLogic.GetPaymentType(orderGuid);

            ViewBag.orderGuid = orderGuid;
            return(View("PaymentOption", model));
        }
Ejemplo n.º 5
0
        public ActionResult DeliveryOption(Guid orderGuid)
        {
            OrderDomainLogic orderDomainLogic = new OrderDomainLogic();
            //Guid.TryParse("B176BAD2-2BC8-4648-86E2-0392703B5CE2", out orderGuid);
            var model = orderDomainLogic.GetDeliveryOption(orderGuid);

            return(View("Delivery", model));
        }
Ejemplo n.º 6
0
        public ActionResult OrderDetail(Guid orderGuid)
        {
            Order order = new Order();

            if (orderGuid != Guid.Empty)
            {
                OrderDomainLogic orderDomainLogic = new OrderDomainLogic();
                order = orderDomainLogic.GetOrderDetails(orderGuid);
            }
            return(View("OrderDetailBuyer", order));
        }
Ejemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="requestQuery"></param>
        /// <param name="activeTab"></param>
        /// <returns></returns>
        public async Task <ActionResult> GetMerchantMyOrders(RequestQuery requestQuery, string activeTab)
        {
            OrderDomainLogic orderDomainLogic = new OrderDomainLogic();
            var loggedInGuid = UserVariables.LoggedInUserGuid;
            var data         =
                await Task.Run(() =>
            {
                return(orderDomainLogic.GetMerchantOrders(loggedInGuid, requestQuery, activeTab));
            });

            return(Json(new { myOrderData = data }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 8
0
        public ActionResult OrderConfirmation(Guid orderGuid, PaymentType paymentType)
        {
            OrderDomainLogic orderDomainLogic = new OrderDomainLogic();
            var result = orderDomainLogic.UpdateDeliveryOptionPaymentMethod(orderGuid, paymentType);

            if (!result)
            {
                return(RedirectTo404());
            }
            var model = orderDomainLogic.GetOrderDetails(orderGuid);

            return(RedirectToAction("orderconfirmation", new { orderGuid = orderGuid }));//return View("OrderConfirmation", model);
        }
Ejemplo n.º 9
0
        public ActionResult SaveDeliveryOption(DeliveryOption deliveryOption)
        {
            OrderDomainLogic orderDomainLogic = new OrderDomainLogic();

            if (deliveryOption.DeliveryType == OrderType.SelfDelivery && string.IsNullOrEmpty(deliveryOption.ShippingAddress.Country))
            {
                ModelState.AddModelError("ShippingAddress.Country", "Select Country.");
                var model = orderDomainLogic.GetDeliveryOption(deliveryOption.OrderGuid);
                deliveryOption.CountryList = model.CountryList;
                deliveryOption.CityList    = model.CityList;
                return(View("Delivery", deliveryOption));
            }

            var result = orderDomainLogic.SaveDeliveryOption(deliveryOption);

            return(RedirectToAction("paymentoption", new { orderGuid = deliveryOption.OrderGuid }));// View("PaymentOption", deliveryOption);
        }
Ejemplo n.º 10
0
        public ActionResult UpdateOrderStatus(Guid orderGuid, OrderStatus orderStatus)
        {
            OrderDomainLogic orderDomainLogic = new OrderDomainLogic();

            return(Json(orderDomainLogic.UpdateOrderStatus(orderGuid, orderStatus), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 11
0
        public ActionResult OrderConfirm()
        {
            OrderDomainLogic orderDomainLogic = new OrderDomainLogic();

            return(View("ThankUOrder"));
        }