public JsonResult UpdateManu(Manufacturers obj) { try { ManufacturersBusiness manuBusiness = new ManufacturersBusiness(); var entity = manuBusiness.GetById(obj.ManuId); entity.ManufacturerName = obj.ManuName; entity.Icon = obj.icon; entity.Description = obj.Description; entity.Order = obj.Order; manuBusiness.Edit(entity); return(Json(1));//Cập nhật thành công } catch (Exception) { throw; } }
public string LoadComBoManufaceture(long cat, long?manuface) { var html = ""; // var listItems = new List<SelectListItem>(); // var listGroup = _catalogsManufacturersBusiness.GetDynamicQuery().Where(x=>x.CatalogId==cat).ToList(); var listGroup = new ManufacturersBusiness().GetList(); //MemberController.ListCatalogsManufacturerses.Where(x => x.CatalogId == cat).ToList(); foreach (var item in listGroup) { if (manuface != null && manuface == item.Id) { html += "<option onclick=\"GetManuface(" + item.Id + ")\" selected=\"selected\" value=\"" + item.Id + "\">" + item.ManufacturerName + "</option>"; } else { html += "<option onclick=\"GetManuface(" + item.Id + ")\" value=\"" + item.Id + "\">" + item.ManufacturerName + "</option>"; } } return(html); }
public static void RegisterRoutes(RouteCollection routes) { try { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); FriendlyUrlBusiness a = new FriendlyUrlBusiness(); List <FriendlyUrl> listFriendly = new List <FriendlyUrl>(); listFriendly = a.searchAllLink(); // routes.Clear(); foreach (FriendlyUrl re in listFriendly) { routes.MapRoute(name: re.NameLink, url: re.Link, defaults: new { controller = re.ControllerName, action = re.ActionName, id = re.ItemId, }, namespaces: new string[] { re.NameSpaces }); } // routes.MapRoute(name: "them-lua-tinh-yeu", url: "danh-muc/them-lua-tinh-yeu-voi-nhung-mau-giuong-ngu-dep-mat.html", defaults: new { controller = "News", action = "Detail", nid = 26, }, namespaces: new string[] { "BuyGroup365.Controllers" }); // routes.MapRoute(name: "Catalog", url: "danh-muc/{friendUrl}.html", defaults: new { controller = "Home", action = "Category", friendUrl = UrlParameter.Optional, }); //routes.MapRoute(name: "Manufacturer", url: "{Content}-m{id}", defaults: new { controller = "Home", action = "Manufacturer", id = UrlParameter.Optional, slug = "" }); // routes.MapRoute(name: "ProductDetail", url: "{Content}-ct{id}.html", defaults: new { controller = "Home", action = "ProductDetail", id = UrlParameter.Optional, }); // routes.MapRoute(name: "GetProductByShop", url: "{Content}-mc{id}.html", defaults: new { controller = "Home", action = "GetProductByShop", id = UrlParameter.Optional, }); // routes.MapRoute(name: "NewsDetail", url: "help/{Content}-n{nid}.html", defaults: new { controller = "News", action = "Detail", nid = UrlParameter.Optional, }, // namespaces: new string[] { "BuyGroup365.Controllers" }); try { CatalogsBusiness cata = new CatalogsBusiness(); ManufacturersBusiness manu = new ManufacturersBusiness(); List <Catalog> ListCatalog = new List <Catalog>(); ListCatalog = cata.SearchCatalogALL(); // routes.Clear(); foreach (Catalog re in ListCatalog) { List <Manufacturer> ListManuFater = new List <Manufacturer>(); ListManuFater = manu.GetList(); foreach (Manufacturer mu in ListManuFater) { routes.MapRoute(name: re.CatalogName + re.Id + "hang" + mu.Id, url: re.FriendlyUrl + "-" + Common.util.Function.ConvertFileName(mu.ManufacturerName), defaults: new { controller = "Home", action = "Category", id = re.Id }); } } } catch { } routes.MapRoute(name: "Search", url: "search.html", defaults: new { controller = "Home", action = "Category", id = -2 }); // routes.MapRoute(name: "NewsGroup", url: "tin-tuc/{Content}-nt{nt}.html", defaults: new { controller = "News", action = "Index", nt = UrlParameter.Optional, }, // namespaces: new string[] { "BuyGroup365.Controllers" }); // routes.MapRoute(name: "NewsDetail2", url: "tin-tuc/{Content}-nid{nid}.html", defaults: new { controller = "News", action = "Detail", nid = UrlParameter.Optional, }, // namespaces: new string[] { "BuyGroup365.Controllers" }); //routes.MapRoute(name: "tags", url: "san-pham/{tag}.html", defaults: new { controller = "Home", action = "Tags", tag = UrlParameter.Optional, }, // namespaces: new string[] { "BuyGroup365.Controllers" }); //routes.MapRoute(name: "tagsnew", url: "tin-tuc-tag/{tag}.html", defaults: new { controller = "News", action = "Tags", tag = UrlParameter.Optional, }, // namespaces: new string[] { "BuyGroup365.Controllers" }); routes.MapRoute(name: "video", url: "videos.html", defaults: new { controller = "Videos", action = "index" }, namespaces: new string[] { "BuyGroup365.Controllers" }); routes.MapRoute(name: "download", url: "downloads.html", defaults: new { controller = "Downloads", action = "index" }, namespaces: new string[] { "BuyGroup365.Controllers" }); routes.MapRoute(name: "Contact", url: "lien-he.html", defaults: new { controller = "Home", action = "Contact" }); routes.MapRoute(name: "sitemap", url: "sitemap.xml", defaults: new { controller = "Home", action = "SitemapXml" }); routes.MapRoute(name: "sanphammoi", url: "san-pham-moi.html", defaults: new { controller = "Home", action = "sanphammoi" }); routes.MapRoute(name: "loi404", url: "loi404", defaults: new { controller = "Home", action = "loi404" }); routes.MapRoute(name: "giohang", url: "gio-hang", defaults: new { controller = "PayGoods", action = "CheckOut" }); //routes.MapRoute(name: "faqlist", url: "hoi-dap.html", defaults: new { controller = "News", action = "FAQ" }, namespaces: new string[] { "BuyGroup365.Controllers" }); //routes.MapRoute(name: "faqdetail", url: "chi-tiet-cau-hoi.html", defaults: new { controller = "News", action = "DetailFAQ", id = UrlParameter.Optional }, namespaces: new string[] { "BuyGroup365.Controllers" }); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new string[] { "BuyGroup365.Controllers" } ); } catch { } }
public ActionResult GetBrandShowcase(string type, string info) { string priceDis; string[] splitImg; long brandId = long.Parse(type); ManufacturersBusiness manufacturersBusiness = new ManufacturersBusiness(); Manufacturer brand = manufacturersBusiness.GetById(brandId); BuyGroup365Entities entitis = new BuyGroup365Entities(); List <SearchProductByBrand_Result> listProduct = entitis.SearchProductByBrand(brandId, 1, 4).ToList(); String html = "<div class=\"mage-magictabs mc-" + type + "\">" + "<div class=\"row\"><div class=\"col-xs-12 col-sm-4 trademark-info\">" + "<div class=\"brand-info\"><div class=\"brand-description\"><div class=\"trademark-logo\">" + "<img alt=\"\" src=\"" + brand.Icon + "\"></div>" + "<div class=\"trademark-desc\">" + brand.Description + "</div></div>" + "<a class=\"trademark-link\" href=\"/search-dm0?mid=" + brandId + "\">Xem toàn bộ sản phẩm</a></div> </div> <div class=\"col-xs-12 col-sm-8 trademark-product\">" + "<ul class=\"flexisel-content products-grid featured zoomOut play\">"; foreach (var item in listProduct) { html += "<li class=\"item item-animate\">" + "<div class=\"per-product\">" + "<div class=\"images-container\">" + "<div class=\"product-hover\">"; if (item.IsVip) { html += "<span class=\"sticker top-left\"><span class=\"labelvip\">Vip</span></span>"; } else if (item.IsAttractive) { html += "<span class=\"sticker top-left\"><span class=\"labelnew\">Hot</span></span>"; } html += "<a href=\"" + Common.util.Function.InitUrlDetaiProduct(item.FriendlyUrl, item.Id) + "\" title=\"\" class=\"product-image\">" + "<img class=\"img-responsive\" src=\""; splitImg = item.ImgSource.Split('?'); html += splitImg[0] + "Medium/" + splitImg[1] + "\" width=\"300\" height=\"366\" alt=\"\">" + "</a>" + "</div>" + "</div>" + "<div class=\"products-textlink clearfix\">" + "<h2 class=\"product-name\">" + "<a href=\"" + Common.util.Function.InitUrlDetaiProduct(item.FriendlyUrl, item.Id) + "\" title=\"\">" + item.ProductName + "</a>" + "</h2>"; priceDis = string.Empty; if (item.Cost > item.Price) { priceDis = "<p class=\"old-price\"><span class=\"price\">" + item.Cost.ToString("N0") + "<sup class=\"u-price\">đ</sup></span></p>"; } html += "<div class=\"price-box\">" + priceDis + "<p class=\"special-price\"><span class=\"price\" itemprop=\"price\">" + item.Price.ToString("N0") + "<sup class=\"u-price\">đ</sup></span></p></div>" + "<div class=\"ratings\"><div class=\"rating-box\"><div class=\"rating\" style=\"width:" + InitStar(item.Rate) + "%\"></div></div></div>" + "</div></div> </li>"; } Response.Write(html.ToString()); return(null); }