Exemplo n.º 1
0
        protected void ResetForm()
        {
            LoadFaculty();
            LoadProgramGroup(null);

            tbProgramFullName.Text  = "";
            tbProgramWebName.Text   = "";
            tbProgramShortName.Text = "";
            tbDescript.Text         = "";
            //tbProgramWeek.Text = "";
            //tbProgramSemester.Text = "";
            //tbProgramMonth.Text = "";
            //tbProgramHoursDay.Text = "";
            //ddlHours.SelectedValue = "";
            tbProgramStartDate.SelectedDate = null;
            tbProgramAdmission.Text         = "";
            tbProgramDiploma.Text           = "";
            tbPracticum.Text                   = "";
            tbIntership.Text                   = "";
            RadButtonActive.Checked            = true;
            tbProgramActiveDate.SelectedDate   = null;
            tbProgramInActiveDate.SelectedDate = null;

            // other fee info
            for (var i = 1; i < 19; i++)
            {
                var fee = (RadNumericTextBox)RadPaneProgram.FindControl("tbFee" + i);
                fee.Value = null;
            }
            tbFeeComment.Text = "";

            // other info
            tbLocalCRC.Text     = "";
            tbDoctorNote.Text   = "";
            tbNoc.Text          = "";
            tbHrsdc.Text        = "";
            tbReference2.Text   = "";
            tbReference3.Text   = "";
            tbEng10.Text        = "";
            tbMath10.Text       = "";
            tbSience11.Text     = "";
            tbEng12.Text        = "";
            tbBio12.Text        = "";
            tbSSience.Text      = "";
            tbSMath.Text        = "";
            tbSEng.Text         = "";
            tbSLBio.Text        = "";
            tbSLChemi.Text      = "";
            tbImmun.Text        = "";
            tbHelpB.Text        = "";
            tbOthercomment.Text = "";

            RadToolBarProgram.FindItemByText("New").Enabled = false;
            //RadToolBarProgram.FindItemByText("Delete").Enabled = false;
            if (RadToolBarProgram.FindItemByText("Update") != null)
            {
                RadToolBarProgram.FindItemByText("Update").Text = "Save";
            }

            GetSiteLocation();
        }
Exemplo n.º 2
0
        protected void GetProgram()
        {
            ResetForm();
            if (Grid.SelectedValue != null)
            {
                var pid     = (new CProgram()).Get(Convert.ToInt32(Grid.SelectedValue));
                var otherId = (new CProgramOtherInfo()).Get(pid.ProgramId);

                if (pid.ProgramGroupId != null)
                {
                    var programGroup = new CProgramGroup().Get(Convert.ToInt32(pid.ProgramGroupId));
                    if (programGroup != null)
                    {
                        RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString();
                        LoadProgramGroup(RadComboBoxFaculty.SelectedValue);
                    }
                    RadComboBoxProgramGroup.SelectedValue = pid.ProgramGroupId.ToString();
                }

                tbProgramFullName.Text = pid.ProgramFullName;

                if (pid.ProgramWebName == null)
                {
                    tbProgramWebName.Text = "N/A";
                }
                else
                {
                    tbProgramWebName.Text = pid.ProgramWebName;
                }

                if (pid.ProgramShortName == null)
                {
                    tbProgramShortName.Text = "N/A";
                }
                else
                {
                    tbProgramShortName.Text = pid.ProgramShortName;
                }

                if (pid.ProgramDescription == null)
                {
                    tbDescript.Text = "N/A";
                }
                else
                {
                    tbDescript.Text = pid.ProgramDescription;
                }

                ddlProgramType.SelectedValue = pid.ProgramType.ToString();
                ddlComType.SelectedValue     = pid.UisType.ToString();
                tbEarningCredit.Text         = pid.EarningCredit.ToString();

                //tbProgramType

                //tbProgramWeek.Text = pid.TotalWeeks.ToString();
                //tbProgramSemester.Text = pid.TotalSemester.ToString();
                //tbProgramMonth.Text = pid.TotalMonth.ToString();
                //tbProgramHoursDay.Text = pid.HoursOfDay.ToString();
                //ddlHours.SelectedValue = pid.HoursOfWeek.ToString();

                tbProgramStartDate.SelectedDate = pid.EstimatedStartDate;

                if (pid.AdmissionRequirement == null)
                {
                    tbProgramAdmission.Text = "N/A";
                }
                else
                {
                    tbProgramAdmission.Text = pid.AdmissionRequirement;
                }

                if (pid.DiplomaCertificationRequirement == null)
                {
                    tbProgramDiploma.Text = "N/A";
                }
                else
                {
                    tbProgramDiploma.Text = pid.DiplomaCertificationRequirement;
                }

                tbPracticum.Text                   = Convert.ToString(pid.PracticumWeeks);
                tbIntership.Text                   = Convert.ToString(pid.IntershipWeeks);
                RadButtonActive.Checked            = Convert.ToBoolean(pid.IsActive);
                tbProgramActiveDate.SelectedDate   = pid.ActiveDate;
                tbProgramInActiveDate.SelectedDate = pid.InActiveDate;

                // OTHER FEE
                var programOtherFeeInfo = (new CProgramOtherFeeInfo()).Get(pid.ProgramId);

                if (programOtherFeeInfo != null)
                {
                    tbFeeComment.Text = programOtherFeeInfo.Comment;
                }

                for (var i = 1; i < 19; i++)
                {
                    var fee = (RadNumericTextBox)RadPaneProgram.FindControl("tbFee" + i);

                    if (programOtherFeeInfo == null)
                    {
                        fee.Value = 0;
                        continue;
                    }

                    switch (i)
                    {
                    case 1:
                        fee.Value = (double)(programOtherFeeInfo.RegFee ?? 0);
                        break;

                    case 2:
                        fee.Value = (double)(programOtherFeeInfo.JRegFee ?? 0);
                        break;

                    case 3:
                        fee.Value = (double)(programOtherFeeInfo.AcademicFee ?? 0);
                        break;

                    case 4:
                        fee.Value = (double)(programOtherFeeInfo.MaterialFee ?? 0);
                        break;

                    case 5:
                        fee.Value = (double)(programOtherFeeInfo.TestFee ?? 0);
                        break;

                    case 6:
                        fee.Value = (double)(programOtherFeeInfo.PracticeFee ?? 0);
                        break;

                    case 7:
                        fee.Value = (double)(programOtherFeeInfo.ExamFee ?? 0);
                        break;

                    case 8:
                        fee.Value = (double)(programOtherFeeInfo.AdminFee ?? 0);
                        break;

                    case 9:
                        fee.Value = (double)(programOtherFeeInfo.InternFee ?? 0);
                        break;

                    case 10:
                        fee.Value = (double)(programOtherFeeInfo.LCFee ?? 0);
                        break;

                    case 11:
                        fee.Value = (double)(programOtherFeeInfo.SDFee ?? 0);
                        break;

                    case 12:
                        fee.Value = (double)(programOtherFeeInfo.UPFee ?? 0);
                        break;

                    case 13:
                        fee.Value = (double)(programOtherFeeInfo.ACFee ?? 0);
                        break;

                    case 14:
                        fee.Value = (double)(programOtherFeeInfo.CFee ?? 0);
                        break;

                    case 15:
                        fee.Value = (double)(programOtherFeeInfo.SupplyFee ?? 0);
                        break;

                    case 16:
                        fee.Value = (double)(programOtherFeeInfo.UniformFee ?? 0);
                        break;

                    case 17:
                        fee.Value = (double)(programOtherFeeInfo.UAGFee ?? 0);
                        break;

                    case 18:
                        fee.Value = (double)(programOtherFeeInfo.OtherFee ?? 0);
                        break;
                    }
                }

                // OTHER INFO
                tbLocalCRC.Text     = otherId.LocalCRC;
                tbDoctorNote.Text   = otherId.DoctorNote;
                tbNoc.Text          = otherId.Noc;
                tbHrsdc.Text        = otherId.Hrsdc;
                tbReference2.Text   = otherId.Reference2;
                tbReference3.Text   = otherId.Reference3;
                tbEng10.Text        = otherId.Eng10;
                tbMath10.Text       = otherId.Math10;
                tbSience11.Text     = otherId.Sience11;
                tbEng12.Text        = otherId.Eng12;
                tbBio12.Text        = otherId.Bio12;
                tbSSience.Text      = otherId.SSience;
                tbSMath.Text        = otherId.SMath;
                tbSEng.Text         = otherId.SEng;
                tbSLBio.Text        = otherId.SLBio;
                tbSLChemi.Text      = otherId.SLChemi;
                tbImmun.Text        = otherId.Immun;
                tbHelpB.Text        = otherId.HelpB;
                tbOthercomment.Text = otherId.Comment;

                RadToolBarProgram.FindItemByText("New").Enabled = true;
                //RadToolBarProgram.FindItemByText("Delete").Enabled = true;
                if (RadToolBarProgram.FindItemByText("Save") != null)
                {
                    RadToolBarProgram.FindItemByText("Save").Text = "Update";
                }
            }
        }