Esempio n. 1
0
        private void GetData()
        {
            IsLongPressed         = false;
            IsImageChecked        = false;
            IsImageOverlayVisible = false;

            GalleryList.Add(new GalleryModel {
                ImageId = 1, ImageUrl = "icon", IsDeleted = false, IsSelected = false
            });
            GalleryList.Add(new GalleryModel {
                ImageId = 2, ImageUrl = "icon", IsDeleted = false, IsSelected = false
            });
            GalleryList.Add(new GalleryModel {
                ImageId = 3, ImageUrl = "icon", IsDeleted = false, IsSelected = false
            });
            GalleryList.Add(new GalleryModel {
                ImageId = 4, ImageUrl = "icon", IsDeleted = false, IsSelected = false
            });
            GalleryList.Add(new GalleryModel {
                ImageId = 5, ImageUrl = "icon", IsDeleted = false, IsSelected = false
            });
            GalleryList.Add(new GalleryModel {
                ImageId = 6, ImageUrl = "icon", IsDeleted = false, IsSelected = false
            });
            GalleryList.Add(new GalleryModel {
                ImageId = 7, ImageUrl = "icon", IsDeleted = false, IsSelected = false
            });
        }
Esempio n. 2
0
        private void GetBearers()
        {
            List <GalleryModel> bearersList = null;

            Task.Factory.StartNew(() =>
            {
                ISyncServices syncService = new SyncServices();
                bearersList = syncService.GetGallery();
            }).ContinueWith((obj) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (bearersList != null)
                    {
                        foreach (var item in bearersList)
                        {
                            if (string.IsNullOrEmpty(item.galleryPhoto))
                            {
                                item.galleryPhoto = "demo";
                            }


                            GalleryList.Add(item);
                        }
                    }
                });
            });
        }
Esempio n. 3
0
 public void AddHostingUnit(BE.HostingUnit hostingUnit)
 {
     hostingUnit.stSerialKey = Configuration.HostingUnitKey;
     Configuration.HostingUnitKey++;
     HostingUnitsList.Add(hostingUnit);
     //save images
     for (int i = 0; i < hostingUnit.TempImages.Count(); i++)
     {
         int key = Configuration.ImageIdentity;
         Configuration.ImageIdentity++;
         GalleryImageItem ii = new GalleryImageItem()
         {
             HostingUnitId = hostingUnit.stSerialKey,
             Id            = key,
             Url           = hostingUnit.TempImages[i].Url
         };
         GalleryList.Add(ii);
     }
     UpdateXml <HostingUnit>(HostingUnitsList);
     UpdateXml <GalleryImageItem>(GalleryList);
 }
Esempio n. 4
0
        public void UpdatingHostingUnit(BE.HostingUnit hostingUnit)
        {
            var h = GetHostingUnitById(hostingUnit.stSerialKey);

            if (h != null)
            {
                h.HostingUnitName      = hostingUnit.HostingUnitName;
                h.Rooms                = hostingUnit.Rooms;
                h.SubArea              = hostingUnit.SubArea;
                h.OwnerId              = hostingUnit.OwnerId;
                h.Pool                 = hostingUnit.Pool;
                h.Adult                = hostingUnit.Adult;
                h.Area                 = hostingUnit.Area;
                h.Children             = hostingUnit.Children;
                h.ChildrensAttractions = hostingUnit.ChildrensAttractions;
                h.Garden               = hostingUnit.Garden;
                //h.
                h.Status = hostingUnit.Status;
                //h.DiaryState = hostingUnit.DiaryState;

                //delete Prev items
                GalleryList.RemoveAll(c => c.HostingUnitId == hostingUnit.stSerialKey);
                for (int i = 0; i < hostingUnit.TempImages.Count(); i++)
                {
                    int key = Configuration.ImageIdentity;
                    Configuration.ImageIdentity++;
                    GalleryImageItem ii = new GalleryImageItem()
                    {
                        HostingUnitId = hostingUnit.stSerialKey,
                        Id            = key,
                        Url           = hostingUnit.TempImages[i].Url
                    };
                    GalleryList.Add(ii);
                }
                UpdateXml <HostingUnit>(HostingUnitsList);
                UpdateXml <GalleryImageItem>(GalleryList);
            }
        }