Example #1
0
        public ActionResult Index()
        {
            VaiTroViewModel mymodel = new VaiTroViewModel();

            mymodel.VaiTro   = db.VaiTroes.ToList();
            mymodel.ListMenu = db.Menus.ToList();
            return(View(mymodel));
        }
        //Sửa
        public JsonResult ChiTietJson(int id)
        {
            VaiTro objVaiTro = DataProvider.ShopEntities.VaiTroes.Where(p => p.Id == id).First();

            VaiTroViewModel objVaiTroView = new VaiTroViewModel();

            if (objVaiTro != null)
            {
                objVaiTroView.Id        = objVaiTro.Id;
                objVaiTroView.TenVaiTro = objVaiTro.TenVaiTro;
                objVaiTroView.MoTa      = objVaiTro.MoTa;
            }
            return(Json(objVaiTroView, JsonRequestBehavior.AllowGet));
        }