// GET http://localhost:8005/api/sync/stocktakes/{reqDate}/{serialNo} // GET http://localhost:8005/api/sync/stocktakes/2014-11-23/920013c000814 public IHttpActionResult GetStockTakes(DateTime reqDate, string serialNo) { serialNo = serialNo.Trim().ToLower(); var terminal = TerminalServices.GetTerminalBySerial(serialNo); if (terminal == null) { return(Unauthorized()); } var result = new StockTakeSyncCollection(); var allstockTakes = _stockTakeApiService.GetAllStockTakes(terminal.TenantId, terminal.WarehouseId, reqDate, true); var stockTakes = new List <StockTakeSync>(); foreach (var p in allstockTakes) { var stockTake = new StockTakeSync(); var mapped = AutoMapper.Mapper.Map(p, stockTake); mapped.StockTakeStatusId = p.Status; mapped.WarehouseName = p.TenantWarehouse.WarehouseName; stockTakes.Add(mapped); } result.Count = stockTakes.Count; result.TerminalLogId = TerminalServices .CreateTerminalLog(reqDate, terminal.TenantId, stockTakes.Count, terminal.TerminalId, TerminalLogTypeEnum.StockTakeSync).TerminalLogId; result.StockTakes = stockTakes; return(Ok(result)); }
public ActionResult StocktakeGridPartial() { var model = _stockTakeService.GetAllStockTakes(CurrentTenantId, CurrentWarehouseId); return(PartialView("_StocktakeGridPartial", model.ToList())); }