protected void RadGridClassStudent_OnRowDrop(object sender, GridDragDropEventArgs e) { if (e.DraggedItems.Count != 0) { foreach (var dataItem in e.DraggedItems) { var sid = dataItem.GetDataKeyValue("ProgramClassStudentId").ToString(); var cProgramClassStudent = new CProgramClassStudent(); var programClassStudent = cProgramClassStudent.Get(Convert.ToInt32(sid)); var cStudent = new CStudent(); var student = cStudent.Get(programClassStudent.StudentId); var cProgramRegistration = new CProgramRegistration(); var programRegistration = cProgramRegistration.Get(programClassStudent.ProgramRegistrationId); if (programRegistration.EndDate < DateTime.Today) { ShowMessage("Move Failed : " + cStudent.GetStudentName(student) + "'s the End Date should not be earlier than today."); } else if (cProgramClassStudent.Delete(programClassStudent)) { ShowMessage("Moved successfuly : " + cStudent.GetStudentName(student)); } } refreshGrid(); } else { ShowMessage("Transfer Failed"); } }
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); } }
protected void Page_Load(object sender, EventArgs e) { // find user control _radGridInvoiceItems = InvoiceItemGrid1.GetRadGridInvoiceItems(); // connect event of invoice Items. _radGridInvoiceItems.PreRender += _radGridInvoiceItems_PreRender; _radGridInvoiceItems.MasterTableView.DataSourceID = null; _radGridInvoiceItems.DataSourceID = null; // just view InvoiceItemGrid1.SetEditMode(false); Id = Convert.ToInt32(Request["id"]); if (!IsPostBack) { var global = new CGlobal(); var cStudent = new CStudent(); var student = cStudent.Get(Id); var studentSite = new CSiteLocation().Get(student.SiteLocationId); StudentSiteId = studentSite.SiteId; StudentSiteLocationId = student.SiteLocationId; LoadAgency(); LoadFaculty(); LoadProgramGroup("0"); LoadProgram("0"); ddlProgramWeeks.DataSource = new CProgram().GetProgramWeeksList(); ddlProgramWeeks.DataTextField = "Name"; ddlProgramWeeks.DataValueField = "Value"; ddlProgramWeeks.DataBind(); ddlPrgHours.DataSource = global.GetDictionary(150); ddlPrgHours.DataTextField = "Name"; ddlPrgHours.DataValueField = "Value"; ddlPrgHours.DataBind(); var cCountry = new CCountry().Get((int)student.CountryId); var cCountryMarket = new CCountryMarket().Get((int)cCountry.CountryMarketId); ViewState["CountryMarketId"] = cCountry.CountryMarketId; ttName1.Text = cStudent.GetStudentName(student) + " [" + student.StudentNo + "]"; ttName2.Text = cCountryMarket.Name; } ddlAgency.OpenDropDownOnLoad = false; ddlFaculty.OpenDropDownOnLoad = false; ddlProgramGrp.OpenDropDownOnLoad = false; ddlProgramName.OpenDropDownOnLoad = false; ddlProgramWeeks.OpenDropDownOnLoad = false; ddlPrgHours.OpenDropDownOnLoad = false; }
protected void Page_Load(object sender, EventArgs e) { // find user control _radGridInvoiceItems = InvoiceItemGrid1.GetRadGridInvoiceItems(); // connect event of invoice Items. _radGridInvoiceItems.PreRender += _radGridInvoiceItems_PreRender; _radGridInvoiceItems.MasterTableView.DataSourceID = null; _radGridInvoiceItems.DataSourceID = null; // just view InvoiceItemGrid1.SetEditMode(false); Id = Convert.ToInt32(Request["id"]); if (!IsPostBack) { var cStudent = new CStudent(); var student = cStudent.Get(Id); LoadAgency(student.SiteLocationId); var cCountry = new CCountry().Get((int)student.CountryId); var cCountryMarket = new CCountryMarket().Get((int)cCountry.CountryMarketId); ViewState["CountryMarketId"] = cCountry.CountryMarketId; ttName1.Text = cStudent.GetStudentName(student) + " [" + student.StudentNo + "]"; ttName2.Text = cCountryMarket.Name; // Package Program ddlPackageProgram.DataSource = new CPackageProgram().GetPackageProgramBySiteIdAndCountryId(student.SiteLocationId); ddlPackageProgram.DataTextField = "Name"; ddlPackageProgram.DataValueField = "Value"; ddlPackageProgram.DataBind(); if (ddlPackageProgram.Items.Count > 0) { SetPackageProgramData(ddlPackageProgram.Items[0].Value); } } ddlPackageProgram.OpenDropDownOnLoad = false; }
public ROrientationForm(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); htmlTextBoxDate.Value = "Date : " + DateTime.Today.ToString("MM-dd-yy"); textBoxRe.Value = $"RE: STUDENT ORIENTATION FOR {program.ProgramFullName}"; htmlTextBoxBody.Value = $@" <b>TO: {new CStudent().GetStudentFullName(student)} #{student.StudentNo}</b><br> C/O: GLOBAL INTERCITY STUDENT CENTER<br><br> We sincerely welcome you to {site.Name}. Your session starts {programRegistration.StartDate?.ToString("MM-dd-yy")} and it is very important that you be here for your level placement and orientation.<br><br> <b>ORIENTATION</b><br> <b><u>{site.Abbreviation}'s orientation starts 9:00am {programRegistration.StartDate?.ToString("MM-dd-yy")} and students are asked to come to school by no later than 8:50am.</u></b>Counselors will inform you on school policies, class schedules along with a brief tour of the outlying area.<br> <b><u>YOUR FIRST DAY AT SCHOOL INCLUDES</u></b><br> 1. A written placement test<br> 2. Orientation with counselors<br> 3. Individual oral interview with a school instructor<br><br> <b>PLEASE MAKE SURE TO BRING FOLLOWNG ITEMS WITH YOU:</b><br> 1. A pencil and an eraser for the Placement Test<br> 2. A photocopy of your passport(the page with your passport photo)<br> 3. A photocopy of your Valid Immigration Document(Study Permit / Work Permit / Visitor's Record)<br> 4. A photocopy of your Medical Insurance Document<br> 5. A photocopy of your Letter of Acceptance and the Refund Policy with your signatures on<br><br> <b>CHANGE OF SCHEDULE</b><br> <b>If you are not able to attend the placement/orientation, you must notify the school immediately.</b><br><br> <b>CLEARING CUSTOMS</b><br> You may not study for over 6 months when entering Canada with a tourist visa. Please have with you your {site.Abbreviation} Letter of Acceptance and Homestay detail. Also, it is a good idea to be prepared to answer simple question that the customs officer may have for you."; 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 sideLogoPath = new CGlobal().GetLogoImagePath((int)invoice.SiteLocationId, CConstValue.ImageType.LogoSide); if (sideLogoPath != string.Empty) { pictureBoxSideLogo.Value = Image.FromFile(sideLogoPath); } } catch (Exception ex) { Debug.Print(ex.Message); } }
public DataTable GetInvoiceData() { // student insurance var cStudent = new CStudent(); var student = cStudent.Get(Id); DataTable table = new DataTable(); table.Columns.Add("InvoiceCoaItemId", typeof(int)); table.Columns.Add("StandardPrice", typeof(decimal)); table.Columns.Add("StudentPrice", typeof(decimal)); table.Columns.Add("AgencyPrice", typeof(decimal)); table.Columns.Add("Remark", typeof(string)); table.Columns.Add("InvoiceItemId", typeof(int)); // Tuition if (tbPrgTuition.Value.ToString() != "0" && tbPrgTuition.Value.ToString() != string.Empty) { table.Rows.Add((int)CConstValue.InvoiceCoaItem.TuitionBasic, tbPrgStandardTuition.Value, tbPrgTuition.Value, tbPrgTuition.Value, string.Empty, 0); // Scholarship double scholarshipPrice = 0; ScholarshipId = null; ImageScholarshipSuccess.Visible = false; ImageScholarshipFail.Visible = true; RadNumericTextBoxAvailableScholarshipAmount.Text = string.Empty; RadNumericTextBoxAvailableScholarshipWeeks.Text = string.Empty; if (RadTextBoxScholarship.Text != string.Empty) { if (student != null && !string.IsNullOrEmpty(ddlAgency.SelectedValue)) { var cScholarship = new CScholarship(); var scholarship = cScholarship.GetScholarship(RadTextBoxScholarship.Text.Replace("-", string.Empty), student.SiteLocationId, Convert.ToInt32(ddlProgramWeeks.Text), Convert.ToInt32(ddlAgency.SelectedValue)); if (scholarship != null) { // search scholarship with availalble value over than 1 var vwScholarship = cScholarship.GetVwScholarship(scholarship.ScholarshipId); if (vwScholarship != null) { // if invoice doesn't have, it can be null decimal availableAmount = vwScholarship.AvailableAmount ?? 0; int availableWeeks = vwScholarship.AvailableWeeks ?? 0; if (scholarship.Amount != null) { RadNumericTextBoxAvailableScholarshipAmount.Value = (double)availableAmount; if (!string.IsNullOrEmpty(RadNumericTextBoxScholarshipAmount.Text)) { if ((double)availableAmount < RadNumericTextBoxScholarshipAmount.Value) { RadNumericTextBoxScholarshipAmount.Value = (double)availableAmount; } } else { RadNumericTextBoxScholarshipAmount.Value = (double)availableAmount; } scholarshipPrice = (double)RadNumericTextBoxScholarshipAmount.Value * -1; RadNumericTextBoxScholarshipWeeks.Text = string.Empty; RadButtonAvailableScholarshipAmount.Checked = true; RadButtonAvailableScholarshipWeeks.Checked = false; } else { RadNumericTextBoxAvailableScholarshipWeeks.Value = availableWeeks; if (!string.IsNullOrEmpty(RadNumericTextBoxScholarshipWeeks.Text)) { if ((double)availableWeeks < RadNumericTextBoxScholarshipWeeks.Value) { RadNumericTextBoxScholarshipWeeks.Value = (double)availableWeeks; } } else { RadNumericTextBoxScholarshipWeeks.Value = (double)availableWeeks; } // todo: cal week for scholarship. // cal weeks !!!!!!!!!!!!!!!!!! scholarshipPrice = (double)RadNumericTextBoxScholarshipWeeks.Value; RadNumericTextBoxScholarshipAmount.Value = scholarshipPrice; RadButtonAvailableScholarshipAmount.Checked = false; RadButtonAvailableScholarshipWeeks.Checked = true; } table.Rows.Add((int)CConstValue.InvoiceCoaItem.TuitionScholarship, 0, 0, scholarshipPrice, string.Empty, 0); ScholarshipId = scholarship.ScholarshipId; ImageScholarshipSuccess.Visible = true; ImageScholarshipFail.Visible = false; } } } } // Commission if (tbCommissionRate.Value.ToString() != "0" && tbCommissionRate.Value.ToString() != string.Empty) { table.Rows.Add((int)CConstValue.InvoiceCoaItem.CommissionTuition, 0, 0, (tbPrgTuition.Value + scholarshipPrice) * (tbCommissionRate.Value / -100), string.Empty, 0); } // Promotion PromotionId = null; ImagePromotionSuccess.Visible = false; ImagePromotionFail.Visible = true; if (RadTextBoxPromotion.Text != string.Empty) { if (student != null) { var cPromotion = new CPromotion(); var promotion = cPromotion.GetPromotion(RadTextBoxPromotion.Text, student.SiteLocationId); if (promotion != null) { PromotionId = promotion.PromotionId; ImagePromotionSuccess.Visible = true; ImagePromotionFail.Visible = false; } } } // from Other fee info if (!string.IsNullOrEmpty(ddlProgramName.SelectedValue)) { var cProgramOtherFeeInfo = new CProgramOtherFeeInfo(); var programOtherFeeInfo = cProgramOtherFeeInfo.Get(Convert.ToInt32(ddlProgramName.SelectedValue)); if (programOtherFeeInfo != null) { // other fees var regFee = programOtherFeeInfo.RegFee + programOtherFeeInfo.JRegFee; if (regFee > 0) { table.Rows.Add((int)CConstValue.InvoiceCoaItem.Registration, regFee, regFee, regFee, string.Empty, 0); } var materialFee = programOtherFeeInfo.AcademicFee + programOtherFeeInfo.MaterialFee + programOtherFeeInfo.UniformFee + programOtherFeeInfo.SupplyFee; if (materialFee > 0) { table.Rows.Add((int)CConstValue.InvoiceCoaItem.MaterialOthers, materialFee, materialFee, materialFee, string.Empty, 0); } var testFee = programOtherFeeInfo.TestFee + programOtherFeeInfo.ExamFee; if (testFee > 0) { table.Rows.Add((int)CConstValue.InvoiceCoaItem.TestExamFee, testFee, testFee, testFee, string.Empty, 0); } var internshipFee = programOtherFeeInfo.InternFee + programOtherFeeInfo.PracticeFee + programOtherFeeInfo.LCFee + programOtherFeeInfo.SDFee + programOtherFeeInfo.UPFee; if (internshipFee > 0) { table.Rows.Add((int)CConstValue.InvoiceCoaItem.InternshipBasic, internshipFee, internshipFee, internshipFee, string.Empty, 0); } var administration = programOtherFeeInfo.ACFee + programOtherFeeInfo.AdminFee + programOtherFeeInfo.UAGFee; if (administration > 0) { table.Rows.Add((int)CConstValue.InvoiceCoaItem.Administration, administration, administration, administration, string.Empty, 0); } var certificateFee = programOtherFeeInfo.CFee; if (certificateFee > 0) { table.Rows.Add((int)CConstValue.InvoiceCoaItem.ServiceCertificate, certificateFee, certificateFee, certificateFee, string.Empty, 0); } var otherFee = programOtherFeeInfo.OtherFee; if (otherFee > 0) { table.Rows.Add((int)CConstValue.InvoiceCoaItem.Other, otherFee, otherFee, otherFee, string.Empty, 0); } } } if (student != null) { if (student.Insurance) { // 33 table.Rows.Add((int)CConstValue.InvoiceCoaItem.Insurance, student.InsuranceTotal, student.InsuranceTotal, student.InsuranceTotal); } } // agency check if (string.IsNullOrEmpty(ddlAgency.SelectedValue)) { foreach (DataRow dr in table.Rows) { dr["AgencyPrice"] = 0; } } } return(table); }
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); } }
protected void StudentButtonClicked(object sender, RadToolBarEventArgs e) { if (e.Item.Text == "Update" && RadGridStudentList.SelectedValue != null) { if (IsValid) { var cStud = new CStudent(); var stud = cStud.Get(Convert.ToInt32(RadGridStudentList.SelectedValue)); stud.FirstName = tbFirstName.Text; stud.LastName1 = tbLastName1.Text; stud.LastName2 = tbLastName2.Text; stud.MiddleName1 = tbMiddleName1.Text; stud.MiddleName2 = tbMiddleName2.Text; stud.Address1InCanada = tbCadAddress.Text; stud.CityInCanada = tbCadCity.Text; stud.ProvinceInCanada = tbCadProvince.Text; stud.PostalCodeInCanada = tbCadZipcode.Text; stud.PermanentAddress1 = tbPerAddress.Text; stud.PermanentCity = tbPerCity.Text; stud.PermanentProvince = tbPerState.Text; stud.PermanentPostalCode = tbPerZiocode.Text; stud.PermanentCountry = (ddlPerCountry.SelectedValue == "") ? 239 : Convert.ToInt32(ddlPerCountry.SelectedValue); //239:N/A stud.Phone1 = tbPhone1.Text; stud.Phone2 = tbPhone2.Text; stud.Email1 = tbEmail1.Text; stud.Email2 = tbEmail2.Text; stud.Fax = tbFax.Text; stud.DOB = Convert.ToDateTime(tbDateOfBirth.SelectedDate); stud.StudentType = Convert.ToInt32(ddlStudentType.SelectedValue); stud.Passport = tbPassport.Text; stud.LoanNo = tbLoanNo.Text; stud.ContactName = tbContactName.Text; stud.ContactPhone = tbContactPhone.Text; stud.ContactRelationship = tbContactRelationship.Text; stud.Comment = tbComment.Text; stud.Gender = Convert.ToBoolean(ddlGender.SelectedValue); //stud.MarketerId = Convert.ToInt32(ddlmarketer.SelectedValue); stud.VisaStatus = Convert.ToInt32(ddlStatus.SelectedValue); stud.VisaStart = (tbStatusStartDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbStatusStartDate.SelectedDate); stud.VisaEnd = (tbStatusEndDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbStatusEndDate.SelectedDate); stud.WorkPermitStatus = Convert.ToInt32(ddlPermit.SelectedValue); stud.WorkPermitStart = (tbPermitStartDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbPermitStartDate.SelectedDate); stud.WorkPermitEnd = (tbPermitEndDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbPermitEndDate.SelectedDate); stud.Insurance = Convert.ToBoolean(ddlInsurance.SelectedValue); stud.InsuranceStart = (tbInsuranceStartDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbInsuranceStartDate.SelectedDate); stud.InsuranceEnd = (tbInsuranceEndtDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbInsuranceEndtDate.SelectedDate); stud.InsuranceDayFee = (tbInsuranceDayFee.Text == null || tbInsuranceDayFee.Text == "") ? 0 : Convert.ToDecimal(tbInsuranceDayFee.Text); stud.InsuranceTotal = (tbInsuranceTotalAmt.Text == null || tbInsuranceTotalAmt.Text == "") ? 0 : Convert.ToDecimal(tbInsuranceTotalAmt.Text); stud.CountryId = Convert.ToInt32(ddlCountry.SelectedValue); stud.UpdatedId = CurrentUserId; if (cStud.Update(stud)) { // UP LOAD FileDownloadList1.SaveFile(Convert.ToInt32(RadGridStudentList.SelectedValue)); ShowMessage("Update inqury successfully"); } else { ShowMessage("Failed to update inqury"); } RadGridStudentList.Rebind(); } } }
protected void GetStudent() { ResetForm(); if (RadGridStudentList.SelectedValue != null && RadGridStudentList.SelectedValue.ToString() != "") { var cStud = new CStudent(); var stud = cStud.Get(Convert.ToInt32(RadGridStudentList.SelectedValue)); if (stud.StudentId > 0) { var siteLocation = new CSiteLocation().Get(stud.SiteLocationId); LoadSite(siteLocation.SiteId); LoadSiteLocation(siteLocation.SiteId); RadComboBoxSite.SelectedValue = siteLocation.SiteId.ToString(); RadComboBoxSiteLocation.SelectedValue = siteLocation.SiteLocationId.ToString(); ddlmarketer.SelectedValue = stud.MarketerId.ToString(); tbFirstName.Text = stud.FirstName; tbMiddleName1.Text = stud.MiddleName1; tbMiddleName2.Text = stud.MiddleName2; tbLastName1.Text = stud.LastName1; tbLastName2.Text = stud.LastName2; ddlGender.SelectedValue = stud.Gender.ToString(); tbDateOfBirth.SelectedDate = stud.DOB; var age = DateTime.Now.Year - stud.DOB.Value.Year; if (age < 12) { ddlAgeSegregation.SelectedValue = "3"; } else if (age < 18) { ddlAgeSegregation.SelectedValue = "2"; } else { ddlAgeSegregation.SelectedValue = "1"; } ddlStudentType.SelectedValue = stud.StudentType.ToString(); ddlCountry.SelectedValue = stud.CountryId.ToString(); tbPhone1.Text = stud.Phone1; tbPhone2.Text = stud.Phone2; tbEmail1.Text = stud.Email1; tbEmail2.Text = stud.Email2; tbPassport.Text = stud.Passport; tbLoanNo.Text = stud.LoanNo; tbComment.Text = stud.Comment; //tbStudentMasterNo.Text = stud.StudentMasterNo; tbContactName.Text = stud.ContactName; tbContactRelationship.Text = stud.ContactRelationship; tbContactPhone.Text = stud.ContactPhone; tbPerAddress.Text = stud.PermanentAddress1; tbPerCity.Text = stud.PermanentCity; tbPerState.Text = stud.PermanentProvince; tbPerZiocode.Text = stud.PermanentPostalCode; ddlPerCountry.SelectedValue = (stud.PermanentCountry.ToString() == null || stud.PermanentCountry.ToString() == "") ? "0" : stud.PermanentCountry.ToString(); tbCadAddress.Text = stud.Address1InCanada; tbCadCity.Text = stud.CityInCanada; tbCadProvince.Text = stud.ProvinceInCanada; tbCadZipcode.Text = stud.PostalCodeInCanada; ddlInsurance.SelectedValue = stud.Insurance.ToString(); //if (ddlInsurance.SelectedValue == "False") // tbInsuranceStartDate.Visible = false; //else // tbInsuranceStartDate.Visible = true; if (stud.InsuranceStart > Convert.ToDateTime("1900-01-01")) { tbInsuranceStartDate.SelectedDate = stud.InsuranceStart; } else { tbInsuranceStartDate.SelectedDate = null; } if (stud.InsuranceEnd > Convert.ToDateTime("1900-01-01")) { tbInsuranceEndtDate.SelectedDate = stud.InsuranceEnd; } else { tbInsuranceEndtDate.SelectedDate = null; } tbInsuranceDayFee.Text = stud.InsuranceDayFee.ToString(); tbInsuranceTotalAmt.Text = stud.InsuranceTotal.ToString(); ddlStatus.SelectedValue = (stud.VisaStatus.ToString() == null || stud.VisaStatus.ToString() == "") ? "120" : stud.VisaStatus.ToString(); tbStatusStartDate.SelectedDate = stud.VisaStart; tbStatusEndDate.SelectedDate = stud.VisaEnd; if (stud.VisaStart > Convert.ToDateTime("1900-01-01")) { tbStatusStartDate.SelectedDate = stud.VisaStart; } else { tbStatusStartDate.SelectedDate = null; } if (stud.VisaEnd > Convert.ToDateTime("1900-01-01")) { tbStatusEndDate.SelectedDate = stud.VisaEnd; } else { tbStatusEndDate.SelectedDate = null; } ddlPermit.SelectedValue = (stud.WorkPermitStatus.ToString() == null || stud.WorkPermitStatus.ToString() == "") ? "126" : stud.WorkPermitStatus.ToString(); tbPermitStartDate.SelectedDate = stud.WorkPermitStart; tbPermitEndDate.SelectedDate = stud.WorkPermitEnd; if (stud.WorkPermitStart > Convert.ToDateTime("1900-01-01")) { tbPermitStartDate.SelectedDate = stud.WorkPermitStart; } else { tbPermitStartDate.SelectedDate = null; } if (stud.WorkPermitEnd > Convert.ToDateTime("1900-01-01")) { tbPermitEndDate.SelectedDate = stud.WorkPermitEnd; } else { tbPermitEndDate.SelectedDate = null; } FileDownloadList1.GetFileDownload(Convert.ToInt32(RadGridStudentList.SelectedValue)); } } }
public RLetterOfAcceptanceInTable(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); textBoxDLI.Value = $@"Designated learning institution number (DLI #) : {"O19375754382"}"; textBoxDateOfIssue.Value = $@"Date of Issue : {DateTime.Today.ToString("MM-dd-yy")}"; htmlTextBoxFaimlyName.Value = $@"1. Family Name : <br><b>{student.LastName1}</b>"; htmlTextBoxFirstName.Value = $@"2. First Name and Initials : <br><b>{student.FirstName}</b>"; htmlTextBoxDateOfBirth.Value = $@"3. Date of Birth : <br><b>{student.DOB?.ToString("MM-dd-yy")}</b>"; htmlTextBoxStudentId.Value = $@"4. Student ID Number : <br><b>{student.StudentNo}</b>"; htmlTextBoxStudentFull.Value = $@"5. Student Full Mailing Address : <br><b>{student.Address1InCanada}</b>"; htmlTextBoxDates.Value = $@"6. Dates : <br>Start Date : <b>{programRegistration.StartDate?.ToString("MM-dd-yy")}</b><br>Completion Date : <b>{programRegistration.EndDate?.ToString("MM-dd-yy")}</b>"; htmlTextBoxNameOfSchool.Value = $@"7. Name of School/Institution(include public or private) : <br><b>{site.Name}</b>"; htmlTextBoxLevelOfStudy.Value = $@"8. Level of Study : <br><b>{"N/A"}</b>"; htmlTextBoxProgram.Value = $@"9. Program/Major/Course : <br><b>{program.ProgramFullName + " " + (programRegistration.HrsStatus == null ? string.Empty : "(" + programRegistration.HrsStatus + "/week)")}</b>"; htmlTextBoxHoursOfInstruction.Value = $@"10. Hours of Instruction per Week : <br><b>{programRegistration.Weeks}</b>"; htmlTextBoxAcademicYear.Value = $@"11. Academic Year of Study which the student will enter (e.g., Year 2 of 3 Year Program)<br><b>{"N/A"}</b>"; htmlTextBoxLateRegistrationDate.Value = $@"12. Late Registration Date : <br><b>{"N/A"}</b>"; var vwStudentContract = new CStudent().GetVwStudentContract(invoiceId); var isFullPayment = false; if (vwStudentContract?.DepositConfirmCnt == vwStudentContract?.PaymentCnt && vwStudentContract.Balance == 0) { isFullPayment = true; } htmlTextBoxConditionOfAcceptance.Value = $@"13. Condition of Acceptance : (must be paid in full at least 2 weeks before start date)<br><b>{(isFullPayment ? "Full Fee Payment" : "Not fully Fee Payment")}</b>"; var invoiceItemList = new CInvoiceItem().GetInvoiceItems(invoiceId); var tuitionFee = invoiceItemList.FirstOrDefault(x => x.InvoiceCoaItemId == (int)CConstValue.InvoiceCoaItem.TuitionBasic); htmlTextBoxEstimatedTuitionFees.Value = $@"14. Estimated Tuition Fees : (not including homestay accommodation fee)<br>Tuition Fee : <b>${tuitionFee}</b>"; string scholarshipMasterNo = string.Empty; if (invoice.ScholarshipId != null) { scholarshipMasterNo = new CScholarship().Get((int)invoice.ScholarshipId)?.ScholarshipMasterNo; } htmlTextBoxScholarship.Value = $@"15. Scholarship/Teaching Assistantship: <br><b>{scholarshipMasterNo}</b>"; htmlTextBoxExchangeStudent.Value = $@"16. Exchange Student (yes/no) : <br><b>{"No"}</b>"; htmlTextBoxLicensingInformation.Value = $@"17. Licensing Information where applicable for Private Institution (yes/no/not applicable): <br><b>{"N/A"}</b>"; htmlTextBoxIfDestinedForQuebec.Value = $@"18. If destined for Quebec, has CAQ information been sent to student (yes/no/not applicable) : <br><b>{"N/A"}</b>"; htmlTextBoxGuardianship.Value = $@"19. Guardianship/Custodianship details if applicable : <br><b>{"N/A"}</b>"; htmlTextBoxCredentials.Value = $@"20. Credentials : <br><b>{site.Name} Certificates and/or Diploma</b>"; htmlTextBoxRequirementsForSuccessful.Value = $@"21. Requirements for successful program completion : <br><b>{"70% grade and 85% attendance"}</b>"; htmlTextBoxSignatureOfInstitution.Value = $@"22. Signature of Institution Representative : <br>"; string name = string.Empty; string position = string.Empty; switch (siteLocation.SiteId) { // CAC case 2: name = "Christine Jang"; position = "Site Administrator"; break; default: name = string.Empty; position = string.Empty; break; } htmlTextBoxNameOfInstitution.Value = $@"23. Name of Institution Representative (please print) : <br><b>{name} - {position}</b>"; htmlTextBoxStudentSignature.Value = $@"24. Student's signature : <br><br><br><br><br>I have read and received a copy this contract and a copy of statement of the student's rights and responsibilities."; 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); } try { var sideLogoPath = new CGlobal().GetLogoImagePath((int)invoice.SiteLocationId, CConstValue.ImageType.LogoSide); if (sideLogoPath != string.Empty) { pictureBoxSideLogo.Value = Image.FromFile(sideLogoPath); } } catch (Exception ex) { Debug.Print(ex.Message); } }
public RConfirmationOfCompletionLetter(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); htmlTextBoxSubTitle.Value = $@"{site.Name} - {siteLocation.Name} - Canada"; htmlTextBoxStudentId.Value = $@"Student ID : {student.StudentNo}"; htmlTextBoxDateOfIssue.Value = $@"Date of Issue : {DateTime.Today}"; htmlTextBoxThisIs.Value = $@"This is to confirm that the following student has successfully completed their studies at {site.Name}."; htmlTextBoxFamilyName.Value = $@"FAMILY NAME : {student.LastName1}"; htmlTextBoxFirstName.Value = $@"FIRST NAME : {student.FirstName}"; htmlTextBoxDateOfBirth.Value = $@"DATE OF BIRTH : {student.DOB?.ToString("MM-dd-yy")}"; htmlTextBoxProgram.Value = $@"PROGRAM : {program.ProgramFullName}"; htmlTextBoxPeriod.Value = $@"PERIOD : {programRegistration.StartDate?.ToString("MM-dd-yy")} ~ {programRegistration.EndDate?.ToString("MM-dd-yy")}"; 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 sideLogoPath = new CGlobal().GetLogoImagePath((int)invoice.SiteLocationId, CConstValue.ImageType.LogoSide); if (sideLogoPath != string.Empty) { pictureBoxSideLogo.Value = Image.FromFile(sideLogoPath); } } catch (Exception ex) { Debug.Print(ex.Message); } }