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)); } }
public JsonResult AllCategory() { var data = new CustomerCRUDViewModel(); var category = data.ShowAllCatogery(); return(Json(category, JsonRequestBehavior.AllowGet)); }
public JsonResult GetPaymentDetail(string paymentid = "") { int PaymentId = int.Parse(paymentid); var method = new CustomerCRUDViewModel(); Payment PaymentData = method.GetPaymentDetail(PaymentId); return(Json(PaymentData, JsonRequestBehavior.AllowGet)); }
public JsonResult ButtonAction(string Action, string ProductId, string CustomerId) { var CustomerModel = new CustomerCRUDViewModel(); CustomerModel.QuantatyUpdate(Action, ProductId, CustomerId); return(Json("Quantaty Add", JsonRequestBehavior.AllowGet)); }
/* * * * [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)); }
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 })); }
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"] })); }
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)); }