Ejemplo n.º 1
0
        public virtual ActionResult Po(string id, string pk1, int pk2)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                return(RedirectToAction(MVC_Inquiry.Inquiry.Home.Index()));
            }
            const int MAX_PICKSLIPS = 1000;
            var       po            = _repos.Value.GetPo(id, pk1, pk2);

            if (po == null)
            {
                this.AddStatusMessage("No info found for PO " + id + " Customer " + pk1 + " iteration " + pk2);
                return(RedirectToAction(MVC_Inquiry.Inquiry.Home.Index()));
            }
            var model = new PoViewModel(_repos.Value.GetPo(id, pk1, pk2))
            {
                AllPickslips = _repos.Value.GetPickslips(id, pk1, pk2, MAX_PICKSLIPS).Select(p => new PickslipHeadlineModel(p)).ToList(),
                ModelTitle   = string.Format("PO {0}", id)
            };

            //if (model.AllPickslips.Count == 0)
            //{
            //    this.AddStatusMessage(string.Format("No info found for PO: {0}; Customer: {1}; Iteration: {2}", id, pk1, pk2));
            //    return RedirectToAction(MVC_Inquiry.Inquiry.Home.Index());
            //}
            if (model.AllPickslips.Count == MAX_PICKSLIPS)
            {
                model.PickslipLimit = MAX_PICKSLIPS;
            }
            //model.ShowInventoryStatus = true;
            return(View(Views.PO, model));
        }
Ejemplo n.º 2
0
        public virtual ActionResult ImportedPo(string id, string pk1)
        {
            const int MAX_PICKSLIPS = 1000;
            var       pickslips     = _repos.Value.GetInOrderBucketPickslipsOfPo(id, pk1);

            if (pickslips.Count == 0)
            {
                this.AddStatusMessage(string.Format("No info found for PO: {0}; Customer: {1}", id, pk1));
                return(RedirectToAction(MVC_Inquiry.Inquiry.Home.Index()));
            }
            var po = (from ps in pickslips
                      select new PurchaseOrder
            {
                CancelDate = ps.CancelDate,
                CustomerId = ps.CustomerId,
                CustomerName = ps.CustomerName,
                DcCancelDate = ps.DcCancelDate,
                PoId = ps.PoId,
                StartDate = ps.StartDate,
            }).First();
            var model = new PoViewModel(po)
            {
                AllPickslips = pickslips.Select(p => new PickslipHeadlineModel(p)).ToList(),
                ModelTitle   = string.Format("In Order Bucket PO {0}", id)
            };

            model.PoId = id;
            if (model.AllPickslips.Count == MAX_PICKSLIPS)
            {
                model.PickslipLimit = MAX_PICKSLIPS;
            }
            //model.ShowInventoryStatus = false;
            return(View(Views.POImported, model));
        }