// GET: SubcategoryProperty/Edit/5 /// <summary> /// Edit serches for subcategory property with ID=id and allows user to edit it /// </summary> /// <param name="id">ID for entity to edit</param> /// <returns></returns> public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SubcategoryPropertyViewModel SubcategoryProperty = _subcatPropService.GetById((int)id); if (SubcategoryProperty == null) { return(HttpNotFound()); } ViewBag.PropertyID = new SelectList(_propertyService.GetAll(), "PropertyID", "Name", SubcategoryProperty.PropertyID); ViewBag.SubcategoryID = new SelectList(_subcategoryService.GetAll(), "SubcategoryID", "Name", SubcategoryProperty.SubcategoryID); return(View(SubcategoryProperty)); }
// GET: Subcategories/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var subctgr_property = _subcatPropService.GetById((int)(id)); if (subctgr_property == null) { return(HttpNotFound()); } return(View(subctgr_property)); }