Пример #1
0
    public static int GetFotoCount(int AlbumID)
    {
        DataSetVepAdminTableAdapters.PhotosTableAdapter taAlb = new DataSetVepAdminTableAdapters.PhotosTableAdapter();
        DataTable dtFoto = taAlb.GetFotoByAlbumID(AlbumID);

        return(dtFoto.Rows.Count);
    }
Пример #2
0
    protected void AggiungiFoto(object sender, EventArgs e)
    {
        int    AlbumID = int.Parse((string)Request.QueryString["AlbumID"]);
        string caption = PhotoCaption.Text;

        byte[] photoBytes = PhotoFile.FileBytes;
        DataSetVepAdminTableAdapters.PhotosTableAdapter taphotos = new DataSetVepAdminTableAdapters.PhotosTableAdapter();
        DataTable dtphotos = taphotos.GetFotoByAlbumID(AlbumID);
        int       ordine   = dtphotos.Rows.Count + 1;

        PhotoManager.AddPhoto(AlbumID, caption, photoBytes, ordine);
    }
Пример #3
0
 protected void ButtonUploadFoto_Click(object sender, EventArgs e)
 {
     if (!_isRefresh)
     {
         int    AlbumID    = int.Parse((string)Request.QueryString["AlbumID"]);
         string caption    = PhotoCaption.Text;
         byte[] photoBytes = PhotoFile.FileBytes;
         //devo recuperare tutte le foto dell'album per trovare la prima posizione disponibile
         DataSetVepAdminTableAdapters.PhotosTableAdapter taPhotos = new DataSetVepAdminTableAdapters.PhotosTableAdapter();
         DataTable dtPhotos = taPhotos.GetFotoByAlbumID(AlbumID);
         int       ordine   = dtPhotos.Rows.Count + 1;
         PhotoManager.AddPhoto(AlbumID, caption, photoBytes, ordine);
         lvFoto.DataBind();
         btnChangePos.Visible = true;
     }
 }
Пример #4
0
    protected void change_pos(object sender, EventArgs e)
    {
        string strarrPos = hdfArrPos.Value;
        string albId     = Request.QueryString["AlbumID"];

        string[] splitted = strarrPos.Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
        DataSetVepAdminTableAdapters.PhotosTableAdapter taPhoto = new DataSetVepAdminTableAdapters.PhotosTableAdapter();
        DataTable dtPhotos = taPhoto.GetFotoByAlbumID(int.Parse(albId));

        for (int i = 0; i < splitted.Length; i++)
        {
            int PhotoId = 0;
            for (int j = 0; j < dtPhotos.Rows.Count; j++)
            {
                if (dtPhotos.Rows[j]["ordine"].ToString() == splitted[i].ToString())
                {
                    PhotoId = int.Parse(dtPhotos.Rows[j]["PhotoID"].ToString());
                    int ret = taPhoto.UpdateOrdineFoto(i + 1, PhotoId);
                }
            }
        }
        lvFoto.DataBind();
    }