public IActionResult CountryDataSource([FromBody] ExtendedDataManager dm) { var country = Country.getCountries(); var Data = country.ToList(); int count = country.Count(); return(dm.RequiresCounts ? Json(new { result = Data.Skip(dm.Skip).Take(dm.Take), count = count }) : Json(Data)); }
public IActionResult StateDataSource([FromBody] ExtendedDataManager dm) { var state = States.getStates(); var Data = state.ToList(); int count = state.Count(); List <States> iterateState = new List <States>(); foreach (States st in state) { if (st.countryId == (Int64)dm.Where[0].value) { iterateState.Add(st); } } return(dm.RequiresCounts ? Json(new { result = Data.Skip(dm.Skip).Take(dm.Take), count = count }) : Json(iterateState.ToList())); }
public IActionResult CityDatasource([FromBody] ExtendedDataManager dm) { var shipcity = ShipCityDetails.getShipCityData(); var Data = shipcity; var dataOperation = new DataOperations(); int count = shipcity.Count(); List <ShipCityDetails> iterateState = new List <ShipCityDetails>(); IEnumerable DataSource = null; if (dm.Where != null && dm.Where.Count > 0) { DataSource = dataOperation.PerformFiltering(shipcity, dm.Where, dm.Where[0].Operator); } else { DataSource = shipcity; } return(dm.RequiresCounts ? Json(new { result = DataSource.Cast <ShipCityDetails>().Skip(dm.Skip).Take(dm.Take), count = count }) : Json(DataSource.Cast <ShipCityDetails>().ToList())); }