public ActionResult sync_vehicle() { foreach (Context.DataTruck dbitem in RepoDataTruck.FindAll()) { if (Repocode_mstr.FindByCodeName(dbitem.VehicleNo) == null) { Repocode_mstr.saveVehicle(dbitem); } } return(RedirectToAction("Index")); }
public string GetItemTruckKonfirmasi(int idSo) { Context.SalesOrder dbitem = RepoSalesOrder.FindByKontrak(idSo); List <SalesOrderKontrakItemTruck> model = new List <SalesOrderKontrakItemTruck>(); List <Context.SalesOrder> dbso = RepoSalesOrder.FindAll().Where(s => s.Id != idSo).ToList(); /* foreach (Context.SalesOrderKontrakTruck item in dbitem.SalesOrderKontrak.SalesOrderKontrakTruck) * { * model.Add(new SalesOrderKontrakItemTruck(item)); * }*/ foreach (Context.DataTruck item in RepoDataTruck.FindAll().Where(d => d.IdJenisTruck == dbitem.SalesOrderKontrak.JenisTruckId).ToList()) { SalesOrderKontrakItemTruck sokit = new SalesOrderKontrakItemTruck(item, dbso); model.Add(sokit); } return(new JavaScriptSerializer().Serialize(new { total = model.Count(), data = model })); }
public string Binding() { GridRequestParameters param = GridRequestParameters.Current; //List<Context.DataTruck> items = RepoDataTruck.FindAll(param.Skip, param.Take, (param.Sortings != null ? param.Sortings.ToList() : null), param.Filters); List <Context.DataTruck> items = RepoDataTruck.FindAll(); List <UnitList> ListModel = new List <UnitList>(); foreach (Context.DataTruck item in items) { ListModel.Add(new UnitList(item)); } int total = RepoDataTruck.Count(param.Filters); return(new JavaScriptSerializer().Serialize(new { total = total, data = ListModel })); }