Esempio n. 1
0
        private bool RaiseHandlerICommandWithUpdate(ICommandWithUpdate value, ref ICommandWithUpdate oldValue, string propertyName, object sender)
        {
            bool _ret = base.RaiseHandler <ICommandWithUpdate>(value, ref oldValue, propertyName, sender);

            if (_ret)
            {
                this.CanExecuteChanged += (sevder, e) => value.RaiseCanExecuteChanged();
            }
            return(_ret);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DisposalRequestDetails" /> class. Used to add new position of the requests list.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="account">The account without disposal created for the relevant request.</param>
 /// <param name="sequenceNumber">The sequence number that will be incremented each time new instance is created.</param>
 internal DisposalRequestDetails(DisposalRequest parent, CustomsWarehouse account, ref int sequenceNumber)
 {
     m_Parent                   = parent;
     m_Disposal                 = null;
     m_Account                  = account;
     AddedKg                    = 0;
     Batch                      = account.Batch;
     CustomsProcedure           = parent.CustomsProcedure;
     DeclaredNetMass            = 0;
     DocumentNumber             = account.DocumentNo;
     MassPerPackage             = account.CW_MassPerPackage.Value;
     PackagesToDispose          = 0;
     QuantityyToClearSum        = 0;
     QuantityyToClearSumRounded = 0;
     RemainingOnStock           = account.TobaccoNotAllocated.Value;
     SequenceNumber             = sequenceNumber++;
     SKU            = account.SKU;
     SKUDescription = string.Empty;
     TotalStock     = account.TobaccoNotAllocated.Value;
     Units          = account.Units;
     MoveDown       = new SynchronousCommandBase <Nullable <int> >(x => parent.GoDown(SequenceNumber), y => !parent.IsBottomActive(SequenceNumber));
     MoveUp         = new SynchronousCommandBase <Nullable <int> >(x => parent.GoUp(SequenceNumber), y => !parent.IsTopActive(SequenceNumber));
 }