Пример #1
0
        public ActionResult Create([Bind(Include = "ID,PermissionName,Description")] Sys_Permission sys_Permission)
        {
            if (ModelState.IsValid)
            {
                db.Sys_Permission.Add(sys_Permission);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sys_Permission));
        }
Пример #2
0
        public ActionResult Create([Bind(Include = "ID,PageUrl,PageName,Sys_FuncID")] Sys_Page sys_Page)
        {
            if (ModelState.IsValid)
            {
                db.Sys_Page.Add(sys_Page);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sys_Page));
        }
Пример #3
0
        public ActionResult Create([Bind(Include = "ID,Sys_PageID,ParentID,FuncName,Description,IsAsc,IsDelete")] Sys_Func sys_Func)
        {
            if (ModelState.IsValid)
            {
                db.Sys_Func.Add(sys_Func);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sys_Func));
        }
Пример #4
0
        public ActionResult Create([Bind(Include = "ID,RoleName,Description")] Sys_Role sys_Role)
        {
            if (ModelState.IsValid)
            {
                db.Sys_Role.Add(sys_Role);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sys_Role));
        }
Пример #5
0
        public ActionResult Create([Bind(Include = "ID,LoginName,Password,RealName,Gender,Mobile,Email,Birthday")] Sys_User sys_User)
        {
            if (ModelState.IsValid)
            {
                db.Sys_User.Add(sys_User);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sys_User));
        }
Пример #6
0
        public ActionResult Create([Bind(Include = "ID,ControlName,PageUrl,PageControlID,Description")] Sys_PageControl sys_PageControl)
        {
            if (ModelState.IsValid)
            {
                db.Sys_PageControl.Add(sys_PageControl);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sys_PageControl));
        }
Пример #7
0
        public ActionResult Index()
        {
            TryerEntities db   = new TryerEntities();
            var           user = new Sys_User()
            {
                ID = Guid.NewGuid().ToString(), LoginName = "llb", Birthday = DateTime.Now, Email = "*****@*****.**", Gender = 1, Mobile = "13902020202", Password = "******", RealName = "李礼彬"
            };

            db.Sys_User.Add(user);
            db.SaveChanges();

            ViewBag.Count = db.Sys_User.Count();

            return(View());
        }