public ActionResult CheckOrder(string n) { var cookie = Request.Cookies[FormsAuthentication.FormsCookieName]; var ticket = FormsAuthentication.Decrypt(cookie.Value); var UserAccount = ticket.Name.Split(',')[1]; var service = new CartService(); var MemberId = service.GetMemberIdByAccount(UserAccount); var OrderID = service.GetCartOrderIDByMemberID(MemberId); bool alter = service.AlterCartToOrders(MemberId, OrderID); var url = ""; if (alter) { url = "~/orders/shippingpayment"; } else { ViewBag.StatusFail = "發生錯誤 請重試!"; } return(Redirect(url)); }