Exemplo n.º 1
0
        /// <summary>
        /// Paint Critera section of the page
        /// </summary>
        /// <remarks>
        /// </remarks>
        private void PaintCriteraPageState()
        {
            int intOrganisationID = UserContext.UserData.OrgID;                               // organisation ID

            BusinessServices.Course objCourse = new BusinessServices.Course();                //Course Object
            DataTable dtbCourses = objCourse.GetCourseListAccessableToOrg(intOrganisationID); // List of courses accesable to the organisation

            if (dtbCourses.Rows.Count == 0)
            {
                this.plhSearchCriteria.Visible = false;
                this.lblError.Text             = ResourceManager.GetString("lblError.NoCourse");  //"No courses exist within this organisation.";
                this.lblError.CssClass         = "FeedbackMessage";
                this.lblError.Visible          = true;
                return;
            }
            cboCourse.DataSource     = dtbCourses;
            cboCourse.DataValueField = "CourseID";
            cboCourse.DataTextField  = "Name";
            cboCourse.DataBind();


            //3. setup date control
            WebTool.SetupHistoricDateControl(this.lstFromDay, this.lstFromMonth, this.lstFromYear);
            WebTool.SetupHistoricDateControl(this.lstToDay, this.lstToMonth, this.lstToYear);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Paint Critera section of the page.
        /// </summary>
        private void PaintCriteraPageState()
        {
            // Get Units accessable to this user.
            BusinessServices.Unit objUnit = new BusinessServices.Unit();
            DataSet dstUnits = objUnit.GetUnitsTreeByUserID(UserContext.UserData.OrgID, UserContext.UserID, 'A');

            // Convert this to an xml string for rendering by the UnitTreeConverter.
            string strUnits = UnitTreeConvert.ConvertXml(dstUnits);

            if (strUnits == "")
            {
                // No units found.
                this.lblError.Visible          = true;
                this.lblError.Text            += "<BR>" + ResourceManager.GetString("lblError.NoUnit");     //No units exist within this organisation.";
                this.lblError.CssClass         = "FeedbackMessage";
                this.plhSearchCriteria.Visible = false;
            }
            else
            {
                // Change to the appropriate view and load the Units in
                this.trvUnitsSelector.LoadXml(strUnits);
            }


            // Get Policies accessable to this organisation
            BusinessServices.Policy objPolicy = new BusinessServices.Policy();
            Organisation            objOrg    = new Organisation();

            //DataTable dtbPolicies = objPolicy. //  objCourse.GetCourseListAccessableToOrg(UserContext.UserData.OrgID);
            DataTable dtbPolicies = objOrg.GetOrganisationPolicies(UserContext.UserData.OrgID);

            if (dtbPolicies.Rows.Count > 0)
            {
                lstPolicy.DataSource     = dtbPolicies;
                lstPolicy.DataTextField  = "PolicyName";
                lstPolicy.DataValueField = "PolicyID";
                lstPolicy.DataBind();
            }
            else
            {
                this.lblError.Visible          = true;
                this.lblError.Text            += "<BR>" + ResourceManager.GetString("lblError.NoPolicy");     //"No courses exist within this organisation.";
                this.lblError.CssClass         = "WarningMessage";
                this.plhSearchCriteria.Visible = false;
            }
            // If there is at least one course then select it.
            if (lstPolicy.Items.Count > 0)
            {
                lstPolicy.SelectedIndex = 0;
            }

            // Initialise the date list boxes.
            WebTool.SetupHistoricDateControl(this.lstEffectiveDay, this.lstEffectiveMonth, this.lstEffectiveYear);
            WebTool.SetupHistoricDateControl(this.lstEffectiveToDay, this.lstEffectiveToMonth, this.lstEffectiveToYear);

            radAcceptance.Items[0].Text = ResourceManager.GetString("radAcceptance.1");
            radAcceptance.Items[1].Text = ResourceManager.GetString("radAcceptance.2");
            radAcceptance.Items[2].Text = ResourceManager.GetString("radAcceptance.3");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Paint Critera section of the page
        /// </summary>
        /// <remarks>
        /// </remarks>
        private void PaintCriteraPageState()
        {
            //1. Paint the unit selector
            BusinessServices.Unit objUnit = new  BusinessServices.Unit();                                         // Unit Object
            DataSet dstUnits = objUnit.GetUnitsTreeByUserID(UserContext.UserData.OrgID, UserContext.UserID, 'A'); // Data set to contain unit details

            if (dstUnits.Tables[0].Rows.Count == 0)
            {
                this.plhSearchCriteria.Visible = false;
                this.lblError.Text             = ResourceManager.GetString("lblError.NoUnit");  //"No units exist within this organisation.";
                this.lblError.Visible          = true;

                return;
            }
            string strUnits = UnitTreeConvert.ConvertXml(dstUnits);             // comma seperated list of units

            this.trvUnitsSelector.LoadXml(strUnits);

            //2. Paint the course list details
            int intOrganisationID = UserContext.UserData.OrgID;                               // organisation ID

            BusinessServices.Course objCourse = new BusinessServices.Course();                //Course Object
            // Get Courses accessable to this organisation
            DataTable dtbCourses = objCourse.GetCourseListAccessableToOrg(intOrganisationID); // List of courses accesable to the organisation

            if (dtbCourses.Rows.Count > 0)
            {
                lstCourses.DataSource     = dtbCourses;
                lstCourses.DataTextField  = "Name";
                lstCourses.DataValueField = "CourseID";
                lstCourses.DataBind();
            }
            else
            {
                this.plhSearchCriteria.Visible = false;
                this.lblError.Text             = ResourceManager.GetString("lblError.NoCourse");  //"No courses exist within this organisation.";
                this.lblError.CssClass         = "FeedbackMessage";
                this.lblError.Visible          = true;
                return;
            }
            // If there is at least one course then select it.
            if (lstCourses.Items.Count > 0)
            {
                lstCourses.SelectedIndex = 0;
            }

            //3. setup date control
            WebTool.SetupHistoricDateControl(this.lstEffectiveDay, this.lstEffectiveMonth, this.lstEffectiveYear);
            WebTool.SetupHistoricDateControl(this.lstEffectiveToDay, this.lstEffectiveToMonth, this.lstEffectiveToYear);

            //4. show custom classification dropdown if required
            DisplayClassifications();
        }