public ActionResult Index() { decimal GrandTotal = 0;; EducationShoppingCartTempViewModel educationshoppingModel = new EducationShoppingCartTempViewModel(); if (Session["Countdown"] != null) { _shoppingeducationService.ResetShippingOrderQuentityStock(HCRGUser.UID); Session["Countdown"] = null; Session["StartDate"] = null; } educationshoppingModel.EducationShoppingCartTempResults = Mapper.Map <IEnumerable <EducationShoppingCart> >(_shoppingeducationService.GetEducationShoppingCartByUserID(HCRGUser.UID)); List <DiscountCoupon> List_DiscountCoupon = new List <DiscountCoupon>(); foreach (EducationShoppingCart viewmodel in educationshoppingModel.EducationShoppingCartTempResults) { if (viewmodel.CoupanID != null) { DiscountCoupon discountCoupon = new DiscountCoupon(); discountCoupon = Mapper.Map <DiscountCoupon>(_discountCouponService.GetDiscountCouponByID(Convert.ToInt32(viewmodel.CoupanID))); List_DiscountCoupon.Add(discountCoupon); } GrandTotal += viewmodel.Amount; } educationshoppingModel.DiscountCouponResults = List_DiscountCoupon.AsEnumerable(); TempData["TotalAmount"] = GrandTotal; return(View(educationshoppingModel)); }
public ActionResult Index() { int educationID = 0; EducationShoppingCartTempViewModel educationshoppingModel = new EducationShoppingCartTempViewModel(); educationshoppingModel.EducationShoppingCartTempResults = Mapper.Map <IEnumerable <EducationShoppingCart> >(_shoppingeducationService.GetEducationShoppingCartByUserID(HCRGUser.UID)); foreach (EducationShoppingCart viewmodel in educationshoppingModel.EducationShoppingCartTempResults) { educationID = viewmodel.TempID; } return(View()); }