Ejemplo n.º 1
0
 public Task <IActionResult> Edit(Manager model)
 {
     return(Task.Factory.StartNew <IActionResult>(() =>
     {
         if (!ModelState.IsValid)
         {
             return Json(ExcutedResult.FailedResult("数据验证失败"));
         }
         ManagerRepository.Edit(model, false);
         return Json(ExcutedResult.SuccessResult());
     }));
 }
        //Saved de veranderingen in de tabel: Applicationuser
        public void Save(Models.Manager manager)
        {
            if (manager == null)
            {
                throw new ArgumentException("user");
            }


            if (manager.ManagerID == 0)
            {
                _repository.Add(manager);
            }
            else
            {
                _repository.Edit(manager);
            }

            _uow.Commit();
        }