/// <summary> /// Populate State/Province List from database /// </summary> private void populateStateList() { StateDataAccess stateDAL = new StateDataAccess(); string webroot = LACESUtilities.GetApplicationConstants("ASLARoot"); int StateProvidenceID = int.Parse(LACESUtilities.GetApplicationConstants("StateProvinceContentID")); IList <State> stateList = stateDAL.GetAllStates(StateProvidenceID, webroot); ///Add default item ListItem defaultItem = new ListItem("- Location -", ""); ddlLocation.Items.Add(defaultItem); /////Add Distance Education item //ListItem distanceEducation = new ListItem("Distance Education", "Distance Education"); //ddlLocation.Items.Add(distanceEducation); foreach (State state in stateList) { ListItem item = new ListItem(state.StateName, state.StateCode); ddlLocation.Items.Add(item); } //for other International value ddlLocation.Items.Add(new ListItem("- Other International -", "OI")); }
/// <summary> /// Call every time when the page load occur /// </summary> /// <param name="sender">Sender object</param> /// <param name="e">EventArgs</param> protected void Page_Load(object sender, EventArgs e) { string relativeURL = "\"" + LACESUtilities.GetApplicationConstants("LibraryASLARelative"); string absoluteURL = "\"" + LACESUtilities.GetApplicationConstants("LibraryASLAAbsolute"); string uri = LACESUtilities.GetApplicationConstants("LACES_App_Pro_Guide_ASLA_CMS_Site_URL"); appProviderLACESDiv.InnerHtml = GetExternalWebData(uri).Replace(relativeURL, absoluteURL); }
/// <summary> /// Send email to the on exception /// </summary> /// <param name="ex">Exception</param> public static void ReportError(Exception ex) { if (ex.Message == "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.") { return; } else if (ex.Message == "Thread was being aborted.") { return; } else if (ex.Message == "The content you have requested does not exist in the system.") { return; } SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try { //Get the SMTP server Address from Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP port from Web.conf smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); //Get the email's TO addresses from Web.conf string values = LACESUtilities.GetApplicationConstants(LACESConstant.CONSTANT_ERROR_REPORT_MAIL_TO); string[] emailAddesses = values.Split(';'); //add individual addresses to the MailMessage class instance for (int i = 0; i < emailAddesses.Length; i++) { message.To.Add(emailAddesses[i]); } //Get the email's Subject from Web.conf message.Subject = LACESUtilities.GetApplicationConstants(LACESConstant.CONSTANT_ERROR_MAIL_SUBJECT); //Whether the message body would be displayed as html or not message.IsBodyHtml = true; //Get the email's FROM address from Web.conf message.From = new System.Net.Mail.MailAddress(LACESUtilities.GetApplicationConstants(LACESConstant.CONSTANT_ERROR_MAIL_FROM)); //Get the email's BODY message.Body = GetMailMessageBody(ex); //Send the mail if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { smtpClient.Send(message); } } catch (Exception exp) { } finally { } }
protected string GetPDFURL(string PDFLibraryID) { string pdfurl = ""; XmlDocument GetPdfXML = new XmlDocument(); GetPdfXML.Load(LACESUtilities.GetApplicationConstants("URLToGetPDFFilename") + "?id=" + PDFLibraryID); pdfurl = LACESUtilities.GetApplicationConstants("ASLABaseURL") + GetPdfXML.SelectSingleNode("root/filename").InnerText;; return(pdfurl); }
/// <summary> /// Checking Provider email address exist in the database and send forgot password email to provider email address. /// </summary> private void CheckAuthentication() { try { string DecryptedPassword = String.Empty; ApprovedProviderDataAccess providerDAL = new ApprovedProviderDataAccess(); ApprovedProvider provider = providerDAL.GetApprovedProviderByEmail(txtEmail.Text); if (provider != null && provider.ID > 0) { ///Decrypt provider password. DecryptedPassword = LACESUtilities.Decrypt(provider.Password); Response.Write(DecryptedPassword); Response.End(); SmtpClient smtpClient = new SmtpClient(); //Get the SMTP server Address from SMTP Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP post 25; smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); //send email bool IsSent = SendEmail(smtpClient, DecryptedPassword); //Checking the email has sent if (IsSent == true) { lblErrorSummary.Visible = false; lblPostBackMessage.Text = LACESConstant.Messages.FORGETPASSWORD_POSTBACK_MESSAGE.Replace("{0}", txtEmail.Text.Trim()); tblControls.Visible = false; } } //if the provider does not existing in the database send invalid email address message. else { //if the provider does not existing in the database send invalid email address message. if (IsPostBack == true) { string ContactEmailAddresses = TranformEmailAddresses(); string AdminEmailWithFormat = "<a href=\"mailto:" + ContactEmailAddresses + "\">contact the " + LACESConstant.LACES_TEXT + " Administrators</a> "; lblErrorSummary.Text = LACESConstant.Messages.PORGETPASSEORD_INVALID_MESSAGE.Replace("{0}", AdminEmailWithFormat); lblPostBackMessage.Text = ""; isInvalidEmail = true; } else { lblErrorSummary.Text = ""; lblPostBackMessage.Text = ""; } } } catch (Exception ex) { throw ex; } }
/// <summary> /// Populate Subject List /// </summary> private void populateSubjectList() { string webroot = LACESUtilities.GetApplicationConstants("ASLARoot"); int SubjectID = int.Parse(LACESUtilities.GetApplicationConstants("SubjectContentID")); SubjectDataAccess subjectDAL = new SubjectDataAccess(); IList <Subject> subjectList = subjectDAL.GetAllSubjects(SubjectID, webroot); // Get all Subjects foreach (Subject subject in subjectList) { ListItem item = new ListItem(subject.SubjectName, subject.SubjectID.ToString()); drpSubject.Items.Add(item); } }
/// <summary> /// Page load event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { string relativeURL = "\"" + LACESUtilities.GetApplicationConstants("LibraryASLARelative"); string absoluteURL = "\"" + LACESUtilities.GetApplicationConstants("LibraryASLAAbsolute"); string uri = LACESUtilities.GetApplicationConstants("AboutLACES_ASLA_CMS_Site_URL"); aboutLACESDiv.InnerHtml = GetExternalWebData(uri).Replace(relativeURL, absoluteURL); } catch (Exception ex) { Response.Write(ex.Message); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { string uri = LACESUtilities.GetApplicationConstants("logosLACES_ASLA_CMS_Site_URL"); string relativeURL = "\"" + LACESUtilities.GetApplicationConstants("ImagesASLARelative"); string absoluteURL = "\"" + LACESUtilities.GetApplicationConstants("ImagesASLAAbsolute"); logosLACESDiv.InnerHtml = GetExternalWebData(uri).Replace(relativeURL, absoluteURL); if (Session[LACESConstant.SessionKeys.LOGEDIN_INACTIVE_PROVIDER] != null) { sessionKeyForProvider = LACESConstant.SessionKeys.LOGEDIN_INACTIVE_PROVIDER; } if (Session[sessionKeyForProvider] != null) { //get the provider from session ApprovedProvider sessionProvider = (ApprovedProvider)Session[sessionKeyForProvider]; // Get provider information from Session //Show loggedin provider name Label lblProviderName = (Label)Master.FindControl("lblProviderName"); if (lblProviderName != null) { lblProviderName.Text = "Signed in as: " + Server.HtmlEncode(sessionProvider.OrganizationName); } //load the provider menu bar HtmlTableCell oHtmlTableCell = (HtmlTableCell)Master.FindControl("tdMenu"); oHtmlTableCell.Controls.Clear(); //if provider is active,provider menu will be shown if (sessionProvider.Status == LACESConstant.ProviderStatus.ACTIVE) { oHtmlTableCell.Controls.Add(LoadControl("~/usercontrols/ProviderMenu.ascx")); } //if provider is inactive, inactive provider menu will be shown else if (sessionProvider.Status == LACESConstant.ProviderStatus.INACTIVE) { oHtmlTableCell.Controls.Add(LoadControl("~/usercontrols/InactiveProviderMenu.ascx")); } try { //change the login status ((HtmlTableCell)Master.FindControl("loginTd")).Attributes["class"] = "loggedIn providerloginStatus"; } catch (Exception ex) { } } }
/// <summary> /// Populate Subject List from Database /// </summary> private void populateSubjectList() { SubjectDataAccess subjectDAL = new SubjectDataAccess(); string webroot = LACESUtilities.GetApplicationConstants("ASLARoot"); int SubjectID = int.Parse(LACESUtilities.GetApplicationConstants("SubjectContentID")); IList <Subject> subjectList = subjectDAL.GetAllSubjects(SubjectID, webroot); ListItem defaultItem = new ListItem("- Subject Area -", ""); ddlSubject.Items.Add(defaultItem); foreach (Subject subject in subjectList) { ListItem item = new ListItem(subject.SubjectName, subject.SubjectName); ddlSubject.Items.Add(item); } }
/// <summary> /// Populate State List /// </summary> private void populateStateList() { StateDataAccess stateDAL = new StateDataAccess(); string webroot = LACESUtilities.GetApplicationConstants("ASLARoot"); int StateProvidenceID = int.Parse(LACESUtilities.GetApplicationConstants("StateProvinceContentID")); IList <State> stateList = stateDAL.GetAllStates(StateProvidenceID, webroot); // Get all States ListItem defaultItem = new ListItem("-State List-", ""); drpState.Items.Add(defaultItem); foreach (State state in stateList) { ListItem item = new ListItem(state.StateName, state.StateCode); drpState.Items.Add(item); } drpState.Items.Add(new ListItem("- Other International -", "OL")); }
protected void SendDeleteForeverEmail(string strSendEmailTo, string subject, string title) { StringBuilder strbDeletedBody = new StringBuilder(); strbDeletedBody.Append("Dear LA CES Provider, <br /><br />"); strbDeletedBody.Append("Thank you for submitting " + title + " to LA CES. Unfortunately, we are unable to approve this course at this time as it does not meet LA CES <a href=\"http://laces.asla.org/ApprovedProviderGuidelines.aspx\">guidelines</a>. We encourage you to resubmit the course after revising it to meet LA CES guidelines. Please contact us at <a href=\"mailto:[email protected]\">[email protected]</a> with any questions or for more information. <br /><br />"); strbDeletedBody.Append("Sincerely,<br /><br />"); strbDeletedBody.Append("LA CES Administrator"); SmtpClient smtpClient = new SmtpClient(); //Get the SMTP server Address from SMTP Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP port 25; smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); //create the message body MailMessage message = new MailMessage(); message.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); message.To.Add(new MailAddress(strSendEmailTo)); message.CC.Add(new MailAddress(LACESUtilities.GetApplicationConstants(LACESConstant.ADMIN_CONTACT_TO_EMAIL))); message.Subject = subject; message.IsBodyHtml = true; message.Body = strbDeletedBody.ToString(); if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { try { smtpClient.Send(message); } catch (Exception ex) { Response.Write(ex.Message); } } }
protected void Page_Load(object sender, EventArgs e) { MailMessage message = new MailMessage(); string ToEmailAddress = "*****@*****.**"; SmtpClient smtpClient = new SmtpClient(); smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP post 25; smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); message.From = new MailAddress("*****@*****.**"); message.To.Add(new MailAddress(ToEmailAddress)); message.Subject = "Test Subject"; message.IsBodyHtml = true; message.Body = "TEST"; //Send Email to Friend Message Body smtpClient.Send(message); //Sending A Mail to the Sender Friend Response.Write("Email sent"); }
/// <summary> /// Use to populate state list in the UI. Get state data from database. /// Return none. /// </summary> private void populateStateList() { //Get all States from DB StateDataAccess stateDAL = new StateDataAccess(); string webroot = LACESUtilities.GetApplicationConstants("ASLARoot"); int StateProvidenceID = int.Parse(LACESUtilities.GetApplicationConstants("StateProvinceContentID")); IList <State> stateList = stateDAL.GetAllStates(StateProvidenceID, webroot); //Add the default value in to the DropDownList ListItem defaultItem = new ListItem("-State List-", "-State List-"); drpState.Items.Add(defaultItem); //Prepare the list as a user friendly version and add into the DropDownList foreach (State state in stateList) { ListItem item = new ListItem(state.StateName, state.StateCode); drpState.Items.Add(item); } }
/// <summary> /// Page Load Event Handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { // title of the page //this.Title = LACESConstant.LACES_TEXT +" - Course Details"; // Manage participant button is inactive in add mode //btnManageParticipant.Enabled = false; // disable Save button for Administrator until populate the Course Information uiLnkDistanceLearning.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("DistanceEducationPDF")); uiLnkHSWClassification.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("HSWClassificationPDF")); uiLnkCalculatingPDH.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("CalculatingPDF")); uiLnkCourseEquiv.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("CourseEquivPDF")); btnSave.Enabled = false; if (!IsPostBack) { //trStatus.Attributes.Add("style", "display:none;"); // Status will not be displayed in Add mode populateStateList(); // populate state dropdown menu populateSubjectList(); // populate subject dropdown menu ///Commentd by Matin according to new business logic //populateCourseStatusList(); // populate status dropdown menu //populateCourseTypeList(); // populate course type dropdown menu populateCourseInfo(); // populate course details Information } //string redirectpage = "ManageCodeTypes.aspx"; //hpRequestNewCodeType.NavigateUrl = "ManageCodeTypes.aspx"; //hpRequestNewCodeType.Attributes.Add("onclick", "return redirectPage('" + redirectpage + "')"); initializePage(); if (Request.Form["hidAction"] != null && !Request.Form["hidAction"].ToString().Equals(string.Empty)) { string redirect = Request.Form["hidAction"].ToString(); saveInformation(); Response.Redirect(redirect); } }
protected void SendEmail(string Text, string ProviderEmail) { try { SmtpClient smtpClient = new SmtpClient(); //Get the SMTP server Address from SMTP Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP post 25; smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); MailMessage message = new MailMessage(); message.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); //message.To.Add(LACESUtilities.GetAdminToEmail()); //message.CC.Add(LACESUtilities.GetAdminCCEmail()); //Get the email's TO from Web.conf message.To.Add(ProviderEmail); string BCC = LACESUtilities.GetApplicationConstants(LACESConstant.ADMIN_CONTACT_TO_EMAIL); message.CC.Add(LACESUtilities.GetApprovedProviderMailTo()); message.Subject = "New Courses Added - Pending Approval"; message.IsBodyHtml = true; message.Body = Text; // Message Body if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { smtpClient.Send(message); //Sending A Mail to Admin } } catch (Exception ex) { Response.Write(ex.Message); Response.End(); } }
/// <summary> /// Return string array by spliting the string by a delimiter /// </summary> /// <param name="stringList">string</param> /// <returns>Array of String</returns> /// protected void SendMoreDataNeededEmail(Course c) { string strMessageBody = uiTxtEmailText.Text.Replace("\r\n", "<br />"); ApprovedProviderDataAccess apda = new ApprovedProviderDataAccess(); ApprovedProvider ap = apda.GetApprovedProviderByID(c.ProviderID); string strSendEmaiTo = ap.ApplicantEmail; SmtpClient smtpClient = new SmtpClient(); //Get the SMTP server Address from SMTP Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP port 25; smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); //create the message body MailMessage message = new MailMessage(); message.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); message.To.Add(new MailAddress(strSendEmaiTo)); message.CC.Add(new MailAddress(LACESUtilities.GetApplicationConstants(LACESConstant.ADMIN_CONTACT_TO_EMAIL))); message.Subject = "LA CES Course Needs More Information"; message.IsBodyHtml = true; message.Body = strMessageBody; if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { try { smtpClient.Send(message); } catch (Exception ex) { Response.Write(ex.Message); } } }
/// <summary> /// Sending a mail after adding a course to the system /// </summary> /// <param name="course">Details of the course for sending email</param> /// <param name="stateProvince">State name</param> private void sendMail(Course course, string stateProvince) { //Provider provider = (Provider)Session[LACESConstant.SessionKeys.LOGEDIN_PROVIDER]; // get provider information from Session ApprovedProvider provider = (ApprovedProvider)Session[LACESConstant.SessionKeys.LOGEDIN_APPROVED_PROVIDER]; // get approved provider information from Session string RefrenceURL = String.Empty; RefrenceURL = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.ToLower().LastIndexOf(LACESConstant.URLS.PROVIDER_BASE.ToLower())) + LACESConstant.URLS.ADMIN_BASE + "/" + LACESConstant.URLS.PENDING_COURSE; string courseDistance = string.Empty; if(course.DistanceEducation.Equals("Y")) { courseDistance = "Yes"; } else { courseDistance = "No"; } if(course.StateProvince.Trim().Equals(string.Empty)) { stateProvince = string.Empty; } StringBuilder EmailBody = new StringBuilder(); EmailBody.Append("<table border='0' width='100%>"); EmailBody.Append("<tr><td width='130'> </td><td> </td></tr>"); EmailBody.Append("<tr><td colspan='2'>A new course has been added to the system by " + Server.HtmlEncode(provider.OrganizationName) + " and is <a href='" + RefrenceURL + "'>pending approval</a>. Please review the details of the course and either approve or reject the course.</td></tr>"); EmailBody.Append("<tr><td colspan='2'><br/>The details of the new course are as follows:<br/></td></tr>"); EmailBody.Append("<tr><td valign='top' width='130'>Course Title:</td><td>" + Server.HtmlEncode(course.Title) + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>Course Hyperlink:</td><td>" + Server.HtmlEncode(course.Hyperlink) + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>Start Date:</td><td>" + course.StartDate.ToString("MM/dd/yyyy") + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>End Date:</td><td>" + course.EndDate.ToString("MM/dd/yyyy") + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>Description:</td><td>" + Server.HtmlEncode(course.Description) + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>City:</td><td>" + Server.HtmlEncode(course.City) + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>State:</td><td>" + Server.HtmlEncode(stateProvince) + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>Distance Education:</td><td>" + courseDistance + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>Subjects:</td><td>" + course.Subjects + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>Health:</td><td>" + course.Healths + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>Hours:</td><td>" + course.Hours + "</td></tr>"); EmailBody.Append("<tr><td valign='top'>Learning Outcomes:</td><td>" + Server.HtmlEncode(course.LearningOutcomes) + "</td></tr>"); EmailBody.Append("<tr><td colspan='2'><br/>If you wish to add this course to the " + LACESConstant.LACES_TEXT + " system, please <a href='" + RefrenceURL + "'>manage the list of pending courses</a> in the administration system to approve it.<br/></td></tr>"); EmailBody.Append("<tr><td colspan='2'><br/>If you are going to reject the course, or wish to discuss the course further, please contact the course provider <a href='mailto:" + provider.ApplicantEmail + "'>via email</a>.<br/></td></tr>"); EmailBody.Append("</table>"); string mailBody = EmailBody.ToString(); try { SmtpClient smtpClient = new SmtpClient(); //Get the SMTP server Address from SMTP Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP post 25; smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); MailMessage message = new MailMessage(); message.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); //message.To.Add(LACESUtilities.GetAdminToEmail()); //message.CC.Add(LACESUtilities.GetAdminCCEmail()); //Get the email's TO from Web.conf message.To.Add(LACESUtilities.GetCourseNotificationMailTo()); message.Subject = "New Course Added - Pending Approval"; message.IsBodyHtml = true; message.Body = mailBody; // Message Body if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { smtpClient.Send(message); //Sending A Mail to Admin } } catch (Exception ex) { throw ex; } }
/// <summary> /// Page Load Event to load input fields initially /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { HtmlMeta htmlGoogleMeta = new HtmlMeta(); htmlGoogleMeta.Attributes.Add("name", "google-site-verification"); htmlGoogleMeta.Attributes.Add("content", "K6O__N94_Ynv_-1cyXov5nLAP0Hej6PqelOB22oi4kY"); Header.Controls.Add(htmlGoogleMeta); //redirect users to their respective section home page //RedirectToSectionSpecificDefaultPage(); uiLnkApplicationForm.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("ApplicationFormPDF")); checkLoggedInProvider(); //change the footer image path // Master.ChangeFooterImagePath = ""; //set the approved provider link string appString = "ApprovedProviderGuidelines.aspx"; if (appString != "") { approvedProLink.Attributes["href"] = appString; } if (!IsPostBack) { //get all approved providers IList <ApprovedProvider> oApprovedProviders; ApprovedProviderDataAccess oApprovedProviderDataAccess = new ApprovedProviderDataAccess(); int totalCount = 0; oApprovedProviders = oApprovedProviderDataAccess.GetPagedApprovedProviderSearch("tblApprovedProvider.Status = 'Active'", 0, Int16.MaxValue, "OrganizationName", "asc", ref totalCount); foreach (ApprovedProvider ap in oApprovedProviders) { string orgName = ap.OrganizationName; if (orgName.Length > 48) { orgName = orgName.Substring(0, 45) + "..."; } lbEducationProvider.Items.Add(new ListItem(orgName, ap.ID.ToString())); } //Populate Subject Dropdown List populateSubjectList(); //Populate State Dropdown List populateStateList(); populateSlideshow(); ///If Reached this page form Course Search Result page by clicking search again ///And having criteria into the session then load existing selection value at the visitor section if (Request.QueryString["SearchAgain"] != null && Session[LACESConstant.SessionKeys.SEARCH_VISITOR_CRITERIA] != null) { ///Get Search criteria from session SearchCourse objSearchCriteria = (SearchCourse)Session[LACESConstant.SessionKeys.SEARCH_VISITOR_CRITERIA]; if (objSearchCriteria != null) { loadExistingSelection(objSearchCriteria); } } ///Focus to the first input control txtKeyword.Focus(); } //txtKeyword.Attributes.Add("onclick", "javascript:RemoveDefaultText(this,'Search Here');"); //chkDistanceEdu.Attributes.Add("onclick", "initializeLocation(this)"); //ddlLocation.Attributes.Add("onchange", "uncheckDistanceEducation(this)"); }
protected void btnApprove_Click(object sender, EventArgs e) { CourseDataAccess objCourseDAL = new CourseDataAccess(); ///Loop all items in data list to check approve checkbox for approve one course foreach (RepeaterItem dl in dlCourseList.Items) { CheckBox chkApp = (CheckBox)dl.FindControl("chkApprove"); ///Get Course Id from hidden field HiddenField hidCourseID = (HiddenField)dl.FindControl("hidCourseID"); if (chkApp.Checked == true) { long courseId = Convert.ToInt64(hidCourseID.Value); if (courseId > 0) { bool approved = objCourseDAL.ApproveCourseByCourseId(courseId); if (approved) { Course approvedCourse = objCourseDAL.GetCoursesDetailsByID(courseId); string strTitle = approvedCourse.Title; string strHyperlink = approvedCourse.Hyperlink; string strStartDate = approvedCourse.StartDate.ToShortDateString(); string strEndDate = approvedCourse.EndDate.ToShortDateString(); string strDesc = approvedCourse.Description; string strCity = approvedCourse.City; string strState = approvedCourse.StateProvince; string strDistanceEd = approvedCourse.DistanceEducation; string strSubjects = approvedCourse.Subjects; string strHours = approvedCourse.Hours; string strLearningOutcomes = approvedCourse.LearningOutcomes; ApprovedProviderDataAccess apda = new ApprovedProviderDataAccess(); ApprovedProvider ap = apda.GetApprovedProviderByID(approvedCourse.ProviderID); string strSendEmaiTo = ap.ApplicantEmail; StringBuilder strbApprovedEmail = new StringBuilder(); string strEmailTitle = "An LA CES Course has been approved"; string strBodyIntro = "Congratulations, a course has been approved by LA CES administrators. Please review the information below carefully as it may have been revised during the approval process. <br />"; string strBodyEnd = "Please contact <a href=\"mailto:[email protected]\"> LA CES administrators </a> with any questions about the course."; strbApprovedEmail.Append(strBodyIntro + "<br />"); strbApprovedEmail.Append("Course Title: " + strTitle + "<br />"); strbApprovedEmail.Append("Course Hyperlink: " + strHyperlink + "<br />"); strbApprovedEmail.Append("Start Date: " + strStartDate + "<br />"); strbApprovedEmail.Append("End Date: " + strEndDate + "<br />"); strbApprovedEmail.Append("Description: " + strDesc + "<br />"); strbApprovedEmail.Append("City: " + strCity + "<br />"); strbApprovedEmail.Append("State: " + strState + "<br />"); strbApprovedEmail.Append("Distance Education: " + strDistanceEd + "<br />"); strbApprovedEmail.Append("Subject: " + strSubjects + "<br />"); strbApprovedEmail.Append("Hours: " + strHours + "<br />"); strbApprovedEmail.Append("Learning Outcomes: " + strLearningOutcomes + "<br /><br />"); strbApprovedEmail.Append(strBodyEnd + "<br />"); SmtpClient smtpClient = new SmtpClient(); //Get the SMTP server Address from SMTP Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP port 25; smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); //create the message body MailMessage message = new MailMessage(); message.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); message.To.Add(new MailAddress(strSendEmaiTo)); message.Subject = strEmailTitle; message.IsBodyHtml = true; message.Body = strbApprovedEmail.ToString(); if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { try { // smtpClient.Send(message); } catch (Exception ex) { Response.Write(ex.Message); } } } } } } ///Re-load pending courses pendingCourses = objCourseDAL.GetAllPendingCourses(); dlCourseList.DataSource = pendingCourses; dlCourseList.DataBind(); ///Show success message lblMsg.Visible = true; lblMsg.ForeColor = System.Drawing.Color.Green; lblMsg.Text = "Selected course(s) approved successfully."; }
/// <summary> /// Perform request course code type action on user button click /// Generates mail message /// Send mail to administrator /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnRequest_Click(object sender, EventArgs e) { try { //Get current provider //Provider provider = (Provider)Session[LACESConstant.SessionKeys.LOGEDIN_PROVIDER]; ApprovedProvider provider = (ApprovedProvider)Session[LACESConstant.SessionKeys.LOGEDIN_APPROVED_PROVIDER]; // get approved provider information from Session //Set to email address //Declare new mail SmtpClient smtpCl = new SmtpClient(); MailMessage omsg = new MailMessage(); //MailMessage omsg.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); omsg.To.Add(LACESUtilities.GetAdminToEmail()); omsg.CC.Add(LACESUtilities.GetAdminCCEmail()); //Set mail subject omsg.Subject = "New Course Code Requested"; //Set HTML mail format omsg.IsBodyHtml = true; string mailBody = Server.HtmlEncode(txtReason.Text.ToString().Trim()); //Replace new line with <BR> mailBody = mailBody.Replace("\r\n", "<BR>"); //Generate mail body omsg.Body = "Someone has requested a new Course Code be added to the " + LACESConstant.LACES_TEXT + " system. The details of the newly requested code are as follows:<br><br>"; omsg.Body += "Requested Code: " + Server.HtmlEncode(txtCodeType.Text.ToString()) + "<br>"; omsg.Body += "Reason: " + mailBody + "<br>"; omsg.Body += "Requester: " + provider.OrganizationName + "<br>"; omsg.Body += "Requester's Email: <a href='mailto:" + provider.ApplicantEmail + "'>" + provider.ApplicantEmail + "</a><br><br>"; omsg.Body += "If you wish to add this code to the " + LACESConstant.LACES_TEXT + " system, please <a href=\"http://" + Request.Url.Host.ToString() + "/admin/ManageCodeTypes.aspx\">manage the list of codes</a> in the administration system.<br><br>"; omsg.Body += "If you are going to reject the code, or wish to discuss the code further, please contact the course provider at their email address listed above."; //Set SMTP host from configuration smtpCl.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER).ToString(); smtpCl.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); //Send mail if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { smtpCl.Send(omsg); } //Generate thank you message message = ""; lblMessage.Visible = true; lblMessage.Text = "Thank You! Your code request has been successfully submitted."; btnRequest.Visible = false; //After altering user if courseid is defind then send user to course detials page else send user to course list page if (Request.QueryString["CourseID"] != null) { long courseID = Convert.ToInt64(Request.QueryString["CourseID"]); //message += "location.replace(\"CourseDetails.aspx?CourseID=" + courseID + "\");"; message = "<META http-equiv=\"refresh\" content=\"5;URL=CourseDetails.aspx?CourseID=" + courseID + "\">"; lblMessage.Text = lblMessage.Text + "<BR>(You will be automatically redirected to course details page in 5 seconds.)"; } else { message = "<META http-equiv=\"refresh\" content=\"5;URL=CourseList.aspx\">"; lblMessage.Text = lblMessage.Text + "<BR>(You will be automatically redirected to course listing page in 5 seconds.)"; } } catch (Exception ex) { throw ex; } }
/// <summary> /// Sends mail to admin and provier after submitting provider application /// </summary> /// <param name="receiverName"></param> /// <param name="receiverEmail"></param> public static void SendMailsAfterProviderApplicationRenewed(string receiverName, string receiverEmail, string receiverOrg) { SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try { //Get the SMTP server Address from Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP port from Web.conf smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); //SEND MAIL TO ADMIN //Get the email's FROM address from Web.conf message.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); //Get the email's TO from Web.conf message.To.Add(LACESUtilities.GetApprovedProviderMailTo()); //message.CC.Add(new MailAddress("*****@*****.**", "*****@*****.**")); //Get the email's Subject message.Subject = "Provider has been renewed"; //Whether the message body would be displayed as html or not message.IsBodyHtml = true; //Get the email's BODY message.Body = "Dear Admin,<br /><br />" + HttpUtility.HtmlEncode(receiverName) + " (" + receiverEmail + ") from " + receiverOrg + " has renewed provider application.<br />Please review and send feedback.<br /><br />Thank you."; //Send the mail to admin if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { smtpClient.Send(message); } //SEND MAIL TO PROVIDER //Get the email's TO address message = new MailMessage(); //Get the email's FROM address from Web.conf message.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); message.To.Add(new MailAddress(receiverEmail, receiverName)); message.CC.Add(new MailAddress("*****@*****.**", "*****@*****.**")); //message.CC.Add(new MailAddress("*****@*****.**", "*****@*****.**")); //Get the email's Subject message.Subject = "Your LA CES Transaction Has Been Processed"; //Whether the message body would be displayed as html or not message.IsBodyHtml = true; //Get the email's BODY message.Body = "Dear " + HttpUtility.HtmlEncode(receiverName) + ",<br /><br />Your LA CES transaction of $295.00 was charged to your credit card on " + System.DateTime.Today.ToShortDateString() + ". Please print this e-mail and keep as a receipt for your records.<br/><br/>Thank you,<br/><br/>LA CES<br/>[email protected]"; //Send the mail to provider if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { smtpClient.Send(message); } } catch (Exception exp) { } }
/// <summary> /// Call every time when the page load occur /// </summary> /// <param name="sender">Sender object</param> /// <param name="e">EventArgs</param> protected void Page_Load(object sender, EventArgs e) { string uri = LACESUtilities.GetApplicationConstants("LACES_App_Pro_Guide_ASLA_CMS_Site_URL"); appProviderLACESDiv.InnerHtml = GetExternalWebData(uri); }
/// <summary> /// Used to send mail when admin add a new provider or update an existing provider. /// Return true is send mail successfull, otherwise return false. /// </summary> /// <param name="isUpdate">True if provider update mode</param> /// <returns>Return true if send mail successfull</returns> private bool SendMailToProvider(bool isUpdate) { try { SmtpClient smtpClient = new SmtpClient(); //Get the SMTP server Address from SMTP Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP port 25; smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); //create the message body MailMessage message = new MailMessage(); string adminToAddress = LACESUtilities.GetAdminToEmail().Replace(",", ";") + "?cc=" + LACESUtilities.GetAdminCCEmail(); string ToEmailAddress = Server.HtmlEncode(txtEmail.Text.Trim()); message.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); message.To.Add(new MailAddress(txtEmail.Text.Trim())); message.Subject = "American Society of Landscape Architects:" + LACESConstant.LACES_TEXT + " Notification"; message.IsBodyHtml = true; string RefrenceURL = String.Empty; RefrenceURL = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/", Request.Url.AbsoluteUri.LastIndexOf("/") - 1)) + "/provider/" + LACESConstant.URLS.PROVIDER_LOGIN; //create the emailbody StringBuilder EmailBody = new StringBuilder(); EmailBody.Append("<html>"); EmailBody.Append("<head>"); EmailBody.Append("<title>Title</title>"); EmailBody.Append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">"); EmailBody.Append("</head>"); EmailBody.Append("<body style=\"font-family: Arial, verdana, Helvetica, sans-serif; font-size:13px;\">"); string MailBody = ""; //if the provider is active if (radStatus.SelectedValue == "Y") { if (isUpdate) { MailBody = @"<div>Dear " + Server.HtmlEncode(txtOrganization.Text.Trim()) + ", </br></br> " + LACESConstant.LACES_TEXT + " admin updated your profile as an active provider. Your updated login information are as follows:</div></br>" + "<p><div>User Name: " + Server.HtmlEncode(txtEmail.Text.Trim()) + "</div>" + "<div>Password: "******"</div></p>" + "<p><div>You can access the " + LACESConstant.LACES_TEXT + " system at the following URL: " + "<a href=\"" + RefrenceURL + "\">" + RefrenceURL + "</a>.</p><p> If you require further assistance, please contact the " + LACESConstant.LACES_TEXT + " Administrators at the following email address: " + "<a href=\"mailto:" + adminToAddress + "\">" + LACESConstant.LACES_TEXT + " Administrators' Emails</a>.</p></div>"; } else { MailBody = @"<div>Dear " + Server.HtmlEncode(txtOrganization.Text.Trim()) + ", </br></br> " + LACESConstant.LACES_TEXT + " admin added you as an active provider. Your login information are as follows:</div></br>" + "<p><div>User Name: " + Server.HtmlEncode(txtEmail.Text.Trim()) + "</div>" + "<div>Password: "******"</div></p>" + "<p><div>You can access the " + LACESConstant.LACES_TEXT + " system at the following URL: " + "<a href=\"" + RefrenceURL + "\">" + RefrenceURL + "</a>.</p><p> If you require further assistance, please contact the " + LACESConstant.LACES_TEXT + " Administrators at the following email address: " + "<a href=\"mailto:" + adminToAddress + "\">" + LACESConstant.LACES_TEXT + " Administrators' Emails</a>.</p></div>"; } } //else if the provider is inactive else if (radStatus.SelectedValue == "N") { if (isUpdate) { MailBody = @"<div>Dear " + Server.HtmlEncode(txtOrganization.Text.Trim()) + ", </br></br> " + LACESConstant.LACES_TEXT + " admin updated your profile and set you as an inactive provider. Your login information are as follows:</div></br>" + "<p><div>User Name: " + Server.HtmlEncode(txtEmail.Text.Trim()) + "</div>" + "<div>Password: "******"</div></p>" + "<p><div>You can access the " + LACESConstant.LACES_TEXT + " system at the following URL when your account will be activated: " + "<a href=\"" + RefrenceURL + "\">" + RefrenceURL + "</a>.</p><p> If you require further assistance, please contact the " + LACESConstant.LACES_TEXT + " Administrators at the following email address: " + "<a href=\"mailto:" + adminToAddress + "\">" + LACESConstant.LACES_TEXT + " Administrators' Emails</a>.</p></div>"; } else { MailBody = @"<div>Dear " + Server.HtmlEncode(txtOrganization.Text.Trim()) + ", </br></br> " + LACESConstant.LACES_TEXT + " admin added you as an inactive provider. Your login information are as follows:</div></br>" + "<p><div>User Name: " + Server.HtmlEncode(txtEmail.Text.Trim()) + "</div>" + "<div>Password: "******"</div></p>" + "<p><div>You can access the " + LACESConstant.LACES_TEXT + " system at the following URL when your account will be activated: " + "<a href=\"" + RefrenceURL + "\">" + RefrenceURL + "</a>.</p><p> If you require further assistance, please contact the " + LACESConstant.LACES_TEXT + " Administrators at the following email address: " + "<a href=\"mailto:" + adminToAddress + "\">" + LACESConstant.LACES_TEXT + " Administrators' Emails</a>.</p></div>"; } } EmailBody.Append(MailBody); EmailBody.Append("</body>"); EmailBody.Append("</html>"); message.Body = EmailBody.ToString(); //finally send mail if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { smtpClient.Send(message); } return(true); } catch (Exception ex) { return(false); } }
protected void SendApprovedEmail(long courseId) { CourseDataAccess objCourseDAL = new CourseDataAccess(); Course approvedCourse = objCourseDAL.GetCoursesDetailsByID(courseId); string strTitle = approvedCourse.Title; string strHyperlink = approvedCourse.Hyperlink; string strStartDate = approvedCourse.StartDate.ToShortDateString(); string strEndDate = approvedCourse.EndDate.ToShortDateString(); string strDesc = approvedCourse.Description; string strCity = approvedCourse.City; string strState = approvedCourse.StateProvince; string strDistanceEd = approvedCourse.DistanceEducation; string strSubjects = approvedCourse.Subjects; string strHours = approvedCourse.Hours; string strLearningOutcomes = approvedCourse.LearningOutcomes; ApprovedProviderDataAccess apda = new ApprovedProviderDataAccess(); ApprovedProvider ap = apda.GetApprovedProviderByID(approvedCourse.ProviderID); string strSendEmaiTo = ap.ApplicantEmail; StringBuilder strbApprovedEmail = new StringBuilder(); string strEmailTitle = "An LA CES Course has been approved"; string strBodyIntro = "Congratulations, a course has been approved by LA CES administrators. Please review the information below carefully as it may have been revised during the approval process. <br />"; string strBodyEnd = "Please contact <a href=\"mailto:[email protected]\"> LA CES administrators </a> with any questions about the course."; strbApprovedEmail.Append(strBodyIntro + "<br />"); strbApprovedEmail.Append("Course Title: " + strTitle + "<br />"); strbApprovedEmail.Append("Course Hyperlink: " + strHyperlink + "<br />"); strbApprovedEmail.Append("Start Date: " + strStartDate + "<br />"); strbApprovedEmail.Append("End Date: " + strEndDate + "<br />"); strbApprovedEmail.Append("Description: " + strDesc + "<br />"); strbApprovedEmail.Append("City: " + strCity + "<br />"); strbApprovedEmail.Append("State: " + strState + "<br />"); strbApprovedEmail.Append("Distance Education: " + strDistanceEd + "<br />"); strbApprovedEmail.Append("Subject: " + strSubjects + "<br />"); strbApprovedEmail.Append("Hours: " + strHours + "<br />"); strbApprovedEmail.Append("Learning Outcomes: " + strLearningOutcomes + "<br /><br />"); strbApprovedEmail.Append(strBodyEnd + "<br />"); SmtpClient smtpClient = new SmtpClient(); //Get the SMTP server Address from SMTP Web.conf smtpClient.Host = LACESUtilities.GetApplicationConstants(LACESConstant.SMTPSERVER); //Get the SMTP port 25; smtpClient.Port = Convert.ToInt32(LACESUtilities.GetApplicationConstants(LACESConstant.SMTPPORT)); //create the message body MailMessage message = new MailMessage(); message.From = new MailAddress(LACESUtilities.GetAdminFromEmail()); message.To.Add(new MailAddress(strSendEmaiTo)); message.Subject = strEmailTitle; message.IsBodyHtml = true; message.Body = strbApprovedEmail.ToString(); if (ConfigurationManager.AppSettings["SendOutgoingEmail"].ToString() == "Y") { try { smtpClient.Send(message); } catch (Exception ex) { Response.Write(ex.Message); } } }
/// <summary> /// Page Load Event Handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { string sessionKeyForProvider = LACESConstant.SessionKeys.LOGEDIN_APPROVED_PROVIDER; //if current user is inactive if (Session[LACESConstant.SessionKeys.LOGEDIN_INACTIVE_PROVIDER] != null) { sessionKeyForProvider = LACESConstant.SessionKeys.LOGEDIN_INACTIVE_PROVIDER; } //if current user is inactive if (Session[sessionKeyForProvider] == null) { Response.Redirect("Login.aspx"); } //show provider spacific menu in edit mode else { //get the provider from session ApprovedProvider sessionProvider = (ApprovedProvider)Session[sessionKeyForProvider]; // Get provider information from Session //Show loggedin provider name Label lblProviderName = (Label)Master.FindControl("lblProviderName"); if (lblProviderName != null) { lblProviderName.Text = "Signed in as: " + Server.HtmlEncode(sessionProvider.OrganizationName); } //load the provider menu bar HtmlTableCell oHtmlTableCell = (HtmlTableCell)Master.FindControl("tdMenu"); oHtmlTableCell.Controls.Clear(); //if provider is active,provider menu will be shown if (sessionProvider.Status == LACESConstant.ProviderStatus.ACTIVE) { oHtmlTableCell.Controls.Add(LoadControl("~/usercontrols/ProviderMenu.ascx")); } //if provider is inactive, inactive provider menu will be shown else if (sessionProvider.Status == LACESConstant.ProviderStatus.INACTIVE) { oHtmlTableCell.Controls.Add(LoadControl("~/usercontrols/InactiveProviderMenu.ascx")); } try { //change the login status ((HtmlTableCell)Master.FindControl("loginTd")).Attributes["class"] = "loggedIn providerloginStatus"; } catch (Exception ex) { } } uiLnkCalculatingPDH.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("CalculatingPDF")); uiLnkDistanceLearning.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("DistanceEducationPDF")); uiLnkModelCertificateForm.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("ModelCertificateForm")); uiLnkModelEvaluationForm.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("ModelEvaluationForm")); uiLnkHSWClassification.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("HSWClassificationPDF")); if (!Page.IsPostBack) { //now check weather it is in edit provider mode if (Session[LACESConstant.SessionKeys.LOGEDIN_APPROVED_PROVIDER] != null) { //get the provider from session ApprovedProvider sessionProvider = (ApprovedProvider)Session[LACESConstant.SessionKeys.LOGEDIN_APPROVED_PROVIDER]; // Get provider information from Session //fill form by provider in session PreparePreviewData(sessionProvider); } else { ApprovedProvider sessionProvider = (ApprovedProvider)Session[LACESConstant.SessionKeys.LOGEDIN_INACTIVE_PROVIDER]; // Get provider information from Session //fill form by provider in session PreparePreviewData(sessionProvider); } } }
protected void Page_Load(object sender, EventArgs e) { string uri = LACESUtilities.GetApplicationConstants("ProviderTools_URL"); uiLitContent.Text = GetExternalWebData(uri); }
/// <summary> /// Page Load Event Handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { // title of the page //this.Title = LACESConstant.LACES_TEXT + " - Course Details"; // Manage participant button is inactive in add mode //btnManageParticipant.Enabled = false; uiLnkDistanceLearning.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("DistanceEducationPDF")); uiLnkCourseEquiv.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("CourseEquivPDF")); uiLnkHSWClassification.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("HSWClassificationPDF")); uiLnkCalculatingPDH.HRef = GetPDFURL(LACESUtilities.GetApplicationConstants("CalculatingPDF")); if (!IsPostBack) { trStatus.Attributes.Add("style", "display:none;"); // Status will not be displayed in Add mode populateStateList(); // populate state dropdown menu populateSubjectList(); // populate subject dropdown menu // populateCourseTypeList(); // populate course type dropdown menu populateCourseInfo(); // populate course details Information if (Session["ReplicateCourseID"] != null && (Request.QueryString["ReplicateCourse"] == "Y" || Request.QueryString["RenewCourse"] == "Y")) { ReplicateCourse(); if(Request.QueryString["RenewCourse"] == "Y") { uiHdnCourseToRenew.Value = Session["ReplicateCourseID"].ToString(); DisableFieldsForAutoApproval(); } } } initializePage(); /** * Start v1.1 * If course id is found in URL set request course code type hyperlink to RequestCourseCode.aspx with course id * else set request course code type hyperlink to RequestCourseCode.aspx page * */ //string redirectpage = "RequestCourseCode.aspx"; //if (Request.QueryString["CourseID"] != null) //{ // hpRequestNewCodeType.NavigateUrl = "RequestCourseCode.aspx?CourseId=" + Request.QueryString["CourseID"].ToString(); // redirectpage= "RequestCourseCode.aspx?CourseId=" + Request.QueryString["CourseID"].ToString(); //} //else // hpRequestNewCodeType.NavigateUrl = "RequestCourseCode.aspx"; /** * End v1.1 **/ //hpRequestNewCodeType.Attributes.Add("onclick", "return confirmonCloseLink(\"You have made changes to the course details. Would you like to save them before requesting a new code?\",'" + redirectpage + "')"); //hpRequestNewCodeType.Attributes.Add("onclick", "return redirectPage('" + redirectpage + "')"); if (Request.Form["hidAction"] != null && !Request.Form["hidAction"].ToString().Equals(string.Empty)) { string redirect = Request.Form["hidAction"].ToString(); saveInformation(); Response.Redirect(redirect); } }