예제 #1
0
파일: QuoteItem.cs 프로젝트: Allors/apps
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertAtLeastOne(this, QuoteItems.Meta.Product, QuoteItems.Meta.ProductFeature, QuoteItems.Meta.Deliverable);
            derivation.Validation.AssertExistsAtMostOne(this, QuoteItems.Meta.Product, QuoteItems.Meta.ProductFeature, QuoteItems.Meta.Deliverable);
        }
예제 #2
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertAtLeastOne(this, OrderShipments.Meta.SalesOrderItem, OrderShipments.Meta.PurchaseOrderItem);
            derivation.Validation.AssertExistsAtMostOne(this, OrderShipments.Meta.SalesOrderItem, OrderShipments.Meta.PurchaseOrderItem);
        }
예제 #3
0
파일: Order.cs 프로젝트: whesius/allors
 public void TestOnDerive(ObjectOnDerive method)
 {
     if (0 == this.Amount)
     {
         this.CurrentObjectState = new OrderObjectStates(this.Strategy.Session).Cancelled;
     }
 }
예제 #4
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertExists(this, WorkEffortTypes.Meta.Description);
            derivation.Validation.AssertExists(this, WorkEffortTypes.Meta.WorkEffortTypeKind);
        }
예제 #5
0
파일: Fee.cs 프로젝트: Allors/apps
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertAtLeastOne(this, Fees.Meta.Amount, Fees.Meta.Percentage);
            derivation.Validation.AssertExistsAtMostOne(this, Fees.Meta.Amount, Fees.Meta.Percentage);
        }
예제 #6
0
파일: PayHistory.cs 프로젝트: Allors/apps
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertAtLeastOne(this, PayHistories.Meta.Amount, PayHistories.Meta.SalaryStep);
            derivation.Validation.AssertExistsAtMostOne(this, PayHistories.Meta.Amount, PayHistories.Meta.SalaryStep);
        }
예제 #7
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertAtLeastOne(this, NonSerializedInventoryItems.Meta.Good, NonSerializedInventoryItems.Meta.Part);
            derivation.Validation.AssertExistsAtMostOne(this, NonSerializedInventoryItems.Meta.Good, NonSerializedInventoryItems.Meta.Part);

            this.AppsOnDeriveQuantityOnHand(derivation);
            this.AppsOnDeriveQuantityCommittedOut(derivation);
            this.AppsOnDeriveQuantityExpectedIn(derivation);
            this.AppsOnDeriveQuantityAvailableToPromise(derivation);

            if (this.ExistPreviousQuantityOnHand && this.QuantityOnHand > this.PreviousQuantityOnHand)
            {
                this.AppsReplenishSalesOrders(derivation);
            }

            if (this.ExistPreviousQuantityOnHand && this.QuantityOnHand < this.PreviousQuantityOnHand)
            {
                this.AppsDepleteSalesOrders(derivation);
            }

            this.AppsOnDeriveCurrentObjectState(derivation);

            this.AppsOnDeriveSku(derivation);
            this.AppsOnDeriveName(derivation);
            this.AppsOnDeriveUnitOfMeasure(derivation);

            if (this.ExistGood)
            {
                this.Good.DeriveAvailableToPromise();
            }

            this.PreviousQuantityOnHand = this.QuantityOnHand;
        }
예제 #8
0
파일: RequestItem.cs 프로젝트: Allors/apps
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertAtLeastOne(this, RequestItems.Meta.Product, RequestItems.Meta.ProductFeature, RequestItems.Meta.Description, RequestItems.Meta.NeededSkill, RequestItems.Meta.Deliverable);
            derivation.Validation.AssertExistsAtMostOne(this, RequestItems.Meta.Product, RequestItems.Meta.ProductFeature, RequestItems.Meta.Description, RequestItems.Meta.NeededSkill, RequestItems.Meta.Deliverable);
        }
예제 #9
0
파일: Country.cs 프로젝트: Allors/apps
        public void AppsOnDerive(ObjectOnDerive method)
        {
            if (this.ExistIsoCode)
            {
                this.EuMemberState = Countries.euMemberStates.Contains(this.IsoCode);

                IbanData ibanData;
                if (Countries.IbanDataByCountry.TryGetValue(this.IsoCode, out ibanData))
                {
                    this.IbanLength = ibanData.Lenght;
                    this.IbanRegex = ibanData.RegexStructure;
                }
                else
                {
                    this.RemoveIbanLength();
                    this.RemoveIbanRegex();
                }
            }
            else
            {
                this.RemoveEuMemberState();
                this.RemoveIbanLength();
                this.RemoveIbanRegex();
            }
        }
예제 #10
0
 public void AppsOnDerive(ObjectOnDerive method)
 {
     this.Description = string.Format(
         "{0} {1} {2}",
         this.ExistCountryCode ? this.CountryCode : null,
         this.ExistAreaCode ? this.AreaCode : null,
         this.ExistContactNumber ? this.ContactNumber : null);
 }
예제 #11
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            this.AppsOnDeriveFromParties();
            this.AppsOnDeriveToParties();
            this.AppsOnDeriveInvolvedParties(derivation);
        }
예제 #12
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            this.SalesRepName = this.SalesRep.PartyName;

            this.AppsOnDeriveRevenue();
        }
예제 #13
0
파일: First.cs 프로젝트: whesius/allors
        public void TestOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            this.Second = new SecondBuilder(this.Strategy.Session).Build();

            this.IsDerived = true;
        }
예제 #14
0
파일: ShipmentItem.cs 프로젝트: Allors/apps
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            this.AppsOnDeriveCustomerShipmentItem(derivation);

            this.AppsOnDerivePurchaseShipmentItem(derivation);
        }
예제 #15
0
파일: Dependent.cs 프로젝트: whesius/allors
 public void TestOnDerive(ObjectOnDerive method)
 {
     if (this.ExistDependee)
     {
         this.Counter = this.Dependee.Counter;
         this.Subcounter = this.Dependee.Subcounter;
     }
 }
예제 #16
0
 public static void AppsOnDerive(this WorkEffort @this, ObjectOnDerive method)
 {
     if (@this.ExistCurrentObjectState && [email protected](@this.LastObjectState))
     {
         var currentStatus = new WorkEffortStatusBuilder(@this.Strategy.Session).WithWorkEffortObjectState(@this.CurrentObjectState).Build();
         @this.AddWorkEffortStatus(currentStatus);
         @this.CurrentWorkEffortStatus = currentStatus;
     }
 }
예제 #17
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            this.Parties = new Party[] { this.Distributor, this.InternalOrganisation };

            if (!this.ExistInternalOrganisation | !this.ExistDistributor)
            {
                this.Delete();
            }
        }
예제 #18
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            this.Parties = new Party[] { this.Child, this.Parent };

            if (!this.ExistParent | !this.ExistChild)
            {
                this.Delete();
            }
        }
예제 #19
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertAtLeastOne(this, SerializedInventoryItems.Meta.Good, SerializedInventoryItems.Meta.Part);
            derivation.Validation.AssertExistsAtMostOne(this, SerializedInventoryItems.Meta.Good, SerializedInventoryItems.Meta.Part);

            this.AppsOnDeriveCurrentObjectState(derivation);
        }
예제 #20
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            this.Parties = new Party[] { this.Contractor, this.SubContractor };

            if (!this.ExistContractor || !this.ExistSubContractor)
            {
                this.Delete();
            }
        }
예제 #21
0
파일: Login.cs 프로젝트: whesius/allors
        public void BaseOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            if (!this.ExistUser)
            {
                this.Delete();
            }
        }
예제 #22
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            this.Parties = new Party[] { this.Client, this.InternalOrganisation };

            if (!this.ExistInternalOrganisation || !this.ExistClient)
            {
                this.Delete();
            }
        }
예제 #23
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertAtLeastOne(this, SupplierOfferings.Meta.Part, SupplierOfferings.Meta.Product);
            derivation.Validation.AssertExistsAtMostOne(this, SupplierOfferings.Meta.Part, SupplierOfferings.Meta.Product);

            this.AppsOnDeriveInventoryItem(derivation);
        }
예제 #24
0
 public static void AppsOnDerive(this PartSpecification partSpecification, ObjectOnDerive method)
 {
     if (partSpecification.ExistCurrentObjectState && !partSpecification.CurrentObjectState.Equals(partSpecification.PreviousObjectState))
     {
         var currentStatus = new PartSpecificationStatusBuilder(partSpecification.Strategy.Session).WithPartSpecificationObjectState(partSpecification.CurrentObjectState).Build();
         partSpecification.AddPartSpecificationStatus(currentStatus);
         partSpecification.CurrentPartSpecificationStatus = currentStatus;
     }
 }
예제 #25
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            this.Parties = new[] { this.Prospect, this.InternalOrganisation };

            if (!this.ExistInternalOrganisation | !this.ExistProspect)
            {
                this.Delete();
            }
        }
        public void AppsOnDerive(ObjectOnDerive method)
        {
            this.Parties = new Party[] { this.Professional, this.ProfessionalServicesProvider };

            if (!this.ExistProfessional | !this.ExistProfessionalServicesProvider)
            {
                this.Delete();
            }
        }
예제 #27
0
파일: Place.cs 프로젝트: whesius/allors
        public void TestOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Log.AssertExists(this, Places.Meta.PostalCode);
            derivation.Log.AssertNonEmptyString(this, Places.Meta.PostalCode);
            derivation.Log.AssertExists(this, Places.Meta.City);
            derivation.Log.AssertNonEmptyString(this, Places.Meta.City);
        }
예제 #28
0
        public void AppsOnDerive(ObjectOnDerive method)
        {
            this.AppsOnDeriveFromParties();
            this.AppsOnDeriveToParties();
            this.AppsOnDeriveInvolvedParties();

            if (!this.ExistOriginator || this.Receivers.Count == 0)
            {
                this.Delete();
            }
        }
예제 #29
0
파일: Cash.cs 프로젝트: Allors/apps
        public void AppsOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            if (this.ExistInternalOrganisationWherePaymentMethod && this.InternalOrganisationWherePaymentMethod.DoAccounting)
            {
                derivation.Validation.AssertExists(this, this.Meta.Creditor);
                derivation.Validation.AssertAtLeastOne(this, this.Meta.GeneralLedgerAccount, this.Meta.Journal);
            }

            derivation.Validation.AssertExistsAtMostOne(this, this.Meta.GeneralLedgerAccount, this.Meta.Journal);
        }
예제 #30
0
파일: Dependee.cs 프로젝트: whesius/allors
        public void TestOnDerive(ObjectOnDerive method)
        {
            this.Counter = this.Counter + 1;

            if (this.ExistSubdependee)
            {
                this.Subcounter = this.Subdependee.Subcounter;
            }

            if (this.DeleteDependent.HasValue && this.DeleteDependent.Value)
            {
                this.DependentWhereDependee.Delete();
            }
        }
예제 #31
0
        public void RealTimeOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            // check if caller or callee only has 1 accepted call
            if (this.Caller.GetAllAcceptedCalls().Count > 1 || this.Callee.GetAllAcceptedCalls().Count > 1)
            {
                derivation.Validation.AddError(this, this.Meta.CurrentObjectState, "Only 1 Call can be in the Accepted State.");
            }

            if (!this.ExistStartDate && this.CurrentObjectState.IsAccepted)
            {
                this.StartDate = this.strategy.Session.Now();
            }

            if (!this.ExistEndDate && this.CurrentObjectState.IsEnded)
            {
                this.EndDate = this.strategy.Session.Now();
            }
        }
        public static void CoreOnDerive(this Auditable @this, ObjectOnDerive method)
        {
            var user = @this.Strategy.Session.GetUser();

            if (user != null)
            {
                var derivation = method.Derivation;
                var changeSet  = derivation.ChangeSet;

                if (changeSet.Created.Contains(@this.Id))
                {
                    @this.CreationDate = @this.Strategy.Session.Now();
                    @this.CreatedBy    = user;
                }

                if (changeSet.Associations.Contains(@this.Id))
                {
                    @this.LastModifiedDate = @this.Strategy.Session.Now();
                    @this.LastModifiedBy   = user;
                }
            }
        }
예제 #33
0
        public void BaseOnDerive(ObjectOnDerive method)
        {
            if (this.ExistIsoCode)
            {
                this.EuMemberState = Countries.EuMemberStates.Contains(this.IsoCode);

                if (Countries.IbanDataByCountry.TryGetValue(this.IsoCode, out var ibanData))
                {
                    this.IbanLength = ibanData.Length;
                    this.IbanRegex  = ibanData.RegexStructure;
                }
                else
                {
                    this.RemoveIbanLength();
                    this.RemoveIbanRegex();
                }
            }
            else
            {
                this.RemoveEuMemberState();
                this.RemoveIbanLength();
                this.RemoveIbanRegex();
            }
        }
예제 #34
0
 public static void BaseOnDerive(this Service @this, ObjectOnDerive method) => @this.BaseOnDeriveVirtualProductPriceComponent();
예제 #35
0
        public void CustomOnDerive(ObjectOnDerive method)
        {
            this.Third = new ThirdBuilder(this.Strategy.Session).Build();

            this.IsDerived = true;
        }
예제 #36
0
 public static void CustomOnDerive(this DerivationCounted @this, ObjectOnDerive method)
 {
     @this.DerivationCount += 1;
 }
예제 #37
0
        public void BaseOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            this.PartyName = this.Name;
        }
예제 #38
0
 public void CustomOnDerive(ObjectOnDerive method) => this.Sync();
예제 #39
0
        public static void BaseOnDerive(this Shipment @this, ObjectOnDerive method)
        {
            var session = @this.Strategy.Session;

            @this.AddSecurityToken(new SecurityTokens(session).DefaultSecurityToken);
        }
예제 #40
0
 public static void AppsOnDerive(this Service @this, ObjectOnDerive method)
 {
     @this.AppsOnDeriveVirtualProductPriceComponent();
 }
예제 #41
0
 public void CustomOnDerive(ObjectOnDerive method) => this.Counter += 1;
예제 #42
0
 public void CustomOnDerive(ObjectOnDerive method)
 {
     this.IsDerived = true;
 }
예제 #43
0
 public void CoreOnDerive(ObjectOnDerive method)
 {
 }
예제 #44
0
        public void BaseOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            derivation.Validation.AssertExists(this, this.Meta.Description);
        }
예제 #45
0
 public void CustomOnDerive(ObjectOnDerive method)
 {
     this.Subcounter = this.Subcounter + 1;
 }
예제 #46
0
 public void BaseOnDerive(ObjectOnDerive method)
 {
 }
        public void BaseOnDerive(ObjectOnDerive method)
        {
            var derivation = method.Derivation;

            this.Parties = new Party[] { this.Contact, this.Organisation };
        }