示例#1
0
        public async Task <IActionResult> Edit(Adminstrator currentAdmin)
        {
            if (ModelState.IsValid)
            {
                _adb.Update(currentAdmin);
                await _adb.SaveChangesAsync();

                return(RedirectToAction("AIndex"));
            }
            return(View(currentAdmin));
        }
示例#2
0
        public async Task <IActionResult> AddAdmin(Adminstrator newAdmin)
        {
            if (ModelState.IsValid)
            {
                _adb.Add(newAdmin);
                await _adb.SaveChangesAsync();

                return(RedirectToAction("AIndex"));
            }
            return(View(newAdmin));
        }
 public AdminstratorController(Adminstrator admin)
 {
     this.admin = admin;
 }
 public AdminstratorController(string nemail, string userName, string password)
 {
     admin = new Adminstrator(nemail, userName, password);
 }