public IHttpActionResult GetPalletDispatches(DateTime reqDate, string serialNo)
        {
            serialNo = serialNo.Trim().ToLower();

            var terminal = TerminalServices.GetTerminalBySerial(serialNo);

            if (terminal == null)
            {
                return(Unauthorized());
            }

            reqDate = TerminalServices.GetTerminalSyncDate(reqDate, terminal.TenantId);

            var result = new PalletsDispatchSyncCollection();

            var allPallets = _palletService.GetAllPalletsDispatch(null, reqDate);

            result.PalletDispatchSync = AutoMapper.Mapper.Map <List <PalletsDispatch>, List <PalletDispatchSync> >(allPallets);
            result.Count         = allPallets.Count;
            result.TerminalLogId = TerminalServices
                                   .CreateTerminalLog(reqDate, terminal.TenantId, allPallets.Count, terminal.TerminalId,
                                                      TerminalLogTypeEnum.PalletingSync).TerminalLogId;

            return(Ok(AutoMapper.Mapper.Map(result, new PalletsDispatchSyncCollection())));
        }
        public ActionResult _PalletsDispatch(int?type, int?ProcessId)
        {
            ViewBag.ProcessId = ProcessId;
            var dispatchPallets = _palletingService.GetAllPalletsDispatch(null, null, ProcessId);

            return(PartialView("_PalletsDispatch", dispatchPallets));
        }