public void btnUpdate_Click(object sender, System.EventArgs e) { try { //Check Security Permissions if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.COURSE_EDIT)) { throw new Exception(SharedSupport.GetLocalizedString("Global_Unauthorized")); } CourseM course = CourseM.Load(courseId); if (course.IsValid) { //Update - Load existing Course and populate fields course.Name = txtShortNameValue.Text.ToString(); course.Description = txtDescription.Text.ToString(); course.HomepageURL = txtHomePageURL.Text.ToString(); course.LastUpdatedDate = DateTime.Now; course.LastUpdatedUserID = SharedSupport.GetUserIdentity(); course.Update(); populateControls(course); Response.Redirect(@"./AddEditCourse.aspx?CourseID=" + courseId + "&Action=Update"); } else { // throw error - can't use this page without CourseID int passed in Response.Redirect(@"../Error.aspx?ErrorDetail=" + "AddEditCourse_MissingCourseID&" + Request.QueryString.ToString(), false); } } catch (Exception ex) { Nav1.Feedback.Text = ex.Message.ToString(); } }
// This function is used to delete the temporary directories that are created on the server when files are downloaded. internal void DeleteTempDirectory(string GUID) { try { // Validate the GUID. System.Guid guid = new System.Guid(GUID); // Get the local path for the AMDownload directory. string filePath = System.Web.HttpContext.Current.Request.MapPath(Constants.ASSIGNMENTMANAGER_DOWNLOAD_DIRECTORY); // Add the GUID to complete the temporary filepath (i.e. 'C:\Inetpub\wwwroot\AMDownload\6c5fb16e-9332-46ce-9eab-94ab6b4f5cdb'). filePath += guid.ToString(); try { Directory.Delete(filePath, true); } catch (Exception ex) { SharedSupport.LogMessage(SharedSupport.GetLocalizedString("Assignment_DeleteStarterProjectFailed") + filePath + " " + ex.Message); } } catch (Exception GUIDException) { // Invalid GUID returned, abort delete action to prevent the deleting or files outside of AMDownload directory. SharedSupport.LogMessage(SharedSupport.GetLocalizedString("Assignment_DeleteStarterProjectFailed") + GUID + " " + GUIDException.Message); } }
/// <summary> /// /// </summary> private void clearFields() { btnUpdate.Text = SharedSupport.GetLocalizedString("AddEditUser_Insert"); //"Insert"; this.lblUserDetails.Text = SharedSupport.GetLocalizedString("AddEditUser_AddLookUpUsers"); //"Add/Look Up Users"; this.lblDescription.Text = SharedSupport.GetLocalizedString("AddEditUser_EnterCreateUserInfo"); this.lblFindInstructions.Text = SharedSupport.GetLocalizedString("AddEditUser_EnterFindUserInfo"); // The password generation mechanism is dependant upon the whether SMTP can be used to inform // the user of their new password. if (Convert.ToBoolean(SharedSupport.UsingSmtp)) { lblPasswordText.Text = SharedSupport.GetLocalizedString("AddEditUser_UserInsertedEmailSent"); } else { lblPasswordText.Text = SharedSupport.GetLocalizedString("AddEditUser_UserInsertedPasswordIsName"); } txtEMailAddress.Text = String.Empty; txtFirstName.Text = String.Empty; txtLastName.Text = String.Empty; txtMiddleName.Text = String.Empty; txtUniversityIdentifier.Text = String.Empty; txtUserName.Text = String.Empty; }
//First, defines the SectionID for the User and Course //Then, grabs the info for the Assignments and status using the UserID and SectionID protected void BrowseAssignments(CourseM course) { if (courseId.Equals(null)) { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("Assignments_SectionIDError"); } else { int userID = SharedSupport.GetUserIdentity(); AssignmentList assignList = course.GetStudentAssignmentList(userID); if (assignList.Count > 0) { //cycle through all the rows and set n/a for (int i = 0; i < assignList.Count; i++) { if (assignList.GetOverallGradeForItem(i).Equals(String.Empty)) { assignList.SetOverallGradeForItem(i, SharedSupport.GetLocalizedString("GradeDetail_Default")); } } //Populate DataList this.dlAssignments.DataSource = assignList.GetDefaultView(Server); this.dlAssignments.DataBind(); } else { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("Assignments_NoAssignmentError"); } } }
private void populateControls(CourseM course) { //Update - Load existing Course and populate fields txtDescription.Text = course.Description; txtHomePageURL.Text = course.HomepageURL; txtShortNameValue.Text = course.Name; // Use the CourseID to create a unique xml filename for the course. string filename = course.CourseID + ".xml"; if (SharedSupport.UsingSsl == true) { txtStudentURL.Text = @"https://" + SharedSupport.BaseUrl + AssignmentManager.Constants.ASSIGNMENTMANAGER_COURSES_DIRECTORY + Server.UrlEncode(filename); } else { txtStudentURL.Text = @"http://" + SharedSupport.BaseUrl + AssignmentManager.Constants.ASSIGNMENTMANAGER_COURSES_DIRECTORY + Server.UrlEncode(filename); } btnUpdate.Text = SharedSupport.GetLocalizedString("AddEditCourse_UpdateText"); }
private void localizeLabels() { //Labels lblEmailAddress.Text = SharedSupport.GetLocalizedString("AdminImport_Email"); lblFirstName.Text = SharedSupport.GetLocalizedString("AdminImport_FirstName"); //lblImportedFileLocation.Text = SharedSupport.GetLocalizedString("AdminImport_ImportedFileLocation"); lblLastName.Text = SharedSupport.GetLocalizedString("AdminImport_LastName"); lblMiddleName.Text = SharedSupport.GetLocalizedString("AdminImport_MiddleName"); lblUniversityID.Text = SharedSupport.GetLocalizedString("AdminImport_UniversityID"); lblUserName.Text = SharedSupport.GetLocalizedString("AdminImport_UserName"); lblTitle.Text = SharedSupport.GetLocalizedString("AdminImport_Title"); lblDescription.Text = SharedSupport.GetLocalizedString("AdminImport_ImportFormPreview_SubTitle"); //Buttons btnImportRecords.Text = SharedSupport.GetLocalizedString("AdminImport_ImportRecords"); btnCancel.Text = SharedSupport.GetLocalizedString("AdminImport_Cancel"); //Set readonly properties txtImportedFileLocation.ReadOnly = true; //add items to combo boxes if (!Page.IsPostBack) { //Set the default value for each of the dropdown menus. int dropdownIndex = 0; ListItem newListItem = new ListItem(SharedSupport.GetLocalizedString("AdminImport_None"), dropdownIndex.ToString()); cboEmailAddress.Items.Add(newListItem); cboFirstName.Items.Add(newListItem); cboLastName.Items.Add(newListItem); cboMiddleName.Items.Add(newListItem); cboUniversityID.Items.Add(newListItem); cboUserName.Items.Add(newListItem); } }
private void checkErrorCases() { if (txtUserName.Text == String.Empty) { throw new Exception(SharedSupport.GetLocalizedString("User_UserNameEmpty")); } else if (txtUserName.Text.Length < 4 || txtUserName.Text.Length > 50) { throw new Exception(SharedSupport.GetLocalizedString("User_UserNameFailedBR")); } else if (txtEMailAddress.Text == String.Empty) { throw new Exception(SharedSupport.GetLocalizedString("User_EmailEmpty")); } else if (txtEMailAddress.Text.Length > 100) { throw new Exception(SharedSupport.GetLocalizedString("User_EmailMoreThan100Char")); } else if (txtUniversityIdentifier.Text == String.Empty) { throw new Exception(SharedSupport.GetLocalizedString("User_UniversityIdentifierEmpty")); } else if (txtUniversityIdentifier.Text.Length > 50) { throw new Exception(SharedSupport.GetLocalizedString("User_UniversityIdentifierTooBig")); } }
public void btnAutoCompile_Click(object sender, System.EventArgs e) { try { //make sure the user is allowed to do this if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.USERASSIGNMENT_EDIT)) { // Note that Redirect ends page execution. Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } int[] userAssignmentIds = getCheckedUserAssignmentIdsFromDataList(); if (userAssignmentIds.Length < 1) { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("Submissions_NoSelectionMade"); return; } //call Auto Compile for each UserAssignmentID for (int i = 0; i < userAssignmentIds.Length; i++) { StudentAssignmentM.SendActionToQueue(userAssignmentIds[i], true, false); } // refresh user assignments data list userAssignmentsRefresh(); Nav1.Feedback.Text = SharedSupport.GetLocalizedString("FacultySubmissions_BuildSubmitSuccessful"); } catch (Exception ex) { Nav1.Feedback.Text = ex.Message; } }
public void btnSave_Click(object sender, System.EventArgs e) { try { if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.USER_ADD)) { // Note that Redirect ends page execution. Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } btnCancel.Enabled = true; btnSave.Enabled = true; btnSave.Visible = true; Nav1.Feedback.Text = String.Empty; AssignmentManager.Common.Functions func = new AssignmentManager.Common.Functions(); string importID = func.ValidateStringQueryStringParameter(this.Request, "ImportID"); if (ImportUsers.CommitImport(importID)) { // Records saved successfully redirect to Users page. Response.Redirect("Users.aspx?CourseID=" + Request.QueryString.Get("CourseID").ToString(), false); } else { throw new ApplicationException(); } } catch { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("AdminResults_UpdateFailed"); btnCancel.Enabled = true; btnSave.Enabled = false; btnSave.Visible = false; } }
protected void LocalizeLabels() { lblAddResource.Text = SharedSupport.GetLocalizedString("AddResource_AddResourcesText"); lblResourceName.Text = SharedSupport.GetLocalizedString("AddResource_DisplayName"); lblNameExample.Text = SharedSupport.GetLocalizedString("AddResource_DisplayNameExample"); lblResourceLink.Text = SharedSupport.GetLocalizedString("AddResource_LinkInfo"); lblLinkExample.Text = SharedSupport.GetLocalizedString("AddResource_LinkInfoExample"); }
private void LocalizeLabels() { Nav1.Feedback.Text = String.Empty; lblDelimitedCharacter.Text = SharedSupport.GetLocalizedString("AdminImport_Delimited_Char"); lblSelectFile.Text = SharedSupport.GetLocalizedString("AdminImport_SelectFile"); btnPreview.Text = SharedSupport.GetLocalizedString("AdminImport_Preview"); //"Preview"; btnCancel.Text = SharedSupport.GetLocalizedString("AdminImport_Cancel"); }
//AutoCompile related fields. Only visible when AutoCompile details are present protected void LocalizeAutoBuildLabels(StudentAssignmentM assignment) { this.lblCompileResultLabel.Text = SharedSupport.GetLocalizedString("GradeDetail_Result"); this.lblCompileResult.Text = Server.HtmlEncode(assignment.BuildResultCode); this.lblCompileDateLabel.Text = SharedSupport.GetLocalizedString("GradeDetail_Date"); this.lblCompileDate.Text = Server.HtmlEncode(assignment.LastUpdatedDate.ToShortDateString()); this.lblCompileDetailLabel.Text = SharedSupport.GetLocalizedString("GradeDetail_Detail"); this.lblCompileDetails.Text = assignment.BuildDetails; }
protected void LocalizeLabels() { this.lblConfirmPwd.Text = SharedSupport.GetLocalizedString("ChangePassword_ConfirmPwdHeader"); this.lblNewPwd.Text = SharedSupport.GetLocalizedString("ChangePassword_NewPwdHeader1"); this.btnCancel.Text = SharedSupport.GetLocalizedString("ChangePassword_btnCancel"); this.btnSave.Text = SharedSupport.GetLocalizedString("ChangePassword_btnSave"); this.lblUser.Text = SharedSupport.GetLocalizedString("ChangePassword_lblUser"); this.lblRequired.Text = SharedSupport.GetLocalizedString("Global_RequiredFieldIndicator"); }
protected void Page_Load(object sender, System.EventArgs e) { try { // grab CourseID parameter from the querystring AssignmentManager.Common.Functions func = new AssignmentManager.Common.Functions(); courseId = func.ValidateNumericQueryStringParameter(this.Request, "CourseID"); UserM user = UserM.Load(SharedSupport.GetUserIdentity()); if (!user.IsInCourse(courseId)) { Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } Nav1.Feedback.Text = String.Empty; Nav1.SideTabId = AssignmentManager.Common.constants.SIDE_NAV_STUDENT_CHANGE_PASSWORD; Nav1.TopTabId = AssignmentManager.Common.constants.TOP_NAV_STUDENT_CHANGE_PASSWORD; Nav1.Title = SharedSupport.GetLocalizedString("ChangePassword_Title1"); Nav1.SubTitle = SharedSupport.GetLocalizedString("ChangePassword_SubTitle1"); Nav1.relativeURL = @"../"; //GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("vstskChangingYourUserPassword"); GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("tskChangingYourUserPasswordForAssignmentManager"); GoBack1.GoBack_left = "275px"; GoBack1.GoBack_top = "-15px"; GoBack1.GoBackIncludeBack = false; if (courseId <= 0) { throw(new ArgumentException(SharedSupport.GetLocalizedString("Global_MissingParameter"))); } // if using SSL and the page isn't using a secure connection, redirect to https if (SharedSupport.UsingSsl == true && Request.IsSecureConnection == false) { // Note that Redirect ends page execution. Response.Redirect("https://" + SharedSupport.BaseUrl + "/faculty/ChangePassword.aspx?CourseID=" + courseId.ToString()); } if (!IsPostBack) { // Evals true first time browser hits the page LocalizeLabels(); } Response.Cache.SetNoStore(); if (user.IsValid) { this.lblUserName.Text = Server.HtmlEncode(user.FirstName + " " + user.LastName); } } catch (Exception ex) { Nav1.Feedback.Text = ex.Message.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { try { Response.Cache.SetNoStore(); Nav1.Feedback.Text = String.Empty; Nav1.SideTabId = AssignmentManager.Common.constants.SIDE_NAV_COURSE_MANAGEMENT; Nav1.TopTabId = AssignmentManager.Common.constants.TOP_NAV_COURSE_ASSIGNMENTS; Nav1.relativeURL = @"../"; GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("vsoriUsingAssignmentManager"); GoBack1.GoBackIncludeBack = true; GoBack1.GoBack_left = "400px"; GoBack1.GoBack_top = "-5px"; GoBack1.GoBack_BackURL = "Assignments.aspx?" + Request.QueryString.ToString(); AssignmentManager.Common.Functions func = new AssignmentManager.Common.Functions(); // grab CourseID parameter from the querystring courseId = func.ValidateNumericQueryStringParameter(this.Request, "CourseID"); if (courseId <= 0) { throw(new ArgumentException(SharedSupport.GetLocalizedString("Global_MissingParameter"))); } // grab assignmentID from querystring assignmentId = func.ValidateNumericQueryStringParameter(this.Request, "AssignmentID"); //Check Security Permissions if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.USERASSIGNMENT_VIEW)) { // Note that Redirect ends page execution. Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } Nav1.Feedback.Text = String.Empty; if (!IsPostBack) { // // Evals true first time browser hits the page // //Get localization string for all text displayed on the page LocalizeLabels(); // refresh user assignments datalist userAssignmentsRefresh(); } } catch (Exception ex) { Nav1.Feedback.Text = ex.Message; } }
private void LocalizeLabels() { txtDescriptionText.Text = String.Empty; lblDescription.Text = SharedSupport.GetLocalizedString("AddEditCourse_lblDescription"); //"Description: "; linkHomePageURLText.Text = String.Empty; lblHomePageURL.Text = SharedSupport.GetLocalizedString("AddEditCourse_lblHomePageURL1"); //"Home Page URL: "; Nav1.Feedback.Text = String.Empty; lblShortName.Text = SharedSupport.GetLocalizedString("AddEditCourse_lblShortName"); //"Course Name: "; lblShortNameValue.Text = String.Empty; }
protected void Page_Load(object sender, EventArgs e) { try { // Do not cache this page Response.Cache.SetNoStore(); Nav1.Feedback.Text = String.Empty; Nav1.SideTabId = AssignmentManager.Common.constants.SIDE_NAV_COURSE_MANAGEMENT; Nav1.TopTabId = AssignmentManager.Common.constants.TOP_NAV_COURSE_ASSIGNMENTS; Nav1.relativeURL = @"../"; GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("vsoriUsingAssignmentManager"); GoBack1.GoBackIncludeBack = true; GoBack1.GoBack_BackURL = "Submissions.aspx?" + "CourseID=" + Request.QueryString["CourseID"].ToString() + "&" + "AssignmentID=" + Request.QueryString["AssignmentID"].ToString(); // grab CourseID parameter from the querystring AssignmentManager.Common.Functions func = new AssignmentManager.Common.Functions(); courseId = func.ValidateNumericQueryStringParameter(this.Request, "CourseID"); if (courseId.Equals(null)) { // Note that Redirect ends page execution. Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_MissingParameter"); } // get UserAssignmentID, AssignmentID querystring param studentID = func.ValidateNumericQueryStringParameter(this.Request, "UserID"); assignmentId = func.ValidateNumericQueryStringParameter(this.Request, "AssignmentID"); if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.USERASSIGNMENT_VIEW)) { // Note that Redirect ends page execution. Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } if (studentID == 0) { //If userassignmentId missing then doesn't make sense to show page at all? throw(new ArgumentException(SharedSupport.GetLocalizedString("Global_MissingParameter"))); } LocalizeLabels(); if (!Page.IsPostBack) { // load the details userAssignmentDetailRefresh(); } } catch (System.Exception ex) { Nav1.Feedback.Text = ex.Message.ToString(); } }
private void LocalizeLabels() { txtDescription.Text = String.Empty; lblDescription.Text = SharedSupport.GetLocalizedString("AddEditCourse_lblDescription"); //"Description: "; txtHomePageURL.Text = String.Empty; lblHomePageURL.Text = SharedSupport.GetLocalizedString("AddEditCourse_lblHomePageURL1"); //"Home Page URL: "; lblShortName.Text = SharedSupport.GetLocalizedString("AddEditCourse_lblShortName") + " " + SharedSupport.GetLocalizedString("Global_RequiredField"); //"Course Name: "; btnUpdate.Text = SharedSupport.GetLocalizedString("AddEditCourse_btnUpdate"); //"Insert"; this.lblStudentURL.Text = SharedSupport.GetLocalizedString("AddEditCourse_lblStudentURL"); this.lblAddResource.Text = SharedSupport.GetLocalizedString("AddEditCourse_lblAddResource1"); this.lblRequired.Text = SharedSupport.GetLocalizedString("Global_RequiredFieldIndicator"); }
private void setNewPassword(int userID) { UserM user = UserM.Load(userID); if (user.IsValid) { // If user is changing their own password, then set HasChanged flag. bool hasChanged = (user.UserID == SharedSupport.GetUserIdentity()); user.SetPassword(txtNewPwd.Text.Trim(), hasChanged); Nav1.Feedback.Text = SharedSupport.GetLocalizedString("MyAccountChangePassword_Successful"); } }
protected void Page_Load(object sender, System.EventArgs e) { LocalizeLabels(); Select1.Multiple = false; Select1.Items.Add(SharedSupport.GetLocalizedString("AddResource_Http")); Select1.Items.Add(SharedSupport.GetLocalizedString("AddResource_MailTo")); Select1.Items.Add(SharedSupport.GetLocalizedString("AddResource_News")); Select1.Items.Add(SharedSupport.GetLocalizedString("AddResource_ftp")); Select1.Items.Add(SharedSupport.GetLocalizedString("AddResource_Gopher")); Select1.Items.Add(SharedSupport.GetLocalizedString("AddResource_Telnet")); // Select1.Items.Add(SharedSupport.GetLocalizedString("AddResource_Other")); // Put user code to initialize the page here }
private void LocalizeLabels() { this.Nav1.Feedback.Text = ""; this.lblAssignmentLabel.Text = SharedSupport.GetLocalizedString("GradeDetail_Assignment"); this.lblDateSubmittedLabel.Text = SharedSupport.GetLocalizedString("GradeDetail_DateSubmitted"); this.lblGradeLabel.Text = SharedSupport.GetLocalizedString("GradeDetail_Grade"); this.lblCommentsLabel.Text = SharedSupport.GetLocalizedString("GradeDetail_Comments"); this.lblCompileDetailsLabel.Text = SharedSupport.GetLocalizedString("GradeDetail_BuildDetails1"); this.lblAutoGradeDetailsLabel.Text = SharedSupport.GetLocalizedString("GradeDetail_AutoGradeDetails"); this.lblAssignmentWebPage.Text = SharedSupport.GetLocalizedString("AssignmentGrade_AssignmentWebPage"); this.lblDescription.Text = SharedSupport.GetLocalizedString("AssignmentGrade_Description"); this.lblDueDate.Text = SharedSupport.GetLocalizedString("AssignmentGrade_DueDate"); }
protected void Page_Load(object sender, EventArgs e) { try { Nav1.Feedback.Text = String.Empty; Nav1.SideTabId = AssignmentManager.Common.constants.SIDE_NAV_SERVER_ADMIN; Nav1.TopTabId = AssignmentManager.Common.constants.TOP_NAV_SERVER_SETTINGS; Nav1.Title = SharedSupport.GetLocalizedString("Settings_Title1"); Nav1.SubTitle = SharedSupport.GetLocalizedString("Settings_SubTitle1"); Nav1.relativeURL = @"../"; GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("vsurfServerAdministrationSettings"); GoBack1.GoBackIncludeBack = false; GoBack1.GoBack_left = "400px"; GoBack1.GoBack_top = "-15px"; // grab CourseID parameter from the querystring AssignmentManager.Common.Functions func = new AssignmentManager.Common.Functions(); courseId = func.ValidateNumericQueryStringParameter(this.Request, "CourseID"); if (courseId.Equals(null)) { throw(new ArgumentException(SharedSupport.GetLocalizedString("Global_MissingParameter"))); } //Check Security Permissions if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.SETTING_VIEW)) { // Note that Redirect ends page execution. Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } if (!IsPostBack) { // // Evals true first time browser hits the page // //Get localization string for all text displayed on the page LocalizeLabels(); initializeFields(); } } catch (Exception ex) { Nav1.Feedback.Text = ex.Message.ToString(); } }
public void btnPreview_Click(object sender, System.EventArgs e) { try { Nav1.Feedback.Text = String.Empty; // Delete any previous imports that have not been committed. //bool clearPreviousImportData = users.CancelPendingImport(courseId); DataSet ds = new DataSet(); //Validate File not blank if (txtUploadFile.PostedFile.Equals(null)) { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("AdminImport_ChooseUploadFile"); return; } //Validate File not blank if (txtUploadFile.PostedFile.FileName == String.Empty) { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("AdminImport_ChooseUploadFile"); return; } //Validate delimiting character not blank if (cboDelimitingCharacter.SelectedItem.Text == String.Empty) { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("AdminImport_ChooseDelimitingChar"); return; } string delimiterCharacter = ""; if (cboDelimitingCharacter.SelectedItem.Text == SharedSupport.GetLocalizedString("AdminImport_Tab")) { delimiterCharacter = "\t"; } else { delimiterCharacter = cboDelimitingCharacter.SelectedItem.Text; } string filename = System.Guid.NewGuid().ToString(); txtUploadFile.PostedFile.SaveAs(SharedSupport.AddBackSlashToDirectory(Server.MapPath(Constants.ASSIGNMENTMANAGER_UPLOAD_DIRECTORY)) + filename); Response.Redirect("ImportFormPreview.aspx?" + Request.QueryString + "&File=" + Server.UrlEncode(filename) + "&Char=" + Server.UrlEncode(delimiterCharacter), false); } catch (Exception ex) { Nav1.Feedback.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { try { //display nav bar Nav1.Feedback.Text = String.Empty; Nav1.SideTabId = AssignmentManager.Common.constants.SIDE_NAV_COURSE_MANAGEMENT; Nav1.TopTabId = AssignmentManager.Common.constants.TOP_NAV_COURSE_USERS; Nav1.Title = " "; Nav1.SubTitle = SharedSupport.GetLocalizedString("ImportForm_SubTitle"); Nav1.relativeURL = @"../"; GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("vstskAddingCourseUsers"); GoBack1.GoBackIncludeBack = true; GoBack1.GoBack_BackURL = "Users.aspx?" + Request.QueryString.ToString(); GoBack1.GoBack_left = "400px"; GoBack1.GoBack_top = "-15px"; AssignmentManager.Common.Functions func = new AssignmentManager.Common.Functions(); courseId = func.ValidateNumericQueryStringParameter(this.Request, "CourseID"); if (courseId <= 0) { throw(new ArgumentException(SharedSupport.GetLocalizedString("Global_MissingParameter"))); } if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.USER_ADD)) { // Note that Redirect ends page execution. Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } if (!IsPostBack) { // Populate the DropDownList with the available delimiters. cboDelimitingCharacter.Items.Clear(); cboDelimitingCharacter.Items.Add(","); cboDelimitingCharacter.Items.Add(";"); cboDelimitingCharacter.Items.Add(SharedSupport.GetLocalizedString("AdminImport_Tab")); } LocalizeLabels(); } catch (Exception ex) { Nav1.Feedback.Text = ex.Message.ToString(); } }
protected void LocalizeLabels() { this.lblAutoGradeOnOff.Text = SharedSupport.GetLocalizedString("Setting_lblAutoGradeOnOff"); //"Auto Grade: "; this.rbtnAutoGradeOff.Text = SharedSupport.GetLocalizedString("Setting_rbtnAutoGradeOff"); //"Off"; this.rbtnAutoGradeOn.Text = SharedSupport.GetLocalizedString("Setting_rbtnAutoGradeOn"); //"On"; this.rbtnSMTPOff.Text = SharedSupport.GetLocalizedString("Setting_rbtnSMTPdisabled"); //"Disabled"; this.rbtnSMTPOn.Text = SharedSupport.GetLocalizedString("Setting_rbtnSMTPenabled"); //"Enabled"; this.rbtnSSLOff.Text = SharedSupport.GetLocalizedString("Setting_rbtnSSLdisabled"); //"Disabled"; this.rbtnSSLOn.Text = SharedSupport.GetLocalizedString("Setting_rbtnSSLenabled"); //"Enabled"; this.btnUpdate.Text = SharedSupport.GetLocalizedString("Setting_btnUpdate"); //"Update"; this.btnCancel.Text = SharedSupport.GetLocalizedString("Setting_btnCancel"); //"Cancel"; this.lblUsingSMTP.Text = SharedSupport.GetLocalizedString("Setting_lblUsingSMTP"); this.lblUsingSSL.Text = SharedSupport.GetLocalizedString("Setting_lblUsingSSL"); this.lblProcessingTime.Text = SharedSupport.GetLocalizedString("Setting_MaxProcessingTime1"); this.lblProjectSize.Text = SharedSupport.GetLocalizedString("Setting_MaxProjectSize"); this.lblAMTitle.Text = SharedSupport.GetLocalizedString("Settings_AMTitle"); }
protected void LocalizeLabels() { Nav1.Feedback.Text = String.Empty; if (!assignmentId.Equals(null)) { AssignmentM assign = AssignmentM.Load(assignmentId); if (assign.IsValid) { Nav1.SubTitle = SharedSupport.GetLocalizedString("FacultySubmissions_SubTitle") + assign.ShortName; } } this.btnAutoCompile.Text = SharedSupport.GetLocalizedString("FacultySubmissions_btnAutoBuild"); //"Re-run Auto Compile"; this.btnAutoGrade.Text = SharedSupport.GetLocalizedString("FacultySubmissions_btnAutoGrade"); //"Re-run Auto Grade"; this.lblCompleted.Text = SharedSupport.GetLocalizedString("FacultySubmissions_lblCompleted"); this.lblFailed.Text = SharedSupport.GetLocalizedString("FacultySubmissions_lblFailed"); this.lblPending.Text = SharedSupport.GetLocalizedString("FacultySubmissions_lblPending"); this.lblSubmissions.Text = SharedSupport.GetLocalizedString("FacultySubmissions_lblSubmissions"); }
protected void LocalizeLabels() { //general Nav1.Feedback.Text = String.Empty; this.lblAssignmentLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblAssignmentLabel "); //"Assignment: "; this.lblAssignment.Text = String.Empty; this.lblDateSubmittedLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblDateSubmittedLabel"); //"Date Submitted: "; this.lblDateSubmitted.Text = String.Empty; this.lblGradeLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblGradeLabel"); //"Grade: "; this.lblCommentsLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblCommentsLabel"); //"Comments: "; //compile this.lblCompileDetailsLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblBuildDetailsLabel1"); //"Compile Details"; this.lblCompileResultLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblCompileResultLabel"); //"Result: "; this.lblCompileResult.Text = String.Empty; this.lblCompileDateLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblBuildDateLabel"); //"Compile Date: "; this.lblCompileDate.Text = String.Empty; this.lblCompileDetailLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblCompileDetailLabel"); //"Detail: "; this.txtCompileDetails.Text = String.Empty; this.txtCompileDetails.ReadOnly = true; this.txtCompileDetails.Enabled = true; this.btnAutoCompile.Text = SharedSupport.GetLocalizedString("FacultySubmissions_btnAutoCompile"); //"Re-run Auto Compile"; //auto grade this.lblAutoGradeDetailsLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblAutoGradeDetailsLabel"); //"Auto Grade Details"; this.lblAutoGradeResultLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblAutoGradeResultLabel"); //"Result: "; this.txtAutoGradeResult.Text = String.Empty; this.txtAutoGradeResult.ReadOnly = true; this.txtAutoGradeResult.Enabled = true; this.lblAutoGradeDateLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblAutoGradeDateLabel"); //"AutoGrade Date: "; this.txtAutoGradeDate.Text = String.Empty; this.lblAutoGradeDetailLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblAutoGradeDetailLabel"); //"Detail: "; this.txtAutoGradeDetails.Text = String.Empty; this.txtAutoGradeDetails.ReadOnly = true; this.txtAutoGradeDetails.Enabled = true; this.btnAutoGrade.Text = SharedSupport.GetLocalizedString("FacultySubmissions_btnAutoGrade"); //"Re-run Auto Grade"; //user details this.lblStudentLabel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_lblStudentLabel"); //"Student Name: "; this.lblStudent.Text = String.Empty; this.btnSaveGrade.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_btnSaveGrade"); this.btnCancel.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_btnCancel"); }
private void userAssignmentDetailRefresh() { StudentAssignmentM sa = StudentAssignmentM.Load(studentID, assignmentId); if (sa != null) { txtGrade.Text = sa.OverallGrade; txtComments.Text = sa.GradeComments; lblDateSubmitted.Text = Server.HtmlEncode(sa.LastSubmitDate.ToShortDateString() + " " + sa.LastSubmitDate.ToShortTimeString()); //Populate Auto-Compile Section lblCompileDate.Text = sa.LastUpdatedDate.ToShortDateString() + " " + sa.LastUpdatedDate.ToShortTimeString(); txtCompileDetails.Text = sa.BuildDetails; lblCompileResult.Text = Server.HtmlEncode(sa.BuildResultCode); //Populate Auto-Grade Section txtAutoGradeDate.Text = sa.LastUpdatedDate.ToShortDateString() + " " + sa.LastUpdatedDate.ToShortTimeString(); txtAutoGradeDetails.Text = sa.CheckDetails; txtAutoGradeResult.Text = sa.CheckResultCode; //Grab assignment information based on loaded assignmentID AssignmentM assign = AssignmentM.Load(assignmentId); if (assign.IsValid) { lblAssignment.Text = Server.HtmlEncode(assign.ShortName); } else { string[] AssignmentID = new string[] { assignmentId.ToString() }; throw new Exception(SharedSupport.GetLocalizedString("FacultyGradeSubmission_InvalidAssignmentID", AssignmentID)); } //Grab user information based on loaded userID UserM user = UserM.Load(studentID); if (user.IsValid) { this.lblStudent.Text = Server.HtmlEncode(user.LastName + SharedSupport.GetLocalizedString("FacultyGradeSubmission_Comma") + user.FirstName); } else { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_NoUserIDFound"); //"No UserID found. "; } } }
protected void Page_Load(object sender, EventArgs e) { try { // link to Core Tools this.hlCoreTools.Text = SharedSupport.GetLocalizedString("ErrorPage_BackToStartPage"); this.hlCoreTools.NavigateUrl = AssignmentManager.Common.constants.BACK_TO_CORETOOLS_LINK; //Check Security Permissions if (!SharedSupport.SecurityIsAllowed(SecurityAction.COURSE_DELETE)) { // Note that Redirect ends page execution. Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } if (!IsPostBack) { string CourseID = Request.QueryString.Get("CourseID").ToString(); System.Guid courseGuid = new System.Guid(CourseID); CourseM course = CourseM.Load(courseGuid); if (course.IsValid) { string dir = System.Web.HttpContext.Current.Server.MapPath("..\\") + "\\Courses\\"; File.Delete(dir + CourseID + ".xml"); course.Delete(); lblFeedback.Text = SharedSupport.GetLocalizedString("DeleteCourse_FacultyDeleteVerification"); // log off to avoid confusion System.Web.Security.FormsAuthentication.SignOut(); } else { lblFeedback.Text = SharedSupport.GetLocalizedString("DeleteCourse_FacultyAlreadyDeleted"); } } } catch (System.Exception ex) { lblFeedback.Text = ex.Message; } }
public void btnAutoCompile_Click(object sender, System.EventArgs e) { try { if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.USERASSIGNMENT_EDIT)) { throw new Exception(SharedSupport.GetLocalizedString("Global_Unauthorized")); } StudentAssignmentM sa = StudentAssignmentM.Load(studentID, assignmentId); sa.SendActionToQueue(true, false); userAssignmentDetailRefresh(); Nav1.Feedback.Text = SharedSupport.GetLocalizedString("FacultySubmissions_BuildSubmitSuccessful"); } catch { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_InvalidUserAssignmentID"); } }