public async Task AddNewPhoto(ProjectCommonLocationImages obj)
        {
            await ProjectCommonLocationImagesDataStore.AddItemAsync(obj);

            //     ProjectCommonLocationImagesDataStore = new ObservableCollection<ProjectCommonLocationImages>(await ProjectCommonLocationImagesDataStore.GetItemsAsyncByProjectLocationId(ProjectLocation.Id));
            //  CountItem = ProjectCommonLocationImagesDataStore.Count.ToString();
        }
        public async Task AddNewPhoto(ProjectCommonLocationImages obj)
        {
            await ProjectCommonLocationImagesDataStore.AddItemAsync(obj);

            ProjectCommonLocationImagesItems = new ObservableCollection <ProjectCommonLocationImages>(await ProjectCommonLocationImagesDataStore.GetItemsAsyncByProjectLocationId(ProjectLocation.Id));
            // UnitPhotoCount = VisualApartmentLocationPhotoItems.Count.ToString();
        }
예제 #3
0
        private async Task Save()
        {
            if (string.IsNullOrEmpty(ProjectCommonLocationImages.Name))
            {
                await Shell.Current.DisplayAlert("Alert", "Project name is required", "OK");

                return;
            }
            if (string.IsNullOrEmpty(ProjectCommonLocationImages.Id))
            {
                ProjectCommonLocationImages.Id = Guid.NewGuid().ToString();

                ProjectCommonLocationImages.ProjectLocationId = ProjectLocation.Id.ToString();
                ////Project.
                ////   Project.ProjectImage = ImgPata;

                await ProjectCommonLocationImagesDataStore.AddItemAsync(ProjectCommonLocationImages);

                await Shell.Current.Navigation.PopAsync();

                // await Shell.Current.Navigation.PushAsync(new ProjectLocationDetail() { BindingContext = new ProjectLocationDetailViewModel() { ProjectLocation = ProjectLocation } });
            }
            else
            {
                await ProjectCommonLocationImagesDataStore.UpdateItemAsync(ProjectCommonLocationImages);

                await Shell.Current.Navigation.PopAsync();
            }
            //await Shell.Current.Navigation.PushAsync(new ProjectLocationDetail() { BindingContext = new ProjectDetailViewModel() { Project = Project } });
        }
        private void GetImageDetail(ImageData ImgData)
        {
            ImageData data = ImgData;
            ProjectCommonLocationImages _locImage = new ProjectCommonLocationImages();

            _locImage.Id                = Guid.NewGuid().ToString();
            _locImage.ImageUrl          = data.Path;
            _locImage.ImageName         = data.Name;
            _locImage.ImageDescription  = data.Description;
            _locImage.ProjectLocationId = ProjectLocation.Id;

            ProjectCommonLocationImagesDataStore.AddItemAsync(_locImage);
            Task.Run(() => this.LoadData()).Wait();
            //LoadData();
        }