public ActionResult EditMenuType(long?Id) { if (Id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var entity = Dao.DetailType(Id); if (entity == null) { return(HttpNotFound()); } return(View(entity)); }
public ActionResult ViewMenu() { long Id = 0; try { Id = long.Parse(SDao.GetValue("Menu_01")); } catch { Id = 0; } var lMneu = Dao.ViewByTypeId(Id); string output = ""; if (lMneu.Count() > 0) { int level = 0; output += "<div class=\"product-menu\">"; output += "<div class=\"title\">" + Dao.DetailType(Id).Name; output += "</div>"; output += "<ul class=\"nav\">"; foreach (var item in lMneu) { if ((item.ParentId == null) || (item.ParentId == 0)) { output += "<li>"; output += "<a title=\"" + item.Text + "\" href=\"/" + item.Url + "\">"; output += item.Text; output += "</a>"; output += submenu(item.Id, level++); output += "</li>"; } } output += "</ul>"; output += "</div>"; } ViewBag.Data = output; return(PartialView()); }