Beispiel #1
0
        private void browse_btn_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter =
                @"Images (*.BMP;*.JPG;*.GIF,*.PNG,*.TIFF)|*.BMP;*.JPG;*.GIF;*.PNG;*.TIFF|" +
                @"All files (*.*)|*.*";
            openFileDialog1.Multiselect = true;
            openFileDialog1.Title       = @"Select Photos";
            openFileDialog1.FileName    = "";
            imageList1.ImageSize        = new Size(50, 50);

            DialogResult dr = openFileDialog1.ShowDialog();

            if (dr == DialogResult.OK)
            {
                foreach (var path in openFileDialog1.FileNames)
                {
                    DateTime imgDateTime = new DateTime();

                    using (NewImgPrompt formImgPrompt = new NewImgPrompt(path))
                    {
                        if (formImgPrompt.ShowDialog() == DialogResult.OK)
                        {
                            imgDateTime = formImgPrompt.GetDate();
                        }
                    }
                    if (!_api.AddNewPhoto(path, imgDateTime))
                    {
                        MessageBox.Show(@"Photo path already in DB!");
                    }
                    else
                    {
                        LoadPhoto(path);
                    }
                }
            }
        }
 public bool AddNewPhoto(string path, DateTime date)
 {
     return(_api.AddNewPhoto(path, date));
 }
Beispiel #3
0
 public bool AddNewPhoto(string path, DateTime date, string Location, List <string> personNames)
 {
     return(photosApi.AddNewPhoto(path, date, Location, personNames));
 }