Esempio n. 1
0
        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");
            }
        }
Esempio n. 2
0
        private void btnSpeak_Click(object sender, EventArgs e)
        {
            CStudent oStudent = new CStudent();

            txtSpeak.Text = oStudent.Speak(txtSpeak.Text, false);
            oStudent      = null;
        }
        public CStudent GetStudent(int studentId)
        {
            Assignment2Entities db = new Assignment2Entities();

            Student student = db.Students.Where(x => x.StudentId == studentId).FirstOrDefault();

            List <Enroll> enrollments = student.Enrolls.ToList();

            List <CCourse> cCourses = new List <CCourse>();

            CourseWebService courseWebService = new CourseWebService();

            foreach (Enroll e in enrollments)
            {
                cCourses.Add(courseWebService.ConvertToCCourse(e.Course));
            }

            CStudent classStudent = new CStudent();

            db.Dispose();

            classStudent         = ConvertToCStudent(student);
            classStudent.Courses = cCourses;

            return(classStudent);
        }
Esempio n. 4
0
        private void btnAddToCollection_Click(object sender, EventArgs e)
        {
            CStudent oStudent = new CStudent();
            Guid     oGuid;

            Guid.TryParse(txtId.Text, out oGuid);

            oStudent.Id                 = oGuid;
            oStudent.StudentId          = txtStudentID.Text;
            oStudent.Program            = txtProgram.Text;
            oStudent.FirstName          = txtFirstName.Text;
            oStudent.LastName           = txtLastName.Text;
            oStudent.Address1.City      = txtCity.Text;
            oStudent.Address1.State     = cboState.Text;
            oStudent.Address1.ZIP       = txtZIP.Text;
            oStudent.Address1.StAddress = txtAddr1.Text;

            oStudent.GPA = float.Parse(txtGPA.Text);
            oStudents.Add(oStudent);

            this.Text = oStudents.Count().ToString();

            dataGridView1.DataSource = null;
            dataGridView1.DataSource = oStudents.Students;
        }
Esempio n. 5
0
        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);
            }
        }
Esempio n. 6
0
        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;
        }
        public Boolean AddStudent(CStudent classStudent)
        {
            Assignment2Entities db = new Assignment2Entities();

            Student student = new Student();

            student = ConvertToStudent(classStudent);

            db.Students.Add(student);
            db.SaveChanges();
            db.Dispose();

            return(true);
        }
        public IHttpActionResult Login(CStudent loginDetails)
        {
            try
            {
                var alluser = _iStudentService.GetAllStudentsWithoutParam();
                var user    = alluser.FirstOrDefault(a => a.Name == loginDetails.Name);

                if (user == null)
                {
                    return(Unauthorized());
                }

                var pass = user.Password;

                if (loginDetails.Password == pass)
                {
                    if (loginDetails == null)
                    {
                        return(Unauthorized());
                    }

                    var tokenHandler = new JwtSecurityTokenHandler();

                    var tokenDescriptor = new SecurityTokenDescriptor
                    {
                        Subject = new ClaimsIdentity(new Claim[]
                        {
                            new Claim(ClaimTypes.Name, user.Id.ToString())
                        }),
                        Expires = DateTime.UtcNow.AddDays(1),
                    };
                    var token       = tokenHandler.CreateToken(tokenDescriptor);
                    var tokenString = tokenHandler.WriteToken(token);

                    // return basic user info (without password) and token to store client side
                    return(Ok(tokenString));
                }

                else
                {
                    //var tokenMessage = "Username or password is wrong";
                    return(Unauthorized());
                }
            }
            catch (InvalidCastException e)
            {
                return(Ok(e));
            }
        }
        public Boolean SaveStudent(CStudent classStudent)
        {
            Assignment2Entities db = new Assignment2Entities();

            Student student = db.Students.Where(x => x.StudentId == classStudent.StudentId).FirstOrDefault();

            Student studentTemp = ConvertToStudent(classStudent);

            db.Entry(student).CurrentValues.SetValues(studentTemp);

            db.SaveChanges();
            db.Dispose();

            return(true);
        }
        public Student ConvertToStudent(CStudent classStudent)
        {
            Student student = new Student();

            student.StudentId     = classStudent.StudentId;
            student.StudentCode   = classStudent.StudentCode;
            student.StudentName   = classStudent.StudentName;
            student.ContactNumber = classStudent.ContactNumber;
            student.Address       = classStudent.Address;
            student.Nic           = classStudent.NIC;
            student.Email         = classStudent.Email;

            student.ContactPerson = classStudent.ContactPerson;

            return(student);
        }
        public CStudent ConvertToCStudent(Student student)
        {
            CStudent classStudent = new CStudent();

            classStudent.StudentId     = student.StudentId;
            classStudent.StudentCode   = student.StudentCode;
            classStudent.StudentName   = student.StudentName;
            classStudent.ContactNumber = student.ContactNumber;
            classStudent.Address       = student.Address;
            classStudent.NIC           = student.Nic;
            classStudent.Email         = student.Email;

            classStudent.ContactPerson = student.ContactPerson;

            return(classStudent);
        }
Esempio n. 12
0
        private void btnPopulate_Click(object sender, EventArgs e)
        {
            CStudent oStudent = new CStudent();

            txtId.Text        = Guid.NewGuid().ToString();
            txtFirstName.Text = "Homer";
            txtLastName.Text  = "Simpson";
            txtStudentID.Text = "123456789";
            txtAddr1.Text     = "123 Main St.";
            txtAddr2.Text     = "Apt. #4";
            txtCity.Text      = "Springfield";
            cboState.Text     = "IL";
            txtZIP.Text       = "34566";
            txtProgram.Text   = "Programmer/Analyst";
            txtGPA.Text       = "3.45";
        }
Esempio n. 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // find user control
            _sqlDataSourceInvoiceItems = InvoiceItemGrid1.GetSqlDataSourceInvoiceItems();
            _radGridInvoiceItems       = InvoiceItemGrid1.GetRadGridInvoiceItems();
            _radGridInvoiceItems.MasterTableView.CommandItemSettings.ShowSaveChangesButton = false;
            // Simple
            InvoiceItemGrid1.SetTypeOfInvoiceCoaItem(1);

            if (!IsPostBack)
            {
                InvoiceItemGrid1.SetEditMode(true);

                var cStudent = new CStudent();
                var student  = cStudent.GetStudentList(CurrentSiteLocationId);
                foreach (var stu in student)
                {
                    RadComboBoxMenu.Items.Add(new RadComboBoxItem(cStudent.GetStudentName(stu) + "(" + stu.StudentNo + ")", stu.StudentId.ToString()));
                }
            }
        }
Esempio n. 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            InvoiceId = Convert.ToInt32(Request["id"]);

            if (!IsPostBack)
            {
                FileDownloadList1.InitFileDownloadList((int)CConstValue.Upload.ProgramChange);
                RefundInfo1.InitReundInfo(InvoiceId, CurrentSiteLocationId, true);


                /////////////////
                var global = new CGlobal();

                var student = new CStudent().Get(InvoiceId);

                LoadAgency(student.SiteLocationId);
                ddlAgencyContact.Items.Insert(0, new RadComboBoxItem("-None-", "0"));
                LoadFaculty();
                LoadProgramGroup("0");
                LoadProgram("0");

                var cCountry = new CCountry().Get((int)student.CountryId);
                ViewState["CountryMarketId"] = cCountry.CountryMarketId;

                tbRequestDate.SelectedDate = DateTime.Now;

                ddlProgramWeeks.DataSource     = GetProgramWeeksList();
                ddlProgramWeeks.DataTextField  = "Name";
                ddlProgramWeeks.DataValueField = "Value";
                ddlProgramWeeks.DataBind();
                ddlProgramWeeks.Items.Insert(0, new RadComboBoxItem("-Select Weeks-", "0"));

                ddlPrgHours.DataSource     = global.GetDictionary(150);
                ddlPrgHours.DataTextField  = "Name";
                ddlPrgHours.DataValueField = "Value";
                ddlPrgHours.DataBind();
                ddlPrgHours.Items.Insert(0, new RadComboBoxItem("-Select HRS-", "0"));
            }
        }
Esempio n. 15
0
        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;
        }
Esempio n. 16
0
        public List <CStudent> List()
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                string sp = "sp_Student_List";
                command    = new SqlCommand(sp, connection);
                dataReader = command.ExecuteReader();

                List <CStudent> result = new List <CStudent>();
                while (dataReader.Read())
                {
                    int      id          = dataReader.GetFieldValue <int>(0);
                    string   name        = dataReader.GetFieldValue <string>(1);
                    int      coursecount = dataReader.GetFieldValue <int>(2);
                    CStudent item        = new CStudent(id, name, coursecount);
                    result.Add(item);
                }
                connection.Close();
                return(result);
            }
        }
Esempio n. 17
0
        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);
            }
        }
Esempio n. 18
0
        protected void StudentButtonClicked(object sender, RadToolBarEventArgs e)
        {
            if (e.Item.Text == @"Save")
            {
                if (IsValid)
                {
                    var cStudentRegi = new CStudent();
                    var studentRegi  = new Erp2016.Lib.Student();

                    studentRegi.AcademicStatus = 1; // 1:NEW
                                                    //studentRegi.IsActive = ;
                                                    //studentRegi.RegisterDate = ;

                    studentRegi.SiteLocationId = Convert.ToInt32(RadComboBoxSiteLocation.SelectedValue);
                    studentRegi.FirstName      = tbFirstName.Text;
                    studentRegi.LastName1      = tbLastName1.Text;
                    studentRegi.LastName2      = tbLastName2.Text;
                    studentRegi.MiddleName1    = tbMiddleName1.Text;
                    studentRegi.MiddleName2    = tbMiddleName2.Text;

                    studentRegi.Address1InCanada   = tbCadAddress.Text;
                    studentRegi.CityInCanada       = tbCadCity.Text;
                    studentRegi.ProvinceInCanada   = tbCadProvince.Text;
                    studentRegi.PostalCodeInCanada = tbCadZipcode.Text;

                    studentRegi.PermanentAddress1   = tbPerAddress.Text;
                    studentRegi.PermanentCity       = tbPerCity.Text;
                    studentRegi.PermanentProvince   = tbPerState.Text;
                    studentRegi.PermanentPostalCode = tbPerZiocode.Text;
                    studentRegi.PermanentCountry    = Convert.ToInt32(ddlPerCountry.SelectedValue);

                    studentRegi.Phone1 = tbPhone1.Text;
                    studentRegi.Phone2 = tbPhone2.Text;
                    studentRegi.Email1 = tbEmail1.Text;
                    studentRegi.Email2 = tbEmail2.Text;
                    studentRegi.Fax    = tbFax.Text;

                    studentRegi.DOB         = Convert.ToDateTime(tbDateOfBirth.SelectedDate);
                    studentRegi.StudentType = Convert.ToInt32(ddlStudentType.SelectedValue);
                    studentRegi.Passport    = tbPassport.Text;
                    studentRegi.LoanNo      = tbLoanNo.Text;

                    studentRegi.ContactName         = tbContactName.Text;
                    studentRegi.ContactPhone        = tbContactPhone.Text;
                    studentRegi.ContactRelationship = tbContactRelationship.Text;
                    studentRegi.Comment             = tbComment.Text;

                    studentRegi.Gender = Convert.ToBoolean(ddlGender.SelectedValue);
                    if (!string.IsNullOrEmpty(ddlmarketer.SelectedValue))
                    {
                        studentRegi.MarketerId = Convert.ToInt32(ddlmarketer.SelectedValue);
                    }

                    studentRegi.VisaStatus       = Convert.ToInt32(ddlStatus.SelectedValue);
                    studentRegi.VisaStart        = (tbStatusStartDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbStatusStartDate.SelectedDate);
                    studentRegi.VisaEnd          = (tbStatusEndDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbStatusEndDate.SelectedDate);
                    studentRegi.WorkPermitStatus = Convert.ToInt32(ddlPermit.SelectedValue);
                    studentRegi.WorkPermitStart  = (tbPermitStartDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbPermitStartDate.SelectedDate);
                    studentRegi.WorkPermitEnd    = (tbPermitEndDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbPermitEndDate.SelectedDate);

                    studentRegi.Insurance       = Convert.ToBoolean(ddlInsurance.SelectedValue);
                    studentRegi.InsuranceStart  = (tbInsuranceStartDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbInsuranceStartDate.SelectedDate);
                    studentRegi.InsuranceEnd    = (tbInsuranceEndtDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbInsuranceEndtDate.SelectedDate);
                    studentRegi.InsuranceDayFee = (tbInsuranceDayFee.Text == null || tbInsuranceDayFee.Text == "") ? 0 : Convert.ToDecimal(tbInsuranceDayFee.Text);
                    studentRegi.InsuranceTotal  = (tbInsuranceTotalAmt.Text == null || tbInsuranceTotalAmt.Text == "") ? 0 : Convert.ToDecimal(tbInsuranceTotalAmt.Text);

                    studentRegi.CountryId = Convert.ToInt32(ddlCountry.SelectedValue);

                    studentRegi.CreatedId = CurrentUserId;

                    int newStudentId = cStudentRegi.Add(studentRegi);
                    if (newStudentId > 0)
                    {
                        // UP LOAD
                        FileDownloadList1.SaveFile(newStudentId);

                        RunClientScript("Save();");
                    }
                    else
                    {
                        ShowMessage("failed to update the Student');");
                    }
                    return;
                }
                else
                {
                    ShowMessage("Please check wrong values");
                }
            }
            else if (e.Item.Text == @"Cancel")
            {
            }
        }
Esempio n. 19
0
        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);
            }
        }
Esempio n. 20
0
        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);
        }
Esempio n. 21
0
        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);
            }
        }
Esempio n. 22
0
        protected void RadGridStudentContract_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            if (RadGridStudentContract.SelectedValue != null)
            {
                CStudent student         = new CStudent();
                var      studentContract = student.GetVwStudentContract(Convert.ToInt32(RadGridStudentContract.SelectedValue));
                if (studentContract != null)
                {
                    var btnRefund         = RadToolBarStudentContract.FindItemByText("Refund");
                    var btnTransfer       = RadToolBarStudentContract.FindItemByText("Transfer");
                    var btnCancel         = RadToolBarStudentContract.FindItemByText("Cancel");
                    var btnBreak          = RadToolBarStudentContract.FindItemByText("Break");
                    var btnScheduleChange = RadToolBarStudentContract.FindItemByText("Schedule Change");
                    var btnProgramChange  = RadToolBarStudentContract.FindItemByText("Program Change");

                    // init
                    btnRefund.Enabled         = false;
                    btnTransfer.Enabled       = false;
                    btnCancel.Enabled         = false;
                    btnBreak.Enabled          = false;
                    btnScheduleChange.Enabled = false;
                    btnProgramChange.Enabled  = false;

                    var balance = studentContract.Balance;

                    var paymentCnt        = studentContract.PaymentCnt;
                    var depositConfirmCnt = studentContract.DepositConfirmCnt;

                    var invoiceStatus = studentContract.Status;
                    var invoiceType   = studentContract.InvoiceTypeInt;
                    var invoiceId     = studentContract.InvoiceId;

                    var startDate = studentContract.StartDate;
                    var today     = DateTime.Now;

                    // =======================
                    // Refund
                    // =======================
                    // Full Paid
                    if (balance >= 0 && paymentCnt > 0 && paymentCnt == depositConfirmCnt && invoiceStatus == (int)CConstValue.InvoiceStatus.Invoiced)
                    {
                        switch (invoiceType)
                        {
                        case (int)CConstValue.InvoiceType.Simple:
                        case (int)CConstValue.InvoiceType.General:
                        case (int)CConstValue.InvoiceType.Manual:
                        case (int)CConstValue.InvoiceType.Dormitory:
                        case (int)CConstValue.InvoiceType.Homestay:
                            btnRefund.Enabled = true;
                            break;
                        }
                    }

                    // =======================
                    // Cancel
                    // =======================
                    // Before Program Start
                    if (startDate > today)
                    {
                        switch (invoiceType)
                        {
                        case (int)CConstValue.InvoiceType.Simple:
                        case (int)CConstValue.InvoiceType.General:
                        case (int)CConstValue.InvoiceType.Manual:
                        case (int)CConstValue.InvoiceType.Dormitory:
                        case (int)CConstValue.InvoiceType.Homestay:

                            if (invoiceStatus == (int)CConstValue.InvoiceStatus.Pending)
                            {
                                btnCancel.Enabled = true;
                            }
                            else if (invoiceStatus == (int)CConstValue.InvoiceStatus.Invoiced)
                            {
                                if (new CPayment().InvoiceCheck(invoiceId) == 0)
                                {
                                    btnCancel.Enabled = true;
                                }
                            }
                            break;
                        }
                    }

                    // =======================
                    // Break
                    // =======================
                    // After Program Start
                    if (startDate <= today)
                    {
                        switch (invoiceType)
                        {
                        case (int)CConstValue.InvoiceType.Simple:
                        case (int)CConstValue.InvoiceType.General:
                        case (int)CConstValue.InvoiceType.Manual:
                            btnBreak.Enabled = true;
                            break;
                        }
                    }

                    // =======================
                    // Schedule change
                    // =======================
                    // Before Program Start
                    if (startDate > today)
                    {
                        switch (invoiceType)
                        {
                        case (int)CConstValue.InvoiceType.Simple:
                        case (int)CConstValue.InvoiceType.General:
                        case (int)CConstValue.InvoiceType.Manual:
                        case (int)CConstValue.InvoiceType.Dormitory:
                        case (int)CConstValue.InvoiceType.Homestay:
                            if (invoiceStatus == (int)CConstValue.InvoiceStatus.Pending || invoiceStatus == (int)CConstValue.InvoiceStatus.Invoiced)
                            {
                                btnScheduleChange.Enabled = true;
                            }
                            break;
                        }
                    }

                    // =======================
                    // Program Change
                    // =======================
                    // nothing

                    // =======================
                    // Transfer
                    // =======================
                    // nothing
                }
            }
        }
Esempio n. 23
0
        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();
                }
            }
        }
Esempio n. 24
0
        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));
                }
            }
        }
Esempio n. 25
0
        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);
            }
        }
Esempio n. 26
0
    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);
        }
    }