Beispiel #1
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            air_conditioner air_conditioner = db.air_conditioner.Find(id);

            if (air_conditioner == null)
            {
                return(HttpNotFound());
            }
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("AppliancesType", "Home"), "Save Energy");
            BreadCrumb.Add(Url.Action("Index", "air_conditioner"), "Air Conditioner");
            BreadCrumb.Add("", air_conditioner.Model_No);

            // Smiliar products display logic

            var results = from x in db.air_conditioner
                          select x;
            var list = results.Where(x => x.Brand.Contains(air_conditioner.Brand)).OrderBy(x => Guid.NewGuid()).Take(3).ToList();

            ViewData["SimilarProducts"] = list;
            return(View(air_conditioner));
        }
Beispiel #2
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            air_conditioner air_conditioner = db.air_conditioner.Find(id);

            if (air_conditioner == null)
            {
                return(HttpNotFound());
            }
            BreadCrumb.Clear();
            BreadCrumb.Add(Url.Action("Index", "Home"), "Home");
            BreadCrumb.Add(Url.Action("AppliancesType", "Home"), "Appliance Type");
            BreadCrumb.Add(Url.Action("Index", "air_conditioner"), "Air Conditioner");
            return(View(air_conditioner));
        }