Exemple #1
0
        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 CProgramGroup();
                var prog  = new Erp2016.Lib.ProgramGroup();
                prog.SiteId = CurrentSiteId;
                if (!string.IsNullOrEmpty(RadComboBoxFaculty.SelectedValue))
                {
                    prog.FacultyId = Convert.ToInt32(RadComboBoxFaculty.SelectedValue);
                }
                prog.IsActive    = RadButtonActive.Checked;
                prog.Name        = tbProgram.Text;
                prog.Description = tbDescript.Text;
                prog.CreatedId   = CurrentUserId;
                prog.CreatedDate = DateTime.Now.Date;

                if (cProg.Add(prog) > 0)
                {
                    ShowMessage("'" + prog.Name + "' is added.");
                    Grid.Rebind();
                }
                else
                {
                    ShowMessage("Failed to add");
                }
            }
            else if (e.Item.Text == "Update")
            {
                if (Grid.SelectedValue != null)
                {
                    var cProg = new CProgramGroup();
                    var prog  = cProg.Get(Convert.ToInt32(Grid.SelectedValue));
                    if (RadComboBoxFaculty.SelectedValue != null)
                    {
                        prog.FacultyId = Convert.ToInt32(RadComboBoxFaculty.SelectedValue);
                    }
                    prog.Name        = tbProgram.Text;
                    prog.IsActive    = RadButtonActive.Checked;
                    prog.Description = tbDescript.Text;
                    prog.UpdatedId   = CurrentUserId;
                    prog.UpdatedDate = DateTime.Now;

                    if (cProg.Update(prog))
                    {
                        ShowMessage("'" + prog.Name + "' is updated.");
                        Grid.Rebind();
                    }
                    else
                    {
                        ShowMessage("Failed to update");
                    }
                }
            }
        }
Exemple #2
0
        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;
        }
Exemple #3
0
        protected void LoadProgramGroup(string facultyId)
        {
            var myDepId       = CurrentSiteLocationId;
            var programgroups = new CProgramGroup();

            ddlProgramGrp.DataSource     = programgroups.GetProgramGroupList(myDepId, Convert.ToInt32(facultyId));
            ddlProgramGrp.DataTextField  = "Name";
            ddlProgramGrp.DataValueField = "Value";
            ddlProgramGrp.DataBind();
            ddlProgramGrp.Items.Insert(0, new RadComboBoxItem("-ALL-", "0"));
        }
Exemple #4
0
        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";
                }
            }
        }
Exemple #5
0
        protected void GetProgram()
        {
            ResetForm();
            if (Grid.SelectedValue != null)
            {
                var cProg = new CProgramGroup();
                var prog  = cProg.Get(Convert.ToInt32(Grid.SelectedValue));

                RadComboBoxFaculty.SelectedValue = prog.FacultyId.ToString();
                tbProgram.Text          = prog.Name;
                tbDescript.Text         = prog.Description;
                RadButtonActive.Checked = prog.IsActive;

                RadToolBarProgramGroup.FindItemByText("New").Enabled = true;
                if (RadToolBarProgramGroup.FindItemByText("Save") != null)
                {
                    RadToolBarProgramGroup.FindItemByText("Save").Text = "Update";
                }
            }
        }
Exemple #6
0
        protected void RadGrid_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            ResetForm();

            // detail information
            var packageProgram = new CPackageProgram().GetPackageProgram(Convert.ToInt32(RadGridProgramPackage.SelectedValue));

            LabelPackageProgramName.Text = packageProgram.PackageProgramName;
            var program = (new CProgram()).Get((int)packageProgram.ProgramId);

            if (program != null)
            {
                RadTextBoxProgram.Text = program.ProgramFullName;
                if (program.ProgramGroupId != null)
                {
                    var programGroup = new CProgramGroup().Get((int)program.ProgramGroupId);
                    if (programGroup != null)
                    {
                        if (programGroup.FacultyId != null)
                        {
                            RadTextBoxFaculty.Text = new CFaculty().Get((int)programGroup.FacultyId)?.Name;
                        }
                        RadTextBoxProgramGroup.Text = programGroup.Name;
                    }
                }
            }

            LabelDescription.Text      = packageProgram.Description;
            LabelPackageStartDate.Text = string.Format("{0:MM-dd-yyyy}", packageProgram.StartDate);
            LabelPackageEndDate.Text   = string.Format("{0:MM-dd-yyyy}", packageProgram.EndDate);

            GetSiteLocation();

            // toolbar
            foreach (RadToolBarItem toolbarItem in RadToolBarPackageProgram.Items)
            {
                // request active check
                if (toolbarItem.Text == "Request")
                {
                    if ((packageProgram.ApprovalStatus == null ||
                         packageProgram.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise) && packageProgram.CreatedId == CurrentUserId)
                    {
                        toolbarItem.Enabled = true;
                    }
                    else
                    {
                        toolbarItem.Enabled = false;
                    }
                }
                else if (toolbarItem.Text == "Cancel")
                {
                    if ((packageProgram.ApprovalStatus == null ||
                         packageProgram.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise ||
                         packageProgram.ApprovalStatus == (int)CConstValue.ApprovalStatus.Requested) && packageProgram.CreatedId == CurrentUserId)
                    {
                        toolbarItem.Enabled = true;
                    }
                    else
                    {
                        toolbarItem.Enabled = false;
                    }
                }
                else if (toolbarItem.Text == "Approve" || toolbarItem.Text == "Reject")
                {
                    // approve active check
                    var refundApproveInfo = new CGlobal();
                    var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.Package, Convert.ToInt32(packageProgram.PackageProgramId));

                    // supervisor or loy employees
                    if ((CurrentUserId == supervisor) &&
                        packageProgram.ApprovalStatus != (int)CConstValue.ApprovalStatus.Approved &&
                        packageProgram.ApprovalStatus != (int)CConstValue.ApprovalStatus.Rejected &&
                        packageProgram.ApprovalStatus != (int)CConstValue.ApprovalStatus.Canceled &&
                        packageProgram.ApprovalStatus != null &&
                        CurrentUserId != packageProgram.ApprovalId)
                    {
                        toolbarItem.Enabled = true;
                    }
                    else
                    {
                        toolbarItem.Enabled = false;
                    }
                }
            }

            // Detail View
            if (CurrentUserId == packageProgram.CreatedId && packageProgram.ApprovalStatus == null)
            {
                RadGridPackageProgramDetail.AllowAutomaticInserts = true;
                RadGridPackageProgramDetail.AllowAutomaticUpdates = true;
                RadGridPackageProgramDetail.AllowAutomaticDeletes = true;
                //RadGridPackageProgramDetail.MasterTableView.EditMode = GridEditMode.Batch;
                RadGridPackageProgramDetail.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
                // hidden delete button
                RadGridPackageProgramDetail.MasterTableView.Columns[RadGridPackageProgramDetail.MasterTableView.Columns.Count - 1].Visible = true;
            }
            else
            {
                RadGridPackageProgramDetail.AllowAutomaticInserts = false;
                RadGridPackageProgramDetail.AllowAutomaticUpdates = false;
                RadGridPackageProgramDetail.AllowAutomaticDeletes = false;
                //RadGridPackageProgramDetail.MasterTableView.EditMode = GridEditMode.InPlace;
                RadGridPackageProgramDetail.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                // hidden delete button
                RadGridPackageProgramDetail.MasterTableView.Columns[RadGridPackageProgramDetail.MasterTableView.Columns.Count - 1].Visible = false;
            }
            //SetApprovalList();
        }
Exemple #7
0
        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";
                }
            }
        }
Exemple #8
0
        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;
        }
Exemple #9
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);
        }
    }
Exemple #10
0
        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;
        }
Exemple #11
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";
                }
            }
        }