Example #1
0
        public virtual void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            DataTable dataSource = null;

            if (fieldName.Equals("Application"))
            {
                dataSource = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);

                dropDownListControl.SelectedValue = SessionVariables.RequestProfile.ApplicationId.ToString();
            }
            else if (fieldName.Equals("ParentMenu"))
            {
                var data = new MenuDataModel();

                var appId = BaseSearchFilterControl.GetParameterValueAsInt("Application");
                if (appId.HasValue)
                {
                    data.ApplicationId = appId.Value;
                }
                else
                {
                    data.ApplicationId = SessionVariables.RequestProfile.ApplicationId;
                }

                dataSource = MenuDataManager.ListOfParentMenuOnly(data, SessionVariables.RequestProfile);
                dataSource.DefaultView.Sort = StandardDataModel.StandardDataColumns.Name + " ASC";
                dataSource = dataSource.DefaultView.ToTable();

                dropDownListControl.Items.Clear();

                dropDownListControl.Items.Add(new ListItem("All", "-1"));

                dropDownListControl.DataSource     = dataSource;
                dropDownListControl.DataTextField  = StandardDataModel.StandardDataColumns.Name;
                dropDownListControl.DataValueField = MenuDataModel.DataColumns.MenuId;

                dropDownListControl.DataBind();
            }
            else if (fieldName.Equals("FunctionalityId"))
            {
                dataSource = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityDataModel.DataColumns.FunctionalityId);
            }
            else if (fieldName.Equals("DeveloperRoleId"))
            {
                dataSource = DeveloperRoleDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DeveloperRoleDataModel.DataColumns.DeveloperRoleId);
            }
            else if (fieldName.Equals("FeatureOwnerStatusId"))
            {
                dataSource = FeatureOwnerStatusDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId);
            }

            else if (fieldName.Equals("EntityId"))
            {
                dataSource = Framework.Components.Core.SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DataModel.Framework.Core.SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);
            }

            else if (fieldName.Equals("ProjectId"))
            {
                dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectDataModel.DataColumns.ProjectId);
            }
            else if (fieldName.Equals("ApplicationId"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                var dv = applicationData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);
            }
            else if (fieldName.Equals("FunctionalityOwner"))
            {
                var drData = FunctionalityOwnerDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                var originalList  = new ArrayList();
                var duplicateList = new ArrayList();
                foreach (DataRow dtRow in drData.Rows)
                {
                    if (originalList.Contains(dtRow["Developer"]))
                    {
                        duplicateList.Add(dtRow);
                    }
                    else
                    {
                        originalList.Add(dtRow["Developer"]);
                    }
                }
                foreach (DataRow dtRow in duplicateList)
                {
                    drData.Rows.Remove(dtRow);
                }
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityOwnerDataModel.DataColumns.Developer,
                                      FunctionalityOwnerDataModel.DataColumns.FunctionalityOwnerId);
            }
            else if (fieldName.Equals("FunctionalityActiveStatus"))
            {
                var drData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId);
            }
            else if (fieldName.Equals("FunctionalityImage"))
            {
                var drData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityImageDataModel.DataColumns.Title,
                                      FunctionalityImageDataModel.DataColumns.FunctionalityImageId);
            }
            else if (fieldName.Equals("FunctionalityImageAttribute"))
            {
                var drData = FunctionalityImageAttributeDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityImageAttributeDataModel.DataColumns.FunctionalityImageAttributeId);
            }
        }
Example #2
0
        public virtual void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            DataTable dataSource = null;

            if (fieldName.Equals("FunctionalityId"))
            {
                dataSource = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityDataModel.DataColumns.FunctionalityId);
            }
            else if (fieldName.Equals("ProjectId"))
            {
                dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectDataModel.DataColumns.ProjectId);
            }
            else if (fieldName.Equals("DeveloperRoleId"))
            {
                dataSource = DeveloperRoleDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DeveloperRoleDataModel.DataColumns.DeveloperRoleId);
            }
            else if (fieldName.Equals("UseCaseId"))
            {
                dataSource = UseCaseDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      UseCaseDataModel.DataColumns.UseCaseId);
            }

            else if (fieldName.Equals("NeedId"))
            {
                dataSource = NeedDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      NeedDataModel.DataColumns.NeedId);
            }

            else if (fieldName.Equals("ProjectUseCaseStatusId"))
            {
                dataSource = ProjectUseCaseStatusDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectUseCaseStatusDataModel.DataColumns.ProjectUseCaseStatusId);
            }
            else if (fieldName.Equals("FeatureOwnerStatusId"))
            {
                dataSource = FeatureOwnerStatusDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId);
            }

            else if (fieldName.Equals("EntityId"))
            {
                dataSource = Framework.Components.Core.SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DataModel.Framework.Core.SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);
            }

            else if (fieldName.Equals("ProjectId"))
            {
                dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectDataModel.DataColumns.ProjectId);
            }

            else if (fieldName.Equals("ApplicationId"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                var dv = applicationData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);
            }
            else if (fieldName.Equals("FunctionalityOwner"))
            {
                var drData = FunctionalityOwnerDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                var originalList  = new ArrayList();
                var duplicateList = new ArrayList();
                foreach (DataRow dtRow in drData.Rows)
                {
                    if (originalList.Contains(dtRow["Developer"]))
                    {
                        duplicateList.Add(dtRow);
                    }
                    else
                    {
                        originalList.Add(dtRow["Developer"]);
                    }
                }
                foreach (DataRow dtRow in duplicateList)
                {
                    drData.Rows.Remove(dtRow);
                }
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityOwnerDataModel.DataColumns.Developer,
                                      FunctionalityOwnerDataModel.DataColumns.FunctionalityOwnerId);
            }
            else if (fieldName.Equals("FunctionalityActiveStatus"))
            {
                var drData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId);
            }
            else if (fieldName.Equals("FunctionalityImage"))
            {
                var drData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityImageDataModel.DataColumns.Title,
                                      FunctionalityImageDataModel.DataColumns.FunctionalityImageId);
            }
            else if (fieldName.Equals("FunctionalityImageAttribute"))
            {
                var drData = FunctionalityImageAttributeDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityImageAttributeDataModel.DataColumns.FunctionalityImageAttributeId);
            }
            else if (fieldName.Equals("TabParentStructure"))
            {
                var drData = TabParentStructureDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      TabParentStructureDataModel.DataColumns.TabParentStructureId);
            }
        }