public IHttpActionResult Get(string name) { int get = new JewelryHandler().Getcategybyname(name); return(Ok((from m in new JewelryHandler().GetJewelries() where (m.Category.Id == get) select ToProductModel(m)).ToList())); }
public ActionResult addpost() { JewelryHandler Jhandler = new JewelryHandler(); ViewBag.Category = ModelHelper.ToSelectItemList(Jhandler.Getcategories()); ViewBag.Types = ModelHelper.ToSelectItemList(Jhandler.GetTypes()); ViewBag.Color = ModelHelper.ToSelectItemList(Jhandler.GetColors()); return(View()); }
public ActionResult create() { JewelryHandler Jhandler = new JewelryHandler(); ViewBag.Category = ModelHelper.ToSelectItemList(Jhandler.Getcategories()); ViewBag.Types = ModelHelper.ToSelectItemList(Jhandler.GetTypes()); ViewBag.Color = ModelHelper.ToSelectItemList(Jhandler.GetColors()); UserModel currentUser = (UserModel)Session[WebUtil.CURRENT_USER]; if (currentUser != null) { User user = new UserHandler().GetUserById(currentUser.Id); if (user.IsInRole(WebUtil.ADMIN_ROLE)) { return(View()); } } return(RedirectToAction("index", "home")); }