Beispiel #1
0
        public IEnumerable <FieldConfigurationDataModel> GetGroupByList(string value)
        {
            var entityName = value;

            var systemEntityTypeId = (SystemEntity)Enum.Parse(typeof(SystemEntity), entityName, true);
            var result             = new List <FieldConfigurationDataModel>();

            var data = new FieldConfigurationDataModel();

            data.SystemEntityTypeId       = (int)systemEntityTypeId;
            data.FieldConfigurationModeId = SessionVariables.SearchControlColumnsModeId;

            var items = FieldConfigurationDataManager.GetFieldConfigurationList(data, SessionVariables.RequestProfile);

            var LstGroupByItems = new List <string>();

            // method used to get the list of items not required to be bound to the GroupBy dropdownlist
            if (entityName == "ReleaseLogDetail")
            {
                for (var i = 0; i < items.Count(); i++)
                {
                    var item = items[i];

                    if (item.Name.Equals("UpdatedRange"))
                    {
                        LstGroupByItems.Add(item.Name);
                    }
                }
            }

            var oData = new FieldConfigurationDataModel();

            oData.FieldConfigurationDisplayName = "None";
            oData.Name = "-1";
            result.Add(oData);

            foreach (var item in items)
            {
                if (!item.Name.Contains("GroupBy") && !LstGroupByItems.Contains(item.Name))
                {
                    oData      = new FieldConfigurationDataModel();
                    oData.Name = item.Name.ToString();
                    oData.FieldConfigurationDisplayName = item.FieldConfigurationDisplayName;
                    result.Add(oData);
                }
            }

            return(result.OrderBy(o => o.Name).ToList());
        }