public JsonResult GetGridData(int tableId) { List <ViewModel_DropDownGrid> dropDownGrid = null; string tableName = GetGridName(tableId); dropDownGrid = SQLFUNC.GetTableValues(tableName).Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); return(Json(dropDownGrid)); }
//[Authorize] public ActionResult Index() { dynamic dropdowndata = new ExpandoObject(); dropdowndata.Gender = SQLFUNC.GetTableValues("INCIDENT_Gender").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); dropdowndata.Disposition = SQLFUNC.GetTableValues("INCIDENT_Disposition").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); dropdowndata.IncidentType = SQLFUNC.GetTableValues("INCIDENT_TYPE").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); dropdowndata.Location = SQLFUNC.GetTableValues("INCIDENT_Location").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); dropdowndata.POI_Type = SQLFUNC.GetTableValues("INCIDENT_POI_TYPE").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); dropdowndata.Report_Written_By = SQLFUNC.GetTableValues("INCIDENT_Report_Written_By").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); dropdowndata.Report_Reviewed_By = SQLFUNC.GetTableValues("INCIDENT_Report_Reviewed_By").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); dropdowndata.EquipmentType = SQLFUNC.GetTableValues("INCIDENT_Equipment_Type").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); dropdowndata.EquipmentStatus = SQLFUNC.GetTableValues("INCIDENT_Equipment_Status").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); dropdowndata.POIType = SQLFUNC.GetTableValues("INCIDENT_POI_Type").Select(x => new ViewModel_DropDownGrid() { TableId = x.TableId, Description = x.Description, Active = x.Active }).ToList(); return(View(dropdowndata)); }