private async Task Delete() { var result = await Shell.Current.DisplayAlert( "Alert", "Are you sure you want to remove?", "Yes", "No"); if (result) { IsBusyProgress = true; var response = await Task.Run(() => BuildingLocationDataStore.DeleteItemAsync(BuildingLocation) ); if (response.Status == ApiResult.Success) { IsBusyProgress = false; await Shell.Current.Navigation.PopAsync(); } //await BuildingLocationDataStore.DeleteItemAsync(BuildingLocation); // Shell.Current.Navigation.RemovePage(new BuildingLocationDetail()); //await Shell.Current.Navigation.PopAsync(); // await Shell.Current.Navigation.PushAsync(new ProjectDetail() { BindingContext = new ProjectDetailViewModel() { Project = project } }); } }
private async Task <bool> Running() { if (BuildingLocation != null) { BuildingLocation = await BuildingLocationDataStore.GetItemAsync(BuildingLocation.Id).ConfigureAwait(true); // BuildingCommonLocationImages = new ObservableCollection<BuildingCommonLocationImages>(await BuildingCommonLocationImagesDataStore.GetItemsAsyncByBuildingId(BuildingLocation.Id)); VisualFormBuildingLocationItems = new ObservableCollection <BuildingLocation_Visual>(await VisualFormBuildingLocationDataStore.GetItemsAsyncByBuildingLocationId(BuildingLocation.Id)); if (App.LogUser.RoleName == "Admin") { IsEditDeleteAccess = true; } else if (BuildingLocation.UserId == App.LogUser.Id.ToString()) { IsEditDeleteAccess = true; } if (App.IsInvasive) { IsInvasiveControlDisable = true; IsEditDeleteAccess = false; } } return(await Task.FromResult(true)); }
private async Task <bool> Running() { ProjectBuilding = await ProjectBuildingDataStore.GetItemAsync(ProjectBuilding.Id); if (App.LogUser.RoleName == "Admin") { IsEditDeleteAccess = true; } else if (ProjectBuilding.UserId == App.LogUser.Id.ToString()) { IsEditDeleteAccess = true; } if (App.IsInvasive) { IsInvasiveControlDisable = true; IsEditDeleteAccess = false; } BuildingLocations = new ObservableCollection <BuildingLocation>(await BuildingLocationDataStore.GetItemsAsyncByBuildingId(ProjectBuilding.Id)); BuildingApartments = new ObservableCollection <BuildingApartment>(await BuildingApartmentDataStore.GetItemsAsyncByBuildingId(ProjectBuilding.Id)); //var items = await BuildingApartmentDataStore.GetItemsAsyncByBuildingId(ProjectBuilding.Id); //if(items.Count()!=0) //{ // BuildingApartments = new ObservableCollection<BuildingApartment>(items); //} return(await Task.FromResult(true)); }
private async Task <Response> Running() { Response result; if (string.IsNullOrEmpty(BuildingLocation.Id)) { BuildingLocation.BuildingId = ProjectBuilding.Id; result = await BuildingLocationDataStore.AddItemAsync(BuildingLocation); } else { result = await BuildingLocationDataStore.AddItemAsync(BuildingLocation); } return(await Task.FromResult(result)); }