public ActionResult DispatchPallets(PalletDispatchViewModel model)
 {
     model.AllVehicles = _marketServices.GetAllValidMarketVehicles(CurrentTenantId).MarketVehicles
                         .Select(m => new SelectListItem()
     {
         Text = m.Name, Value = m.Id.ToString()
     });
     model.AllDrivers = _employeeServices.GetAllEmployees(CurrentTenantId)
                        .Select(m => new SelectListItem()
     {
         Text = m.Name, Value = m.ResourceId.ToString()
     });
     model.AllSentMethods = _palletingService.GetAllSentMethods()
                            .Select(m => new SelectListItem()
     {
         Text = m.Name, Value = m.SentMethodID.ToString()
     });
     model.DispatchRefrenceNumber       = GaneStaticAppExtensions.GenerateDateRandomNo();
     ViewBag.ControllerName             = "Pallets";
     Session["UploadedPalletEvidences"] = null;
     return(PartialView("_PalletDisptachDetail", model));
 }
        public IHttpActionResult GetPalletDispatchMethods(DateTime reqDate, string serialNo)
        {
            var terminal = TerminalServices.GetTerminalBySerial(serialNo);

            if (terminal == null)
            {
                return(Unauthorized());
            }
            var result = new PalletDispatchMethodSyncCollection()
            {
                PalletDispatchMethods = _palletService.GetAllSentMethods().Select(m => new PalletDispatchMethodSync()
                {
                    SentMethod = m.Name, SentMethodID = m.SentMethodID
                }).ToList(),
                SerialNo = serialNo
            };

            result.Count         = result.PalletDispatchMethods.Count();
            result.TerminalLogId = TerminalServices
                                   .CreateTerminalLog(reqDate, terminal.TenantId, result.Count, terminal.TerminalId, TerminalLogTypeEnum.PalletDispatchMethodsSync).TerminalLogId;
            return(Ok(result));
        }