Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="photoList"></param>
        public void SavePhotoList(PhotoList photoList)
        {
            if (photoList.AddCheck == "Y")
            {
                photoList.CheckTypeId = null;
            }
            PhotoList findOne = db.PhotoList.Where(x => (x.PhotoId == photoList.PhotoId)).FirstOrDefault();

            if (findOne == null)
            {
                photoList.InDateTime     = DateTime.Now;
                photoList.ModifyDateTime = DateTime.Now;
                db.PhotoList.Add(photoList);
            }
            else
            {
                findOne.ModifyDateTime = DateTime.Now;
                findOne.ModifyUserId   = photoList.ModifyUserId;
                findOne.PhotoName      = photoList.PhotoName;
                findOne.UseChk         = photoList.UseChk;
                findOne.AddCheck       = photoList.AddCheck;
                findOne.MustChk        = photoList.MustChk;
                findOne.CheckTypeId    = photoList.CheckTypeId;
                findOne.ProjectId      = photoList.ProjectId;
            }
            db.SaveChanges();
        }
Esempio n. 2
0
        private void AddPhotos(string photos_)
        {
            PhotoList photos = PhotoList.Deserialize(photos_);

            Settings.Instance.PicturesCounter = photos.Photos.Count;
            PhotoDB.AddPhotos(photos);
        }
Esempio n. 3
0
        //string artistName)
        public ActionResult Index()
        {
            PhotoList photos = new PhotoList();
            List<string> fileList = new List<string>();
            var dirList = System.IO.Directory.GetDirectories(Server.MapPath(Url.Content("~/Content/Artists/")));
            Random rand = new Random();

            //Selects a random sample of 10 pictures and returns them to the view to use in the slider.
            foreach (string directory in dirList)
            {
                var artist = GetArtistName(directory);
                var files = from f in System.IO.Directory.GetFiles(directory)
                            where System.IO.Path.GetFileName(f).ToUpper().StartsWith("TAT")
                            select f;
                fileList.AddRange(files);
                foreach (string fileName in files)
                {
                    decimal sortKey = rand.Next();
                    photos.Add( new Models.Photo { FileName = artist + "/" + System.IO.Path.GetFileName(fileName),
                        Title = GetTitle(fileName),
                        SortKey = sortKey});
                }
            }

            photos.Sort((p1, p2) => (p1.SortKey.CompareTo(p2.SortKey)));

            return View(new PhotoList(photos.GetRange(0, 10)));
        }
        public async Task SendStatus()
        {
            IsLoading = true;
            if (string.IsNullOrEmpty(Status) || Status.Length > 500)
            {
                return;
            }
            IEnumerable <int> mediaIds = null;

            if (PhotoList.Any())
            {
                mediaIds = PhotoList.Select(node => node.Attachment.Id);
            }
            int?replyId = null;

            if (ReplyStatus != null)
            {
                replyId = ReplyStatus.Id;
            }
            try
            {
                var result = await Client.PostStatus(Status, StatusVisibility, replyId, mediaIds, Sensitive, SpoilerText.Any()?SpoilerText : null);

                await NavigationService.NavigateAsync(typeof(MainPage), "home");
            }
            catch (Exception e)
            {
                await MessageDialogMaker.SendMessageDialogAsync(e.Message, false);
            }
            IsLoading = false;
        }
 public APIResult SavePhotoList(PhotoList photo)
 {
     try
     {
         //List<PhotoList> photoList = masterService.GetPhotoList("", "", "", photo.PhotoName, null);
         //if (photoList != null && photoList.Count != 0 && photo.PhotoId != photoList[0].PhotoId)
         //{
         //    return new APIResult() { Status = false, Body = "照片名称重复" };
         //}
         //else
         //{
         masterService.SavePhotoList(photo);
         return(new APIResult()
         {
             Status = true, Body = ""
         });
         //}
     }
     catch (Exception ex)
     {
         return(new APIResult()
         {
             Status = false, Body = ex.Message.ToString()
         });
     }
 }
Esempio n. 6
0
    protected void ListBand(int id)
    {
        List <ProductsPhoto> al = new List <ProductsPhoto>();

        al = Leyp.SQLServerDAL.Factory.getProductsPhotoDAL().getListByProductsID(id);
        PhotoList.DataSource = al;
        PhotoList.DataBind();
    }
        private void LoadMovieList()
        {
            _movieList = null;
            PhotoFiles = new PhotoList(DBFolder);
            List <Movie> ls = AssistRoutines.MovieTbl.GetAllList();

            MovieList = new ObservableCollection <Movie>((ls.OrderBy(x => x.Title).ToList()));
        }
Esempio n. 8
0
    protected void init()
    {
        string  ID = Request.QueryString["BuyOrderID"].ToString();
        DataSet dd = Leyp.SQLServerDAL.Buy.Factory.getBuyOrderDetailDAL().getOrderDetailPhoto(ID);

        PhotoList.DataSource = dd;
        PhotoList.DataBind();
        Label1.Text = ID;
    }
Esempio n. 9
0
 /// <summary>
 /// Remove Image from ListBox and PhotoList
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void RemoveImage_Click(object sender, EventArgs e)
 {
     if (IListBox.Items.Count != 0)
     {
         PhotoList.Remove(IListBox.Items[indexer].ToString());
         IListBox.Items.Remove(IListBox.Items[indexer].ToString());
         indexer = 0;
     }
 }
Esempio n. 10
0
 protected override void ScanPhotos(ImportController controller, PhotoList photo_list)
 {
     foreach (var uri in uris)
     {
         Log.Debug("Scanning " + uri);
         ScanPhotoDirectory(controller, uri, photo_list);
     }
     ThreadAssist.ProxyToMain(() => controller.PhotoScanFinished());
 }
Esempio n. 11
0
        /// <summary>
        /// Changed current windows background
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UpdateWindow_Click(object sender, EventArgs e)
        {
            var path = PhotoList.GetCurrentPath();

            if (!string.IsNullOrWhiteSpace(path))
            {
                Native.SetWindow(path, SettingList.TypeImage);
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Open image in any programm
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void IListBox_DoubleClick(object sender, EventArgs e)
        {
            var path = PhotoList.GetCurrentPath();

            if (!string.IsNullOrWhiteSpace(path))
            {
                Process.Start(path);
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Remove duplicate image
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DelCopy_Click(object sender, EventArgs e)
        {
            var removes = PhotoList.Remove();

            foreach (var item in removes)
            {
                IListBox.Items.Remove(item);
            }
        }
Esempio n. 14
0
        /// <summary>
        /// If SelectedIndexChanged current image in Panel is changed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void IListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            indexer = IListBox.SelectedIndex == -1 ? 0 : IListBox.SelectedIndex;
            string locale = PhotoList.File(IListBox.Items[indexer].ToString());

            if (!string.IsNullOrWhiteSpace(locale))
            {
                Slider.BackgroundImage = Image.FromFile(locale);
            }
        }
Esempio n. 15
0
        public void StartPhotoScan(ImportController controller, PhotoList photo_list)
        {
            if (PhotoScanner != null)
            {
                run_photoscanner = false;
                PhotoScanner.Join();
            }

            run_photoscanner = true;
            PhotoScanner     = ThreadAssist.Spawn(() => ScanPhotos(controller, photo_list));
        }
Esempio n. 16
0
        /// <summary>
        /// Change image of the previous
        /// </summary>
        private void Previous()
        {
            var index = IListBox.Items.IndexOf(PhotoList.Previous().GetLastPart());

            if (index != -1)
            {
                IListBox.SelectedItem = IListBox.Items[index];
            }

            Native.SetWindow(PhotoList.Previous(), SettingList.TypeImage);
        }
        private string GetImageSurveyUrl(int hotelId)
        {
            string imageUrl = Constant.ImageDefault;
            var    image    = PhotoList.FirstOrDefault(x => x.HotelId == hotelId && x.ImageTypeId > 3 && x.IsActive.HasValue && x.IsActive.Value);

            if (image != null)
            {
                imageUrl = image.Url;
            }
            return(imageUrl);
        }
Esempio n. 18
0
        public ImportDialogController(bool persistPreferences)
        {
            // This flag determines whether or not the chosen options will be
            // saved. You don't want to overwrite user preferences when running
            // headless.
            this.persistPreferences = persistPreferences;

            Photos        = new PhotoList();
            FailedImports = new List <SafeUri> ();
            LoadPreferences();
        }
Esempio n. 19
0
        async Task SaveToJson()
        {
            try
            {
                // read list of photos from JSON file
                FileStream   stream1      = new FileStream(JsonFilePath, FileMode.Open);
                StreamReader reader       = new StreamReader(stream1);
                string       fileContents = reader.ReadToEnd();
                reader.Close();
                PhotoList = JsonConvert.DeserializeObject <List <PhotoItem> >(fileContents);

                // query to see if photo object already in file
                List <PhotoItem> otherObjects = (from photoItemObject in PhotoList
                                                 where photoItemObject.PhotoFilePath != PhotoItemObject.PhotoFilePath
                                                 select photoItemObject).ToList <PhotoItem>();

                // photo object already exists; update it
                if (otherObjects.Count != PhotoList.Count)
                {
                    otherObjects.Add(PhotoItemObject);
                    PhotoList = otherObjects;
                    AllPhotos = PhotoList;
                }
                // add new photo item to list
                else
                {
                    PhotoList.Add(PhotoItemObject);
                    AllPhotos.Add(PhotoItemObject);
                }
                AllPhotos = (from photo in AllPhotos
                             orderby photo.PhotoTime
                             select photo).ToList();

                PhotoSource = new ObservableCollection <PhotoItem>(AllPhotos);

                // write updated photo list to JSON file
                StreamWriter writer = new StreamWriter(JsonFilePath, false);
                writer.WriteLine(JsonConvert.SerializeObject(PhotoList));
                writer.Close();

                // update locations
                Location currentLocation = await GetCurrentDistance();

                for (int i = 0; i < AllPhotos.Count; i++)
                {
                    AllPhotos[i].DistanceToCurrent = Math.Round(Location.CalculateDistance(currentLocation, AllPhotos[i].PhotoLocation, DistanceUnits.Miles), 4);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Esempio n. 20
0
        public RepairDialog(IBrowsableCollection collection) : base("RepairDialog.ui", "repair_dialog")
        {
            source  = collection;
            missing = new PhotoList();

            FindMissing();
            TrayView view = new TrayView(missing);

            view_scrolled.Add(view);

            this.ShowAll();
        }
Esempio n. 21
0
 public new void Update()
 {
     Details_ListView.Items.Clear(); //czyszczenie listview z atrybutami
     ImageList.Images.Clear();       //czyszczenie listy z obrazkami
     PhotoList.BeginUpdate();
     PhotoList.Items.Clear();        //czyszczenie listview z nazwami i obrazkami
     foreach (Element element in elements)
     {
         ImageList.Images.Add(element.ID.ToString(), element.Image); //dodanie obrazkow z ID do listy obrazkow
     }
     PhotoList.Items.AddRange(listViewItem.ToArray());               //dodanie listviewitem do listview z obrazkami i nazwami
     PhotoList.EndUpdate();
 }
 /// <summary>
 /// プレイヤー操作終了時関数
 /// </summary>
 public void GameEnd()
 {
     for (int i = 0; i < PhotoShotList.Count; i++)
     {
         var list = PhotoShotList[i];
         for (int j = 0; j < list.Count; j++)
         {
             if (list[j].isShootted)
             {
                 PhotoList.Add(list[j].photo);
             }
         }
     }
 }
Esempio n. 23
0
        void RescanPhotos()
        {
            if (ActiveSource == null)
            {
                return;
            }

            photo_scan_running = true;
            PhotoList pl = new PhotoList();

            Photos.Collection = pl;
            ActiveSource.StartPhotoScan(this, pl);
            FireEvent(ImportEvent.PhotoScanStarted);
        }
Esempio n. 24
0
        void RescanPhotos()
        {
            if (ActiveSource == null)
            {
                return;
            }

            photo_scan_running = true;
            var pl = new PhotoList();

            Photos.Collection                    = pl;
            ActiveSource.PhotoFoundEvent        += OnPhotoFound;
            ActiveSource.PhotoScanFinishedEvent += OnPhotoScanFinished;
            ActiveSource.StartPhotoScan(RecurseSubdirectories, MergeRawAndJpeg);
            FireEvent(ImportEvent.PhotoScanStarted);
        }
Esempio n. 25
0
        public async Task <string> GetPhotos(string query)
        {
            try
            {
                PhotosService _photosService = new PhotosService();
                PhotoList     response       = await _photosService.SearchPhotos(query);

                var photos = JsonConvert.SerializeObject(response.results);
                return(photos);
            }
            catch (System.Exception ex)
            {
                Debug.WriteLine(ex);
                return(ex.Message);
            }
        }
Esempio n. 26
0
        private void WindowLoaded(object sender, EventArgs e)
        {
            var layer = AdornerLayer.GetAdornerLayer(CurrentPhoto);
            _cropSelector = new RubberbandAdorner(CurrentPhoto) {Window = this};
            layer.Add(_cropSelector);
#if VISUALCHILD
            CropSelector.Rubberband.Visibility = Visibility.Hidden;
#endif
#if NoVISUALCHILD
            CropSelector.ShowRect = false;
#endif

            Photos = (PhotoList) (Application.Current.Resources["Photos"] as ObjectDataProvider)?.Data;
            Photos.Path = "..\\..\\Photos";
            ShoppingCart = (PrintList) (Application.Current.Resources["ShoppingCart"] as ObjectDataProvider)?.Data;
        }
Esempio n. 27
0
        public void SubmitExecute(object obj)
        {
            PhotoList.Clear();
            //Check if search string is null or empty
            if (String.IsNullOrWhiteSpace(ImageSearchKeyword))
            {
                IsPhotoListEmpty      = true;
                EmptyPhotoListMessage = ConstantsUtility.EmptySearchStringErrorMessage;
                return;
            }

            //Fetch data from api call
            var result = (FlickerFeed)_feedApi.ImageSearch(ImageSearchKeyword);

            if (result != null && result.IsSuccessful)
            {
                foreach (var i in result.Entry)
                {
                    foreach (var link in i.Link)
                    {
                        if (link.Type.Contains(ConstantsUtility.LinkTypeImageString))
                        {
                            var pic = new Photo()
                            {
                                Title = i.Title,
                                Url   = link.Href.ToString()
                            };
                            PhotoList.Add(pic);
                        }
                    }
                }
                CheckAndUpdateIsPhotoListEmpty();
            }
            else
            {
                IsPhotoListEmpty = true;
                //We can handle error message based on the business logic scenarios
                if (result != null)
                {
                    EmptyPhotoListMessage = result.ErrorMessage;
                }
                else
                {
                    EmptyPhotoListMessage = ConstantsUtility.ErrorMessageString;
                }
            }
        }
Esempio n. 28
0
        /// <summary>
        /// Add image from call UriDialog to PhotoList,ListBox and puts current picture in Panel
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddImageURL_Click(object sender, EventArgs e)
        {
            string path = "";

            using (var uD = new UrlDialog())
                if (uD.ShowDialog(this) == DialogResult.OK)
                {
                    path = uD.Path;
                }

            if (!string.IsNullOrWhiteSpace(path))
            {
                PhotoList.Add(path);
                IListBox.Items.Add(path.GetLastPart());
                Slider.BackgroundImage = Image.FromFile(path);
            }
        }
        private string GetHotelImageUrl(int hotelId)
        {
            string imageUrl = Constant.ImageDefault;
            var    image    = PhotoList.FirstOrDefault(x => x.HotelId == hotelId && x.ImageTypeId > 3 && x.IsActive.HasValue && x.IsActive.Value);

            if (image != null)
            {
                imageUrl = image.Url;
            }
            try
            {
                return(string.Format("{0}",
                                     new Uri(new Uri(AppConfiguration.CdnImageUrlDefault), imageUrl).AbsoluteUri));
            }
            catch (Exception)
            {
                return(imageUrl);
            }
        }
Esempio n. 30
0
 public static void DeleteRecord(Photograph photo, PhotoList list)
 {
     list.Remove(photo);
     using (SqlConnection connection = new SqlConnection(connectionString))
     {
         try
         {
             using (SqlCommand command = new SqlCommand($"DELETE FROM tblPhotoAlbum WHERE Id = @Id", connection))
             {
                 command.Parameters.AddWithValue("@Id", photo.Id);
                 connection.Open();
                 command.ExecuteNonQuery();
             }
         }
         catch (SqlException e)
         {
             MessageBox.Show("An exception occurred:" + e.Message);
         }
     }
 }
        public (PhotoList, List <ImportError>) FindPhotos(
            string sourcePath, IOutputPort outputPort, bool readImageMetaData)
        {
            _outputPort = outputPort;
            _list       = new PhotoList();
            _errorList  = new List <ImportError>();

            FindPhotosInDirectory(sourcePath);

            _outputPort?.TrackHandleTelemetry(_list, _errorList,
                                              // ReSharper disable once UseStringInterpolation
                                              string.Format("ImportPhotos: Found photos (Source: {0}, ExistingPhotos: {1}, Errors {2})",
                                                            sourcePath, _list.Count, _errorList.Count));

            if (readImageMetaData)
            {
                ReadImageMetaData();
            }

            return(_list, _errorList);
        }
Esempio n. 32
0
        private void AddPhotoToList(FlickrNet.Flickr f, FlickrNet.Photo flickrPhoto, Photoset photoset)
        {
            // Filter by date, if filter option enabled and date taken is known.
            if (!Settings.FilterByDate ||
                flickrPhoto.DateTakenUnknown ||
                (flickrPhoto.DateTaken.Date >= Settings.StartDate && flickrPhoto.DateTaken.Date <= Settings.StopDate))
            {
                Photo photo = new Photo(flickrPhoto, photoset);
                PhotoList.Add(photo);

                // Get the photo info to get the raw tags, and put them into the photo object.
                // The raw tags are as uploaded or entered -- with spaces, punctuation, and
                // upper/lower case.
                FlickrNet.PhotoInfo info = f.PhotosGetInfo(flickrPhoto.PhotoId);
                photo.Tags.Clear();
                for (int i = 0; i < info.Tags.Count; i++)
                {
                    photo.Tags.Add(info.Tags[i].Raw);
                }
            }
        }
        /// <summary>
        /// Bind the photo list to the main list view control
        /// </summary>
        /// <param name="photoList">the photo list to bind</param>
        public void SetListViewDataBinding(PhotoList photoList)
        {
            if (!Dispatcher.CheckAccess())
            {
                // we were called on a worker thread
                // marshal the call to the user interface thread
                Dispatcher.Invoke(new PhotoListParameterDelegate(SetListViewDataBinding),
                            new object[] { photoList });
                return;
            }

            // this code can only be reached
            // by the user interface thread
            lvPhotos.DataContext = photoList;
        }
Esempio n. 34
0
 public Product()
 {
     photos = new PhotoList();
 }
Esempio n. 35
0
 private void WindowLoaded(object sender, RoutedEventArgs e)
 {
     _photos = (PhotoList) (Resources["MyPhotos"] as ObjectDataProvider).Data;
     _photos.Path = "...\\...\\Images";
 }
Esempio n. 36
0
		// XXX: never called
		void HandleAdjustTime (object sender, EventArgs args)
		{
			PhotoList list = new PhotoList (Selection.Items);
			list.Sort (new IPhotoComparer.CompareDateName ());
			(new AdjustTimeDialog (Database, list)).Run ();
		}