Exemple #1
0
 protected override void Initialize(RequestContext requestContext)
 {
     base.Initialize(requestContext);
     if (_service == null)
     {
         _service = new CartonManagerService(requestContext);
     }
 }
Exemple #2
0
 public override void OnViewExecuting(CartonManagerService service, ControllerContext context)
 {
     this.QualityList          = service.GetQualityCodes().Select(Map);
     this.VirutalWareHouseList = service.GetVwhList().Select(Map);
     this.PriceSeasonCodeList  = service.GetPriceSeasonCodes().Select(Map);
     this.ReasonCodeList       = service.GetReasonCodes().Select(Map);
     this.PrinterList          = service.GetZebraPrinters().Select(Map);
     this.AreaList             = Enumerable.Repeat(new GroupSelectListItem {
         Text = "(Any)", Value = ""
     }, 1).Concat(service.GetCartonAreas(null, null).Select(Map));
 }
        /// <summary>
        /// Get info of carton
        /// </summary>
        /// <param name="service"></param>
        /// <param name="context"></param>
        public override void OnViewExecuting(CartonManagerService service, ControllerContext context)
        {
            base.OnViewExecuting(service, context);
            var carton = service.GetCarton(this.ScanText);

            if (carton == null)
            {
                this.StatusMessages.Add(string.Format("Carton {0} has been deleted", this.ScanText));
                this.ScanText = string.Empty;
            }
            else if (string.IsNullOrEmpty(carton.BundleId))
            {
                if (this.EmptyCarton)
                {
                    service.DeleteEmptyCarton(this.ScanText);
                }
                this.StatusMessages.Add(string.Format("Carton {0} is empty and cannot be modified", this.ScanText));
                this.ScanText = string.Empty;
            }
            else
            {
                IrregularAreaList                  = service.GetTransferAreas(PiecesRemoveFlag.Irregular).Select(p => Map(p));
                SamplesAreaList                    = service.GetTransferAreas(PiecesRemoveFlag.Samples).Select(p => Map(p));
                this.UpdatingRules.Pieces          = carton.Pieces;
                this.UpdatingRules.PriceSeasonCode = carton.PriceSeasonCode;
                this.UpdatingRules.QualityCode     = carton.QualityCode;
                this.UpdatingRules.VwhId           = carton.VwhId;
                this.QualificationRules.Rework     = carton.RemarkWorkNeeded ? ReworkStatus.NeedsRework : ReworkStatus.DoesNotNeedRework;
                this.UpdatingRules.SkuBarCode      = carton.SkuInCarton.UpcCode;
                this.UpdatingRules.SkuId           = carton.SkuInCarton.SkuId;
                this.QualificationRules.IsReserved = carton.IsReserved;
                this.SkuDescription                = carton.SkuInCarton.ToString();
                this.BundleId  = carton.BundleId;
                this.ShortName = carton.CartonArea.ShortName;
                this.UpdatingRules.LocationID = carton.LocationId;
                this.DestinationPalletId      = carton.PalletId;
            }
            var helper = new UrlHelper(context.RequestContext);

            if (helper.RouteCollection[DcmsLibrary.Mvc.PublicRoutes.DcmsConnect_SearchCarton1] != null)
            {
                this.UrlInquiryCarton = helper.RouteUrl(DcmsLibrary.Mvc.PublicRoutes.DcmsConnect_SearchCarton1, new
                {
                    id = carton.CartonId
                });
            }
        }
Exemple #4
0
 /// <summary>
 /// Called after all carton update queries have been executed. This is your chance to perform additional updates.
 /// </summary>
 /// <param name="service"></param>
 /// <remarks>
 /// </remarks>
 public virtual void OnCartonUpdated(CartonManagerService service)
 {
 }
Exemple #5
0
 /// <summary>
 /// This is called just before the view is rendered using this model. The call comes only in postback scenario. This is not called for AJAX requests.
 /// Fill your drop down lists here.
 /// </summary>
 /// <param name="service"></param>
 public virtual void OnViewExecuting(CartonManagerService service, ControllerContext context)
 {
 }