Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142951 | Feb 26,2019 07:22 PM UTC | Feb 28,2019 06:34 AM UTC | ASP.NET MVC - EJ 2 | 3 |
![]() |
Tags: Grid |
public ActionResult UrlDatasource(Data dm)
{
var order = OrdersDetails.GetAllRecords();
var Data = order.ToList();
int count = order.Count();
// we have serialize the json object using newtonsoft
var SerializeData = Newtonsoft.Json.JsonConvert.SerializeObject(Data);
return dm.requiresCounts ? Json(new { result = SerializeData.Skip(dm.skip).Take(dm.take), count = count }): Json(SerializeData);
}
}
public class OrdersDetails
{
public OrdersDetails()
{
}
public OrdersDetails(int OrderID, string CustomerId, int EmployeeId, double Freight, bool Verified, DateTime OrderDate, string ShipCity, string ShipName, string ShipCountry, DateTime ShippedDate, string ShipAddress, state State)
{
. . . . .
this.ShipAddress = ShipAddress;
this.State = State;
}
public int? OrderID { get; set; }
public string CustomerID { get; set; }
. . . . .
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public state State { get; }
}
public enum state
{
[Display(Name = "Activated")]
Activated = 1,
[Display(Name = "Unactivated")]
Unactivated,
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.