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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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()); }