Ejemplo n.º 1
0
        private void ConnectWithSelectedCategories(string imgPath)
        {
            int imgId = SqlUtilities.GetImageId(imgPath);

            foreach (ListItem item in ImageCategories.Items)
            {
                int categId;
                if (item.Selected && int.TryParse(item.Value, out categId))
                {
                    SqlUtilities.InsertIntoBelongsTo(imgId, categId);
                }
            }
        }
Ejemplo n.º 2
0
        private void ConnectWithSelectedAlbums(string imgPath)
        {
            int imgId = SqlUtilities.GetImageId(imgPath);

            foreach (ListItem item in UserAlbums.Items)
            {
                int albumId;
                if (item.Selected && int.TryParse(item.Value, out albumId))
                {
                    if (albumId == -1)
                    {
                        albumId = SqlUtilities.InsertIntoAlbums(NewAlbumName.Text, (string)Session["username"]);
                    }
                    SqlUtilities.InsertIntoIncludedIn(imgId, albumId);
                }
            }
        }