예제 #1
0
        public async Task <IActionResult> Create([Bind("RoleId,Role,Active,Discription,CreatedBy,CreatedDate")] TblRole tblRole)
        {
            if (ModelState.IsValid)
            {
                db.Add(tblRole);
                await db.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tblRole));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("UserId,Username,Password,Lock,RoleId,CreatedBy,CreatedDate")] TblUser tblUser)
        {
            if (ModelState.IsValid)
            {
                db.Add(tblUser);
                await db.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tblUser));
        }