public string Binding() { GridRequestParameters param = GridRequestParameters.Current; List <Context.SalesOrder> items = RepoSalesOrder.FindAllKontrak().Where(d => d.Status == "save" || d.Status == "draft planning").ToList(); List <SalesOrderKontrak> ListModel = new List <SalesOrderKontrak>(); foreach (Context.SalesOrder item in items) { ListModel.Add(new SalesOrderKontrak(item)); } List <Context.SalesOrderKontrakListSo> itemsListSoKontrakBatalTruk = RepoSalesOrderKontrakListSo.returnListSoBatalTruckOnly(); foreach (Context.SalesOrderKontrakListSo itemBatalTruk in itemsListSoKontrakBatalTruk) { ListModel.Add(new SalesOrderKontrak(RepoSalesOrder.FindByKontrak(itemBatalTruk.SalesKontrakId.Value), itemBatalTruk)); } int total = RepoSalesOrder.CountKontrak(param.Filters); return(new JavaScriptSerializer().Serialize(new { total = ListModel.Count(), data = ListModel })); }
public string GetItemTruck(int idSo) { Context.SalesOrder dbitem = RepoSalesOrder.FindByKontrak(idSo); List <SalesOrderKontrakItemTruck> model = new List <SalesOrderKontrakItemTruck>(); foreach (Context.SalesOrderKontrakTruck item in dbitem.SalesOrderKontrak.SalesOrderKontrakTruck) { model.Add(new SalesOrderKontrakItemTruck(item)); } return(new JavaScriptSerializer().Serialize(model)); }