public JsonResult SaveGridSettings() { var gridTable = JsonTools.DeserializeObject <GridTable>(Request.Form["Data"]); var gridSettingsViewModel = new GridSettingsViewModel(gridTable); gridSettingsViewModel.Save(CurrentFirmaSession); return(new JsonResult()); }
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"); }
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; }