public ActionResult Tracking() { WOTrackingViewModel vm = new WOTrackingViewModel(); IList <WOViewModel> wos = new List <WOViewModel>(); vm.Search = string.Empty; vm.WOs = wos; vm.FirstLoad = true; return(View(vm)); }
public ActionResult Tracking(WOTrackingViewModel woTrackVM) { IList <WOViewModel> wos = new List <WOViewModel>(); TWO wo = _woTasks.GetWOByWONo(woTrackVM.Search); string msg = string.Empty; if (wo != null) { WOViewModel woVM = new WOViewModel(); woVM.WOID = wo.Id; woVM.CustomerName = wo.CustomerId.CustomerName; woVM.CustomerPhone = wo.CustomerId.CustomerPhone; woVM.CustomerAddress = wo.CustomerId.CustomerAddress; woVM.WODate = wo.WODate; woVM.WONo = wo.WONo; woVM.WOItemType = wo.WOItemType; woVM.WOItemSN = wo.WOItemSn; woVM.WOIsGuarantee = wo.WOIsGuarantee; woVM.WOEquipments = wo.WOEquipments; woVM.WOScStore = wo.WOScStore; woVM.WOPriority = wo.WOPriority; woVM.WOBrokenDesc = wo.WOBrokenDesc; woVM.WOLastStatus = wo.WOLastStatus; woVM.WOStartDate = wo.WOStartDate; woVM.WOTotal = wo.WOTotal; woVM.WODp = wo.WODp; woVM.WOTakenDate = wo.WOTakenDate; woVM.WOInvoiceNo = wo.WOInvoiceNo; woVM.WOComplain = wo.WOComplain; woVM.WORemarkStatus = wo.WORemarkStatus; woVM.WOReceivedBy = wo.WOReceivedBy; woVM.WORepairedBy = wo.WORepairedBy; wos.Add(woVM); } else { msg = string.Format("Maaf, WO dengan nomor {0} tidak ditemukan.", woTrackVM.Search); } WOTrackingViewModel vm = new WOTrackingViewModel(); vm.Search = woTrackVM.Search; vm.WOs = wos; vm.StatusMessage = msg; vm.FirstLoad = false; return(View(vm)); }