Пример #1
0
        public async Task <JsonResult> Delete(int id)
        {
            AccountProvider accountProvider = new AccountProvider();
            Account         account         = await accountProvider.GetByIDAsync(id);

            if (account == null)
            {
                return(Json(new AccessEntityResult {
                    Status = AccessEntityStatusCode.NotFound, Message = MessageManager.GetErrorMessage(ModuleType.Base, MessageType.NotFound)
                }));
            }
            else
            {
                AccessEntityStatusCode accessEntityStatusCode = await accountProvider.DeleteAsync(account);

                return(Json(new AccessEntityResult {
                    Status = accessEntityStatusCode, Message = MessageManager.GetErrorMessage(ModuleType.Base, accessEntityStatusCode)
                }));
            }
        }