Exemplo n.º 1
0
        public async Task <JsonResult> Update(int id, Account account)
        {
            ModelState.Remove("Password");
            if (ModelState.IsValid)
            {
                AccountProvider provider = new AccountProvider();
                Tuple <AccessEntityStatusCode, Account> result = await provider.EditAsync(account, id);

                return(Json(new AccessEntityResult {
                    Status = result.Item1, Message = MessageManager.GetErrorMessage(ModuleType.Base, result.Item1)
                }));
            }
            else
            {
                return(Json(new AccessEntityResult {
                    Status = AccessEntityStatusCode.ModelFailed, Message = MessageManager.GetErrorMessage(ModuleType.Base, MessageType.ModelFailed)
                }));
            }
        }