Ejemplo n.º 1
0
        /// <summary>
        /// populates the metadata of a photo
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns></returns>
        private static Photo GetItem(IDataRecord reader)
        {
            Photo photo = new Photo
            {
                PhotoID     = Convert.ToInt32(reader["PhotoID"]),
                Title       = Convert.ToString(reader["Title"]),
                Description = Convert.ToString(reader["Description"]),
                DateTaken   = SetDateTaken(reader),
                Profile     = EnumParse <PhotoProfile> .Parse(reader["Profile"].ToString())
            };

            return(photo);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// populates a single photo class
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns></returns>
        private static Photo GetSingleItem(IDataReader reader)
        {
            Photo photo = new Photo();

            using (reader)
            {
                while (reader.Read())
                {
                    photo.PhotoID     = Convert.ToInt32(reader["PhotoID"]);
                    photo.Title       = Convert.ToString(reader["Title"]);
                    photo.Description = Convert.ToString(reader["Description"]);
                    photo.DateTaken   = SetDateTaken(reader);
                    photo.Profile     = EnumParse <PhotoProfile> .Parse(reader["Profile"].ToString());
                }
            }

            return(photo);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handles the Click event of the saveButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void saveButton_Click(object sender, EventArgs e)
        {
            GallerySettings settings = new GallerySettings();

            try
            {
                settings.GalleryTitle = galleryTitle.Text.Trim();

                //set thumbnail height and Width
                settings.ThumbnailDimensions.Height = Convert.ToInt32(thumbnailHeight.Text.Trim());
                settings.ThumbnailDimensions.Width  = Convert.ToInt32(thumbnailWidth.Text.Trim());

                //Set method of storage
                settings.DataStorage = EnumParse <DataStorage> .Parse(storageSelection.SelectedValue);

                //Set presentation mode
                settings.PresentationMode = EnumParse <PresentationMode> .Parse(presentationModeRadioButtonList.SelectedItem.Text);

                //Set current theme
                settings.Theme = themeDropdown.SelectedValue;

                //set fullsize height and Width
                settings.FullsizeDimensions.Height = Convert.ToInt32(fullsizeHeight.Text.Trim());
                settings.FullsizeDimensions.Width  = Convert.ToInt32(fullsizeWidth.Text.Trim());

                //Sets the crossdomain file to the correct hosts.
                SaveCrossDomainXml();

                settings.Save();
                message.Text = AdminResources.SettingsSaved;
            }
            catch (Exception ex)
            {
                message.Text = ex.Message;
            }
        }