Esempio n. 1
0
        // GET: Basket
        public ActionResult Index()
        {
            var model   = BasketLayer.GetInstance();
            var summary = BasketLayer.GetSummary();

            ViewBag.Summary = summary;
            return(View(model));
        }
        //GET: Commit
        public ActionResult Commit(int id)
        {
            var orderLayer = new OrderLayer();

            string orderMail      = this.RenderRazorView("Mails/Order", orderLayer.Order);
            var    customerWorker = new CustomerWorker();
            var    customerUser   = customerWorker.GetCustomerUser(CustomerLayer.Customer.Id.ToString());
            var    mailer         = new Khaled.SmtpClient.SmtpMailClient();

            mailer.PostMail(ConfigurationManager.AppSettings["AdminEmail"], "Sipariş", orderMail);
            BasketLayer.RemoveAll();

            ViewBag.Method = id;

            return(View(orderLayer.Order));
        }
Esempio n. 3
0
 public static decimal ShippingPrice(ShipmentTypeViewModel model)
 {
     if (model.PricingMethod == 2)
     {
         return(BasketLayer.GetSummary().BasketTotal *(decimal)(model.PricingValue / 100));
     }
     else if (model.PricingMethod == 3)
     {
         return(BasketLayer.GetSummary().ProductCount *(decimal)model.PricingValue);
     }
     else if (model.PricingMethod == 4)
     {
         return((decimal)BasketLayer.GetSummary().TareTotal *(decimal)model.PricingValue);
     }
     else
     {
         return((decimal)model.PricingValue);
     }
 }
Esempio n. 4
0
        public ActionResult RemoveAll()
        {
            var result = BasketLayer.RemoveAll();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 5
0
        public ActionResult RemoveItem(int id)
        {
            var result = BasketLayer.RemoveBasketItem(id);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 6
0
        public ActionResult GetBasketSummaryApi()
        {
            var result = BasketLayer.GetSummary();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 7
0
        public ActionResult GetBasketDetailApi()
        {
            var result = BasketLayer.GetInstance();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 8
0
        public ActionResult AddRelatedItem(int ProductId, int RelatedProductId, int Quantity, int CampaignId)
        {
            var result = BasketLayer.AddRelatedItem(ProductId, RelatedProductId, Quantity, CampaignId);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 9
0
        //Json apies
        public ActionResult AddItem(int ProductId, int Quantity)
        {
            var result = BasketLayer.AddItem(ProductId, Quantity);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 10
0
 //GET: Clear
 public ActionResult ClearBasket()
 {
     BasketLayer.RemoveAll();
     return(RedirectToAction("Index"));
 }
Esempio n. 11
0
 //GET: RemoveRelItem
 public ActionResult RemoveRelProduct(int id)
 {
     BasketLayer.RemoveBasketRelItem(id);
     return(RedirectToAction("Index"));
 }
Esempio n. 12
0
 //GET: UpdateRelQuantity
 public ActionResult UpdateRelQuantity(int id, int quantity)
 {
     BasketLayer.UpdateRelQuantity(id, quantity);
     return(RedirectToAction("Index"));
 }