Esempio n. 1
0
 private static DeliveryProductMailerModel GetProductModel(ProductRow p, ModificationKind rowKind)
 {
     return(new DeliveryProductMailerModel()
     {
         Name = p.Name,
         Quantity = p.Quantity,
         Reference = p.Reference,
         Conditioning = p.GetConditioning(),
         RowKind = rowKind,
         Vat = p.Vat,
         ProductTotalVatPrice = p.TotalProductVatPrice,
         ProductTotalWholeSalePrice = p.TotalProductWholeSalePrice,
         ProductTotalOnSalePrice = p.TotalProductOnSalePrice,
         ProductWholeSalePrice = p.UnitWholeSalePrice,
         HasReturnable = p.HasReturnable,
         ReturnableName = p.ReturnableName,
         ReturnableQuantity = p.Quantity,
         ReturnableVat = p.ReturnableVat,
         ReturnableWholeSalePrice = p.ReturnableWholeSalePrice,
         ReturnableTotalVatPrice = p.TotalReturnableVatPrice,
         ReturnableTotalOnSalePrice = p.TotalReturnableOnSalePrice,
         ReturnableTotalWholeSalePrice = p.TotalReturnableWholeSalePrice,
         TotalVatPrice = p.TotalVatPrice,
         TotalOnSalePrice = p.TotalOnSalePrice,
         TotalWholeSalePrice = p.TotalWholeSalePrice
     });
 }
 private void HandleModificationState_OnStateChange(ModificationKind kind, object entity)
 {
     if (kind == ModificationKind.Add && entity is Entity.ClientUri)
     {
         StateHasChanged();
     }
 }
Esempio n. 3
0
 private void HandleModificationState_OnStateChange(ModificationKind kind, object _)
 {
     if (kind == ModificationKind.Delete)
     {
         EditContext.Validate();
     }
 }
Esempio n. 4
0
 private void HandleModificationState_OnStateChange(ModificationKind kind, object entity)
 {
     if (entity is T && (kind == ModificationKind.Add || kind == ModificationKind.Delete))
     {
         StateHasChanged();
     }
 }
Esempio n. 5
0
 private void HandleModificationState_OnStateChange(ModificationKind kind, object entity)
 {
     if (entity is Entity.ClientScope)
     {
         StateHasChanged();
     }
 }
Esempio n. 6
0
 private void HandleModificationState_OnStateChange(ModificationKind kind, object entity)
 {
     if (entity is ApiClaim)
     {
         StateHasChanged();
     }
 }
Esempio n. 7
0
 private protected AbstractModification(ModificationKind kind, bool readOnly)
 {
     if (!(this is TSelf))
     {
         throw new InvalidOperationException("derived type must inherit TSymbol");
     }
     Kind     = kind;
     ReadOnly = readOnly;
 }
Esempio n. 8
0
        protected void OnStateChange(ModificationKind kind, object entity)
        {
            var isWebClient = _isWebClient;

            _isWebClient = Model.IsWebClient();
            if (isWebClient != _isWebClient)
            {
                StateHasChanged();
            }
        }
Esempio n. 9
0
 public TextModifiedEventArgs(
     ModificationKind kind,
     string modification,
     int offset,
     int length
     )
 {
     _kind         = kind;
     _modification = modification;
     _offset       = offset;
     _length       = length;
 }
Esempio n. 10
0
        private static DeliveryProductMailerModel GetProductModel(PreparedProduct p, ModificationKind rowKind)
        {
            var model = GetProductModel((ProductRow)p, rowKind);

            model.Batches = p.Batches?.Select(b => new BatchMailerModel
            {
                Number = b.Batch.Number,
                DLC    = b.Batch.DLC,
                DDM    = b.Batch.DDM
            }).ToList() ?? new List <BatchMailerModel>();
            return(model);
        }
Esempio n. 11
0
        public static string ToEnumString(this ModificationKind kind)
        {
            switch (kind)
            {
            case ModificationKind.ToDeliver:
                return("à livrer");

            case ModificationKind.Broken:
                return("cassé");

            case ModificationKind.Improper:
                return("non conforme");

            case ModificationKind.Missing:
                return("manquant");

            case ModificationKind.Excess:
                return("en surplu");

            default:
                return("");
            }
        }
        public static FindBelongingResult FindBelongingThing(SyntakTreeDecorator toFind, List <SyntakTreeDecorator> possibleMatches)
        {
            var toFindContentString = ContentString(toFind.node);
            var toFindFullString    = toFind.node.ToFullString().Trim();

            {
                var identical = possibleMatches.Find(n => n.node.ToFullString().Trim().Equals(toFindFullString));
                if (identical != null)
                {
                    return(new FindBelongingResult()
                    {
                        treeNode = identical, wasModified = false, howModified = ModificationKind.noModification
                    });
                }

                var equiv = possibleMatches.Find(n => n.node.IsEquivalentTo(toFind.node));
                if (equiv != null)
                {
                    return(new FindBelongingResult()
                    {
                        treeNode = equiv, wasModified = false, howModified = ModificationKind.noModification
                    });
                }
            }

            {
                var sameKind = possibleMatches.FindAll(n => n.node.Kind().Equals(toFind.node.Kind()));
                if (sameKind != null)
                {
                    foreach (var s in sameKind)
                    {
                        bool?haveSameName = HaveSameName(toFind.node.Kind(), s.node, toFind.node);
                        if (haveSameName == true || haveSameName == null)   // same name, or no name
                        {
                            return(new FindBelongingResult()
                            {
                                treeNode = s, wasModified = !ContentString(s.node).Equals(toFindContentString), howModified = ModificationKind.contentChanged
                            });
                        }
                    }
                }

                if (sameKind.Count == 1)
                {
                    var              s           = sameKind[0];
                    bool             sameContent = ContentString(s.node).Equals(toFindContentString);
                    ModificationKind how         = ModificationKind.nameChanged;
                    if (!sameContent)
                    {
                        how = how | ModificationKind.contentChanged;
                    }

                    return(new FindBelongingResult()
                    {
                        treeNode = s, wasModified = true, howModified = how
                    });
                }
            }

            return(null);
        }
Esempio n. 13
0
 public MethodModification(MethodDescriptor methodDescriptor, ModificationKind modificationKind)
 {
     this.MethodDescriptor = methodDescriptor;
     this.ModificationKind = modificationKind;
 }
Esempio n. 14
0
 public TextModifiedEventArgs()
 {
     _kind = ModificationKind.Significant;
 }
Esempio n. 15
0
 internal EventModification(TypeModification declaringType, UTF8String name, ITypeReference <ITypeDefOrRef> type, ModificationKind kind, bool readOnly) : base(declaringType, name, kind, readOnly) => Type = type;
Esempio n. 16
0
 internal PropertyModification(TypeModification declaringType, UTF8String name, PropertySignature signature, ModificationKind kind, bool readOnly) : base(declaringType, name, kind, readOnly) => Signature = signature;
Esempio n. 17
0
 private static IEnumerable <object> GetModifiedEntities(Dictionary <object, ModificationKind> modificationList, ModificationKind kind)
 {
     return(modificationList
            .Where(m => m.Value == kind)
            .Select(m => m.Key));
 }
Esempio n. 18
0
 private protected MemberModification(TypeModification declaringType, UTF8String name, ModificationKind kind, bool readOnly) : base(kind, readOnly)
 {
     DeclaringType = declaringType;
     Name          = name;
 }
Esempio n. 19
0
 private void HandleModificationState_OnStateChange(ModificationKind kind, object entity)
 {
     _disabled = false;
     StateHasChanged();
 }
Esempio n. 20
0
 private static DeliveryReturnableMailerModel GetReturnableModel(ProductRow product, ModificationKind rowKind)
 {
     return(new DeliveryReturnableMailerModel()
     {
         Name = product.ReturnableName,
         Quantity = product.Quantity,
         RowKind = rowKind,
         Vat = product.ReturnableVat ?? 0,
         TotalVatPrice = product.TotalReturnableVatPrice ?? 0,
         TotalWholeSalePrice = product.TotalReturnableWholeSalePrice ?? 0,
         TotalOnSalePrice = product.TotalReturnableOnSalePrice ?? 0,
         WholeSalePrice = product.ReturnableWholeSalePrice ?? 0
     });
 }
Esempio n. 21
0
 public DeliveryProduct(ProductRow product, int quantity, ModificationKind kind)
     : base(product, quantity)
 {
     RowKind = kind;
     SetQuantity(quantity);
 }
Esempio n. 22
0
 private protected AccessibleModification(TypeModification declaringType, UTF8String name, ModificationKind kind, bool readOnly) : base(declaringType, name, kind, readOnly)
 {
 }