public IActionResult Index()
        {
            var order = OrdersDetails.GetAllRecords();

            ViewBag.datasource = order.ToArray();
            return(View());
        }
        //insert the record
        public ActionResult InsertArray([FromBody] List <OrdersDetails> value)
        {
            for (int i = 0; i < value.Count; i++)
            {
                OrdersDetails.GetAllRecords().Insert(0, value[i]);
            }
            var data = OrdersDetails.GetAllRecords().ToList();

            return(Json(data));
        }
        public ActionResult Update([FromBody] ICRUDModel <OrdersDetails> value)
        {
            var           ord = value.value;
            OrdersDetails val = OrdersDetails.GetAllRecords().Where(or => or.OrderID == ord.OrderID).FirstOrDefault();

            val.OrderID    = ord.OrderID;
            val.EmployeeID = ord.EmployeeID;
            val.CustomerID = ord.CustomerID;
            val.Freight    = ord.Freight;
            val.OrderDate  = ord.OrderDate;
            val.ShipCity   = ord.ShipCity;

            return(Json(value.value));
        }
        public IActionResult UrlDatasource([FromBody] DataManagerRequest dm)
        {
            IEnumerable    DataSource = OrdersDetails.GetAllRecords();
            DataOperations operation  = new DataOperations();
            int            count      = DataSource.Cast <OrdersDetails>().Count();

            if (dm.Skip != 0)
            {
                DataSource = operation.PerformSkip(DataSource, dm.Skip);   //Paging
            }
            if (dm.Take != 0)
            {
                DataSource = operation.PerformTake(DataSource, dm.Take);
            }
            return(dm.RequiresCounts ? Json(new { result = DataSource, count = count }) : Json(DataSource));
        }
 public ActionResult Delete([FromBody] ICRUDModel <OrdersDetails> value)
 {
     OrdersDetails.GetAllRecords().Remove(OrdersDetails.GetAllRecords().Where(or => or.OrderID == int.Parse(value.key.ToString())).FirstOrDefault());
     return(Json(value));
 }
 public ActionResult Insert([FromBody] ICRUDModel <OrdersDetails> value)
 {
     OrdersDetails.GetAllRecords().Insert(0, value.value);
     return(Json(value.value));
 }