public JsonResult Work_Schedule_JSON() { var service = new Shopping_Cart_Service(); var jdata = JsonConvert.SerializeObject(service.Get_Work_Schedule()); return(Json(jdata, JsonRequestBehavior.AllowGet)); }
public void Work_Schedule_JSONTest() { var service = new Shopping_Cart_Service(); var data = JsonConvert.SerializeObject(service.Get_Work_Schedule()); Assert.IsNotNull(data); }
public ActionResult shopping_cart() { if (!User.Identity.IsAuthenticated) { return(RedirectToAction("Login", "Account")); } var model = (ShopingCartViewModel)TempData["model"]; var service = new Shopping_Cart_Service(); var user_name = HttpContext.User.Identity.Name; //Product_Price_list if (!model.ReserveItem.Contains(',')) { ViewBag.Services = model.ReserveItem; } var get_service_price_model = service.GetService(model.ReserveItem); //coupon var Account = new AccountDetailService(); var viewmodel = Account.get_account_detail(user_name); var _Coupon = service.GetCoupon(viewmodel.Cust_id); //Designer var get_designer_model = service.GetDesigners(); ViewBag.Designers = get_designer_model; //Session var get_session = service.Get_Session_list(); ViewBag.Session = get_session; ViewBag.Origin = service.Calculate_Original_Price(get_service_price_model.Shop_list); ViewBag.Store = model.Store; ViewBag.Services = model.ReserveItem.Split(','); ViewBag.Coupons = _Coupon; return(View(get_service_price_model)); }
public void shopping_cartTest() { ShopingCartViewModel model = new ShopingCartViewModel(); var service = new Shopping_Cart_Service(); model.ReserveItem = "手部精緻保養,足部精緻保養"; var get_service_price_model = service.GetService(model.ReserveItem); var user_name = "*****@*****.**"; var Account = new AccountDetailService(); var viewmodel = Account.get_account_detail(user_name); var _Coupon = service.GetCoupon(viewmodel.Cust_id); var get_designer_model = service.GetDesigners(); var get_session = service.Get_Session_list(); Assert.IsNotNull(get_service_price_model); Assert.IsNotNull(viewmodel); Assert.IsNotNull(_Coupon); Assert.IsNotNull(get_designer_model); Assert.IsNotNull(get_session); }