コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.User.Identity.IsAuthenticated)
            {
                //Only accessible when logged in
                FormsAuthentication.RedirectToLoginPage();
            }

            LoggedInUser currentUser = (LoggedInUser)Session["loggedInUser"];

            //List<Audio> currentAudio = currentUser.getAudioFiles();

            AudioManagement_Table.DataSource = currentUser.uploadedFiles;
            AudioManagement_Table.DataBind();
        }
コード例 #2
0
        //Fired when the File Upload Form is submitted
        protected void AudioManagement_FileUploadButton_Click(object sender, EventArgs e)
        {
            LoggedInUser currentUser = (LoggedInUser)Session["loggedInUser"];

            Debug.Write(AudioManagement_FileUpload.PostedFile.ContentLength);
            //Uploading the submitted file as posted file
            int result = currentUser.uploadAudio(AudioManagement_FileUpload.PostedFile, AudioManagement_Alias.Text, AudioManagement_Description.Text);

            if (result == 0)
            {
                //Bind new rows to the PL table
                //List<Audio> currentAudio = currentUser.getAudioFiles();

                AudioManagement_Table.DataSource = currentUser.uploadedFiles;
                AudioManagement_Table.DataBind();
            }
        }
コード例 #3
0
        protected void AudioManagement_Table_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int ID;

            try
            {
                //Get the ID of the row that has fired the event
                ID = (int)AudioManagement_Table.DataKeys[e.RowIndex].Value;
            }
            catch (ArgumentOutOfRangeException arg)
            {
                return;
            }

            //Cathing the currentUser out of the Session and deleting the Audio
            LoggedInUser currentUser = (LoggedInUser)Session["loggedInUser"];

            currentUser.deleteAudio(ID);

            //List<Audio> currentAudio = currentUser.getAudioFiles();

            AudioManagement_Table.DataSource = currentUser.uploadedFiles;
            AudioManagement_Table.DataBind();
        }