public static void LoadBuiltins(CProgram program) { ImportType(program, SearchAssembliesForType(program, "System.Object"), BuiltIns.Variant); ImportType(program, SearchAssembliesForType(program, "System.String"), BuiltIns.String); CClass vtype = program.FindClass("System.ValueType"); ImportType(program, SearchAssembliesForType(program, "System.Byte"), BuiltIns.Byte); BuiltIns.Byte.ForceSetBaseClass(vtype); ImportType(program, SearchAssembliesForType(program, "System.Int32"), BuiltIns.Int32); BuiltIns.Int32.ForceSetBaseClass(vtype); ImportType(program, SearchAssembliesForType(program, "System.Int64"), BuiltIns.Int64); BuiltIns.Int64.ForceSetBaseClass(vtype); ImportType(program, SearchAssembliesForType(program, "System.Char"), BuiltIns.Character); BuiltIns.Character.ForceSetBaseClass(vtype); ImportType(program, SearchAssembliesForType(program, "System.Boolean"), BuiltIns.Boolean); BuiltIns.Boolean.ForceSetBaseClass(vtype); ImportType(program, SearchAssembliesForType(program, "System.DateTime"), BuiltIns.Date); BuiltIns.Date.ForceSetBaseClass(vtype); ImportType(program, SearchAssembliesForType(program, "System.Double"), BuiltIns.Double); BuiltIns.Double.ForceSetBaseClass(vtype); BuiltIns.Variant.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.Variant, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); BuiltIns.Object.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.Object, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); BuiltIns.String.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.String, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); BuiltIns.Byte.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.Byte, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); BuiltIns.Int32.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.Int32, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); BuiltIns.Int64.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.Int64, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); BuiltIns.Character.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.Character, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); BuiltIns.Boolean.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.Boolean, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); BuiltIns.Date.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.Date, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); BuiltIns.Double.Attributes.Add(CToken.Identifer(null, "ExecuteAnywhere"), new CTypeRef(BuiltIns.Double, CToken.Identifer(null, "ExecuteAnywhereAttribute"))); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FileDownloadList1.InitFileDownloadList((int)CConstValue.Upload.PackageProgram); hfId.Value = Request["id"]; hfType.Value = Request["type"]; ResetForm(); LoadFaculty(); // new if (hfType.Value == "0") { GetSiteLocation(false); mainToolBar.FindItemByText("Request").Enabled = false; } // modify else { GetSiteLocation(true); var cP = new CPackageProgram().GetViewPackageProgram(Convert.ToInt32(hfId.Value)); RadTextBoxPackageProgramName.Text = cP.PackageProgramName; var cProgram = new CProgram(); var program = cProgram.Get((int)cP.ProgramId); if (program != null) { if (program.ProgramGroupId != null) { var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId)); if (programGroup != null) { RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString(); LoadProgramGroup(RadComboBoxFaculty.SelectedValue); } RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString(); LoadProgram(RadComboBoxProgramGroup.SelectedValue); } RadComboBoxProgram.SelectedValue = program.ProgramId.ToString(); } RadDatePickerStartDate.SelectedDate = cP.StartDate; RadDatePickerEndDate.SelectedDate = cP.EndDate; RadTextBoxDescription.Text = cP.Description; //btnToggleActive.Checked = (bool)cP.IsActive; //btnToggleActive.Visible = true; // UP LOAD FileDownloadList1.GetFileDownload(Convert.ToInt32(hfId.Value)); } } RadComboBoxFaculty.OpenDropDownOnLoad = false; RadComboBoxProgramGroup.OpenDropDownOnLoad = false; RadComboBoxProgram.OpenDropDownOnLoad = false; }
static void Main(string[] args) { var prog = new CProgram(new string[] { "./prog/prog.c", "./prog/other.c" }); prog.Compile(); }
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 LatheProgram() { _program = new CProgram(); DataApi.CMachine machine = new DataApi.CMachine(); machine.Init(); DataApi.CProgram prog = new DataApi.CProgram(); _defaultPath = prog.GetDefaultProgramPath(); }
static void Main(string[] args) { try { string path; if (args.Length == 0) { Console.WriteLine("Please enter a filepath: "); path = Console.ReadLine(); } else { path = args[0]; } ErrorManager em = new ErrorManager(); Lexer lexer = new Lexer(new FileSource(path)); Parser parser = new Parser(lexer); parser.HookTo(em); AST program = parser.parse(); SymbolTableBuildingVisitor tableBuilder = new SymbolTableBuildingVisitor(); tableBuilder.HookTo(em); SymbolTableManager stm = tableBuilder.buildTables(program); IdentifierUsageCheckingVisitor idChecker = new IdentifierUsageCheckingVisitor(stm); idChecker.HookTo(em); idChecker.check(program); TypeCheckingVisitor typeChecker = new TypeCheckingVisitor(stm); typeChecker.HookTo(em); typeChecker.check(program); if (!em.areErrors()) { CodeGeneratingVisitor cgv = new CodeGeneratingVisitor(stm); CProgram cProgram = cgv.generate(program); cProgram.generateFile(); Console.WriteLine("Build successful."); } else { Console.WriteLine("Build failed."); } Console.ReadLine(); } catch (Exception ex) { Console.WriteLine(ex); return; } }
protected void LoadProgram(string programgrpId) { var myDepId = CurrentSiteLocationId; var program = new CProgram(); ddlProgramName.DataSource = program.GetProgramList(myDepId, Convert.ToInt32(programgrpId)); ddlProgramName.DataTextField = "Name"; ddlProgramName.DataValueField = "Value"; ddlProgramName.DataBind(); ddlProgramName.Items.Insert(0, new RadComboBoxItem("-Select Program-", "0")); }
private void SetPackageProgramData(string value) { var split = value.Split(','); if (string.IsNullOrEmpty(split[0])) { return; } var packageProgramId = Convert.ToInt32(split[0]); ViewState["PackageProgramId"] = packageProgramId; var programId = Convert.ToInt32(split[1]); var cCP = new CProgram(); var cP = cCP.Get(programId); if (cP != null) { // program Group if (cP.ProgramGroupId != null) { var cProgramGroup = (new CProgramGroup()).Get((int)cP.ProgramGroupId); if (cProgramGroup != null) { radTextBoxProgramGroup.Text = cProgramGroup.Name; // faculty if (cProgramGroup.FacultyId != null) { var cFaculty = (new CFaculty()).Get((int)cProgramGroup.FacultyId); radTextBoxFaculty.Text = cFaculty.Name; } } } // program name radTextBoxProgramName.Text = cP.ProgramFullName; } var cPackageProgram = new CPackageProgram(); var packageProgram = cPackageProgram.GetPackageProgram(packageProgramId); tbPrgStartDate.SelectedDate = packageProgram.StartDate; tbPrgEndDate.SelectedDate = packageProgram.EndDate; var standardTuition = cPackageProgram.GetStandardTuition(packageProgramId).ToString(); tbPrgStandardTuition.Text = standardTuition; tbPrgTuition.Text = standardTuition; }
private static TypeDefinition SearchAssembliesForType(CProgram program, string name) { foreach (var asm in program.Assemblies) { var typed = asm.MainModule.Types.FirstOrDefault(td => td.FullName == name); if (typed != null) { return(typed); } } return(null); }
private static void ImportType(CProgram program, TypeDefinition typed, CClass type) { if (type.CecilType != null) return; type.CecilType = typed; if (typed.GenericParameters.Count > 0 || !IsClsCompliant(typed.CustomAttributes)) return; if (typed.IsEnum) { type.IsObject = false; type.IsNumeric = true; } type.IsObject = !typed.IsValueType; type.SetSemanticallyComplete(); }
protected void GetProgramCourseLevel() { ResetForm(); if (Grid.SelectedValue != null) { var c = new CProgramCourseLevel().Get(Convert.ToInt32(Grid.SelectedValue)); if (c != null) { var programCourse = new CProgramCourse().Get(c.ProgramCourseId); if (programCourse != null) { var program = new CProgram().Get(programCourse.ProgramId); if (program != null) { if (program.ProgramGroupId != null) { var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId)); if (programGroup != null) { RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString(); LoadProgramGroup(RadComboBoxFaculty.SelectedValue); } RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString(); LoadProgram(RadComboBoxProgramGroup.SelectedValue); } RadComboBoxProgram.SelectedValue = program.ProgramId.ToString(); LoadProgramCourse(RadComboBoxProgram.SelectedValue); } } RadTextBoxProgramCourseLevel.Text = c.Level; RadTextBoxDescription.Text = c.Description; RadButtonActive.Checked = c.IsActive; } RadToolBarProgramGroup.FindItemByText("New").Enabled = true; if (RadToolBarProgramGroup.FindItemByText("Save") != null) { RadToolBarProgramGroup.FindItemByText("Save").Text = "Update"; } } }
private static void ImportType(CProgram program, TypeDefinition typed, CClass type) { if (type.CecilType != null) { return; } type.CecilType = typed; if (typed.GenericParameters.Count > 0 || !IsClsCompliant(typed.CustomAttributes)) { return; } if (typed.IsEnum) { type.IsObject = false; type.IsNumeric = true; } type.IsObject = !typed.IsValueType; type.SetSemanticallyComplete(); }
protected override bool Visit(ASTProgramNode node) { _includes.Add(new CInclude { Name = "inttypes", Standard = true }); _includes.Add(new CInclude { Name = "string", Standard = true }); // typedef struct { void* data; int64_t count; } ArrayName; _structs.Add(new CStruct { Name = ArrayName, Enumerable = new [] { new CStruct.Field { Type = new CPointer { Child = new CSymbol { Name = "void" } }, Name = "data" }, new CStruct.Field { Type = new CSymbol { Name = "int64_t" }, Name = "count" } } }); // ArrayName CreateStringProcedure(char* c) { return (ArrayName){ .data = c, .count = strlen(c) }; }; _functions.Add(new CFunction { Return = new CSymbol { Name = ArrayName }, Name = CreateStringProcedure, Arguments = new [] { new CFunction.Argument { Type = new CPointer { Child = new CSymbol { Name = "char" } }, Name = "c" }, }, Block = new CBlock { Statements = new [] { new CReturn { Child = new CStructInitializer { Type = new CSymbol { Name = ArrayName }, Fields = new [] { new CStructInitializer.Field { Name = "data", Value = new CSymbol { Name = "c" } }, new CStructInitializer.Field { Name = "count", Value = new CCall { Callee = new CSymbol { Name = "strlen" }, Arguments = new [] { new CSymbol { Name = "c" } } } } } } } } } }); if (!base.Visit(node)) { return(false); } Result = new CProgram { Functions = _functions, Globals = _globalScole, Includes = _includes, Structs = _structs, Typedefs = _typedefs }; return(true); }
protected void ToolbarClick(object sender, RadToolBarEventArgs e) { if (e.Item.Text == "New") { Grid.SelectedIndexes.Clear(); ResetForm(); } else if (e.Item.Text == "Save") { var cProg = new CProgram(); var prog = new Erp2016.Lib.Program(); if (string.IsNullOrEmpty(RadComboBoxProgramGroup.SelectedValue) == false) { prog.ProgramGroupId = Convert.ToInt32(RadComboBoxProgramGroup.SelectedValue); } prog.ProgramFullName = tbProgramFullName.Text; prog.ProgramWebName = tbProgramWebName.Text; prog.ProgramShortName = tbProgramShortName.Text; prog.ProgramDescription = tbDescript.Text; if (string.IsNullOrEmpty(ddlProgramType.SelectedValue) == false) { prog.ProgramType = Convert.ToInt32(ddlProgramType.SelectedValue); } else { prog.ProgramType = null; } if (string.IsNullOrEmpty(ddlComType.SelectedValue) == false) { prog.UisType = Convert.ToInt32(ddlComType.SelectedValue); } else { prog.UisType = null; } prog.EarningCredit = Convert.ToDecimal(tbEarningCredit.Value); //if (tbProgramWeek.Text != "") // prog.TotalWeeks = Convert.ToInt32(tbProgramWeek.Text); //else // prog.TotalWeeks = null; //if (tbProgramSemester.Text != "") // prog.TotalSemester = Convert.ToInt32(tbProgramSemester.Text); //else // prog.TotalSemester = null; //if (tbProgramMonth.Text != "") // prog.TotalMonth = Convert.ToInt32(tbProgramMonth.Text); //else // prog.TotalMonth = null; //if (tbProgramHoursDay.Text != "") // prog.HoursOfDay = Convert.ToInt32(tbProgramHoursDay.Text); //else // prog.HoursOfDay = null; //prog.HoursOfWeek = Convert.ToInt32(ddlHours.SelectedValue); prog.EstimatedStartDate = tbProgramStartDate.SelectedDate; prog.AdmissionRequirement = tbProgramAdmission.Text; prog.DiplomaCertificationRequirement = tbProgramDiploma.Text; if (string.IsNullOrEmpty(tbPracticum.Text) == false) { prog.PracticumWeeks = Convert.ToInt32(tbPracticum.Text); } else { prog.PracticumWeeks = null; } if (string.IsNullOrEmpty(tbIntership.Text) == false) { prog.IntershipWeeks = Convert.ToInt32(tbIntership.Text); } else { prog.IntershipWeeks = null; } prog.IsActive = RadButtonActive.Checked; prog.ActiveDate = tbProgramActiveDate.SelectedDate; prog.InActiveDate = tbProgramInActiveDate.SelectedDate; prog.CreatedId = CurrentUserId; prog.CreatedDate = DateTime.Now; prog.UpdatedId = CurrentUserId; prog.UpdatedDate = DateTime.Now; int programId = cProg.Add(prog); if (programId > 0) { var cProgramSiteLocation = new CProgramSiteLocation(); cProgramSiteLocation.DelProgramSiteLocationList(programId); foreach (var siteLocation in RadComboBoxSiteLocation.CheckedItems) { var programSiteLocation = new ProgramSiteLocation() { CreatedId = CurrentUserId, ProgramId = programId, SiteLocationId = Convert.ToInt32(siteLocation.Value), CreatedDate = DateTime.Now }; cProgramSiteLocation.Add(programSiteLocation); } // other info fee var cProgramOtherFeeInfo = new CProgramOtherFeeInfo(); var programOtherFeeInfo = new ProgramOtherFeeInfo(); for (var i = 1; i < 19; i++) { var fee = (RadNumericTextBox)RadPaneProgram.FindControl("tbFee" + i); programOtherFeeInfo.ProgramId = prog.ProgramId; decimal feeValue = (decimal)(fee.Value ?? 0); switch (i) { case 1: programOtherFeeInfo.RegFee = feeValue; //oid.InvoiceCoaItemId = 7; break; case 2: programOtherFeeInfo.JRegFee = feeValue; //oid.InvoiceCoaItemId = 7; break; case 3: programOtherFeeInfo.AcademicFee = feeValue; //oid.InvoiceCoaItemId = 11; break; case 4: programOtherFeeInfo.MaterialFee = feeValue; //oid.InvoiceCoaItemId = 11; break; case 5: programOtherFeeInfo.TestFee = feeValue; //oid.InvoiceCoaItemId = 31; break; case 6: programOtherFeeInfo.PracticeFee = feeValue; //oid.InvoiceCoaItemId = 27; break; case 7: programOtherFeeInfo.ExamFee = feeValue; //oid.InvoiceCoaItemId = 31; break; case 8: programOtherFeeInfo.AdminFee = feeValue; //oid.InvoiceCoaItemId = 13; break; case 9: programOtherFeeInfo.InternFee = feeValue; //oid.InvoiceCoaItemId = 27; break; case 10: programOtherFeeInfo.LCFee = feeValue; //oid.InvoiceCoaItemId = 27; break; case 11: programOtherFeeInfo.SDFee = feeValue; //oid.InvoiceCoaItemId = 27; break; case 12: programOtherFeeInfo.UPFee = feeValue; //oid.InvoiceCoaItemId = 27; break; case 13: programOtherFeeInfo.ACFee = feeValue; //oid.InvoiceCoaItemId = 13; break; case 14: programOtherFeeInfo.CFee = feeValue; //oid.InvoiceCoaItemId = 45; break; case 15: programOtherFeeInfo.SupplyFee = feeValue; //oid.InvoiceCoaItemId = 11; break; case 16: programOtherFeeInfo.UniformFee = feeValue; //oid.InvoiceCoaItemId = 11; break; case 17: programOtherFeeInfo.UAGFee = feeValue; //oid.InvoiceCoaItemId = 13; break; case 18: programOtherFeeInfo.OtherFee = feeValue; //oid.InvoiceCoaItemId = 0; break; } } programOtherFeeInfo.Comment = tbFeeComment.Text; programOtherFeeInfo.CreatedId = CurrentUserId; programOtherFeeInfo.CreatedDate = DateTime.Now; cProgramOtherFeeInfo.Add(programOtherFeeInfo); // other info var cOtid = new CProgramOtherInfo(); var otid = new ProgramOtherInfo(); otid.ProgramId = prog.ProgramId; otid.LocalCRC = tbLocalCRC.Text; otid.DoctorNote = tbDoctorNote.Text; otid.Noc = tbNoc.Text; otid.Hrsdc = tbHrsdc.Text; otid.Reference2 = tbReference2.Text; otid.Reference3 = tbReference3.Text; otid.Eng10 = tbEng10.Text; otid.Math10 = tbMath10.Text; otid.Sience11 = tbSience11.Text; otid.Eng12 = tbEng12.Text; otid.Bio12 = tbBio12.Text; otid.SSience = tbSSience.Text; otid.SMath = tbSMath.Text; otid.SEng = tbSEng.Text; otid.SLBio = tbSLBio.Text; otid.SLChemi = tbSLChemi.Text; otid.Immun = tbImmun.Text; otid.HelpB = tbHelpB.Text; otid.Comment = tbOthercomment.Text; otid.CreatedId = CurrentUserId; otid.CreatedDate = DateTime.Now; otid.UpdatedId = CurrentUserId; otid.UpdatedDate = otid.CreatedDate; if (cOtid.Add(otid) > 0) { ShowMessage("New program is added"); Grid.Rebind(); } } else { ShowMessage("Failed to add program, please try again"); } } else if (e.Item.Text == "Update") { if (Grid.SelectedValue != null) { var cProg = new CProgram(); var prog = cProg.Get(Convert.ToInt32(Grid.SelectedValue)); if (RadComboBoxProgramGroup.SelectedValue != null) { prog.ProgramGroupId = Convert.ToInt32(RadComboBoxProgramGroup.SelectedValue); } prog.ProgramFullName = tbProgramFullName.Text; prog.ProgramWebName = tbProgramWebName.Text; prog.ProgramShortName = tbProgramShortName.Text; prog.ProgramDescription = tbDescript.Text; if (ddlProgramType.SelectedValue != "") { prog.ProgramType = Convert.ToInt32(ddlProgramType.SelectedValue); } else { prog.ProgramType = null; } if (ddlComType.SelectedValue != "") { prog.UisType = Convert.ToInt32(ddlComType.SelectedValue); } else { prog.UisType = null; } prog.EarningCredit = Convert.ToDecimal(tbEarningCredit.Value); //if (tbProgramWeek.Text != "") // prog.TotalWeeks = Convert.ToInt32(tbProgramWeek.Text); //else // prog.TotalWeeks = null; //if (tbProgramSemester.Text != "") // prog.TotalSemester = Convert.ToInt32(tbProgramSemester.Text); //else // prog.TotalSemester = null; //if (tbProgramMonth.Text != "") // prog.TotalMonth = Convert.ToInt32(tbProgramMonth.Text); //else // prog.TotalMonth = null; //if (tbProgramHoursDay.Text != "") // prog.HoursOfDay = Convert.ToInt32(tbProgramHoursDay.Text); //else // prog.HoursOfDay = null; //prog.HoursOfWeek = Convert.ToInt32(ddlHours.SelectedValue); prog.EstimatedStartDate = tbProgramStartDate.SelectedDate; prog.AdmissionRequirement = tbProgramAdmission.Text; prog.DiplomaCertificationRequirement = tbProgramDiploma.Text; if (tbPracticum.Text != "") { prog.PracticumWeeks = Convert.ToInt32(tbPracticum.Text); } else { prog.PracticumWeeks = null; } if (tbIntership.Text != "") { prog.IntershipWeeks = Convert.ToInt32(tbIntership.Text); } else { prog.IntershipWeeks = null; } prog.IsActive = RadButtonActive.Checked; prog.ActiveDate = tbProgramActiveDate.SelectedDate; prog.InActiveDate = tbProgramInActiveDate.SelectedDate; prog.UpdatedId = CurrentUserId; prog.UpdatedDate = DateTime.Now; if (cProg.Update(prog)) { var cProgramSiteLocation = new CProgramSiteLocation(); cProgramSiteLocation.DelProgramSiteLocationList(prog.ProgramId); foreach (var siteLocation in RadComboBoxSiteLocation.CheckedItems) { var programSiteLocation = new ProgramSiteLocation() { CreatedId = CurrentUserId, ProgramId = prog.ProgramId, SiteLocationId = Convert.ToInt32(siteLocation.Value), CreatedDate = DateTime.Now }; cProgramSiteLocation.Add(programSiteLocation); } var cProgramOtherFeeInfo = new CProgramOtherFeeInfo(); var programOtherFeeInfo = cProgramOtherFeeInfo.Get(Convert.ToInt32(Grid.SelectedValue)); if (programOtherFeeInfo != null) { for (var i = 1; i < 19; i++) { var fee = (RadNumericTextBox)RadPaneProgram.FindControl("tbFee" + i); decimal feeValue = (decimal)(fee.Value ?? 0); switch (i) { case 1: programOtherFeeInfo.RegFee = feeValue; break; case 2: programOtherFeeInfo.JRegFee = feeValue; break; case 3: programOtherFeeInfo.AcademicFee = feeValue; break; case 4: programOtherFeeInfo.MaterialFee = feeValue; break; case 5: programOtherFeeInfo.TestFee = feeValue; break; case 6: programOtherFeeInfo.PracticeFee = feeValue; break; case 7: programOtherFeeInfo.ExamFee = feeValue; break; case 8: programOtherFeeInfo.AdminFee = feeValue; break; case 9: programOtherFeeInfo.InternFee = feeValue; break; case 10: programOtherFeeInfo.LCFee = feeValue; break; case 11: programOtherFeeInfo.SDFee = feeValue; break; case 12: programOtherFeeInfo.UPFee = feeValue; break; case 13: programOtherFeeInfo.ACFee = feeValue; break; case 14: programOtherFeeInfo.CFee = feeValue; break; case 15: programOtherFeeInfo.SupplyFee = feeValue; break; case 16: programOtherFeeInfo.UniformFee = feeValue; break; case 17: programOtherFeeInfo.UAGFee = feeValue; break; case 18: programOtherFeeInfo.OtherFee = feeValue; break; } } programOtherFeeInfo.Comment = tbFeeComment.Text; programOtherFeeInfo.UpdatedId = CurrentUserId; programOtherFeeInfo.UpdatedDate = DateTime.Now; cProgramOtherFeeInfo.Update(programOtherFeeInfo); } var cOtid = new CProgramOtherInfo(); var otid = cOtid.Get(Convert.ToInt32(Grid.SelectedValue)); if (otid != null) { otid.ProgramId = prog.ProgramId; otid.LocalCRC = tbLocalCRC.Text; otid.DoctorNote = tbDoctorNote.Text; otid.Noc = tbNoc.Text; otid.Hrsdc = tbHrsdc.Text; otid.Reference2 = tbReference2.Text; otid.Reference3 = tbReference3.Text; otid.Eng10 = tbEng10.Text; otid.Math10 = tbMath10.Text; otid.Sience11 = tbSience11.Text; otid.Eng12 = tbEng12.Text; otid.Bio12 = tbBio12.Text; otid.SSience = tbSSience.Text; otid.SMath = tbSMath.Text; otid.SEng = tbSEng.Text; otid.SLBio = tbSLBio.Text; otid.SLChemi = tbSLChemi.Text; otid.Immun = tbImmun.Text; otid.HelpB = tbHelpB.Text; otid.Comment = tbOthercomment.Text; otid.UpdatedId = CurrentUserId; otid.UpdatedDate = DateTime.Now; cOtid.Update(otid); } ShowMessage("Program updated"); RefreshProgramList(); } else { ShowMessage("Failed to update program, please try again"); } } } }
public void VisitProgram(CProgram program) { visitor.VisitProgram(program); }
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 Page_Load(object sender, EventArgs e) { var tempSplit = Request["programClassStudentIdList"].Split(','); foreach (var v in tempSplit) { _classStudentIdList.Add(Convert.ToInt32(v)); } var programClassStudent = new CProgramClassStudent().Get(_classStudentIdList[0]); CurrentProgramClassId = programClassStudent.ProgramClassId; if (!IsPostBack) { ResetForm(); var c = new CProgramClass().Get(CurrentProgramClassId); if (c != null) { var program = new CProgram().Get(c.ProgramId); if (program != null) { if (program.ProgramGroupId != null) { var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId)); if (programGroup != null) { RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString(); LoadProgramGroup(RadComboBoxFaculty.SelectedValue); } RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString(); LoadProgram(RadComboBoxProgramGroup.SelectedValue); } RadComboBoxProgram.SelectedValue = program.ProgramId.ToString(); LoadProgramCourse(RadComboBoxProgram.SelectedValue); if (c.ProgramCourseId != null) { var programCourse = new CProgramCourse().Get((int)c.ProgramCourseId); if (programCourse != null) { RadComboBoxProgramCourse.SelectedValue = programCourse.ProgramCourseId.ToString(); LoadProgramCourseLevel(RadComboBoxProgramCourse.SelectedValue); } } if (c.ProgramCourseLevelId != null) { var programCourseLevel = new CProgramCourseLevel().Get((int)c.ProgramCourseLevelId); if (programCourseLevel != null) { RadComboBoxProgramCourseLevel.SelectedValue = programCourseLevel.ProgramCourseLevelId.ToString(); LoadProgramClass(RadComboBoxProgramCourse.SelectedValue, CurrentProgramClassId); } } } } } SearchProgramClassStudent(); RadComboBoxFaculty.OpenDropDownOnLoad = false; RadComboBoxProgramGroup.OpenDropDownOnLoad = false; RadComboBoxProgram.OpenDropDownOnLoad = false; RadComboBoxProgramCourse.OpenDropDownOnLoad = false; RadComboBoxProgramCourseLevel.OpenDropDownOnLoad = false; RadComboBoxProgramClass.OpenDropDownOnLoad = false; }
protected void GetProgramClass() { ResetForm(); if (RadGridProgramClass.SelectedValue != null) { var c = new CProgramClass().Get(Convert.ToInt32(RadGridProgramClass.SelectedValue)); if (c != null) { var program = new CProgram().Get(c.ProgramId); if (program != null) { if (program.ProgramGroupId != null) { var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId)); if (programGroup != null) { RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString(); LoadProgramGroup(RadComboBoxFaculty.SelectedValue); } RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString(); LoadProgram(RadComboBoxProgramGroup.SelectedValue); } RadComboBoxProgram.SelectedValue = program.ProgramId.ToString(); LoadProgramCourse(RadComboBoxProgram.SelectedValue); if (c.ProgramCourseId != null) { var programCourse = new CProgramCourse().Get((int)c.ProgramCourseId); if (programCourse != null) { RadComboBoxProgramCourse.SelectedValue = programCourse.ProgramCourseId.ToString(); LoadProgramCourseLevel(RadComboBoxProgramCourse.SelectedValue); } } if (c.ProgramCourseLevelId != null) { var programCourseLevel = new CProgramCourseLevel().Get((int)c.ProgramCourseLevelId); if (programCourseLevel != null) { RadComboBoxProgramCourseLevel.SelectedValue = programCourseLevel.ProgramCourseLevelId.ToString(); } } } RadComboBoxInstructor.SelectedValue = c.InstructorId.ToString(); RadTextBoxProgramClass.Text = c.Name; RadTextBoxDescription.Text = c.Description; RadButtonActive.Checked = c.IsActive; RadDatePickerStartDate.SelectedDate = c.StartDate; RadDatePickerEndDate.SelectedDate = c.EndDate; RadComboBoxWeeks.SelectedValue = c.ClassWeek.ToString(); RadTimePickerStartMon.SelectedTime = c.MondayStartTime; RadTimePickerStartTue.SelectedTime = c.TuesdayStartTime; RadTimePickerStartWed.SelectedTime = c.WednesdayStartTime; RadTimePickerStartThu.SelectedTime = c.ThursdayStartTime; RadTimePickerStartFri.SelectedTime = c.FridayStartTime; RadTimePickerEndMon.SelectedTime = c.MondayEndTime; RadTimePickerEndTue.SelectedTime = c.TuesdayEndTime; RadTimePickerEndWed.SelectedTime = c.WednesdayEndTime; RadTimePickerEndThu.SelectedTime = c.ThursdayEndTime; RadTimePickerEndFri.SelectedTime = c.FridayEndTime; } SetClassTime(); RadToolBarProgramClass.FindItemByText("New").Enabled = true; if (RadToolBarProgramClass.FindItemByText("Save") != null) { RadToolBarProgramClass.FindItemByText("Save").Text = "Update"; } } }
private static TypeDefinition SearchAssembliesForType(CProgram program, string name) { foreach (var asm in program.Assemblies) { var typed = asm.MainModule.Types.FirstOrDefault(td => td.FullName == name); if (typed != null) return typed; } return null; }
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"]); Type = Request["type"]; if (!IsPostBack) { ResetForm(); // new if (Type == "0") { // } // modify else { var gradeSchema = new CGradeSchema(); var grade = gradeSchema.Get(Id); if (grade != null) { RadTextBoxName.Text = grade.Name; if (grade.IsGlobal) { RadComboBoxIsGlobal.SelectedIndex = 0; } else { RadComboBoxIsGlobal.SelectedIndex = 1; } if (grade.ProgramId != null) { var program = new CProgram().Get(Convert.ToInt32(grade.ProgramId)); if (program != null) { var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId)); if (programGroup != null) { RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString(); LoadProgramGroup(RadComboBoxFaculty.SelectedValue); } RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString(); LoadProgram(RadComboBoxProgramGroup.SelectedValue); } RadComboBoxProgram.SelectedValue = program.ProgramId.ToString(); LoadProgramCourse(RadComboBoxProgram.SelectedValue); if (grade.ProgramCourseId != null) { var programCourse = new CProgramCourse().Get(Convert.ToInt32(grade.ProgramCourseId)); if (programCourse != null) { RadComboBoxProgramCourse.SelectedValue = programCourse.ProgramCourseId.ToString(); LoadProgramCourseLevel(RadComboBoxProgramCourse.SelectedValue); if (grade.ProgramCourseLevelId != null) { var programCourseLevel = new CProgramCourseLevel().Get(Convert.ToInt32(grade.ProgramCourseLevelId)); if (programCourseLevel != null) { RadComboBoxProgramCourseLevel.SelectedValue = programCourseLevel.ProgramCourseLevelId.ToString(); LoadProgramClass(RadComboBoxProgram.SelectedValue, RadComboBoxProgramCourse.SelectedValue, RadComboBoxProgramCourseLevel.SelectedValue); if (grade.ProgramClassId != null) { var programclass = new CProgramClass().Get(Convert.ToInt32(grade.ProgramClassId)); if (programclass != null) { RadComboBoxProgramClass.SelectedValue = programclass.ProgramClassId.ToString(); } } } } } } } } } } RadComboBoxFaculty.OpenDropDownOnLoad = false; RadComboBoxProgramGroup.OpenDropDownOnLoad = false; RadComboBoxProgram.OpenDropDownOnLoad = false; RadComboBoxProgramCourse.OpenDropDownOnLoad = false; RadComboBoxProgramCourseLevel.OpenDropDownOnLoad = false; RadComboBoxProgramClass.OpenDropDownOnLoad = false; }
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); } }