public ActionResult AddMobo(string name, string model, string link, int ramSlots, int maxRam, int sataSlots, int manufacturerId, int formFactorId, int ramTypeId, int socketId, int shopId, string image) { if (Request.IsAuthenticated && User.Identity.Name == "admin") { var moboToAdd = new Mobo() { Name = name, ManufacturerId = manufacturerId, Model = model, Link = link, FormFactorId = formFactorId, SocketId = socketId, RamSlots = ramSlots, RamTypeId = ramTypeId, MaxRam = maxRam, SataSlots = sataSlots, Image = image, ShopId = shopId }; context.Mobo.Add(moboToAdd); context.SaveChanges(); return(RedirectToAction("MoboAddForm")); } else { return(RedirectToAction("Index", "Home")); } }
/// MOBO public void MoboAddToBuild(Mobo mobo) { var build = NewBuild(); build.Mobo = mobo; session.Set(SessionNames.BuildSessionKey, build); }
public CbValues(Mobo n, decimal p7700K, decimal p7600K, decimal p6700K, decimal p6600K) { name = n; pi7_7700K = p7700K; pi5_7600K = p7600K; pi7_6700K = p6700K; pi5_6600K = p6600K; }
public static string GetPrice(Mobo c) { using (WebClient webClient = new WebClient()) { webClient.Encoding = Encoding.UTF8; string html = webClient.DownloadString(c.Link); HtmlDocument pageDocument = new HtmlDocument(); pageDocument.LoadHtml(html); if (c.Shop.Name == "Sferis") { if (html.ToString().Contains("Produkt chwilowo niedostępny")) { return("Produkt niedostępny"); } else { var prize = pageDocument.DocumentNode.SelectSingleNode("//div[@class='" + c.Shop.Class + "']/span"); return(prize.InnerHtml.ToString()); } } else if (c.Shop.Name == "Media Expert") { var prize = pageDocument.DocumentNode.SelectSingleNode("//p[@class='" + c.Shop.Class + "']"); var prizeMod = prize.InnerHtml.ToString().Replace("<span>", ",").Replace("</span>", "") + " zł"; return(prizeMod); } else if (c.Shop.Name == "Vobis") { if (html.ToString().Contains("Produkt niedostępny")) { return("Produkt niedostępny"); } else { var prize = pageDocument.DocumentNode.SelectSingleNode("//div[@class='" + c.Shop.Class + "']/span"); var prizeMod = prize.InnerHtml.ToString().Replace("PLN", "zł"); return(prizeMod); } } else { var prize = pageDocument.DocumentNode.SelectSingleNode("//div[@class='" + c.Shop.Class + "']"); return(prize.InnerHtml.ToString()); } } }
public decimal getCashbackValue(Mobo moboName, CPU cpuName) { return(values[moboName].getCbValue(cpuName)); }
public LinkMobo(string l, Mobo n) { url = l; name = n; }