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; }
private void GetSiteLocation() { RadComboBoxSiteLocation.Items.Clear(); List <SiteLocation> siteLocationList = new List <SiteLocation>(); if (RadGridAgency.SelectedValue != null) { var cAgencySiteLocation = new CAgencySiteLocation(); var agencySiteLocation = cAgencySiteLocation.GetAgencySiteLocationList(Convert.ToInt32(RadGridAgency.SelectedValue)); if (agencySiteLocation.Count > 0) { var siteLocation = new CSiteLocation().Get(agencySiteLocation[0].SiteLocationId); siteLocationList = new CSiteLocation().GetSiteLocationBySiteId(siteLocation.SiteId); RadTextBoxSite.Text = (new CSite()).Get(siteLocation.SiteId).Abbreviation; } foreach (var siteLocation in siteLocationList) { RadComboBoxSiteLocation.Items.Add(new RadComboBoxItem(siteLocation.Name, siteLocation.SiteLocationId.ToString())); } foreach (var agencySiteLo in agencySiteLocation) { foreach (RadComboBoxItem siteLocation in RadComboBoxSiteLocation.Items) { if (agencySiteLo.SiteLocationId == Convert.ToInt32(siteLocation.Value)) { siteLocation.Checked = true; } } } } else { var cSiteLocation = new CSiteLocation(); siteLocationList = cSiteLocation.GetSiteLocationBySiteId(CurrentSiteId); foreach (var siteLocation in siteLocationList) { RadComboBoxSiteLocation.Items.Add(new RadComboBoxItem(siteLocation.Name, siteLocation.SiteLocationId.ToString())); } RadTextBoxSite.Text = (new CSite()).Get(CurrentSiteId).Abbreviation; } RadComboBoxSiteLocation_OnSelectedIndexChanged(null, null); }
private void GetSiteLocation(bool isModify) { RadComboBoxSiteLocation.Items.Clear(); List <SiteLocation> siteLocationList = new List <SiteLocation>(); if (isModify) { var cPackageProgramSiteLocation = new CPackageProgramSiteLocation(); var packageProgramSiteLocation = cPackageProgramSiteLocation.GetPackageProgramSiteLocationList(Convert.ToInt32(hfId.Value)); if (packageProgramSiteLocation.Count > 0) { var siteLocation = new CSiteLocation().Get(packageProgramSiteLocation[0].SiteLocationId); siteLocationList = new CSiteLocation().GetSiteLocationBySiteId(siteLocation.SiteId); RadTextBoxSite.Text = (new CSite()).Get(siteLocation.SiteId).Abbreviation; } foreach (var siteLocation in siteLocationList) { RadComboBoxSiteLocation.Items.Add(new RadComboBoxItem(siteLocation.Name, siteLocation.SiteLocationId.ToString())); } foreach (var packageProgramSiteLo in packageProgramSiteLocation) { foreach (RadComboBoxItem siteLocation in RadComboBoxSiteLocation.Items) { if (packageProgramSiteLo.SiteLocationId == Convert.ToInt32(siteLocation.Value)) { siteLocation.Checked = true; } } } } else { var cSiteLocation = new CSiteLocation(); siteLocationList = cSiteLocation.GetSiteLocationBySiteId(CurrentSiteId); foreach (var siteLocation in siteLocationList) { RadComboBoxSiteLocation.Items.Add(new RadComboBoxItem(siteLocation.Name, siteLocation.SiteLocationId.ToString())); } RadTextBoxSite.Text = (new CSite()).Get(CurrentSiteId).Abbreviation; } RadComboBoxSiteLocation_OnSelectedIndexChanged(null, null); }
protected void GetStaffInfo() { if (RadGridUser.SelectedValue != null) { var cUser = new CUser(); var user = cUser.Get(Convert.ToInt32(RadGridUser.SelectedValue)); if (user.UserId > 0) { var cSiteLocation = new CSiteLocation(); var siteLocation = cSiteLocation.Get(user.SiteLocationId); LoadSite(siteLocation.SiteId); LoadSiteLocation(siteLocation.SiteId); LoadUserGroup(siteLocation.SiteId); LoadSupervisor(); RadComboBoxSite.SelectedValue = siteLocation.SiteId.ToString(); RadComboBoxSiteLocation.SelectedValue = user.SiteLocationId.ToString(); var cUserPosition = new CUserPosition(); var userPosition = cUserPosition.Get(user.UserPositionId); if (userPosition != null) { RadComboBoxUserGroup.SelectedValue = userPosition.UserGroupId.ToString(); LoadUserPosition(userPosition.UserGroupId); RadComboBoxUserPosition.SelectedValue = user.UserPositionId.ToString(); } RadComboBoxSuper.SelectedValue = user.Supervisor.ToString(); tbUserID.Enabled = false; tbUserID.Text = user.LoginId; //tbPassWord.Text = user.Password; tbFName.Text = user.FirstName; tbMName.Text = user.MidName; tbLName.Text = user.LastName; tbSIN.Text = Convert.ToString(user.SINNo); tbDOB.SelectedDate = user.DOB; DateTime Today = DateTime.Now; DateTime Dob = Convert.ToDateTime(user.DOB); TimeSpan ts = Today - Dob; DateTime Age = DateTime.MinValue + ts; int Years = Age.Year - 1; tbAge.Text = Years.ToString(); ddlMarital.SelectedValue = user.MaritalStatus; ddlGender.SelectedValue = user.Gender; tbWEmail.Text = user.Email; tbWPhone.Text = user.Phone; tbEmpNo.Text = user.EmployeeNumber; cbActive.Checked = user.IsActive; tbPAddess1.Text = user.Address1; tbPAddess2.Text = user.Address2; tbPCity.Text = user.City; tbPProvince.Text = user.Province; tbPPostal.Text = user.PostalCode; tbPHomePhone.Text = user.HomePhone; tbPCell.Text = user.CellPhone; tbPEmail.Text = user.PersonalEmail; tbEName.Text = user.EContactName; tbERelation.Text = user.ERelation; tbEPhone.Text = user.EPhone; tbEAddress.Text = user.EAddress; // pic if (user.Picture != null) { RadBinaryImagePicture.DataValue = user.Picture.ToArray(); RadBinaryImagePicture.Visible = true; } else { RadBinaryImagePicture.DataValue = null; RadBinaryImagePicture.Visible = false; } if (RadToolBarUser.FindItemByText("New") != null) { RadToolBarUser.FindItemByText("New").Enabled = true; } if (RadToolBarUser.FindItemByText("Save") != null) { RadToolBarUser.FindItemByText("Save").Text = @"Update"; } } } }
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 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 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); } }
protected void Page_Load(object sender, EventArgs e) { Id = Convert.ToInt32(Request["id"]); if (!IsPostBack) { FileDownloadList1.InitFileDownloadList((int)CConstValue.Upload.Inventory); var buttonList = new List <string>(); // new if (Request["createOrListType"] == "0") { buttonList.Add("Save"); buttonList.Add("Close"); } // select else { buttonList.Add("Save"); buttonList.Add("Print"); buttonList.Add("Close"); } foreach (RadToolBarItem item in RadToolBar1.Items) { if (buttonList.Contains(item.Text)) { item.Visible = true; } else { item.Visible = false; } } LoadInventoryCategory(); if (!string.IsNullOrEmpty(RadComboBoxInventoryCategory.SelectedValue)) { LoadInventoryCategoryItem(Convert.ToInt32(RadComboBoxInventoryCategory.SelectedValue)); } LoadSite(); LoadSiteLocation(CurrentSiteId); LoadAssignedUser(CurrentSiteLocationId); LoadInUse(); LoadCondition(); var inventory = new CInventory().Get(Id); if (inventory != null) { var inventoryCategoryItem = new CInventoryCategoryItem().Get(inventory.InventoryCategoryItemId); RadComboBoxInventoryCategory.SelectedValue = inventoryCategoryItem.InventoryCategoryId.ToString(); RadComboBoxInventoryCategoryItem.SelectedValue = inventory.InventoryCategoryItemId.ToString(); var siteLocation = new CSiteLocation().Get(inventory.SiteLocationId); RadComboBoxSite.SelectedValue = siteLocation.SiteId.ToString(); RadComboBoxSiteLocation.SelectedValue = inventory.SiteLocationId.ToString(); RadComboBoxAssignedUser.SelectedValue = inventory.AssignedUserId.ToString(); RadComboBoxInUse.SelectedValue = inventory.InUseType.ToString(); RadComboBoxCondition.SelectedValue = inventory.ConditionType.ToString(); RadTextBoxCompany.Text = inventory.Company; RadNumericTextBoxPrice.Value = (double)inventory.Price; RadDatePickerPurchased.SelectedDate = inventory.PurchasedDate?.Date; RadDatePickerExpire.SelectedDate = inventory.ExpireDate?.Date; RadTextBoxDepartment.Text = inventory.Company; RadTextBoxModelNo.Text = inventory.ModelNo; RadTextBoxSerialNo.Text = inventory.SerialNo; FileDownloadList1.GetFileDownload(Convert.ToInt32(Id)); } } }
public static void SetFilterCheckListItems(GridFilterCheckListItemsRequestedEventArgs e) { object dataSource = null; string dataField = (e.Column as IGridDataColumn).GetActiveDataField(); switch (dataField) { // Common case "SiteName": dataSource = new CSite().GetSiteNameList(); break; case "SiteLocationName": dataSource = new CSiteLocation().GetSiteLocationNameList(); break; case "CountryName": dataSource = new CCountry().GetCountryNameList(); break; case "AgencyName": dataSource = new CAgency().GetAgencyNameList(); break; case "ProgramName": dataSource = new CProgram().GetProgramNameList(); break; case "InvoiceCoaItemId": dataSource = new CInvoiceCoaItem().GetInvoiceCoaItemIdNameList(); break; case "InvoiceName": dataSource = new CProgram().GetInvoiceNameList(); break; case "StudentName": dataSource = new CStudent().GetStudentNameList(); break; case "UserName": dataSource = new CUser().GetUserNameList(); break; case "Status": dataSource = new CApproval().GetStatusNameList(); break; case "ApprovalUserName": dataSource = new CUser().GetApprovalUserNameList(); break; case "InstructorName": dataSource = new CUser().GetInstructorNameList(); break; case "ProgramStatusName": dataSource = new CProgramRegistration().GetProgramStatusList(); break; // Dashboard case "Type": dataSource = new CApproval().GetApprovalTypeNameList(); break; // Invoice case "InvoiceType": dataSource = new CInvoice().GetInvoiceTypeList(); break; case "InvoiceStatus": dataSource = new CInvoice().GetInvoiceStatusList(); break; // Deposit case "DepositStatus": dataSource = new CDeposit().GetDepositStatusNameList(); break; case "DepositBank": dataSource = new CDeposit().GetDepositBankNameList(); break; case "PaidMethod": dataSource = new CDeposit().GetPaidMethodNameList(); break; case "ExtraTypeName": dataSource = new CDeposit().GetExtraTypeNameList(); break; // CreditMemo case "CreditMemoType": dataSource = new CCreditMemo().GetCreditMemoTypeNameList(); break; case "PayoutMethodName": dataSource = new CCreditMemoPayout().GetPayoutMethodNameList(); break; // Academic case "FacultyName": dataSource = new CFaculty().GetFacultyNameList(); break; case "ProgramGroupName": dataSource = new CProgramGroup().GetProgramGroupNameList(); break; // Vacation case "VacationType": dataSource = new CVacation().GetVacationTypeNameList(); break; // User case "CreatedUserName": dataSource = new CUser().GetCreatedUserNameList(); break; case "UpdatedUserName": dataSource = new CUser().GetUpdatedUserNameList(); break; case "PositionName": dataSource = new CUser().GetPositionNameList(); break; case "Email": dataSource = new CUser().GetEmailNameList(); break; case "LoginId": dataSource = new CUser().GetLoginIdNameList(); break; // PurchaseOrder case "PurchaseOrderTypeName": dataSource = new CPurchaseOrder().GetPurchaseOrderTypeNameList(); break; case "PriorityTypeName": dataSource = new CPurchaseOrder().GetPriorityTypeNameList(); break; case "ReviewTypeName": dataSource = new CPurchaseOrder().GetReviewTypeNameList(); break; ////Invoice# //case "SchoolName": // dataSource = new CSite().GetSiteNameList(); // break; // Inventory case "AssignedUserName": dataSource = new CUser().GetAssignedUserNameList(); break; case "InventoryCategoryName": dataSource = new CInventory().GetInventoryCategoryNameList(); break; case "InventoryCategoryItemName": dataSource = new CInventory().GetInventoryCategoryItemNameList(); break; case "ConditionName": dataSource = new CInventory().GetConditionNameList(); break; case "InUseName": dataSource = new CInventory().GetInUseNameList(); break; } if (dataSource != null) { SetFilter(e, dataField, dataSource); } }
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); } }
protected void Page_Load(object sender, EventArgs e) { Id = Convert.ToInt32(Request["id"]); if (!IsPostBack) { foreach (GridColumn v in RadGridCorporateCreditCardDetail.Columns) { if (v.GetType() == typeof(GridTemplateColumn)) { var column = (GridTemplateColumn)v; switch (column.UniqueName) { case "Date": column.DefaultInsertValue = DateTime.Today.ToString("MM-dd-yyyy"); break; case "SiteLocationId": var vwSiteLocationList = new CSiteLocation().GetSiteLocationList(CurrentSiteLocationId); if (vwSiteLocationList != null) { column.DefaultInsertValue = vwSiteLocationList.SiteAndSiteLocationName; } break; } } } var scriptManager = (RadScriptManager)Page.Master.FindControl("RadScriptManager1"); //scriptManager.Scripts.Add(new ScriptReference() { Path = ResolveUrl("~/assets/js/jquery.printArea.js") }); //scriptManager.RegisterPostBackControl(RadButtonFileDownload); FileDownloadList1.InitFileDownloadList((int)CConstValue.Upload.CorporateCreditCard); var obj = new CCorporateCreditCard(); var requestOrApprovalType = Request["requestOrApprovalType"]; var approvalType = Request["approvalType"]; var buttonList = new List <string>(); // new if (Request["createOrListType"] == "0") { obj = obj.GetNewDocument(CurrentUserId); buttonList.Add("TempSave"); buttonList.Add("Request"); buttonList.Add("Close"); SetVisibleItems(true); } // select else { FileDownloadList1.GetFileDownload(Convert.ToInt32(Id)); // date obj = new CCorporateCreditCard(Id); // request list if (requestOrApprovalType == "0") { // Revise if (approvalType == ((int)CConstValue.ApprovalStatus.Revise).ToString()) { buttonList.Add("Request"); buttonList.Add("Cancel"); buttonList.Add("Close"); SetVisibleItems(true); } // TempSave else if (approvalType == string.Empty) { buttonList.Add("TempSave"); buttonList.Add("Request"); buttonList.Add("Cancel"); buttonList.Add("Close"); SetVisibleItems(true); } // Request else if (approvalType == ((int)CConstValue.ApprovalStatus.Requested).ToString()) { buttonList.Add("Cancel"); buttonList.Add("Close"); SetVisibleItems(false); } else { buttonList.Add("Close"); SetVisibleItems(false); } } // approval else if (requestOrApprovalType == "1") { // approved or rejected if (approvalType == ((int)CConstValue.ApprovalStatus.Approved).ToString() || approvalType == ((int)CConstValue.ApprovalStatus.Rejected).ToString() || approvalType == ((int)CConstValue.ApprovalStatus.Canceled).ToString()) { buttonList.Add("Close"); } else { var refundApproveInfo = new CGlobal(); var supervisor = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.CorporateCreditCard, Convert.ToInt32(Id)); if (CurrentUserId == supervisor) { buttonList.Add("Approve"); buttonList.Add("Reject"); buttonList.Add("Revise"); buttonList.Add("Close"); } else { buttonList.Add("Close"); } } SetVisibleItems(false); } // Hire from HQ else if (requestOrApprovalType == "2") { // Wating for review from HQ if (approvalType == ((int)CConstValue.ApprovalStatus.WaitingForPreviewFromHq).ToString()) { buttonList.Add("Accept"); buttonList.Add("Reject"); buttonList.Add("Close"); } // In progress else if (approvalType == ((int)CConstValue.ApprovalStatus.InProgress).ToString()) { buttonList.Add("Print"); buttonList.Add("Complete"); buttonList.Add("Reject"); buttonList.Add("Close"); } // Approved else if (approvalType == ((int)CConstValue.ApprovalStatus.Approved).ToString()) { buttonList.Add("Print"); buttonList.Add("Close"); } else { buttonList.Add("Close"); } SetVisibleItems(false); } } foreach (RadToolBarItem item in RadToolBar1.Items) { if (buttonList.Contains(item.Text)) { item.Visible = true; } else { item.Visible = false; } } // new or temp if (approvalType == ((int)CConstValue.ApprovalStatus.Canceled).ToString() || approvalType == string.Empty) { FileDownloadList1.SetVisibieUploadControls(true); } else { FileDownloadList1.SetVisibieUploadControls(false); } var dt = new DataTable(); dt.Columns.Add("DocNo"); dt.Columns.Add("Site"); dt.Columns.Add("Location"); dt.Columns.Add("Name"); dt.Columns.Add("Date"); var newDr = dt.NewRow(); newDr["DocNo"] = obj.DocNo; newDr["Site"] = obj.Site; newDr["Location"] = obj.Location; newDr["Name"] = obj.Name; newDr["Date"] = obj.Date; dt.Rows.Add(newDr); RadGridInfo.DataSource = dt; // date if (obj.StartDate != null) { RadDatePickerStart.SelectedDate = obj.StartDate; } if (obj.EndDate != null) { RadDatePickerEnd.SelectedDate = obj.EndDate; } } }