public async Task <OperationDetails> DeleteUserAsync(string id, OperationDetails MessageSuccess, OperationDetails MessageFail) { UserDTO user = await service.GetItemByIdAsync(id); //AddressDTO address = await this.kernel.Get<IAddressService>().GetAddressByIdAsync(user.AddressID); //OperationDetails result1 = await this.kernel.Get<IAddressCityService>().DeleteAddressCityAsync(address.AddressCityID); //OperationDetails result2 = await this.kernel.Get<IAddressRegionService>().DeleteAddressRegionAsync(address.AddressRegionID); //OperationDetails result3 = await this.kernel.Get<IAddressStreetService>().DeleteAddressStreetAsync(address.AddressStreetID); //OperationDetails result4 = await this.kernel.Get<IAddressService>().DeleteAddressAsync(user.AddressID); //if (result4.Succedeed==true) //{ // await service.DeleteItemAsync(id, // new OperationDetails(true, $"Пользователь успешно удален", ""), // new OperationDetails(false, "Такого пользователя нет в базе данных", "User")); // //identity.AppUserManager.DeleteAsync //} return(await service.DeleteItemAsync(id, MessageSuccess, MessageFail)); }
public async Task <OperationDetails> DeleteEmployeeDismissAsync(int id, OperationDetails MessageSuccess, OperationDetails MessageFail) { return(await service.DeleteItemAsync(id, MessageSuccess, MessageFail)); }
public async Task <OperationDetails> DeleteContractAsync(int id, OperationDetails MessageSuccess, OperationDetails MessageFail) { return(await service.DeleteItemAsync(id, MessageSuccess, MessageFail)); }
public async Task <OperationDetails> DeleteRealEstateTypeAsync(int id, OperationDetails MessageSuccess, OperationDetails MessageFail) { return(await service.DeleteItemAsync(id, MessageSuccess, MessageFail)); }