public RCertification(int invoiceId) { // // Required for telerik Reporting designer support // InitializeComponent(); var invoice = new CInvoice().Get(invoiceId); if (invoice?.ProgramRegistrationId == null) { return; } var programRegistration = new CProgramRegistration().Get((int)invoice.ProgramRegistrationId); if (programRegistration == null) { return; } var cStudent = new CStudent(); var student = cStudent.Get((int)invoice.StudentId); if (student == null) { return; } var program = new CProgram().Get(programRegistration.ProgramId); var siteLocation = new CSiteLocation().Get(student.SiteLocationId); var site = new CSite().Get(siteLocation.SiteId); var weeks = programRegistration.Weeks == null ? string.Empty : programRegistration.Weeks + " weeks"; var programDescription = program.ProgramFullName + (programRegistration.HrsStatus != null ? $"({programRegistration.HrsStatus}/week)" : string.Empty) + " Program"; htmlTextBoxBody.Value = $@"This Certification awarded to<br> <b>{cStudent.GetStudentFullName(student)}</b><br> for successfully completing {weeks} in the<br> <b>{programDescription}</b><br> at {site.Name}, {siteLocation.Name}, ON, Canada"; htmlTextBoxDate.Value = $"Dated : <b>{DateTime.Today.ToString("MM-dd-yy")}</b>"; try { var signPath = new CGlobal().GetLogoImagePath((int)invoice.SiteLocationId, CConstValue.ImageType.Sign); if (signPath != string.Empty) { pictureBoxSign.Value = Image.FromFile(signPath); } } catch (Exception ex) { Debug.Print(ex.Message); } }
public RConfirmationOfEnrollment(int invoiceId) { // // Required for telerik Reporting designer support // InitializeComponent(); var invoice = new CInvoice().Get(invoiceId); if (invoice?.ProgramRegistrationId == null) { return; } var programRegistration = new CProgramRegistration().Get((int)invoice.ProgramRegistrationId); if (programRegistration == null) { return; } var cStudent = new CStudent(); var student = cStudent.Get((int)invoice.StudentId); if (student == null) { return; } var studentGender = (student.Gender == false ? "Mr. " : "Ms. "); textBoxDate.Value = DateTime.Today.ToString("MM-dd-yy"); // id textBoxId.Value = "ID : " + student.StudentNo; // letter of acceptance textBoxConfirmationOfEnrollment.Value = $@"Confirmation Of Enrollment : {studentGender + cStudent.GetStudentFullName(student)}"; // date of birth textBoxDateOfBirth.Value = $@"(Date of Birth: {student.DOB?.ToString("MM-dd-yy")})"; var programType = "Part-time"; var hours = string.Empty; var weeks = string.Empty; if (programRegistration.HrsStatus != null) { if (programRegistration.HrsStatus >= 20) { programType = "Full-time"; } hours = $"({programRegistration.HrsStatus} hours per week)"; } if (programRegistration.Weeks != null) { weeks = programRegistration.Weeks + " weeks"; } var program = new CProgram().Get(programRegistration.ProgramId); var siteLocation = new CSiteLocation().Get(student.SiteLocationId); var site = new CSite().Get(siteLocation.SiteId); // this letter htmlTextBoxThisLetter.Value = $@"This letter certifies that {studentGender + cStudent.GetStudentFullName(student)} has been accepted for {programType} studies {hours} of {program?.ProgramFullName} at the {siteLocation.Name} campus of {site.Abbreviation}. The period of enrollment is {weeks} beginning {programRegistration.StartDate?.ToString("MM-dd-yy")} and ending {programRegistration.EndDate?.ToString("MM-dd-yy")}.<br><br> During the student's enrollment {studentGender + cStudent.GetStudentFullName(student)} attended classes.<br> During the {weeks} of study, {studentGender + cStudent.GetStudentFullName(student)}'s attendance was above 85%.<br><br><br> If you should have any questions regarding the enrollment of {studentGender + student.FirstName} at our college, please do not hesitate to contact our campus director."; switch (siteLocation.SiteId) { // CAC case 2: textBoxName.Value = "Christine Jang"; textBoxJobTitle.Value = "Site Administrator"; break; default: textBoxName.Value = string.Empty; textBoxJobTitle.Value = string.Empty; break; } try { var logoPath = new CGlobal().GetLogoImagePath((int)invoice.SiteLocationId, CConstValue.ImageType.Logo); if (logoPath != string.Empty) { pictureBoxCompanyLogo.Value = Image.FromFile(logoPath); } } catch (Exception ex) { Debug.Print(ex.Message); } try { var signPath = new CGlobal().GetLogoImagePath((int)invoice.SiteLocationId, CConstValue.ImageType.Sign); if (signPath != string.Empty) { pictureBoxSign.Value = Image.FromFile(signPath); } } catch (Exception ex) { Debug.Print(ex.Message); } }