Example #1
0
 public FileManager()
 {
     loDocument = new Document();
     loDocAuthor = new DocAuthor();
     loDocEditor = new DocEditor();
     loDocTag = new DocTag();
     loImage = new ImageBO();
     loImageTag = new ImageTag();
 }
Example #2
0
        private void btnAddImage_Click(object sender, EventArgs e)
        {
            loImage = new ImageBO();
            loImage.ImageID = "";
            loImage.Title = txtTitle.Text;
            loImage.Path = @"" + txtBrowse.Text;
            loImage.Type = Path.GetExtension(txtBrowse.Text);
            loImage.Caption = txtCaption.Text;
            loImage.Location = txtLocation.Text;
            loImage.PhotographerId = cboPhotographers.SelectedValue.ToString();
            loImage.DateTaken = dtpDateTaken.Value;
            loImage.Tags = txtTags.Text;
            PhotographerName = cboPhotographers.Text;
            ThumbnailImage = loImageThumbnail;

            ClosingType = Common.Enum.ClosingType.Accepted;
            Close();
        }
Example #3
0
        public int countImages(string pSearchTag, DateTime pFrom, DateTime pTo)
        {
            ImageBO _image = new ImageBO();
            int _tagCount = 0;
            string _strTags = "";
            if (pSearchTag != "")
            {
                string[] _artags = GlobalFunctions.addSlashes(pSearchTag).Split(' ');
                IList<string> _tags = GlobalFunctions.removeRedundancy(_artags);

                _tagCount = _tags.Count;
                foreach (string _str in _tags)
                {
                    _strTags = _strTags + "'" + _str + "',";
                }
                _strTags = _strTags.Substring(0, _strTags.Length - 1);
            }
            return _image.count(_strTags, _tagCount, pFrom, pTo);
        }
Example #4
0
        private void btnAddImage_Click(object sender, EventArgs e)
        {
            AddImage _addImage = new AddImage();
            _addImage.ShowDialog(this);

            if (_addImage.ClosingType == Common.Enum.ClosingType.Accepted)
            {
                loImage = _addImage.getImage();
                gridImages.Rows.Count++;
                gridImages.SetData(gridImages.Rows.Count - 1, "Title", loImage.Title);
                gridImages.SetData(gridImages.Rows.Count - 1, "Local Path", loImage.Path);
                gridImages.SetData(gridImages.Rows.Count - 1, "Caption", loImage.Caption);
                gridImages.SetData(gridImages.Rows.Count - 1, "Location", loImage.Location);
                gridImages.SetData(gridImages.Rows.Count - 1, "Photographer", _addImage.PhotographerName);
                gridImages.SetData(gridImages.Rows.Count - 1, "Photographer ID", loImage.PhotographerId);
                gridImages.SetData(gridImages.Rows.Count - 1, "Thumbnail", _addImage.ThumbnailImage);
                gridImages.SetData(gridImages.Rows.Count - 1, "Date Taken", loImage.DateTaken);
                gridImages.SetData(gridImages.Rows.Count - 1, "Tags", loImage.Tags);
                gridImages.SetData(gridImages.Rows.Count - 1, "Type", loImage.Type);

                gridImages.AutoSizeRows();
                gridImages.AutoSizeCols();
            }
        }
Example #5
0
 public bool deleteImage(string pImageId)
 {
     ImageBO _oImage = new ImageBO(pImageId);
     string[] _type = _oImage.Path.Split('.');
     string _path = _oImage.ImageID + "." + _type[_type.Length - 1];
     bool _del = _oImage.delete();
     if (_del)
     {
         try
         {
             File.Move(GlobalVariables.goImageServer + @"\" + _path, GlobalVariables.goRecycleBin + @"\" + _path);
         }
         catch { }
     }
     return _del;
 }
Example #6
0
 public bool saveImage(ImageBO poImage)
 {
     return poImage.update();
 }
Example #7
0
 public ImageBO getImage(string pImageId)
 {
     ImageBO _image = new ImageBO(pImageId);
     return _image;
 }
Example #8
0
 private void ViewImage_Load(object sender, EventArgs e)
 {
     loImage = loFilSearch.getImage(lImageId);
     loadComboBoxes();
     loadTags();
     populate();
 }