private async Task SaveCommandExecute() { try { ValidateFields(); if (_settings.IsOnline == true) { if (CityName.IsValid && FCCIEmail.IsValid && MCEmail.IsValid && AdminEmail.IsValid && MobileNumber.IsValid && UserName.IsValid && UserPassword.IsValid && ConfirmPassword.IsValid) { IsBusy = true; CityDTO cityDTO = new CityDTO(); var currentDate = DateTime.UtcNow; cityDTO.Id = 0; cityDTO.CityName = CityName.Value.Trim(); cityDTO.CountryId = 1; cityDTO.IsActive = IsActive.Value; cityDTO.FcciEmail = FCCIEmail.Value?.Trim(); cityDTO.MCEmail = MCEmail.Value?.Trim(); cityDTO.AdminEmail = AdminEmail.Value.Trim(); cityDTO.CreatedBy = _settings.UserId.Trim(); cityDTO.ModifiedBy = _settings.UserId.Trim(); cityDTO.CreatedDate = currentDate; cityDTO.ModifiedDate = currentDate; cityDTO.MobileNo = MobileNumber.Value.Trim(); cityDTO.IsCreate = true; cityDTO.IsEmptyModel = false; cityDTO.Password = UserPassword.Value.Trim(); cityDTO.UserName = UserName.Value.Trim(); var result = await _complaintService.CreateCityOnServer(cityDTO); IsBusy = false; if (result.ResponeContent == false) { await PageDialogService.DisplayAlertAsync(null, "Please supply valid email address", "Ok"); } else { await PageDialogService.DisplayAlertAsync(null, "The city has been created successfully with an admin account.", "Ok"); await NavigationService.GoBackAsync(); } } } else { IsBusy = false; await PageDialogService.DisplayAlertAsync(null, AppAlertMessage.NoInternetConnections, "Ok"); } } catch (Exception ex) { IsBusy = false; await PageDialogService.DisplayAlertAsync(null, "Please supply valid email address", "Ok"); } }