Exemplo n.º 1
0
        public virtual ActionResult Pickslip(long?id)
        {
            if (id == null)
            {
                return(RedirectToAction(MVC_Inquiry.Inquiry.Home.Index()));
            }
            int MAX_BOXES = 1000;
            var pickslip  = _repos.Value.GetActivePickslip(id.Value);

            if (pickslip == null)
            {
                this.AddStatusMessage(string.Format("No info found for pickslip {0}", id));
                return(RedirectToAction(MVC_Inquiry.Inquiry.Home.Index()));
            }
            var boxes = _repos.Value.GetBoxes(id.Value, MAX_BOXES);
            var model = new PickslipViewModel(pickslip)
            {
                AllSku      = _repos.Value.GetPickslipSku(id.Value).Select(p => new PickslipSkuModel(p)).ToArray(),
                AllBoxes    = boxes.Select(p => new BoxHeadlineModel(p)).ToList(),
                PrinterList = _repos.Value.GetPackingSlipPrinters().Select(p => new SelectListItem
                {
                    Text  = string.Format("{0} : {1}", p.Item1, p.Item2),
                    Value = p.Item1
                })
            };
            var box = boxes.FirstOrDefault();

            if (box != null)
            {
                model.TotalBoxes = box.TotalBoxes;
            }
            model.ModelTitle = string.Format("Pickslip {0}", id);
            var cookie = this.Request.Cookies[GlobalConstants.COOKIE_PACKING_PRINTER];

            if (cookie != null)
            {
                model.PrinterId = cookie.Value;
            }
            return(View(Views.Pickslip, model));
        }
Exemplo n.º 2
0
        public virtual ActionResult PickslipImported(long?id)
        {
            if (id == null)
            {
                return(RedirectToAction(MVC_Inquiry.Inquiry.Home.Index()));
            }
            // Status 1 in dem_pickslip.
            var pickslip = _repos.Value.GetInOrderBucketPickslip(id.Value);

            if (pickslip == null)
            {
                this.AddStatusMessage(string.Format("No info found for In_Order bucket pickslip {0}. If you worked on this pickslip after the last scan, please scan again.", id));
                return(RedirectToAction(MVC_Inquiry.Inquiry.Home.Index()));
            }
            var model = new PickslipViewModel(pickslip)
            {
                AllSku   = _repos.Value.GetSkuOfImportedPickslip(id.Value).Select(p => new PickslipSkuModel(p)).ToArray(),
                AllBoxes = new BoxHeadlineModel[0]
            };

            model.ModelTitle = string.Format("In Order Bucket Pickslip {0}", id);
            return(View(Views.PickslipImported, model));
        }