diff --git a/Database/script.sql b/Database/script.sql new file mode 100644 index 0000000..0cc0e4f Binary files /dev/null and b/Database/script.sql differ diff --git a/Test/App_Start/BundleConfig.cs b/Test/App_Start/BundleConfig.cs index c4980db..deab17d 100644 --- a/Test/App_Start/BundleConfig.cs +++ b/Test/App_Start/BundleConfig.cs @@ -27,6 +27,7 @@ public static void RegisterBundles(BundleCollection bundles) "~/Content/bootstrap.css", "~/Content/site.css", "~/Content/home.css")); + } } } diff --git a/Test/App_Start/RouteConfig.cs b/Test/App_Start/RouteConfig.cs index 1f81edd..89e0878 100644 --- a/Test/App_Start/RouteConfig.cs +++ b/Test/App_Start/RouteConfig.cs @@ -4,7 +4,7 @@ using System.Web; using System.Web.Mvc; using System.Web.Routing; - +using Test.Models; namespace Test { public class RouteConfig @@ -18,11 +18,83 @@ public static void RegisterRoutes(RouteCollection routes) url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); + routes.MapRoute( name: "AddCart", + url: "{controller}/{action}/{id}/{quantity}", + defaults: new { controller = "Home", action = "AddCart", id = UrlParameter.Optional, quantity = UrlParameter.Optional } + ); + + routes.MapRoute( + name: "ProductDetails", url: "{controller}/{action}/{id}", - defaults: new { controller = "Home", action = "AddCart", id = UrlParameter.Optional } + defaults: new { controller = "Home", action = "ViewProduct", id = UrlParameter.Optional } + ); + + routes.MapRoute( + name: "Phone", + url: "{controller}/{action}", + defaults: new { controller = "PhonePage", action = "Index" } ); + routes.MapRoute( + name: "PhonePaging", + url: "{controller}/{action}/{page}", + defaults: new { controller = "PhonePage", action = "Paging", page = UrlParameter.Optional } + ); + + routes.MapRoute( + name: "LapTop", + url: "{controller}/{action}", + defaults: new { controller = "LapTopPage", action = "Index" } + ); + routes.MapRoute( + name: "LapTopPaging", + url: "{controller}/{action}/{page}", + defaults: new { controller = "LapTopPage", action = "Paging", page = UrlParameter.Optional } + ); + routes.MapRoute( + name: "Search", + url: "{controller}/{action}", + defaults: new { controller = "Search", action = "Index" } + ); + routes.MapRoute( + name: "GetFirstSearch", + url: "{controller}/{action}", + defaults: new { controller = "Search", action = "GetFirstSearch" } + ); + + + routes.MapRoute( + name: "News", + url: "{controller}/{action}/{id}", + defaults: new { controller = "News", action = "ViewPost", id = UrlParameter.Optional } + ); + routes.MapRoute( + name: "ViewCart", + url: "{controller}/{action}/{id}", + defaults: new { controller = "Cart", action = "ViewCart"} + ); + routes.MapRoute( + name: "RemoveProduct", + url: "{controller}/{action}/{id}", + defaults: new { controller = "Cart", action = "RemoveProduct",id = UrlParameter.Optional } + ); + routes.MapRoute( + name: "UpdateProductSession", + url: "{controller}/{action}/{id}", + defaults: new { controller = "Cart", action = "UpdateProductSession", id = UrlParameter.Optional,quantity=UrlParameter.Optional } + ); + routes.MapRoute( + name: "ThanhToan", + url: "{controller}/{action}/{id}", + defaults: new { controller = "Cart", action = "ThanToan"} + ); + routes.MapRoute( + name: "Checkout", + url: "{controller}/{action}/{id}", + defaults: new { controller = "Cart", action = "Checkout",id=UrlParameter.Optional } + ); } + } } diff --git a/Test/Content/Site.css b/Test/Content/Site.css index 6ea5d8f..3c48cb8 100644 --- a/Test/Content/Site.css +++ b/Test/Content/Site.css @@ -22,3 +22,187 @@ select, textarea { max-width: 280px; } + +/*View product page css*/ +#view-product-body { + min-height: 550px; +} +.price-text-color { + color: #219FD1; +} + +.price-sale .card .card-title { + background: #DE181D; + color: white; + padding: 1.25rem; +} +.price-sale .card .card-title span { + color: #F8E31C; +} + +.price-sale .card .card-block .card-text span:before { + content: ''; + background: url(../../Images/bullet.png); + width: 14px; + height: 14px; + background-size: 14px 14px; +} + +.price-sale .card .card-block .buy-now { + display: block; + overflow: hidden; + padding: 9px 0; + background-image: linear-gradient(-180deg,#e52025 2%,#d81116 96%); + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + font-size: 16px; + line-height: normal; + text-transform: uppercase; + color: #fff; + text-align: center; +} +.price-sale .card .card-block .buy-now span { + display: block; + font-size: 12px; + color: #fff; + text-transform: none; +} + +.price-sale .card .card-block .buy-ins span { + display: block; + font-size: 12px; + color: #fff; + text-transform: none; +} + +.price-sale .card .card-block .buy-ins { + line-height: normal; + display: block; + padding: 9px 0; + text-align: center; + margin: 10px 0 0; + background-image: linear-gradient(-180deg,#288ad6 0%,#0e74c3 100%); + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + color: #fff; + font-size: 16px; + text-transform: uppercase; +} + +.view-content ul.policy { + border: 1px dashed #f6a623; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + margin-bottom: 30px; + margin-top: 0; +} + +.checkexist .dropdown { + margin-top:10px; + width: 100%; +} +.breadcrumb-item + .breadcrumb-item::before { + display: inline-block; + padding-right: 0.5rem; + padding-left: 0.5rem; + color: #636c72; + content: "/"; +} +.container-card-button { + flex: 1; + display: flex; + align-items: center; + background: #0090e3; + color: #fff; +} + +.container-card-button .icon-card { + font-size: 22px; + padding: 5px 8px; +} +.btn-default { + flex: 1; + transition: 0.4s; + color: #fff; + background-color: #303030; + text-transform: uppercase; +} + +/*Footer*/ +#myFooter { + background-color: #3c3d41; + color: white; + margin-top: 20px; + padding-top: 30px; + font-size: 20px; + margin-bottom: -20px; +} +.footer-copyright { + background-color: #333333; + padding-top: 3px; + padding-bottom: 3px; + text-align: center; +} +#myFooter .social-networks { + text-align: center; + padding-top: 10px; + padding-bottom: 16px; +} +#myFooter .social-networks a { + color: white; + font-size: 34px; + margin-right: 10px; +} +#myFooter .btn { + color: white; + background-color: #d84b6b; + border-radius: 20px; + cursor: pointer; + border: none; + width: 150px; + display: block; + margin: 10px auto; + line-height: 25px; +} +#myFooter .col-sm-2>ul>li>a { + color: white; +} +/*Style for view news page*/ +#header-news { + max-width: 100%; + min-height: 250px; + padding: 100px !important; + background: linear-gradient(141deg, #0fb8ad 0%, #1fc8db 51%, #2cb5e8 75%); + opacity: 0.95; +} +.news-header-title { + color: white; + text-align: center; +} +.news-des { + font-size: 25px; + text-align: left; + border-left: 5px solid coral; + padding-left: 5px; +} +article .imgwrap { + position: relative; + min-height: 100px; + margin-top: 5px; + background: #f1f1f1; + margin: 0 auto; +} +article .imgwrap img { + max-width: 825px; +} +#news-wrapper { + margin-top: 20px; + max-width: 100%; + padding: 15px; +} +.infor-news a { + color: white; +} diff --git a/Test/Content/home.css b/Test/Content/home.css index 466485f..15a8bb1 100644 --- a/Test/Content/home.css +++ b/Test/Content/home.css @@ -1,6 +1,86 @@ *{ } +.searchTitle { + margin-bottom: 20px; + font-size: 20px; +} + +form.navbar-form.navbar-left { + width: 169%; +} + +div.loadMore,.searchButton { + border: 1px solid #eee; + padding: 6px 30px; + border-radius: 3px; + color: #51B7ED; + transition: .5s; + cursor: pointer; +} + +div.loadMore:hover { + background: #288AD6; + color: white; + transition:.5s; +} +.searchButton:hover{ + background: #288AD6; + color: white; + transition:.5s; +} + + + +.row.d-flex.justify-content-center { + display: flex; + justify-content: center; + margin-top:20px; +} + +.listProductCategory {overflow: hidden;} + +.allTypePhoneList ul { + display: flex; + justify-content: center; +} + +.allTypePhoneList ul { + padding: 0; +} + +.allTypePhoneList ul li { + display: inline-block; + border: 1px solid #eee; +} + +span#cartItemsSize { + color: white; + width: 30px; + text-align: center; + line-height: 30px; + height: 30px; + display: inline-block; + position: absolute; + background: #F36E36; + border-radius: 50%; + top: 5px; + right: -16px; +} + +ul.nav.navbar-nav.navbar-right { + padding-right: 20px; +} + +.cart i {color: white;font-size: 30px;} + +.cart { + float: right; + padding-top: 20px; + margin-bottom: 5px; + position: relative; +} + .oneProduct.card.col-sm-3 { border: 1px solid white; margin-bottom: 5px; @@ -52,6 +132,10 @@ i.fas.fa-th { width: 100%; } +.listProductHeader a { + color: white; +} + .listProduct { border: 1px solid #D84B6B; width: 100%; @@ -165,10 +249,117 @@ nav.navbar .collapse ul { img.logo { width: 50px; } +.logo-space { + float:left; + margin-left: -15px; + margin-right: 10px; + margin-top: 5px; +} .body-content{ margin-top:50px; } .oneProduct.card.col-sm-3 img{ width:100%; + margin-top: 5px; +} + +.img-fluid { + max-width: 100%; + height: auto; +} + +.foodPay{ + margin-top: 2.5rem; + border: 1px solid #D7D7D7; + padding: 20px; + background: #FFFFFF; + box-shadow: 0px 0px 20px 5px #0000002b; + border-radius: 6px; +} + +.oneFood{position: relative;height: 60px;overflow: hidden;} +.oneFood .foodImg{width: 60px;display: inline-block;border-radius: 4px;overflow: hidden;} +.oneFood .foodImg img{width: 100%;} +.oneFood .foodName{display: inline-block;font-weight: bold;position: absolute;margin-left: 10px;top: 50%;transform: translateY(-50%);width: 60%;} +.oneFood .foodPrice{bottom: 0;display: inline-block;position: absolute;color: #206B9B;font-weight: 700;right: 0;} +.oneFood .addFood{display: inline-block;position: absolute;right: 0;top: 0; cursor: pointer;} +.oneFood .addFood i{color: #CF2127;font-size: 25px;} +.oneFood .minusFood{display: inline-block;position: absolute;right: 45px;top: 0; cursor: pointer;} +.oneFood .minusFood i{color: #CF2127;font-size: 25px;} +.oneFood .quantity{ + position: absolute; + right: 29px; + top: 0px; + font-weight: bold; +} + + +.removeFood{ + cursor: pointer; +} + +.payment{ + margin-top: 2.5rem; + border: 1px solid #D7D7D7; + padding: 20px; + background: #FFFFFF; + box-shadow: 0px 0px 20px 5px #0000002b; + border-radius: 6px; +} +.payment .card-text{ + font-weight: 500; + display: inline-block; +} +.payment .totalPrice{ + display: inline-block; + float: right; + font-weight: 600; +} +.payment label{ + margin: 0; + padding: 5px 0; +} +.payment button{ + margin-top: 30px; + width: 100%; +} +.payment .inputAddress,.payment .inputPhone{ + float: right; + border: 1px solid #eee; + padding: 5px 10px; + border-radius: 5px; +} +.note{ + display: inline-block; + margin-left: 30px; + float: right; +} +.note input{border: 1px solid #eee;padding: 5px 10px;border-radius: 5px;} +.cartContent{ + margin-top:50px; + margin-bottom:50px; +} + +.img-logo { + width: 65%; + margin-top: 3px; + margin-left: 55px; +} + +.food-list { + margin-left: 30px +} + +.orderlist { + margin-top: 40px +} + +.slsp{position: absolute; + right: 0; + width: 69px; + border: 1px solid black; + padding: 5px 10px; + border-radius: 10px; + outline: none; } \ No newline at end of file diff --git a/Test/Controllers/CartController.cs b/Test/Controllers/CartController.cs new file mode 100644 index 0000000..f4f7dd8 --- /dev/null +++ b/Test/Controllers/CartController.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Test.Models; +using Newtonsoft.Json; + +namespace Test.Controllers +{ + + + public class CartController : Controller + { + Entities db = new Entities(); + // GET: Cart + public ActionResult ViewCart() + { + //getmaxCurrentInvoice + int currentInvoice = db.Invoices.Max(x => x.invoiceID); + int nextInvoice = currentInvoice + 1; + List cartItems = Session["CartItems"] as List; + + List listInvoiceLine = null; + //list product + List listProduct = null; + //get cartItems from session + if (cartItems != null && cartItems.Count>0) + { + listProduct = new List(); + listInvoiceLine = new List(); + for (int i = 0; i < cartItems.Count; i++) + { + int k = cartItems[i].productID; + Product product = db.Products.Single(p => p.productID == k); + listProduct.Add(product); + + listInvoiceLine.Add(new InvoiceLine(nextInvoice, product.productID, (int)cartItems[i].quantity, (int)product.price, "Note")); + + } + ViewBag.listInvoiceLine = listInvoiceLine; + ViewBag.listProduct = listProduct; + Session["CartItemsSize"] = cartItems.Count; + }else + { + Session["CartItemsSize"] = 0; + } + return View(); + } + + public ActionResult RemoveProduct(int id) + { + //System.Diagnostics.Debug.WriteLine(id); + List cartItems = Session["CartItems"] as List; + System.Diagnostics.Debug.WriteLine((int)cartItems.Count); + for (int i = 0; i < cartItems.Count; i++) + { + if (cartItems[i].productID == id) + { + cartItems.Remove(cartItems[i]); + } + } + + Session.Remove("CartItems"); + + Session["CartItems"] = cartItems; + Session["CartItemsSize"] = cartItems.Count; + System.Diagnostics.Debug.WriteLine((int)cartItems.Count); + + //Return productId is removed -> change Front-End + return Json(cartItems); + } + + + public ActionResult UpdateProductSession(int id, int quantity) + { + //System.Diagnostics.Debug.WriteLine(id); + List cartItems = Session["CartItems"] as List; + for (int i = 0; i < cartItems.Count; i++) + { + if (cartItems[i].productID == id) + { + cartItems[i].quantity = quantity; + } + } + + Session.Remove("CartItems"); + Session["CartItems"] = cartItems; + Session["CartItemsSize"] = cartItems.Count; + return Json(cartItems); + + } + + + public ActionResult ThanhToan(string array, string name, string email, string address, string phone) + { + //try + //{ + // System.Diagnostics.Debug.WriteLine(array); + // JsonConvert.DeserializeObject(array,typeof(List)); + + + + //} + //catch (Exception e) + //{ + // e.ToString(); + //} + + + + //Insert new user's information + int currentInfo = db.Information.Max(x => x.userID); + //System.Diagnostics.Debug.WriteLine(currentInfo); + Information user = new Information(); + user.name = name; + user.email = email; + user.phoneNumber = phone; + user.address = address; + db.Information.Add(user); + db.SaveChanges(); + currentInfo = db.Information.Max(x => x.userID); + //System.Diagnostics.Debug.WriteLine(currentInfo); + //Insert newInvoice + DateTime today = DateTime.Today; + Invoice newInvoice = new Invoice(); + newInvoice.userID = currentInfo; + newInvoice.orderTIme = today; + db.Invoices.Add(newInvoice); + db.SaveChanges(); + //System.Diagnostics.Debug.WriteLine(today); + //get currentInvoice + int currentInvoice = db.Invoices.Max(x => x.invoiceID); + //System.Diagnostics.Debug.WriteLine(currentInvoice); + + + List cartItems = Session["CartItems"] as List; + //System.Diagnostics.Debug.WriteLine(cartItems.Count); + List listProduct = new List(); + //System.Diagnostics.Debug.WriteLine("Hello"); + for (int i = 0; i < cartItems.Count; i++) + { + int k = (int)cartItems[i].productID; + Product product = db.Products.Single(p => p.productID == k); + + InvoiceLine line = new InvoiceLine(); + line.Note = "Note"; + line.productID = product.productID; + line.invoiceID = currentInvoice; + line.quantity = (int)cartItems[i].quantity; + line.unitPrice = (int)product.price; + db.InvoiceLines.Add(line); + db.SaveChanges(); + int m = db.InvoiceLines.Max(x => x.invoiceID); + //System.Diagnostics.Debug.WriteLine(m); + } + + return Json(currentInfo); + } + + public ActionResult Checkout(int id) + { + System.Diagnostics.Debug.WriteLine(id); + + + int max = db.Information.Max(y => y.userID); + Information currentInfo = db.Information.Single(x => x.userID == max); + + ViewBag.info = currentInfo; + Session.Remove("CartItems"); + Session["CartItemsSize"] = 0; + return View(); + } + + } +} diff --git a/Test/Controllers/HomeController.cs b/Test/Controllers/HomeController.cs index ca398d1..297758a 100644 --- a/Test/Controllers/HomeController.cs +++ b/Test/Controllers/HomeController.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Web; @@ -12,82 +13,77 @@ public class HomeController : Controller Entities db = new Entities(); public ActionResult Index() { - string resultPhones = ""; - string resultLaptops = ""; - var phones = (from p in db.Products where p.productType.Equals("SmartPhone") orderby p.productID select p).Take(8).ToList(); - var laptops= (from p in db.Products where p.productType.Equals("Laptop") orderby p.productID select p).Take(8).ToList(); - for (int i = 0; i < phones.Count; i++) - { - resultPhones += "
" - +"\"Card" - +"
" - +"

"+ phones[i].name+ "

" - + "

$" + phones[i].price + "

" - + "
" - +"
" - +"" - + " Add to cart" - + "
" - +"
" - +"
" - +"" - + " More details" - +"
" - + "
" - + "
" - + "
"; - } + List phonesList = (from p in db.Products where p.productType.Equals("SmartPhone") orderby p.productID select p).Take(8).ToList(); + List lapTopsList= (from p in db.Products where p.productType.Equals("Laptop") orderby p.productID select p).Take(8).ToList(); + List news = (from tblNews in db.News select tblNews).Take(4).ToList(); + ViewBag.phonesList = phonesList; + ViewBag.lapTopsList = lapTopsList; + ViewBag.news = news; + return View(); + } + public ActionResult AddCart(int id, int quantity) + { + try { + List cartItems; + if (Session["CartItems"] == null) + { + cartItems = new List(); + cartItems.Add(new CartItem(id, quantity)); + Session["CartItems"] = cartItems; + Session["CartItemsSize"] = cartItems.Count; + return Json(cartItems, JsonRequestBehavior.AllowGet); + } + else + { + cartItems = Session["CartItems"] as List; + for (int i = 0; i < cartItems.Count; i++) + { + if (cartItems[i].productID == id) + { + cartItems[i].quantity += quantity; + return Json(cartItems); + } + } - for (int i = 0; i < laptops.Count; i++) + cartItems.Add(new CartItem(id, 1)); + Session["CartItemsSize"] = cartItems.Count; + return Json(cartItems); + } + } + catch(Exception e) { - resultLaptops += "
" - + "\"Card" - + "
" - + "

" + laptops[i].name + "

" - + "

$" + phones[i].price + "/p>" - + "

" - + "
" - + "" - + " Add to cart" - + "
" - + "
" - + "
" - + "" - + " More details" - + "
" - + "
" - + "
" - + "
"; + Console.WriteLine(e.ToString()); + return Json("error"); } - ViewBag.phones = resultPhones; - ViewBag.laptops = resultLaptops; - return View(); + + + //ViewBag.id = id; + //return View(); + } - public ActionResult AddCart(int id) + public ActionResult Cart() { - Session["CartProductId"] = id; - ViewBag.id = Session["CartProductId"]; + List cartItems = Session["CartItems"] as List; + ViewBag.cartItems = cartItems; return View(); + } - public ActionResult Cart() + + public ActionResult ViewProduct(int id) { - ViewBag.id = Session["CartProductId"]; + Product product = db.Products.Single(p => p.productID == id); + ViewData["Product"] = product; return View(); } public ActionResult About() { - ViewBag.Message = "Your application description page."; - return View(); } public ActionResult Contact() { - ViewBag.Message = "Your contact page."; - return View(); } - } } \ No newline at end of file diff --git a/Test/Controllers/LapTopPageController.cs b/Test/Controllers/LapTopPageController.cs new file mode 100644 index 0000000..1f69db1 --- /dev/null +++ b/Test/Controllers/LapTopPageController.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Test.Models; +using Newtonsoft.Json; + +namespace Test.Controllers +{ + public class LapTopPageController : Controller + { + + Entities db = new Entities(); + public ActionResult Index() + { + string resultLaptops = ""; + List phonesList = (from p in db.Products where p.productType.Equals("LapTop") orderby p.productID select p).Take(8).ToList(); + ViewBag.phonesList = phonesList; + + return View(); + } + public ActionResult Paging(int page) + { + var pageSize = 8; + int from = page * pageSize - pageSize + 1; + int to = page * pageSize; + + + System.Diagnostics.Debug.WriteLine("page:" + page); + System.Diagnostics.Debug.WriteLine("from:" + from); + System.Diagnostics.Debug.WriteLine("to:" + to); + var phonesList = db.GetLapTopPaging(from, to); + System.Diagnostics.Debug.WriteLine("phonesList:" + phonesList); + var list = JsonConvert.SerializeObject(phonesList, + Formatting.None, + new JsonSerializerSettings() + { + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore + }); + + return Json(list, JsonRequestBehavior.AllowGet); + } + } +} \ No newline at end of file diff --git a/Test/Controllers/NewsController.cs b/Test/Controllers/NewsController.cs new file mode 100644 index 0000000..3b3736c --- /dev/null +++ b/Test/Controllers/NewsController.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Test.Models; + +namespace Test.Controllers +{ + public class NewsController : Controller + { + Entities db = new Entities(); + + // GET: News/ViewPost/id + public ActionResult ViewPost(int id) + { + List news = (from tblNews in db.News select tblNews).Take(4).ToList(); + News currentPost = db.News.Single(p => p.postId == id); + ViewBag.news = news; + ViewBag.currentPost = currentPost; + return View(); + } + } +} \ No newline at end of file diff --git a/Test/Controllers/PhonePageController.cs b/Test/Controllers/PhonePageController.cs new file mode 100644 index 0000000..5d6b7ee --- /dev/null +++ b/Test/Controllers/PhonePageController.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Test.Models; +using Newtonsoft.Json; + +namespace Test.Controllers +{ + public class PhonePageController : Controller + { + Entities db = new Entities(); + public ActionResult Index() + { + List phonesList = (from p in db.Products where p.productType.Equals("SmartPhone") orderby p.productID select p).Take(8).ToList(); + ViewBag.phonesList = phonesList; + + return View(); + } + public ActionResult Paging(int page) + { + var pageSize = 8; + int from = page * pageSize - pageSize + 1; + int to = page * pageSize; + + + System.Diagnostics.Debug.WriteLine("page:" + page); + System.Diagnostics.Debug.WriteLine("from:" + from); + System.Diagnostics.Debug.WriteLine("to:" + to); + var phonesList = db.GetPhonePaging(from,to); + System.Diagnostics.Debug.WriteLine("phonesList:"+phonesList); + var list = JsonConvert.SerializeObject(phonesList, + Formatting.None, + new JsonSerializerSettings() + { + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore + }); + + return Json(list, JsonRequestBehavior.AllowGet); + } + } +} \ No newline at end of file diff --git a/Test/Controllers/SearchController.cs b/Test/Controllers/SearchController.cs new file mode 100644 index 0000000..cc48479 --- /dev/null +++ b/Test/Controllers/SearchController.cs @@ -0,0 +1,56 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Test.Models; + +namespace Test.Controllers +{ + public class SearchController : Controller + { + Entities db = new Entities(); + public ActionResult Index(string searchString) + { + List news = (from tblNews in db.News select tblNews).Take(4).ToList(); + ViewBag.news = news; + if (searchString==null) + { + return View(); + } + else + { + System.Diagnostics.Debug.WriteLine("searchString:" + searchString); + var pageSize = 8; + int from = 1 * pageSize - pageSize + 1; + int to = 1 * pageSize; + var phonesList = db.searchByName(from, to, searchString); + System.Diagnostics.Debug.WriteLine("first:" + phonesList); + ViewBag.phonesList = phonesList.ToList(); + ViewBag.searchString = searchString; + return View(); + } + } + + + + public ActionResult Paging(string searchString, int page) + { + System.Diagnostics.Debug.WriteLine("HEREsearchString:" + searchString); + var pageSize = 8; + int from = page * pageSize - pageSize + 1; + int to = page * pageSize; + var phonesList = db.searchByName(from, to, searchString); + System.Diagnostics.Debug.WriteLine("first:" + phonesList); + var list = JsonConvert.SerializeObject(phonesList, + Formatting.None, + new JsonSerializerSettings() + { + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore + }); + + return Json(list, JsonRequestBehavior.AllowGet); + } + } +} \ No newline at end of file diff --git a/Test/Images/Asus-(Zenfone)42-b_14.jpg b/Test/Images/Asus-(Zenfone)42-b_14.jpg new file mode 100644 index 0000000..aa3294f Binary files /dev/null and b/Test/Images/Asus-(Zenfone)42-b_14.jpg differ diff --git a/Test/Images/BlackBerry42-b_38.png b/Test/Images/BlackBerry42-b_38.png new file mode 100644 index 0000000..9078d64 Binary files /dev/null and b/Test/Images/BlackBerry42-b_38.png differ diff --git a/Test/Images/Laptop1.jpg b/Test/Images/Laptop1.jpg new file mode 100644 index 0000000..a7b0571 Binary files /dev/null and b/Test/Images/Laptop1.jpg differ diff --git a/Test/Images/Laptop2.jpg b/Test/Images/Laptop2.jpg new file mode 100644 index 0000000..02c65b0 Binary files /dev/null and b/Test/Images/Laptop2.jpg differ diff --git a/Test/Images/Laptop3.png b/Test/Images/Laptop3.png new file mode 100644 index 0000000..e617473 Binary files /dev/null and b/Test/Images/Laptop3.png differ diff --git a/Test/Images/Laptop4.jpg b/Test/Images/Laptop4.jpg new file mode 100644 index 0000000..d2ccb1d Binary files /dev/null and b/Test/Images/Laptop4.jpg differ diff --git a/Test/Images/Nokia42-b_21.jpg b/Test/Images/Nokia42-b_21.jpg new file mode 100644 index 0000000..6746be0 Binary files /dev/null and b/Test/Images/Nokia42-b_21.jpg differ diff --git a/Test/Images/OPPO42-b_23.jpg b/Test/Images/OPPO42-b_23.jpg new file mode 100644 index 0000000..2976faf Binary files /dev/null and b/Test/Images/OPPO42-b_23.jpg differ diff --git a/Test/Images/Qt_logo.png b/Test/Images/Qt_logo.png new file mode 100644 index 0000000..7a5f356 Binary files /dev/null and b/Test/Images/Qt_logo.png differ diff --git a/Test/Images/Samsung42-b_25.jpg b/Test/Images/Samsung42-b_25.jpg new file mode 100644 index 0000000..5f0d69d Binary files /dev/null and b/Test/Images/Samsung42-b_25.jpg differ diff --git a/Test/Images/Tablet1.jpg b/Test/Images/Tablet1.jpg new file mode 100644 index 0000000..8725bdf Binary files /dev/null and b/Test/Images/Tablet1.jpg differ diff --git a/Test/Images/Tablet2.jpg b/Test/Images/Tablet2.jpg new file mode 100644 index 0000000..cf95486 Binary files /dev/null and b/Test/Images/Tablet2.jpg differ diff --git a/Test/Images/Tablet3.jpg b/Test/Images/Tablet3.jpg new file mode 100644 index 0000000..ec73f0c Binary files /dev/null and b/Test/Images/Tablet3.jpg differ diff --git a/Test/Images/Tablet4.jpg b/Test/Images/Tablet4.jpg new file mode 100644 index 0000000..584a698 Binary files /dev/null and b/Test/Images/Tablet4.jpg differ diff --git a/Test/Images/Vsmart42-b_40.png b/Test/Images/Vsmart42-b_40.png new file mode 100644 index 0000000..643feb5 Binary files /dev/null and b/Test/Images/Vsmart42-b_40.png differ diff --git a/Test/Images/Xiaomi42-b_31.png b/Test/Images/Xiaomi42-b_31.png new file mode 100644 index 0000000..baea159 Binary files /dev/null and b/Test/Images/Xiaomi42-b_31.png differ diff --git a/Test/Images/bullet.png b/Test/Images/bullet.png new file mode 100644 index 0000000..6f1db9a Binary files /dev/null and b/Test/Images/bullet.png differ diff --git a/Test/Images/header-bg.jpg b/Test/Images/header-bg.jpg new file mode 100644 index 0000000..609fee5 Binary files /dev/null and b/Test/Images/header-bg.jpg differ diff --git a/Test/Images/hot1.jpg b/Test/Images/hot1.jpg new file mode 100644 index 0000000..1eeadd5 Binary files /dev/null and b/Test/Images/hot1.jpg differ diff --git a/Test/Images/hot2.jpg b/Test/Images/hot2.jpg new file mode 100644 index 0000000..b1c19de Binary files /dev/null and b/Test/Images/hot2.jpg differ diff --git a/Test/Images/hot3.jpg b/Test/Images/hot3.jpg new file mode 100644 index 0000000..d1316ec Binary files /dev/null and b/Test/Images/hot3.jpg differ diff --git a/Test/Images/hot4.jpg b/Test/Images/hot4.jpg new file mode 100644 index 0000000..50f6f65 Binary files /dev/null and b/Test/Images/hot4.jpg differ diff --git a/Test/Images/hot5.jpg b/Test/Images/hot5.jpg new file mode 100644 index 0000000..e86b7e1 Binary files /dev/null and b/Test/Images/hot5.jpg differ diff --git a/Test/Images/hot6.jpg b/Test/Images/hot6.jpg new file mode 100644 index 0000000..09465ef Binary files /dev/null and b/Test/Images/hot6.jpg differ diff --git a/Test/Images/hot7.jpg b/Test/Images/hot7.jpg new file mode 100644 index 0000000..7e74676 Binary files /dev/null and b/Test/Images/hot7.jpg differ diff --git a/Test/Images/hot8.jpg b/Test/Images/hot8.jpg new file mode 100644 index 0000000..8cde19e Binary files /dev/null and b/Test/Images/hot8.jpg differ diff --git a/Test/Images/hotnews1.jpg b/Test/Images/hotnews1.jpg new file mode 100644 index 0000000..099358d Binary files /dev/null and b/Test/Images/hotnews1.jpg differ diff --git a/Test/Images/hotnews2.jpg b/Test/Images/hotnews2.jpg new file mode 100644 index 0000000..d23ae83 Binary files /dev/null and b/Test/Images/hotnews2.jpg differ diff --git a/Test/Images/hotnews3.jpg b/Test/Images/hotnews3.jpg new file mode 100644 index 0000000..0c28b3b Binary files /dev/null and b/Test/Images/hotnews3.jpg differ diff --git a/Test/Images/hotnews4.jpg b/Test/Images/hotnews4.jpg new file mode 100644 index 0000000..b480452 Binary files /dev/null and b/Test/Images/hotnews4.jpg differ diff --git a/Test/Images/iPhone-(Apple)42-b_16.jpg b/Test/Images/iPhone-(Apple)42-b_16.jpg new file mode 100644 index 0000000..65cb9ff Binary files /dev/null and b/Test/Images/iPhone-(Apple)42-b_16.jpg differ diff --git a/Test/Images/iphone-6s-32gb--3.jpg b/Test/Images/iphone-6s-32gb--3.jpg new file mode 100644 index 0000000..f826449 Binary files /dev/null and b/Test/Images/iphone-6s-32gb--3.jpg differ diff --git a/Test/Images/iphone-6s-32gb--4.jpg b/Test/Images/iphone-6s-32gb--4.jpg new file mode 100644 index 0000000..6c72f34 Binary files /dev/null and b/Test/Images/iphone-6s-32gb--4.jpg differ diff --git a/Test/Images/iphone-6s-32gb--5.jpg b/Test/Images/iphone-6s-32gb--5.jpg new file mode 100644 index 0000000..9f9d903 Binary files /dev/null and b/Test/Images/iphone-6s-32gb--5.jpg differ diff --git a/Test/Images/iphone-6s-32gb.png b/Test/Images/iphone-6s-32gb.png new file mode 100644 index 0000000..8e7fcf7 Binary files /dev/null and b/Test/Images/iphone-6s-32gb.png differ diff --git a/Test/Images/newspic1.jpg b/Test/Images/newspic1.jpg new file mode 100644 index 0000000..5ca779c Binary files /dev/null and b/Test/Images/newspic1.jpg differ diff --git a/Test/Images/newspic2.jpg b/Test/Images/newspic2.jpg new file mode 100644 index 0000000..c2729ca Binary files /dev/null and b/Test/Images/newspic2.jpg differ diff --git a/Test/Images/newspic3.jpg b/Test/Images/newspic3.jpg new file mode 100644 index 0000000..cd778b6 Binary files /dev/null and b/Test/Images/newspic3.jpg differ diff --git a/Test/Images/newspic4.jpg b/Test/Images/newspic4.jpg new file mode 100644 index 0000000..dedd804 Binary files /dev/null and b/Test/Images/newspic4.jpg differ diff --git a/Test/Images/phone1.jpg b/Test/Images/phone1.jpg new file mode 100644 index 0000000..01473e3 Binary files /dev/null and b/Test/Images/phone1.jpg differ diff --git a/Test/Images/phone2.jpg b/Test/Images/phone2.jpg new file mode 100644 index 0000000..e96431e Binary files /dev/null and b/Test/Images/phone2.jpg differ diff --git a/Test/Images/phone3.jpg b/Test/Images/phone3.jpg new file mode 100644 index 0000000..a0044ea Binary files /dev/null and b/Test/Images/phone3.jpg differ diff --git a/Test/Images/phone4.jpg b/Test/Images/phone4.jpg new file mode 100644 index 0000000..1991b6d Binary files /dev/null and b/Test/Images/phone4.jpg differ diff --git a/Test/Images/poster.jpg b/Test/Images/poster.jpg new file mode 100644 index 0000000..79657fc Binary files /dev/null and b/Test/Images/poster.jpg differ diff --git a/Test/Images/qt.png b/Test/Images/qt.png new file mode 100644 index 0000000..d8f04e7 Binary files /dev/null and b/Test/Images/qt.png differ diff --git a/Test/Images/slide-img-1.png b/Test/Images/slide-img-1.png new file mode 100644 index 0000000..7e0c042 Binary files /dev/null and b/Test/Images/slide-img-1.png differ diff --git a/Test/Images/slide-img-2.png b/Test/Images/slide-img-2.png new file mode 100644 index 0000000..8d5b8b5 Binary files /dev/null and b/Test/Images/slide-img-2.png differ diff --git a/Test/Images/slide-img-3.png b/Test/Images/slide-img-3.png new file mode 100644 index 0000000..6a98fe3 Binary files /dev/null and b/Test/Images/slide-img-3.png differ diff --git a/Test/Images/slide-img-4.png b/Test/Images/slide-img-4.png new file mode 100644 index 0000000..d73d63e Binary files /dev/null and b/Test/Images/slide-img-4.png differ diff --git a/Test/Images/slide-img-5.png b/Test/Images/slide-img-5.png new file mode 100644 index 0000000..9ffb731 Binary files /dev/null and b/Test/Images/slide-img-5.png differ diff --git a/Test/Images/slide-img-6.jpg b/Test/Images/slide-img-6.jpg new file mode 100644 index 0000000..ba6afc8 Binary files /dev/null and b/Test/Images/slide-img-6.jpg differ diff --git a/Test/Images/slide-img-7.jpg b/Test/Images/slide-img-7.jpg new file mode 100644 index 0000000..d8083b0 Binary files /dev/null and b/Test/Images/slide-img-7.jpg differ diff --git a/Test/Images/slide-img-8.jpg b/Test/Images/slide-img-8.jpg new file mode 100644 index 0000000..bf3a71b Binary files /dev/null and b/Test/Images/slide-img-8.jpg differ diff --git a/Test/Images/smartphones_mobile.jpg b/Test/Images/smartphones_mobile.jpg new file mode 100644 index 0000000..48d50de Binary files /dev/null and b/Test/Images/smartphones_mobile.jpg differ diff --git a/Test/Images/vi-vn-1-thietke.jpg b/Test/Images/vi-vn-1-thietke.jpg new file mode 100644 index 0000000..840a1fd Binary files /dev/null and b/Test/Images/vi-vn-1-thietke.jpg differ diff --git a/Test/Models/CartItem.cs b/Test/Models/CartItem.cs new file mode 100644 index 0000000..639a40f --- /dev/null +++ b/Test/Models/CartItem.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace Test.Models +{ + public class CartItem + { + + public CartItem(int productID, int quantity) { + this.quantity = quantity; + this.productID = productID; + } + + public int productID { get; set; } + public int quantity { get; set; } + } +} \ No newline at end of file diff --git a/Test/Models/GetLapTopPaging_Result.cs b/Test/Models/GetLapTopPaging_Result.cs new file mode 100644 index 0000000..00c0d29 --- /dev/null +++ b/Test/Models/GetLapTopPaging_Result.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Test.Models +{ + using System; + + public partial class GetLapTopPaging_Result + { + public int productID { get; set; } + public int shopID { get; set; } + public string name { get; set; } + public string image { get; set; } + public double price { get; set; } + public string productType { get; set; } + public string description { get; set; } + public string OS { get; set; } + public string screen { get; set; } + public string camera { get; set; } + public string CPU { get; set; } + public string RAM { get; set; } + public string PIN { get; set; } + public string SIM { get; set; } + public string innerMemory { get; set; } + public string manufacture { get; set; } + public string guarantee { get; set; } + public Nullable status { get; set; } + public Nullable row { get; set; } + } +} diff --git a/Test/Models/GetPhonePaging_Result.cs b/Test/Models/GetPhonePaging_Result.cs new file mode 100644 index 0000000..f741acb --- /dev/null +++ b/Test/Models/GetPhonePaging_Result.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Test.Models +{ + using System; + + public partial class GetPhonePaging_Result + { + public int productID { get; set; } + public int shopID { get; set; } + public string name { get; set; } + public string image { get; set; } + public double price { get; set; } + public string productType { get; set; } + public string description { get; set; } + public string OS { get; set; } + public string screen { get; set; } + public string camera { get; set; } + public string CPU { get; set; } + public string RAM { get; set; } + public string PIN { get; set; } + public string SIM { get; set; } + public string innerMemory { get; set; } + public string manufacture { get; set; } + public string guarantee { get; set; } + public Nullable status { get; set; } + public Nullable row { get; set; } + } +} diff --git a/Test/Models/GetProductPaging_Result.cs b/Test/Models/GetProductPaging_Result.cs new file mode 100644 index 0000000..08de66d --- /dev/null +++ b/Test/Models/GetProductPaging_Result.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Test.Models +{ + using System; + + public partial class GetProductPaging_Result + { + public int productID { get; set; } + public int shopID { get; set; } + public string name { get; set; } + public string image { get; set; } + public double price { get; set; } + public string productType { get; set; } + public string description { get; set; } + public string OS { get; set; } + public string screen { get; set; } + public string camera { get; set; } + public string CPU { get; set; } + public string RAM { get; set; } + public string PIN { get; set; } + public string SIM { get; set; } + public string innerMemory { get; set; } + public string manufacture { get; set; } + public string guarantee { get; set; } + public Nullable status { get; set; } + public Nullable row { get; set; } + } +} diff --git a/Test/Models/InvoiceLine.cs b/Test/Models/InvoiceLine.cs index 6851967..b28611d 100644 --- a/Test/Models/InvoiceLine.cs +++ b/Test/Models/InvoiceLine.cs @@ -14,6 +14,23 @@ namespace Test.Models public partial class InvoiceLine { + private int nextInvoice; + private int price; + private string v; + + public InvoiceLine(int nextInvoice, int productID, int quantity, int price, string v) + { + this.nextInvoice = nextInvoice; + this.productID = productID; + this.quantity = quantity; + this.price = price; + this.v = v; + } + + public InvoiceLine() + { + } + public int invoiceID { get; set; } public int productID { get; set; } public int quantity { get; set; } diff --git a/Test/Models/News.cs b/Test/Models/News.cs new file mode 100644 index 0000000..2279409 --- /dev/null +++ b/Test/Models/News.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Test.Models +{ + using System; + using System.Collections.Generic; + + public partial class News + { + public int postId { get; set; } + public string title { get; set; } + public string image { get; set; } + public string postContent { get; set; } + public Nullable viewCount { get; set; } + public Nullable commentCount { get; set; } + public Nullable shareCount { get; set; } + } +} diff --git a/Test/Models/Product.Context.cs b/Test/Models/Product.Context.cs index 1d9078c..70e1108 100644 --- a/Test/Models/Product.Context.cs +++ b/Test/Models/Product.Context.cs @@ -12,6 +12,8 @@ namespace Test.Models using System; using System.Data.Entity; using System.Data.Entity.Infrastructure; + using System.Data.Entity.Core.Objects; + using System.Linq; public partial class Entities : DbContext { @@ -28,7 +30,64 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder) public virtual DbSet Information { get; set; } public virtual DbSet Invoices { get; set; } public virtual DbSet InvoiceLines { get; set; } + public virtual DbSet News { get; set; } public virtual DbSet Products { get; set; } public virtual DbSet Shops { get; set; } + + public virtual ObjectResult GetLapTopPaging(Nullable u, Nullable v) + { + var uParameter = u.HasValue ? + new ObjectParameter("u", u) : + new ObjectParameter("u", typeof(int)); + + var vParameter = v.HasValue ? + new ObjectParameter("v", v) : + new ObjectParameter("v", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetLapTopPaging", uParameter, vParameter); + } + + public virtual ObjectResult GetPhonePaging(Nullable u, Nullable v) + { + var uParameter = u.HasValue ? + new ObjectParameter("u", u) : + new ObjectParameter("u", typeof(int)); + + var vParameter = v.HasValue ? + new ObjectParameter("v", v) : + new ObjectParameter("v", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetPhonePaging", uParameter, vParameter); + } + + public virtual ObjectResult GetProductPaging(Nullable u, Nullable v) + { + var uParameter = u.HasValue ? + new ObjectParameter("u", u) : + new ObjectParameter("u", typeof(int)); + + var vParameter = v.HasValue ? + new ObjectParameter("v", v) : + new ObjectParameter("v", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetProductPaging", uParameter, vParameter); + } + + public virtual ObjectResult searchByName(Nullable u, Nullable v, string w) + { + var uParameter = u.HasValue ? + new ObjectParameter("u", u) : + new ObjectParameter("u", typeof(int)); + + var vParameter = v.HasValue ? + new ObjectParameter("v", v) : + new ObjectParameter("v", typeof(int)); + + var wParameter = w != null ? + new ObjectParameter("w", w) : + new ObjectParameter("w", typeof(string)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("searchByName", uParameter, vParameter, wParameter); + } } } diff --git a/Test/Models/Product.Designer.cs b/Test/Models/Product.Designer.cs index 5c74af7..3ebb043 100644 --- a/Test/Models/Product.Designer.cs +++ b/Test/Models/Product.Designer.cs @@ -1,4 +1,4 @@ -// T4 code generation is enabled for model 'C:\Users\ASUS\Desktop\semester5\QTOnline\ProjectCSharp\Test\Models\Product.edmx'. +// T4 code generation is enabled for model 'E:\Study FPT\KY 5\PRN292\ProjectCSharp\Test\Models\Product.edmx'. // To enable legacy code generation, change the value of the 'Code Generation Strategy' designer // property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model // is open in the designer. diff --git a/Test/Models/Product.edmx b/Test/Models/Product.edmx index 6a1b3bc..7516789 100644 --- a/Test/Models/Product.edmx +++ b/Test/Models/Product.edmx @@ -34,6 +34,18 @@ + + + + + + + + + + + + @@ -65,7 +77,7 @@ - + @@ -101,13 +113,31 @@ + + + + + + + + + + + + + + + + + + - + @@ -134,7 +164,7 @@ - + @@ -143,7 +173,7 @@ - + @@ -159,6 +189,18 @@ + + + + + + + + + + + + @@ -191,7 +233,7 @@ - + @@ -231,9 +273,10 @@ + - + @@ -245,7 +288,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -283,6 +427,19 @@ + + + + + + + + + + + + + @@ -316,6 +473,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Test/Models/Product.edmx.diagram b/Test/Models/Product.edmx.diagram index 250d42f..c53d7f4 100644 --- a/Test/Models/Product.edmx.diagram +++ b/Test/Models/Product.edmx.diagram @@ -4,13 +4,14 @@ - - - - - - - + + + + + + + + diff --git a/Test/Models/searchByName_Result.cs b/Test/Models/searchByName_Result.cs new file mode 100644 index 0000000..25025ce --- /dev/null +++ b/Test/Models/searchByName_Result.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Test.Models +{ + using System; + + public partial class searchByName_Result + { + public int productID { get; set; } + public int shopID { get; set; } + public string name { get; set; } + public string image { get; set; } + public double price { get; set; } + public string productType { get; set; } + public string description { get; set; } + public string OS { get; set; } + public string screen { get; set; } + public string camera { get; set; } + public string CPU { get; set; } + public string RAM { get; set; } + public string PIN { get; set; } + public string SIM { get; set; } + public string innerMemory { get; set; } + public string manufacture { get; set; } + public string guarantee { get; set; } + public Nullable status { get; set; } + public Nullable row { get; set; } + } +} diff --git a/Test/Scripts/_references.js b/Test/Scripts/_references.js index cbe7a47..86e5958 100644 Binary files a/Test/Scripts/_references.js and b/Test/Scripts/_references.js differ diff --git a/Test/Scripts/bootstrap.min.js b/Test/Scripts/bootstrap.min.js index 9c96832..d9c72df 100644 --- a/Test/Scripts/bootstrap.min.js +++ b/Test/Scripts/bootstrap.min.js @@ -1,21 +1,7 @@ -/* NUGET: BEGIN LICENSE TEXT - * - * Microsoft grants you the right to use these script files for the sole - * purpose of either: (i) interacting through your browser with the Microsoft - * website or online service, subject to the applicable licensing or use - * terms; or (ii) using the files as included with a Microsoft product subject - * to that product's license terms. Microsoft reserves all other rights to the - * files not expressly granted by Microsoft, whether by implication, estoppel - * or otherwise. Insofar as a script file is dual licensed under GPL, - * Microsoft neither took the code under GPL nor distributes it thereunder but - * under the terms set out in this paragraph. All notices and licenses - * below are for informational purposes only. - * - * NUGET: END LICENSE TEXT */ - -/** -* bootstrap.js v3.0.0 by @fat and @mdo -* Copyright 2013 Twitter Inc. -* http://www.apache.org/licenses/LICENSE-2.0 -*/ -if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery); \ No newline at end of file +/*! + * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com) + * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");+function(t){var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(jQuery),+function(){function t(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;nthis._items.length-1||e<0)){if(this._isSliding)return void t(this._element).one(m.SLID,function(){return n.to(e)});if(i===e)return this.pause(),void this.cycle();var o=e>i?p.NEXT:p.PREVIOUS;this._slide(o,this._items[e])}},h.prototype.dispose=function(){t(this._element).off(l),t.removeData(this._element,a),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},h.prototype._getConfig=function(n){return n=t.extend({},_,n),r.typeCheckConfig(e,n,g),n},h.prototype._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(m.KEYDOWN,function(t){return e._keydown(t)}),"hover"!==this._config.pause||"ontouchstart"in document.documentElement||t(this._element).on(m.MOUSEENTER,function(t){return e.pause(t)}).on(m.MOUSELEAVE,function(t){return e.cycle(t)})},h.prototype._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case d:t.preventDefault(),this.prev();break;case f:t.preventDefault(),this.next();break;default:return}},h.prototype._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(v.ITEM)),this._items.indexOf(e)},h.prototype._getItemByDirection=function(t,e){var n=t===p.NEXT,i=t===p.PREVIOUS,o=this._getItemIndex(e),r=this._items.length-1,s=i&&0===o||n&&o===r;if(s&&!this._config.wrap)return e;var a=t===p.PREVIOUS?-1:1,l=(o+a)%this._items.length;return l===-1?this._items[this._items.length-1]:this._items[l]},h.prototype._triggerSlideEvent=function(e,n){var i=t.Event(m.SLIDE,{relatedTarget:e,direction:n});return t(this._element).trigger(i),i},h.prototype._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(v.ACTIVE).removeClass(E.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(E.ACTIVE)}},h.prototype._slide=function(e,n){var i=this,o=t(this._element).find(v.ACTIVE_ITEM)[0],s=n||o&&this._getItemByDirection(e,o),a=Boolean(this._interval),l=void 0,h=void 0,c=void 0;if(e===p.NEXT?(l=E.LEFT,h=E.NEXT,c=p.LEFT):(l=E.RIGHT,h=E.PREV,c=p.RIGHT),s&&t(s).hasClass(E.ACTIVE))return void(this._isSliding=!1);var d=this._triggerSlideEvent(s,c);if(!d.isDefaultPrevented()&&o&&s){this._isSliding=!0,a&&this.pause(),this._setActiveIndicatorElement(s);var f=t.Event(m.SLID,{relatedTarget:s,direction:c});r.supportsTransitionEnd()&&t(this._element).hasClass(E.SLIDE)?(t(s).addClass(h),r.reflow(s),t(o).addClass(l),t(s).addClass(l),t(o).one(r.TRANSITION_END,function(){t(s).removeClass(l+" "+h).addClass(E.ACTIVE),t(o).removeClass(E.ACTIVE+" "+h+" "+l),i._isSliding=!1,setTimeout(function(){return t(i._element).trigger(f)},0)}).emulateTransitionEnd(u)):(t(o).removeClass(E.ACTIVE),t(s).addClass(E.ACTIVE),this._isSliding=!1,t(this._element).trigger(f)),a&&this.cycle()}},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o=t.extend({},_,t(this).data());"object"===("undefined"==typeof e?"undefined":i(e))&&t.extend(o,e);var r="string"==typeof e?e:o.slide;if(n||(n=new h(this,o),t(this).data(a,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(void 0===n[r])throw new Error('No method named "'+r+'"');n[r]()}else o.interval&&(n.pause(),n.cycle())})},h._dataApiClickHandler=function(e){var n=r.getSelectorFromElement(this);if(n){var i=t(n)[0];if(i&&t(i).hasClass(E.CAROUSEL)){var o=t.extend({},t(i).data(),t(this).data()),s=this.getAttribute("data-slide-to");s&&(o.interval=!1),h._jQueryInterface.call(t(i),o),s&&t(i).data(a).to(s),e.preventDefault()}}},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return _}}]),h}();return t(document).on(m.CLICK_DATA_API,v.DATA_SLIDE,T._dataApiClickHandler),t(window).on(m.LOAD_DATA_API,function(){t(v.DATA_RIDE).each(function(){var e=t(this);T._jQueryInterface.call(e,e.data())})}),t.fn[e]=T._jQueryInterface,t.fn[e].Constructor=T,t.fn[e].noConflict=function(){return t.fn[e]=c,T._jQueryInterface},T}(jQuery),function(t){var e="collapse",s="4.0.0-alpha.6",a="bs.collapse",l="."+a,h=".data-api",c=t.fn[e],u=600,d={toggle:!0,parent:""},f={toggle:"boolean",parent:"string"},_={SHOW:"show"+l,SHOWN:"shown"+l,HIDE:"hide"+l,HIDDEN:"hidden"+l,CLICK_DATA_API:"click"+l+h},g={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},p={WIDTH:"width",HEIGHT:"height"},m={ACTIVES:".card > .show, .card > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},E=function(){function l(e,i){n(this,l),this._isTransitioning=!1,this._element=e,this._config=this._getConfig(i),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],'+('[data-toggle="collapse"][data-target="#'+e.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return l.prototype.toggle=function(){t(this._element).hasClass(g.SHOW)?this.hide():this.show()},l.prototype.show=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(!t(this._element).hasClass(g.SHOW)){var n=void 0,i=void 0;if(this._parent&&(n=t.makeArray(t(this._parent).find(m.ACTIVES)),n.length||(n=null)),!(n&&(i=t(n).data(a),i&&i._isTransitioning))){var o=t.Event(_.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){n&&(l._jQueryInterface.call(t(n),"hide"),i||t(n).data(a,null));var s=this._getDimension();t(this._element).removeClass(g.COLLAPSE).addClass(g.COLLAPSING),this._element.style[s]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&t(this._triggerArray).removeClass(g.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var h=function(){t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).addClass(g.SHOW),e._element.style[s]="",e.setTransitioning(!1),t(e._element).trigger(_.SHOWN)};if(!r.supportsTransitionEnd())return void h();var c=s[0].toUpperCase()+s.slice(1),d="scroll"+c;t(this._element).one(r.TRANSITION_END,h).emulateTransitionEnd(u),this._element.style[s]=this._element[d]+"px"}}}},l.prototype.hide=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(t(this._element).hasClass(g.SHOW)){var n=t.Event(_.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension(),o=i===p.WIDTH?"offsetWidth":"offsetHeight";this._element.style[i]=this._element[o]+"px",r.reflow(this._element),t(this._element).addClass(g.COLLAPSING).removeClass(g.COLLAPSE).removeClass(g.SHOW),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&t(this._triggerArray).addClass(g.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var s=function(){e.setTransitioning(!1),t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).trigger(_.HIDDEN)};return this._element.style[i]="",r.supportsTransitionEnd()?void t(this._element).one(r.TRANSITION_END,s).emulateTransitionEnd(u):void s()}}},l.prototype.setTransitioning=function(t){this._isTransitioning=t},l.prototype.dispose=function(){t.removeData(this._element,a),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},l.prototype._getConfig=function(n){return n=t.extend({},d,n),n.toggle=Boolean(n.toggle),r.typeCheckConfig(e,n,f),n},l.prototype._getDimension=function(){var e=t(this._element).hasClass(p.WIDTH);return e?p.WIDTH:p.HEIGHT},l.prototype._getParent=function(){var e=this,n=t(this._config.parent)[0],i='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return t(n).find(i).each(function(t,n){e._addAriaAndCollapsedClass(l._getTargetFromElement(n),[n])}),n},l.prototype._addAriaAndCollapsedClass=function(e,n){if(e){var i=t(e).hasClass(g.SHOW);e.setAttribute("aria-expanded",i),n.length&&t(n).toggleClass(g.COLLAPSED,!i).attr("aria-expanded",i)}},l._getTargetFromElement=function(e){var n=r.getSelectorFromElement(e);return n?t(n)[0]:null},l._jQueryInterface=function(e){return this.each(function(){var n=t(this),o=n.data(a),r=t.extend({},d,n.data(),"object"===("undefined"==typeof e?"undefined":i(e))&&e);if(!o&&r.toggle&&/show|hide/.test(e)&&(r.toggle=!1),o||(o=new l(this,r),n.data(a,o)),"string"==typeof e){if(void 0===o[e])throw new Error('No method named "'+e+'"');o[e]()}})},o(l,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return d}}]),l}();return t(document).on(_.CLICK_DATA_API,m.DATA_TOGGLE,function(e){e.preventDefault();var n=E._getTargetFromElement(this),i=t(n).data(a),o=i?"toggle":t(this).data();E._jQueryInterface.call(t(n),o)}),t.fn[e]=E._jQueryInterface,t.fn[e].Constructor=E,t.fn[e].noConflict=function(){return t.fn[e]=c,E._jQueryInterface},E}(jQuery),function(t){var e="dropdown",i="4.0.0-alpha.6",s="bs.dropdown",a="."+s,l=".data-api",h=t.fn[e],c=27,u=38,d=40,f=3,_={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK:"click"+a,CLICK_DATA_API:"click"+a+l,FOCUSIN_DATA_API:"focusin"+a+l,KEYDOWN_DATA_API:"keydown"+a+l},g={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",SHOW:"show"},p={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},m=function(){function e(t){n(this,e),this._element=t,this._addEventListeners()}return e.prototype.toggle=function(){if(this.disabled||t(this).hasClass(g.DISABLED))return!1;var n=e._getParentFromElement(this),i=t(n).hasClass(g.SHOW);if(e._clearMenus(),i)return!1;if("ontouchstart"in document.documentElement&&!t(n).closest(p.NAVBAR_NAV).length){var o=document.createElement("div");o.className=g.BACKDROP,t(o).insertBefore(this),t(o).on("click",e._clearMenus)}var r={relatedTarget:this},s=t.Event(_.SHOW,r);return t(n).trigger(s),!s.isDefaultPrevented()&&(this.focus(),this.setAttribute("aria-expanded",!0),t(n).toggleClass(g.SHOW),t(n).trigger(t.Event(_.SHOWN,r)),!1)},e.prototype.dispose=function(){t.removeData(this._element,s),t(this._element).off(a),this._element=null},e.prototype._addEventListeners=function(){t(this._element).on(_.CLICK,this.toggle)},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data(s);if(i||(i=new e(this),t(this).data(s,i)),"string"==typeof n){if(void 0===i[n])throw new Error('No method named "'+n+'"');i[n].call(this)}})},e._clearMenus=function(n){if(!n||n.which!==f){var i=t(p.BACKDROP)[0];i&&i.parentNode.removeChild(i);for(var o=t.makeArray(t(p.DATA_TOGGLE)),r=0;r0&&a--,n.which===d&&adocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},h.prototype._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},h.prototype._checkScrollbar=function(){this._isBodyOverflowing=document.body.clientWidth=n){var i=this._targets[this._targets.length-1];return void(this._activeTarget!==i&&this._activate(i))}if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){var r=this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t "+g.NAV_LINKS).addClass(_.ACTIVE),t(this._scrollElement).trigger(f.ACTIVATE,{relatedTarget:e})},h.prototype._clear=function(){t(this._selector).filter(g.ACTIVE).removeClass(_.ACTIVE)},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===("undefined"==typeof e?"undefined":i(e))&&e; +if(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return u}}]),h}();return t(window).on(f.LOAD_DATA_API,function(){for(var e=t.makeArray(t(g.DATA_SPY)),n=e.length;n--;){var i=t(e[n]);m._jQueryInterface.call(i,i.data())}}),t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=c,m._jQueryInterface},m}(jQuery),function(t){var e="tab",i="4.0.0-alpha.6",s="bs.tab",a="."+s,l=".data-api",h=t.fn[e],c=150,u={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK_DATA_API:"click"+a+l},d={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",DISABLED:"disabled",FADE:"fade",SHOW:"show"},f={A:"a",LI:"li",DROPDOWN:".dropdown",LIST:"ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)",FADE_CHILD:"> .nav-item .fade, > .fade",ACTIVE:".active",ACTIVE_CHILD:"> .nav-item > .active, > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},_=function(){function e(t){n(this,e),this._element=t}return e.prototype.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(d.ACTIVE)||t(this._element).hasClass(d.DISABLED))){var n=void 0,i=void 0,o=t(this._element).closest(f.LIST)[0],s=r.getSelectorFromElement(this._element);o&&(i=t.makeArray(t(o).find(f.ACTIVE)),i=i[i.length-1]);var a=t.Event(u.HIDE,{relatedTarget:this._element}),l=t.Event(u.SHOW,{relatedTarget:i});if(i&&t(i).trigger(a),t(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=t(s)[0]),this._activate(this._element,o);var h=function(){var n=t.Event(u.HIDDEN,{relatedTarget:e._element}),o=t.Event(u.SHOWN,{relatedTarget:i});t(i).trigger(n),t(e._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},e.prototype.dispose=function(){t.removeClass(this._element,s),this._element=null},e.prototype._activate=function(e,n,i){var o=this,s=t(n).find(f.ACTIVE_CHILD)[0],a=i&&r.supportsTransitionEnd()&&(s&&t(s).hasClass(d.FADE)||Boolean(t(n).find(f.FADE_CHILD)[0])),l=function(){return o._transitionComplete(e,s,a,i)};s&&a?t(s).one(r.TRANSITION_END,l).emulateTransitionEnd(c):l(),s&&t(s).removeClass(d.SHOW)},e.prototype._transitionComplete=function(e,n,i,o){if(n){t(n).removeClass(d.ACTIVE);var s=t(n.parentNode).find(f.DROPDOWN_ACTIVE_CHILD)[0];s&&t(s).removeClass(d.ACTIVE),n.setAttribute("aria-expanded",!1)}if(t(e).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0),i?(r.reflow(e),t(e).addClass(d.SHOW)):t(e).removeClass(d.FADE),e.parentNode&&t(e.parentNode).hasClass(d.DROPDOWN_MENU)){var a=t(e).closest(f.DROPDOWN)[0];a&&t(a).find(f.DROPDOWN_TOGGLE).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0)}o&&o()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data(s);if(o||(o=new e(this),i.data(s,o)),"string"==typeof n){if(void 0===o[n])throw new Error('No method named "'+n+'"');o[n]()}})},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();return t(document).on(u.CLICK_DATA_API,f.DATA_TOGGLE,function(e){e.preventDefault(),_._jQueryInterface.call(t(this),"show")}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=h,_._jQueryInterface},_}(jQuery),function(t){if("undefined"==typeof Tether)throw new Error("Bootstrap tooltips require Tether (http://tether.io/)");var e="tooltip",s="4.0.0-alpha.6",a="bs.tooltip",l="."+a,h=t.fn[e],c=150,u="bs-tether",d={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:[],container:!1},f={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"string",constraints:"array",container:"(string|element|boolean)"},_={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},g={SHOW:"show",OUT:"out"},p={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,INSERTED:"inserted"+l,CLICK:"click"+l,FOCUSIN:"focusin"+l,FOCUSOUT:"focusout"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l},m={FADE:"fade",SHOW:"show"},E={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},v={element:!1,enabled:!1},T={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},I=function(){function h(t,e){n(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._isTransitioning=!1,this._tether=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}return h.prototype.enable=function(){this._isEnabled=!0},h.prototype.disable=function(){this._isEnabled=!1},h.prototype.toggleEnabled=function(){this._isEnabled=!this._isEnabled},h.prototype.toggle=function(e){if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(m.SHOW))return void this._leave(null,this);this._enter(null,this)}},h.prototype.dispose=function(){clearTimeout(this._timeout),this.cleanupTether(),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null},h.prototype.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){if(this._isTransitioning)throw new Error("Tooltip is transitioning");t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var o=this.getTipElement(),s=r.getUID(this.constructor.NAME);o.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(o).addClass(m.FADE);var a="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,l=this._getAttachment(a),c=this.config.container===!1?document.body:t(this.config.container);t(o).data(this.constructor.DATA_KEY,this).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({attachment:l,element:o,target:this.element,classes:v,classPrefix:u,offset:this.config.offset,constraints:this.config.constraints,addTargetClasses:!1}),r.reflow(o),this._tether.position(),t(o).addClass(m.SHOW);var d=function(){var n=e._hoverState;e._hoverState=null,e._isTransitioning=!1,t(e.element).trigger(e.constructor.Event.SHOWN),n===g.OUT&&e._leave(null,e)};if(r.supportsTransitionEnd()&&t(this.tip).hasClass(m.FADE))return this._isTransitioning=!0,void t(this.tip).one(r.TRANSITION_END,d).emulateTransitionEnd(h._TRANSITION_DURATION);d()}},h.prototype.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE);if(this._isTransitioning)throw new Error("Tooltip is transitioning");var s=function(){n._hoverState!==g.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),n._isTransitioning=!1,n.cleanupTether(),e&&e()};t(this.element).trigger(o),o.isDefaultPrevented()||(t(i).removeClass(m.SHOW),this._activeTrigger[T.CLICK]=!1,this._activeTrigger[T.FOCUS]=!1,this._activeTrigger[T.HOVER]=!1,r.supportsTransitionEnd()&&t(this.tip).hasClass(m.FADE)?(this._isTransitioning=!0,t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(c)):s(),this._hoverState="")},h.prototype.isWithContent=function(){return Boolean(this.getTitle())},h.prototype.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0]},h.prototype.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(E.TOOLTIP_INNER),this.getTitle()),e.removeClass(m.FADE+" "+m.SHOW),this.cleanupTether()},h.prototype.setElementContent=function(e,n){var o=this.config.html;"object"===("undefined"==typeof n?"undefined":i(n))&&(n.nodeType||n.jquery)?o?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[o?"html":"text"](n)},h.prototype.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},h.prototype.cleanupTether=function(){this._tether&&this._tether.destroy()},h.prototype._getAttachment=function(t){return _[t.toUpperCase()]},h.prototype._setListeners=function(){var e=this,n=this.config.trigger.split(" ");n.forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==T.MANUAL){var i=n===T.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,o=n===T.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(o,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=t.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},h.prototype._fixTitle=function(){var t=i(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},h.prototype._enter=function(e,n){var i=this.constructor.DATA_KEY;return n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?T.FOCUS:T.HOVER]=!0),t(n.getTipElement()).hasClass(m.SHOW)||n._hoverState===g.SHOW?void(n._hoverState=g.SHOW):(clearTimeout(n._timeout),n._hoverState=g.SHOW,n.config.delay&&n.config.delay.show?void(n._timeout=setTimeout(function(){n._hoverState===g.SHOW&&n.show()},n.config.delay.show)):void n.show())},h.prototype._leave=function(e,n){var i=this.constructor.DATA_KEY;if(n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?T.FOCUS:T.HOVER]=!1),!n._isWithActiveTrigger())return clearTimeout(n._timeout),n._hoverState=g.OUT,n.config.delay&&n.config.delay.hide?void(n._timeout=setTimeout(function(){n._hoverState===g.OUT&&n.hide()},n.config.delay.hide)):void n.hide()},h.prototype._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},h.prototype._getConfig=function(n){return n=t.extend({},this.constructor.Default,t(this.element).data(),n),n.delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},h.prototype._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===("undefined"==typeof e?"undefined":i(e))&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e)){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return a}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return l}},{key:"DefaultType",get:function(){return f}}]),h}();return t.fn[e]=I._jQueryInterface,t.fn[e].Constructor=I,t.fn[e].noConflict=function(){return t.fn[e]=h,I._jQueryInterface},I}(jQuery));(function(r){var a="popover",l="4.0.0-alpha.6",h="bs.popover",c="."+h,u=r.fn[a],d=r.extend({},s.Default,{placement:"right",trigger:"click",content:"",template:''}),f=r.extend({},s.DefaultType,{content:"(string|element|function)"}),_={FADE:"fade",SHOW:"show"},g={TITLE:".popover-title",CONTENT:".popover-content"},p={HIDE:"hide"+c,HIDDEN:"hidden"+c,SHOW:"show"+c,SHOWN:"shown"+c,INSERTED:"inserted"+c,CLICK:"click"+c,FOCUSIN:"focusin"+c,FOCUSOUT:"focusout"+c,MOUSEENTER:"mouseenter"+c,MOUSELEAVE:"mouseleave"+c},m=function(s){function u(){return n(this,u),t(this,s.apply(this,arguments))}return e(u,s),u.prototype.isWithContent=function(){return this.getTitle()||this._getContent()},u.prototype.getTipElement=function(){return this.tip=this.tip||r(this.config.template)[0]},u.prototype.setContent=function(){var t=r(this.getTipElement());this.setElementContent(t.find(g.TITLE),this.getTitle()),this.setElementContent(t.find(g.CONTENT),this._getContent()),t.removeClass(_.FADE+" "+_.SHOW),this.cleanupTether()},u.prototype._getContent=function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)},u._jQueryInterface=function(t){return this.each(function(){var e=r(this).data(h),n="object"===("undefined"==typeof t?"undefined":i(t))?t:null;if((e||!/destroy|hide/.test(t))&&(e||(e=new u(this,n),r(this).data(h,e)),"string"==typeof t)){if(void 0===e[t])throw new Error('No method named "'+t+'"');e[t]()}})},o(u,null,[{key:"VERSION",get:function(){return l}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return a}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return c}},{key:"DefaultType",get:function(){return f}}]),u}(s);return r.fn[a]=m._jQueryInterface,r.fn[a].Constructor=m,r.fn[a].noConflict=function(){return r.fn[a]=u,m._jQueryInterface},m})(jQuery)}(); \ No newline at end of file diff --git a/Test/Scripts/index.js b/Test/Scripts/index.js new file mode 100644 index 0000000..cfcb5be --- /dev/null +++ b/Test/Scripts/index.js @@ -0,0 +1,158 @@ +function addToCart(id) { + $.ajax({ + url: "/Home/AddCart/" + id + "/1", + type: 'Post', + success: function (body) { + console.log(body) + var cartItemsSize = $('#cartItemsSize'); + cartItemsSize.text(body.length); + }, + error: function (body) { + console.log(body) + } + }) +} +var pushProductSession = function () { + + + $(".pushProduct").click((e) => { + var id = e.target.getAttribute("id"); + var quantity = document.getElementById(id).value; + $.ajax({ + url: "/Cart/UpdateProductSession/"+id+"/"+quantity, + type: 'POST', + success: function (data) { + console.log("update successfully"); + var cartItemsSize = $('#cartItemsSize'); + cartItemsSize.text(data.length); + window.location.href = "/Cart/ViewCart"; + + }, + error: function (err) { + console.log(err); + } + }); + }); +}; + +$(".removeItem").click((e) => { + + var id = e.target.getAttribute("data-id"); + console.log(id); + $(".formRemoveProduct").submit((e) => { + e.preventDefault(); + $.ajax({ + url: "/Cart/RemoveProduct/" + id, + type: 'POST', + success: function (data) { + var cartItemsSize = $('#cartItemsSize'); + cartItemsSize.text(data.length); + window.location.href = "/Cart/ViewCart"; + //$('#item' + deletedId).remove(); + + }, + error: function (err) { + console.log(err); + } + }); + }); + +}); + +$('.loadMore').click(() => { + console.log($(".loadMore").attr("page")) + $.ajax({ + url: $(".loadMore").attr("url") + $(".loadMore").attr("page"), + type: 'get', + success: function (data) { + console.log("here") + dataFinal = JSON.parse(data) + if (dataFinal.length == 0) { + $(".loadMore").hide(); + return; + } + for (var i = 0; i < dataFinal.length; i++) { + $("#listProductCategory") + .append(function(){ + var html = `
+ Card image cap +
+

`+dataFinal[i].name+`

+

$`+dataFinal[i].price+`

+
+ +
+ +
+
+
+ ` + return html; + }) + } + console.log("old: " + parseInt($(".loadMore").attr("page"))) + var page = parseInt($(".loadMore").attr("page")) + 1; + console.log("new:" + page) + $(".loadMore").attr("page", page); + }, + error: function (err) { + console.log(err); + } + }) +}) + + + +$('.searchButton').click(() => { + console.log("search ne") + $.ajax({ + url: '/Search/Paging?searchString=' + $(".form-control").val() + "&page=" + $(".searchButton").attr("page"), + type: 'get', + success: function (data) { + console.log("here") + dataFinal = JSON.parse(data) + if (dataFinal.length == 0) { + $(".searchButton").hide(); + return; + } + for (var i = 0; i < dataFinal.length; i++) { + $("#listProductCategory") + .append(function () { + var html = `
+ Card image cap +
+

`+ dataFinal[i].name + `

+

$`+ dataFinal[i].price + `

+
+ +
+ +
+
+
+ ` + return html; + }) + } + console.log("old: " + parseInt($(".searchButton").attr("page"))) + var page = parseInt($(".searchButton").attr("page")) + 1; + console.log("new:" + page) + $(".searchButton").attr("page", page); + }, + error: function (err) { + console.log(err); + } + }) +}) \ No newline at end of file diff --git a/Test/Scripts/jquery-3.1.1.slim.min.js b/Test/Scripts/jquery-3.1.1.slim.min.js new file mode 100644 index 0000000..a240ca9 --- /dev/null +++ b/Test/Scripts/jquery-3.1.1.slim.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.1.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/animatedSelector,-effects/Tween,-deprecated | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/animatedSelector,-effects/Tween,-deprecated",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1, +holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}}),r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var Ya,Za=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?Ya:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),Ya={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=Za[b]||r.find.attr;Za[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=Za[g],Za[g]=e,e=null!=c(a,b,d)?g:null,Za[g]=f),e}});var $a=/^(?:input|select|textarea|button)$/i,_a=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):$a.test(a.nodeName)||_a.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function ab(a){var b=a.match(K)||[];return b.join(" ")}function bb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,bb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=bb(c),d=1===c.nodeType&&" "+ab(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=ab(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,bb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=bb(c),d=1===c.nodeType&&" "+ab(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=ab(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,bb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=bb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+ab(bb(c))+" ").indexOf(b)>-1)return!0;return!1}});var cb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(cb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:ab(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var db=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!db.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,db.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var eb=/\[\]$/,fb=/\r?\n/g,gb=/^(?:submit|button|image|reset|file)$/i,hb=/^(?:input|select|textarea|keygen)/i;function ib(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||eb.test(a)?d(a,e):ib(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d); +});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)ib(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)ib(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&hb.test(this.nodeName)&&!gb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(fb,"\r\n")}}):{name:b.name,value:c.replace(fb,"\r\n")}}).get()}}),r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="
",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=pa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))};function jb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=jb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||qa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=jb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Oa(o.pixelPosition,function(a,c){if(c)return c=Na(a,b),La.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var kb=a.jQuery,lb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=lb),b&&a.jQuery===r&&(a.jQuery=kb),r},b||(a.jQuery=a.$=r),r}); diff --git a/Test/Test.csproj b/Test/Test.csproj index 4d17ee1..9947502 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -80,6 +80,10 @@ + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + @@ -88,6 +92,14 @@ + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + True + @@ -198,12 +210,27 @@ + + + + + Global.asax + + + Product.tt + + + Product.tt + + + Product.tt + Product.tt @@ -215,6 +242,9 @@ Product.tt + + Product.tt + True True @@ -233,6 +263,9 @@ True Product.tt + + Product.tt + Product.tt @@ -272,6 +305,7 @@ Product.edmx + @@ -283,7 +317,9 @@ - + + Designer + Web.config @@ -319,6 +355,16 @@ + + + + + + + + + + diff --git a/Test/Views/Cart/Checkout.cshtml b/Test/Views/Cart/Checkout.cshtml new file mode 100644 index 0000000..fabe0df --- /dev/null +++ b/Test/Views/Cart/Checkout.cshtml @@ -0,0 +1,86 @@ +@using Test.Models; +@{ + ViewBag.Title = "Checkout"; + Layout = "~/Views/Shared/_Layout.cshtml"; + double total = 0; + Entities db = new Entities(); + int k = ViewBag.info.userID; + List products = new List(); + products = (from info in db.Information + join invoice in db.Invoices on info.userID equals invoice.userID + join line in db.InvoiceLines on invoice.invoiceID equals line.invoiceID + join product in db.Products on line.productID equals product.productID + where info.userID == k + select product).ToList(); + + List invoiceLines = new List(); + invoiceLines = (from info in db.Information + join invoice in db.Invoices on info.userID equals invoice.userID + join line in db.InvoiceLines on invoice.invoiceID equals line.invoiceID + join product in db.Products on line.productID equals product.productID + where info.userID == k + select line).ToList(); + + foreach (var x in products) + { + foreach (var y in invoiceLines) + { + if (x.productID == y.productID) + { + total += x.price * y.quantity; + } + } + } +} + +
+
+ + +
+
+

Hello, @ViewBag.info.name

+

Address: @ViewBag.info.address

+

Phone: @ViewBag.info.phoneNumber

+ +
+ + + + + + + + + + + + + @foreach (var x in products) + { + + + + + + @foreach (var y in invoiceLines) + { + if (x.productID == y.productID && y.quantity>0) + { + + } + } + + + + } + +
ProductIDNameImagePriceQuantity
@x.productID@x.nameProductImg@x.price@y.quantity
+ +

Your total price: @total Đ

+
+
+
diff --git a/Test/Views/Cart/ViewCart.cshtml b/Test/Views/Cart/ViewCart.cshtml new file mode 100644 index 0000000..b6be56d --- /dev/null +++ b/Test/Views/Cart/ViewCart.cshtml @@ -0,0 +1,160 @@ + +@using Test.Models +@{ + ViewBag.Title = "ViewCart"; + Layout = "~/Views/Shared/_Layout.cshtml"; + int sum = 0; + List listInvoiceLine = ViewBag.listInvoiceLine != null ? ViewBag.listInvoiceLine : null; + if (ViewBag.listProduct != null) + { + for (var i = 0; i < ViewBag.listProduct.Count; i++) + { + sum += (int)ViewBag.listProduct[i].price * ViewBag.listInvoiceLine[i].quantity; + } + + int total = ViewBag.listProduct.Count; + } + +} + + + + + +@if (ViewBag.listProduct != null && ViewBag.listInvoiceLine != null) +{ +
+ @foreach (var x in ViewBag.listProduct) + { + +
+
+ +
+
+ +
+ + ProductImg +
@x.image
+
@x.shopID
+
+
@x.name
+ @foreach (var y in ViewBag.listInvoiceLine) + { + if (x.productID == y.productID) + { + + } + } + +
$@x.price
+
+
+
+ +
+ +
+
+
+
+ } +
+
+
+
+

Thông tin đơn hàng

+

Tạm tính

+
+ $@sum +
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ +
+
+
+} +else +{ +
+ + + +
+} + + + + + + diff --git a/Test/Views/Home/About.cshtml b/Test/Views/Home/About.cshtml index 4b2d9e8..b8c1fb7 100644 --- a/Test/Views/Home/About.cshtml +++ b/Test/Views/Home/About.cshtml @@ -5,3 +5,22 @@

@ViewBag.Message

Use this area to provide additional information.

+

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text + ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. + It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. + It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with + desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

+

+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text + ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. + It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. + It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with + desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. +

+

+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text + ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. + It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. + It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with + desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. +

\ No newline at end of file diff --git a/Test/Views/Home/Cart.cshtml b/Test/Views/Home/Cart.cshtml index a3c6863..81d0524 100644 --- a/Test/Views/Home/Cart.cshtml +++ b/Test/Views/Home/Cart.cshtml @@ -4,5 +4,15 @@ }

Cart

-@Html.Raw(ViewBag.id) + +@if (ViewBag.cartItems != null) +{ + foreach (var x in ViewBag.cartItems) + { +
+ @x.productID + @x.quantity +
+ } +} diff --git a/Test/Views/Home/Contact.cshtml b/Test/Views/Home/Contact.cshtml index 0f4327e..9756f2a 100644 --- a/Test/Views/Home/Contact.cshtml +++ b/Test/Views/Home/Contact.cshtml @@ -1,17 +1,45 @@ @{ ViewBag.Title = "Contact"; } -

@ViewBag.Title.

-

@ViewBag.Message

+
+
+
+
+
+ Contact us -
- One Microsoft Way
- Redmond, WA 98052-6399
- P: - 425.555.0100 -
+ +
+ +
+ +
+
-
- Support: Support@example.com
- Marketing: Marketing@example.com -
\ No newline at end of file + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+
+ +
+
+
+
+
+
+
diff --git a/Test/Views/Home/Index.cshtml b/Test/Views/Home/Index.cshtml index 943f40e..847455e 100644 --- a/Test/Views/Home/Index.cshtml +++ b/Test/Views/Home/Index.cshtml @@ -2,63 +2,69 @@ ViewBag.Title = "Home Page"; }
- @**@
-
- Card image cap +
+ @Html.Partial("_SidebarPartial");
-
+
-
Laptop
+
- @Html.Raw(ViewBag.phones) + @if (ViewBag.phonesList != null) + { + foreach (var x in ViewBag.phonesList) + { +
+ Card image cap +
+

@x.name

+

$@x.price

+
+ +
+ +
+
+
+ } + }
-
Điện thoại
+
- @Html.Raw(ViewBag.laptops) + @if (ViewBag.lapTopsList != null) + { + foreach (var x in ViewBag.lapTopsList) + { +
+ Card image cap +
+

@x.name

+

$@x.price

+
+ +
+ +
+
+
+ } + }
diff --git a/Test/Views/Home/ViewProduct.cshtml b/Test/Views/Home/ViewProduct.cshtml new file mode 100644 index 0000000..82e0b73 --- /dev/null +++ b/Test/Views/Home/ViewProduct.cshtml @@ -0,0 +1,168 @@ +@using Test.Models +@{ + ViewBag.Title = "Product Details"; + Layout = "~/Views/Shared/_Layout.cshtml"; + var product = (Product)ViewData["Product"]; +} +
+
+ +
    +
  • +

    @product.productType @product.name @product.RAM

    +
  • +
  • +
    + +
    +
  • +
+
+
+
+
+
+ Img product +
+
+
+
+

+ Buy Online with lowest price + @product.price $ +

+
+

+ @product.description +
+ @product.description + @product.description +
+ @product.description +

+ +
+
+
+ Add to card + +
+
+
+
+
+
+
+
+
+
+

Đặc điểm nổi bật

+
+ +
+
+
+

Thông số kỹ thuật

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Màn hình:@product.screen
Hệ điều hành@product.OS
Camara sau:@product.camera
Camara trước:@product.camera
CPU:@product.CPU
RAM:@product.RAM
Bộ nhớ trong:32 GB
Thẻ sim:@product.SIM
Dung lượng@product.PIN
+
+
+
+
+ diff --git a/Test/Views/LapTopPage/Index.cshtml b/Test/Views/LapTopPage/Index.cshtml new file mode 100644 index 0000000..bc7210c --- /dev/null +++ b/Test/Views/LapTopPage/Index.cshtml @@ -0,0 +1,45 @@ + +@{ + ViewBag.Title = "Index"; +} + +
+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+ @if (ViewBag.phonesList != null) + { + foreach (var x in ViewBag.phonesList) + { +
+ Card image cap +
+

@x.name

+

$@x.price

+
+ +
+ +
+
+
+ } + } +
+ +
+
XEM THÊM SẢN PHẨM
+
+ diff --git a/Test/Views/News/ViewPost.cshtml b/Test/Views/News/ViewPost.cshtml new file mode 100644 index 0000000..28a60a7 --- /dev/null +++ b/Test/Views/News/ViewPost.cshtml @@ -0,0 +1,116 @@ +@using Test.Models +@{ + ViewBag.Title = "ViewPost"; + Layout = "~/Views/Shared/_Layout.cshtml"; + var currenPost = ViewBag.currentPost; +} + +
+
+
+
+
+

@currenPost.title

+

+ @currenPost.postContent.Substring(0, 300); +

+
+
+ +
+
+
+
+
+
+ @Html.Partial("_SidebarPartial") +
+
+ +
+ +
+

+ ROM tuỳ biến muôn màu sắc cá nhân thú vị, cùng với đó là cái tên thân quen với dân công nghệ - ROM cook, từng một thời là nguồn cảm hứng với người dùng Android. Vậy hiện tại đã là 2018, anh em thích dùng Android gốc hay Android tuỳ biến hơn? + Tạm gác ROM cook sang một bên, vì nó đòi hỏi người dùng phải có kiến thức sâu hơn trong việc vọc vạch, up rom ... Mình sẽ chỉ đề cập đến những thiết bị chính hãng với ROM gốc và ROM tuỳ biến sẵn có cho người dùng cơ bản. +

+

+ Tạm gác ROM cook sang một bên, vì nó đòi hỏi người dùng phải có kiến thức sâu hơn trong việc vọc vạch, up rom ... Mình sẽ chỉ đề cập đến những thiết bị chính hãng với ROM gốc và ROM tuỳ biến sẵn có cho người dùng cơ bản. +

+

+ ROM tuỳ biến khác nhau như thế nào? +

+ +

Từ lâu các hãng sản xuất smartphone Android lớn như Samsung, LG, HTC, Sony, ... đều muốn mang màu sắc riêng của từng hãng đến người tiêu dùng. Từ đó mỗi hãng đều có những giao diện riêng với tên gọi khác nhau, Samsung thì từ TouchWiz đã chuyển hẳn sang tên gọi mới là Samsung Experience, LG thì có LG UX, Xiaomi thì có hẳn MIUI riêng biệt, ...

+ +
ROM gốc và ROM tuỳ biến
+ +

Khi sử dụng một chiếc điện thoại, chúng ta đều mong muốn thiết bị của mình phải thật khác biệt so xung quanh và khẳng định chất tôi mỗi khi ai đó mượn chiếc máy của bạn. Từ đó xu hướng kho theme phát triển trong mỗi máy cũng dần phổ biến hơn.

+
ROM gốc và ROM tuỳ biến
+

Không chỉ dừng lại ở việc "làm đẹp" smartphone, ROM tuỳ biến còn đem đến người dùng những tính năng vui vẻ và tiện lợi hơn khi sử dụng. Ví dụ như nhiều giao diện cho phép tuỳ chỉnh vị trí, số lượng phím tắt bật tắt đèn flash, chế độ đọc sách, ... đa dạng hơn nhiều so với thanh phím tắt của Android gốc.

+
ROM thuần gốc và ROM tuỳ biến
+

Hoặc nhiều người có thói quen hay xoá tất cả đa nhiệm khi không dùng đến, nhiều hãng đã thêm nút Clear All để đỡ tốn công xoá từng app. Thế nhưng Android gốc thì mãi tận bây giờ vẫn chưa thấy.

+
ROM thuần gốc và ROM tuỳ biến
+

Một điểm tuỳ biến khác đến từ một ứng dụng mà ai cũng dùng đến hằng ngày, chính là camera. Có thể nói nhờ sự tuỳ biến, giao diện camera trên các máy Android ngày nay mới đa dạng và phong phú hơn như chỉnh tay chuyên nghiệp, phơi sáng kép, chế độ làm đẹp, ... điều mà ROM gốc không thể có được.

+
ROM gốc và ROM tuỳ biến
+

Cùng nhìn lại, số lượng người dùng đón chào ROM tuỳ biến vẫn rất đông, lấy ví dụ về ông lớn Samsung. Với năm 2017, Samsung đã dần hình thành một Samsung Experince lần đầu xuất hiện trên Galaxy S8 hay Galaxy J7 Pro, với icon cách điệu bo cong đặc trưng, kho theme tuỳ biến đồ sộ, nhiều tính năng như chạy 2 tài khoản hay chụp màn hình cuộn trang, đều là những thứ người dùng vô tình cần đến trong cuộc sống.

+

Xem thêm: Android thống trị thị trường smartphone toàn cầu, nhưng ở Mỹ thì không

+

2016, năm trỗi dậy của ROM gốc

+

Đến giai đoạn 2016, chúng ta chứng kiến sự trỗi dậy mạnh mẽ của Android gốc khi phiên bản 7.0 Nougat thực sự là một phiên bản hoàn thiện nhất từ trước đến nay. Là một phiên bản Android dung hoà được về sự ổn định, yếu tố thẩm mĩ và cả tính năng.

+

Thị trường chính hãng hiện tại, có thể thấy chỉ có Moto và Nokia đang đi theo hướng phát triển trên nền Android gốc. 

+
ROM gốc và ROM tuỳ biến
+

Không cần sự màu mè giao diện, sự ổn định là yếu tố khiến các thiết bị giá rẻ tầm 2 - 3 triệu chính hãng như Moto C Plus hay Nokia 3, đem đến sự mượt mà cho người dùng dù cấu hình không quá nổi trội. Điều mà các máy chính hãng của hãng khác khó lòng bì kịp.

+
ROM gốc và ROM tuỳ biến
+

Yếu tố thứ hai đến từ việc cập nhật, cảm giác của bạn thế nào khi chiếc Xiaomi Mi A1 giá chỉ 6 triệu hay Moto X4 chỉ có 9 triệu, nhưng đã lên Android 8.0 chính thức? Trong khi đó Galaxy S8, LG G6, ... vẫn đang chờ đợi từng ngày? Nhiều bạn sẽ nói là Huawei Mate 10 Pro hay LG V30 đã lên Android 8 rồi đấy thôi, vậy thế còn Android 9.0 thì sẽ ra sao?

+
ROm gốc và ROM tuỳ biến
+

Không chỉ hơn về mặt ổn định và cập nhật, Android thuần gốc còn đem đến những dịch vụ hỗ trợ đi kèm mà nhiều hãng muốn lược bỏ đi. Bạn có bao giờ nhận thấy các máy chạy Android gốc, thậm chí là các máy HTC với thư viện sử dụng chung với Google Photos, luôn đồng bộ và tốc độ đồng bộ rất nhanh? Không chỉ Photos, mà ngay cả Mail, Lịch, Office, Files đều như thế.

+
ROM thuần gốc và ROM tuỳ biến
+

Chưa kể đến với những hãng như Samsung, LG, Huawei đều có những ứng dụng mặc định riêng về đồng hồ, thư viện, quản lí file, ... nhưng người dùng vẫn cần lưu trữ đám mây từ Google. Và thế là bạn phải tốn thêm bộ nhớ trong cho 2 ứng dụng thư viện, lịch, ghi chú hay thậm chí là mail.

+

Xem thêm: Trải nghiệm Android One trên Xiaomi Mi A1: Có khác gì với Android thuần?

+

Bạn thích ROM gốc hay ROM tuỳ biến hơn?

+

Có thể thấy ngoài việc không thể đa dạng hoá về phần theme, cơ bản Android gốc cũng rất đẹp và tinh tế theo phong cách phẳng, dường như ROM gốc mang đến cho người dùng khá nhiều thứ hay ho như cập nhật nhanh, ổn định, đáp ứng hết mọi nhu cầu của một chiếc smartphone từ đồng bộ, tính năng, ...

+

Thế nhưng nhờ các tính năng sáng tạo từ việc tuỳ biến của Samsung, LG hay Xiaomi, ... thì giờ đây Android 7.0 mới có được việc chia đôi cửa sổ ứng dụng, Android 8 mới có Picture-in-picture,...

+
ROM gốc và ROM tuỳ biến
+

Anh em đang dùng máy gì và thích team #ROMgốc hay #ROMtuỳbiến ? Hãy cùng bình luận ngay phía bên dưới lí do mà bạn thích nhé!

+ +
+

+ Xem thêm: + Bạn có biết: Jelly Bean là phiên bản Android cuối cùng đạt 50% thị phần +

+ +
+ +
+
+
+
+ diff --git a/Test/Views/PhonePage/Index.cshtml b/Test/Views/PhonePage/Index.cshtml new file mode 100644 index 0000000..9f159d9 --- /dev/null +++ b/Test/Views/PhonePage/Index.cshtml @@ -0,0 +1,45 @@ + +@{ + ViewBag.Title = "Index"; +} + +
+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+ @if (ViewBag.phonesList != null) + { + foreach (var x in ViewBag.phonesList) + { +
+ Card image cap +
+

@x.name

+

$@x.price

+
+ +
+ +
+
+
+ } + } +
+ +
+
XEM THÊM SẢN PHẨM
+
+ diff --git a/Test/Views/Search/Index.cshtml b/Test/Views/Search/Index.cshtml new file mode 100644 index 0000000..9a4e864 --- /dev/null +++ b/Test/Views/Search/Index.cshtml @@ -0,0 +1,49 @@ + +@{ + ViewBag.Title = "Index"; +} + +
+ +
+
+
+ @Html.Partial("_SidebarPartial") +
+
+ @if (ViewBag.phonesList != null) + { +
Tìm thấy kết quả phù hợp với từ khóa "@Html.Raw(ViewBag.searchString)":
+
+ @foreach (var x in ViewBag.phonesList) + { +
+ Card image cap +
+

@x.name

+

$@x.price

+
+ +
+ +
+
+
+ } + +
+
+
XEM THÊM SẢN PHẨM
+
+ } +
+
+
+ +
diff --git a/Test/Views/Shared/Cart.cshtml b/Test/Views/Shared/Cart.cshtml new file mode 100644 index 0000000..3c25d93 --- /dev/null +++ b/Test/Views/Shared/Cart.cshtml @@ -0,0 +1,13 @@ + + + + + + @ViewBag.Title + + +
+ @RenderBody() +
+ + diff --git a/Test/Views/Shared/_Layout.cshtml b/Test/Views/Shared/_Layout.cshtml index 3159363..de64bf9 100644 --- a/Test/Views/Shared/_Layout.cshtml +++ b/Test/Views/Shared/_Layout.cshtml @@ -3,17 +3,19 @@ - @ViewBag.Title - My ASP.NET Application - + @ViewBag.Title - QT Company + @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") + @Scripts.Render("~/bundles/jquery") + @Scripts.Render("~/bundles/jqueryval")
@RenderBody() -
-
-

© @DateTime.Now.Year - THANG TAN CONG TRONG

-
- + @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) + diff --git a/Test/Views/Shared/_SidebarPartial.cshtml b/Test/Views/Shared/_SidebarPartial.cshtml new file mode 100644 index 0000000..1f33148 --- /dev/null +++ b/Test/Views/Shared/_SidebarPartial.cshtml @@ -0,0 +1,40 @@ + + +
+ + +   Hot News + +
    + @{ + if (ViewBag.news != null) + { + foreach (var post in ViewBag.news) + { +
  • + + +

    @post.title

    +
    +
  • + } + } + } +
+
diff --git a/Test/Web.config b/Test/Web.config index 53fac06..94cbc52 100644 --- a/Test/Web.config +++ b/Test/Web.config @@ -10,7 +10,7 @@ - + @@ -33,6 +33,12 @@ + + + + + + diff --git a/Test/packages.config b/Test/packages.config index c640d20..0a5dcd9 100644 --- a/Test/packages.config +++ b/Test/packages.config @@ -19,6 +19,10 @@ + + + +