public JsonResult GetClasses([DataSourceRequest] DataSourceRequest request) { List <Classes> classes = _ClassesBL.GetAllClass(); List <Classes> oList = new List <Classes>(); foreach (Classes classItem in classes) { oList.Add(new Classes() { ID = classItem.ID, Class_name = classItem.Class_name, Caption = classItem.Caption, Class_type = classItem.Class_type, SpatialRefrence = classItem.SpatialRefrence, Scale = classItem.Scale, FillColor = classItem.FillColor, StrokColor = classItem.StrokColor, Width = classItem.Width, StrokWidth = classItem.StrokWidth, UniqueField = classItem.UniqueField, HasFlow = classItem.HasFlow, SupervisorDateOfField = classItem.SupervisorDateOfField, SupervisorField = classItem.SupervisorField, DateOf = classItem.DateOf, TimeOf = classItem.TimeOf, UserId = classItem.UserId, RequieredPhoto = classItem.RequieredPhoto }); } return(Json(oList.ToDataSourceResult(request))); }
// GET: Classes public JsonResult GetClasses() { List <Classes> classes = _ClassesBL.GetAllClass(); /* List<Classes> oList = new List<Classes>(); * foreach (Classes classItem in classes) * { * oList.Add(new Classes() * { * ID = classItem.ID, * Class_name = classItem.Class_name, * Caption = classItem.Caption, * Class_type = classItem.Class_type, * SpatialRefrence = classItem.SpatialRefrence, * Scale = classItem.Scale, * FillColor = classItem.FillColor, * StrokColor = classItem.StrokColor, * Width = classItem.Width, * StrokWidth = classItem.StrokWidth, * UniqueField = classItem.UniqueField, * HasFlow = classItem.HasFlow, * SupervisorField = classItem.SupervisorField, * SupervisorDateOfField = classItem.SupervisorDateOfField, * DateOf = classItem.DateOf, * UserId = classItem.UserId * }); * }*/ return(Json(classes, JsonRequestBehavior.AllowGet)); }