Exemplo n.º 1
0
        public IEnumerable <FieldConfigurationDataModel> ResetSearchFilterColumns(string value, string value1)
        {
            var settingCategory     = value1;
            var searchControlModeId = SessionVariables.SearchControlColumnsModeId.ToString();
            var entityName          = value;
            var lstColumns          = GetFieldConfigurations(searchControlModeId, entityName).ToList();

            // get previously stored values using Setting Category and Name of the Field Configuration,
            // storing it in Value field as that is used as the model in angular
            for (var i = 0; i < lstColumns.Count; i++)
            {
                lstColumns[i].Value = PerferenceUtility.ResetUserPreferenceByKey(lstColumns[i].Name, settingCategory);
                if (string.IsNullOrEmpty(lstColumns[i].Value))
                {
                    lstColumns[i].Value = "";
                }
                else if (lstColumns[i].Value == "None")
                {
                    lstColumns[i].Value = "-1";
                }
            }

            return(lstColumns);
        }