Exemple #1
0
        private void toggleOrganizationCodeView(enumOrgChartType selectedChartType, OrgCodeFormatTypes listFormat)
        {
            // Get data based on chart type
            OrganizationCodeCollection listOrgCodes = base.CurrentUser.GetAvailableOrganizationCodesByChartType(selectedChartType, listFormat);

            if (listOrgCodes.Count == 0)
            {
                // display message if there is no organization codes
                printOrgCodeListMessage(GetLocalResourceObject("NoOrgCodesAvailableMessage").ToString());
            }
            else
            {
                printOrgCodeListMessage(string.Empty);
                string displayTextField = (listFormat == OrgCodeFormatTypes.NewOrgCode) ? "NewOrgCodeLine" : "OldOrgCodeLine";

                // show org codes if there is data
                ControlUtility.BindRadComboBoxControl(dropDownOrganizationCodes, listOrgCodes, null, displayTextField, "OrganizationCodeID", "<<--Select Organization -->>");
            }
        }
        private void toggleChartTypeView()
        {
            try
            {
                resetOrgChartPanels();
                enumOrgChartType selectedChartType = (enumOrgChartType)int.Parse(this.dropDownChartTypes.SelectedValue);

                if (selectedChartType == enumOrgChartType.Undefined)
                {
                    printOrgCodeListMessage(GetLocalResourceObject("NoChartTypeSelectedMessage").ToString());
                }
                else
                {
                    OrgCodeFormatTypes selectedOrgCodeFormat = (OrgCodeFormatTypes)int.Parse(radioListOrgCode.SelectedValue);
                    toggleOrganizationCodeView(selectedChartType, selectedOrgCodeFormat);
                }
            }
            catch (Exception ex)
            {
                base.HandleException(ex);
            }
        }
Exemple #3
0
        public OrganizationCodeCollection GetAvailableOrganizationCodesByChartType(enumOrgChartType selectedChartType, OrgCodeFormatTypes selectedSortType)
        {
            OrganizationCodeCollection childDataCollection = null;

            if (base.ValidateKeyField(this._userID))
            {
                try
                {
                    DbCommand commandWrapper = GetDbCommand("spr_GetAvailableOrganizationCodesByChartType");

                    commandWrapper.Parameters.Add(new SqlParameter("@UserID", this._userID));

                    if (selectedChartType == enumOrgChartType.Undefined)
                    {
                        commandWrapper.Parameters.Add(new SqlParameter("@OrganizationChartTypeID", DBNull.Value));
                    }
                    else
                    {
                        commandWrapper.Parameters.Add(new SqlParameter("@OrganizationChartTypeID", (int)selectedChartType));
                    }

                    if (selectedSortType == OrgCodeFormatTypes.None)
                    {
                        commandWrapper.Parameters.Add(new SqlParameter("@OrgCodeFormatTypeID", DBNull.Value));
                    }
                    else
                    {
                        commandWrapper.Parameters.Add(new SqlParameter("@OrgCodeFormatTypeID", (int)selectedSortType));
                    }

                    // fill collection list
                    childDataCollection = OrganizationCode.GetCollection(ExecuteDataTable(commandWrapper));
                }
                catch (Exception ex)
                {
                    HandleException(ex);
                }
            }

            return(childDataCollection);
        }