Exemplo n.º 1
0
        public JsonResult AddToCart(string productId = "")
        {
            if (Session["Customer"] == null)
            {
                return(Json(new
                {
                    redirectUrl = Url.Action("Login", "Registeration", new { id = 2 }),
                    isRedirect = true
                }));
            }

            //here increament value in cart
            //Session["CartOrder"] = Convert.ToInt32(Session["CartOrder"]) + 1; ;\
            else
            {
                var data = new CustomerCRUDViewModel();

                data.AddToCart(productId, Session["CustomerId"].ToString());

                if (Session["CustomerId"] != null)
                {
                    var CartOrderQuantaty = data.CarTOrderQuantaty(Session["CustomerId"]);
                    Session["CartOrderQuantaty"] = CartOrderQuantaty;
                }
                else
                {
                    Session["CartOrderQuantaty"] = 0;
                }



                return(Json("Product Add", JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 2
0
        public JsonResult AllCategory()
        {
            var data = new CustomerCRUDViewModel();

            var category = data.ShowAllCatogery();

            return(Json(category, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        public JsonResult GetPaymentDetail(string paymentid = "")
        {
            int     PaymentId   = int.Parse(paymentid);
            var     method      = new CustomerCRUDViewModel();
            Payment PaymentData = method.GetPaymentDetail(PaymentId);

            return(Json(PaymentData, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public JsonResult ButtonAction(string Action, string ProductId, string CustomerId)
        {
            var CustomerModel = new CustomerCRUDViewModel();

            CustomerModel.QuantatyUpdate(Action, ProductId, CustomerId);


            return(Json("Quantaty Add", JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 5
0
        /*
         *
         *
         * [AllowAnonymous]
         * public ActionResult checkOut()
         * {
         *  if (Session["Customer"] == null)
         *  {
         *      return RedirectToAction("Login", "Registeration", new { id = 2 });
         *  }
         *  var data = new AdminPanalCRUDViewModel();
         *
         *  var product = data.CheckOut(Session["CustomerId"]);
         *
         *
         *  return View(product);
         *
         * }
         */
        public ActionResult checkOut()
        {
            if (Session["Customer"] == null)
            {
                return(RedirectToAction("Login", "Registeration", new { id = 2 }));
            }
            var data = new CustomerCRUDViewModel();

            var product = data.CheckOut(Session["CustomerId"].ToString());

            return(View(product));
        }
Exemplo n.º 6
0
        public JsonResult YesProceedToCheckOut(string UserAddress = "", string CustomerId = "", string GrandTotal = "", string OrderPaymentType = "")
        {
            var data = new CustomerCRUDViewModel();

            var product = data.YesProceedToCheckOut(UserAddress, CustomerId, GrandTotal, OrderPaymentType);

            return(Json(new
            {
                redirectUrl = Url.Action("Index", "Home"),
                isRedirect = true
            }));
        }
Exemplo n.º 7
0
        public ActionResult CustomerFinishPayment(string paymentid = "")
        {
            int    PaymentId = int.Parse(paymentid);
            var    method    = new CustomerCRUDViewModel();
            string message   = "";

            try
            {
                message = method.FinalPayment(PaymentId);
            }
            catch (Exception e)
            {
                TempData["CustomerPayment"] = e.Message;
            }
            return(RedirectToAction("CustomerPayments", new { id = Session["CustomerId"] }));
        }
Exemplo n.º 8
0
        public ActionResult CustomerClaims(string claim = "")
        {
            var    method     = new CustomerCRUDViewModel();
            string message    = "";
            int    CustomerId = int.Parse(Session["CustomerId"].ToString());

            try
            {
                TempData["ClaimHomeMessage"] = method.Claim(claim, CustomerId);
            }
            catch (Exception e)
            {
                TempData["ClaimHomeMessage"] = e.Message;
            }
            return(View());
        }
        public ActionResult Index(int CategoryId = 1)
        {
            var viewmodel = new AdminPanalViewModel();

            var data = new CustomerCRUDViewModel();

            var category = data.ShowAllCatogery();
            var product  = data.ShowAllProduct(CategoryId);

            viewmodel.ShowAllCategory = category;    // here is a list of show all product in view model

            viewmodel.ShowAllProduct = product;

            if (Session["CustomerId"] != null)
            {
                var CartOrderQuantaty = data.CarTOrderQuantaty(Session["CustomerId"]);
                Session["CartOrderQuantaty"] = CartOrderQuantaty;
            }
            else
            {
                Session["CartOrderQuantaty"] = 0;
            }
            return(View(viewmodel));
        }