예제 #1
0
        public JsonResult SaveGridSettings()
        {
            var gridTable             = JsonTools.DeserializeObject <GridTable>(Request.Form["Data"]);
            var gridSettingsViewModel = new GridSettingsViewModel(gridTable);

            gridSettingsViewModel.Save(CurrentFirmaSession);
            return(new JsonResult());
        }
예제 #2
0
        public static SelectList GridColumns()
        {
            var rawData = new Dictionary<string, string>();
            foreach (var gc in GridColumn_DTO.GetAll())
            {
                var gsvm = new GridSettingsViewModel();
                var propType = gsvm.GetType().GetProperty(gc.PropertyName).PropertyType;
                if (propType.IsGenericType && propType.GetGenericTypeDefinition() == typeof(Nullable<>))
                {
                    propType = propType.GetGenericArguments()[0];
                }
                rawData.Add(gc.PropertyName, gc.DisplayName);
            }

            return new SelectList(rawData, "Key", "Value");
        }
예제 #3
0
        public static List<GridColumn_DTO> DateColumns()
        {
            var list = new List<GridColumn_DTO>();
            foreach (var gc in GridColumn_DTO.GetAll())
                {
                    var gsvm = new GridSettingsViewModel();
                    var propType = gsvm.GetType().GetProperty(gc.PropertyName).PropertyType;
                    if (propType.IsGenericType && propType.GetGenericTypeDefinition() == typeof(Nullable<>))
                    {
                        propType = propType.GetGenericArguments()[0];
                    }
                    if (propType == typeof(DateTime))
                    {
                        list.Add(gc);
                    }
                }

            return list;
        }