//New
        public AttachmentEditInput(string name, string displayName, string description, string sourceReference,
                                   AttachmentOperation operation, GetAttachmentBy by, int entityId)
        {
            this.Name            = name;
            this.DisplayName     = displayName;
            this.Description     = description;
            this.SourceReference = sourceReference;

            this.AttachmentOperation = operation;
            this.AttachmentBy        = by;
            this.EntityId            = entityId;
        }
Exemple #2
0
        public async Task <IEnumerable <Attachment> > GetAttachments(GetAttachmentBy by, int id)
        {
            switch (by)
            {
            case GetAttachmentBy.PART:
                return(await this._attachmentRepositry.GetEntityListAsync(e => e.PartId == id));

            case GetAttachmentBy.PARTINSTANCE:
                return(await this._attachmentRepositry.GetEntityListAsync(e => e.PartInstanceId == id));

            case GetAttachmentBy.PRICE:
                return(await this._attachmentRepositry.GetEntityListAsync(e => e.PriceId == id));

            case GetAttachmentBy.DISTRIBUTOR:
                return(await this._attachmentRepositry.GetEntityListAsync(e => e.DistributorId == id));

            case GetAttachmentBy.MANUFACTURER:
                return(await this._attachmentRepositry.GetEntityListAsync(e => e.ManufacturerId == id));

            default:
                return(null);
            }
        }
 public AttachmentDataTraveler(GetAttachmentBy getBy, int entityId)
 {
     this.EntityId = entityId;
     this.GetBy    = getBy;
 }