Exemplo n.º 1
0
        protected void ddlCloudUsers_SelectedIndexChanged(object sender, EventArgs e)
        {
            lblUserFileStatus.Text = "";

            DataSet   dsFiles = pxy.GetFilesByUserID(Convert.ToInt32(ddlCloudUsers.SelectedValue), objAccount.UserEmail, objAccount.UserPassword);
            DataTable dtFiles = dsFiles.Tables[0];

            if (dsFiles.Tables[0].Rows.Count != 0)
            {
                dtFiles.Columns.Add("ImageURL", typeof(string));

                // Determine which icon to show based on the file type
                for (int i = 0; i < dtFiles.Rows.Count; i++)
                {
                    string fileType = dtFiles.Rows[i]["FileType"].ToString();
                    string url      = objGM.GetImageURL(fileType);
                    dtFiles.Rows[i]["ImageURL"] = url;
                }

                gvUserCloud.Visible    = true;
                gvUserCloud.DataSource = dtFiles;
                gvUserCloud.DataBind();
            }
            else
            {
                gvUserCloud.Visible    = false;
                lblUserFileStatus.Text = "No files were found";
            }
        }
Exemplo n.º 2
0
        public void FillControls()
        {
            gvViewVersions.Visible = false;

            DataSet dsFiles = pxy.GetFilesByUserID(objAccount.UserID, objAccount.UserEmail, objAccount.UserPassword);
            DataTable dtFiles = dsFiles.Tables[0];

            if (dsFiles.Tables[0].Rows.Count != 0)
            {
                dtFiles.Columns.Add("ImageURL", typeof(string));

                // Determine which icon to show based on the file type
                for (int i = 0; i < dtFiles.Rows.Count; i++)
                {
                    string fileType = dtFiles.Rows[i]["FileType"].ToString();
                    string url = objGM.GetImageURL(fileType);
                    dtFiles.Rows[i]["ImageURL"] = url;
                }

                gvUserCloud.Visible = true;
                gvUserCloud.DataSource = dtFiles;
                gvUserCloud.DataBind();

                ddlFiles.DataSource = dtFiles;
                ddlFiles.DataBind();

                lblStatus.Text += "\nYou have used " + objAccount.StorageUsed + " bytes of your allotted " + objAccount.StorageCapacity + " bytes.";
                lblFileStatus.Text = "";
            }
            else
            {
                lblFileStatus.Text = "No files were found";
                gvUserCloud.Visible = false;
            }

            DataSet dsStorageOptions = pxy.GetStorageOptions(objAccount.UserEmail, objAccount.UserPassword);
            ddlPlanOptions.DataSource = dsStorageOptions;
            ddlPlanOptions.DataBind();
        }