示例#1
0
        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()));
        }
示例#2
0
        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());
        }
示例#3
0
        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"));
        }