public static void BaseOnBuild(this UniquelyIdentifiable @this, ObjectOnBuild method) { if ([email protected]) { @this.Strategy.SetUnitRole(UniquelyIdentifiables.Meta.UniqueId, Guid.NewGuid()); } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistEffectiveDate) { this.EffectiveDate = DateTime.UtcNow; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistCreationDate) { this.CreationDate = DateTime.UtcNow; } }
public static void AppsOnBuild(this Requirement @this, ObjectOnBuild method) { if ([email protected]) { @this.CurrentObjectState = new RequirementObjectStates(@this.Strategy.Session).Active; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistInternalOrganisation) { this.InternalOrganisation = Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistCurrentObjectState) { this.CurrentObjectState = new SalesInvoiceItemObjectStates(this.Strategy.Session).ReadyForPosting; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistIsActive) { this.IsActive = true; } }
public static void AppsOnBuild(this PartyRelationship @this, ObjectOnBuild method) { if ([email protected]) { @this.FromDate = DateTime.UtcNow; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistStartDateTime) { this.StartDateTime = DateTime.UtcNow; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistSpecifiedFor) { this.SpecifiedFor = Domain.Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistReceivedDateTime) { this.ReceivedDateTime = DateTime.UtcNow; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistFromDate) { this.FromDate = DateTime.UtcNow; } this.HasBankStatementTransactions = false; }
public void BaseOnBuild(ObjectOnBuild method) { var builder = method.Builder; if (!this.ExistUserEmailConfirmed) { this.UserEmailConfirmed = false; } this.BuildOwnerSecurityToken(); }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistFromDate) { this.FromDate = DateTime.UtcNow; } if (!this.ExistUseAsDefault) { this.UseAsDefault = false; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistInternalOrganisation) { this.InternalOrganisation = Domain.Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; } if (!this.ExistSubAccountNumber) { this.SubAccountNumber = this.InternalOrganisation.DeriveNextSubAccountNumber(); } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistSalesOrderCounter) { this.SalesOrderCounter = new CounterBuilder(this.strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } if (!this.ExistOutgoingShipmentCounter) { this.OutgoingShipmentCounter = new CounterBuilder(this.strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } }
public void CustomOnBuild(ObjectOnBuild method) { this.AccountantUsergroup = new UserGroupBuilder(this.Strategy.Session).WithName("XXX Accountants").Build(); this.AccountantSecurityToken = new SecurityTokenBuilder(this.Strategy.Session).Build(); var accountantRole = new Roles(this.Strategy.Session).Accountant; new AccessControlBuilder(this.Strategy.Session) .WithRole(accountantRole) .WithObject(this.AccountantSecurityToken) .WithSubjectGroup(this.AccountantUsergroup) .Build(); }
public void BaseOnBuild(ObjectOnBuild method) { var builder = method.Builder; var mediaBuilder = (MediaBuilder)builder; if (mediaBuilder.MediaContentValue != null) { this.MediaContent = new MediaContentBuilder(this.Strategy.Session).WithValue(mediaBuilder.MediaContentValue).Build(); if (!this.ExistMediaType) { this.MediaType = new MediaTypes(this.Strategy.Session).Infer(this.Content); } } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistPurchaseInvoiceCounter) { this.PurchaseInvoiceCounter = new CounterBuilder(this.strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } if (!this.ExistQuoteCounter) { this.QuoteCounter = new CounterBuilder(this.strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } if (!this.ExistPurchaseOrderCounter) { this.PurchaseOrderCounter = new CounterBuilder(this.strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } if (!this.ExistIncomingShipmentCounter) { this.IncomingShipmentCounter = new CounterBuilder(this.strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } if (!this.ExistSubAccountCounter) { this.SubAccountCounter = new CounterBuilder(this.strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } if (!this.ExistDoAccounting) { this.DoAccounting = false; } if (!this.ExistInvoiceSequence) { this.InvoiceSequence = new InvoiceSequences(this.Strategy.Session).RestartOnFiscalYear; } if (!this.ExistFiscalYearStartMonth) { this.FiscalYearStartMonth = 1; } if (!this.ExistFiscalYearStartDay) { this.FiscalYearStartDay = 1; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistCreationDate) { this.CreationDate = DateTime.UtcNow; } if (!this.ExistCurrentObjectState) { this.CurrentObjectState = new PickListObjectStates(this.Strategy.Session).Created; } if (!this.ExistStore) { var internalOrganisation = Allors.Domain.Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; if (internalOrganisation.StoresWhereOwner.Count == 1) { this.Store = internalOrganisation.StoresWhereOwner.First; } } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistInternalOrganisation) { this.InternalOrganisation = Domain.Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; } if (!this.ExistBlockUnpaidTransactions) { this.BlockUnpaidTransactions = false; } if (!this.ExistCloseWhenInBalance) { this.CloseWhenInBalance = false; } if (!this.ExistUseAsDefault) { this.UseAsDefault = false; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistCurrentObjectState) { this.CurrentObjectState = new PurchaseInvoiceObjectStates(this.Strategy.Session).InProcess; } if (!this.ExistInvoiceNumber && this.ExistBilledToInternalOrganisation) { this.InvoiceNumber = this.BilledToInternalOrganisation.DeriveNextPurchaseInvoiceNumber(); } if (!this.ExistInvoiceDate) { this.InvoiceDate = DateTime.UtcNow; } if (!this.ExistEntryDate) { this.EntryDate = DateTime.UtcNow; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistCashAccount) { this.CashAccount = false; } if (!this.ExistCostCenterAccount) { this.CostCenterAccount = false; } if (!this.ExistCostCenterRequired) { this.CostCenterRequired = false; } if (!this.ExistCostUnitAccount) { this.CostUnitAccount = false; } if (!this.ExistCostUnitRequired) { this.CostUnitRequired = false; } if (!this.ExistReconciliationAccount) { this.ReconciliationAccount = false; } if (!this.ExistProtected) { this.Protected = false; } }
public void BaseOnBuild(ObjectOnBuild method) { if (!this.ExistAutoGenerateCustomerShipment) { this.AutoGenerateCustomerShipment = true; } if (!this.ExistAutoGenerateShipmentPackage) { this.AutoGenerateShipmentPackage = true; } if (!this.ExistSalesOrderCounter) { this.SalesOrderCounter = new CounterBuilder(this.Strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } if (!this.ExistOutgoingShipmentCounter) { this.OutgoingShipmentCounter = new CounterBuilder(this.Strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } if (!this.ExistBillingProcess) { this.BillingProcess = new BillingProcesses(this.Strategy.Session).BillingForShipmentItems; } if (!this.ExistSalesInvoiceTemporaryCounter) { this.SalesInvoiceTemporaryCounter = new CounterBuilder(this.Strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } if (!this.ExistCreditNoteCounter) { this.CreditNoteCounter = new CounterBuilder(this.Strategy.Session).WithUniqueId(Guid.NewGuid()).WithValue(0).Build(); } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistCurrentObjectState) { this.CurrentObjectState = new PurchaseShipmentObjectStates(this.Strategy.Session).Created; } if (!this.ExistShipToParty) { this.ShipToParty = Domain.Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; } if (!this.ExistFacility && this.ExistShipToParty) { var toParty = this.ShipToParty as Domain.InternalOrganisation; if (toParty != null) { this.Facility = toParty.DefaultFacility; } } if (!this.ExistShipmentNumber && this.ExistShipToParty) { var internalOrganisation = this.ShipToParty as Domain.InternalOrganisation; if (internalOrganisation != null) { this.ShipmentNumber = internalOrganisation.DeriveNextShipmentNumber(); } } if (!this.ExistEstimatedArrivalDate) { this.EstimatedArrivalDate = DateTime.UtcNow.Date; } }
public void BaseOnBuild(ObjectOnBuild method) { var builder = method.Builder; this.NameToLowerCase(); }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistCurrentObjectState) { this.CurrentObjectState = new CustomerShipmentObjectStates(this.Strategy.Session).Created; } if (!this.ExistReleasedManually) { this.ReleasedManually = false; } if (!this.ExistHeldManually) { this.HeldManually = false; } if (!this.ExistWithoutCharges) { this.WithoutCharges = false; } if (!this.ExistShipFromParty) { this.ShipFromParty = Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; } if (!this.ExistBillFromInternalOrganisation) { this.BillFromInternalOrganisation = Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; } if (!this.ExistBillFromContactMechanism) { this.BillFromContactMechanism = BillFromInternalOrganisation.BillingAddress; } if (!this.ExistStore && this.ExistShipFromParty) { var organisation = this.ShipFromParty as Domain.InternalOrganisation; if (organisation != null && organisation.StoresWhereOwner.Count == 1) { this.Store = organisation.StoresWhereOwner.First; } } if (!this.ExistEstimatedShipDate) { this.EstimatedShipDate = DateTime.UtcNow.Date; } if (!this.ExistShipmentNumber && this.ExistStore) { this.ShipmentNumber = this.Store.DeriveNextShipmentNumber(); } if (!this.ExistCarrier && this.ExistStore) { this.Carrier = this.Store.DefaultCarrier; } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistCurrentObjectState) { this.CurrentObjectState = new SalesInvoiceObjectStates(this.Strategy.Session).ReadyForPosting; } if (!this.ExistEntryDate) { this.EntryDate = DateTime.UtcNow; } if (!this.ExistInvoiceDate) { this.InvoiceDate = DateTime.UtcNow; } if (this.ExistBillToCustomer) { this.PreviousBillToCustomer = this.BillToCustomer; } if (!this.ExistBilledFromInternalOrganisation) { this.BilledFromInternalOrganisation = Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; } if (!this.ExistStore && this.ExistBilledFromInternalOrganisation) { if (this.BilledFromInternalOrganisation.StoresWhereOwner.Count == 1) { this.Store = this.BilledFromInternalOrganisation.StoresWhereOwner.First; } } if (!this.ExistInvoiceNumber && this.ExistStore) { this.InvoiceNumber = this.Store.DeriveNextInvoiceNumber(this.InvoiceDate.Year); } if (!this.ExistSalesInvoiceType) { this.SalesInvoiceType = new SalesInvoiceTypes(this.Strategy.Session).SalesInvoice; } if (!this.ExistCustomerCurrency) { if (this.ExistBillToCustomer && (this.BillToCustomer.ExistPreferredCurrency || this.BillToCustomer.ExistLocale)) { this.CustomerCurrency = this.BillToCustomer.ExistPreferredCurrency ? this.BillToCustomer.PreferredCurrency : this.BillToCustomer.Locale.Country.Currency; } else { if (this.ExistBilledFromInternalOrganisation) { this.CustomerCurrency = this.BilledFromInternalOrganisation.ExistPreferredCurrency ? this.BilledFromInternalOrganisation.PreferredCurrency : this.BilledFromInternalOrganisation.Locale.Country.Currency; } } } }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistCurrentObjectState) { this.CurrentObjectState = new SalesOrderObjectStates(this.Strategy.Session).Provisional; } if (!this.ExistPartiallyShip) { this.PartiallyShip = true; } if (!this.ExistOrderDate) { this.OrderDate = DateTime.UtcNow; } if (!this.ExistEntryDate) { this.EntryDate = DateTime.UtcNow; } if (!this.ExistDeliveryDate) { this.DeliveryDate = DateTime.UtcNow; } if (!this.ExistTakenByInternalOrganisation) { this.TakenByInternalOrganisation = Singleton.Instance(this.Strategy.Session).DefaultInternalOrganisation; } if (!this.ExistStore && this.ExistTakenByInternalOrganisation) { if (this.TakenByInternalOrganisation.StoresWhereOwner.Count == 1) { this.Store = this.TakenByInternalOrganisation.StoresWhereOwner.First; } } if (!this.ExistVatRegime && this.ExistBillToCustomer) { this.VatRegime = this.BillToCustomer.VatRegime; } if (!this.ExistPaymentMethod) { if (this.ShipToCustomer != null) { this.PaymentMethod = this.ShipToCustomer.DefaultPaymentMethod; } if (!this.ExistPaymentMethod && this.ExistStore) { this.PaymentMethod = this.Store.DefaultPaymentMethod; } } if (!this.ExistBillToCustomer && this.ExistShipToCustomer) { this.BillToCustomer = this.ShipToCustomer; } if (!this.ExistShipToCustomer && this.ExistBillToCustomer) { this.ShipToCustomer = this.BillToCustomer; } if (!this.ExistShipToAddress && this.ExistShipToCustomer) { this.ShipToAddress = this.ShipToCustomer.ShippingAddress; } if (!this.ExistShipmentMethod) { if (this.ShipToCustomer != null) { this.ShipmentMethod = this.ShipToCustomer.DefaultShipmentMethod; } if (this.ShipmentMethod == null && this.ExistStore) { this.ShipmentMethod = this.Store.DefaultShipmentMethod; } } }
public void BaseOnBuild(ObjectOnBuild method) { if (!this.ExistSalesOrderState) { this.SalesOrderState = new SalesOrderStates(this.Strategy.Session).Provisional; } if (!this.ExistSalesOrderShipmentState) { this.SalesOrderShipmentState = new SalesOrderShipmentStates(this.Strategy.Session).NotShipped; } if (!this.ExistSalesOrderInvoiceState) { this.SalesOrderInvoiceState = new SalesOrderInvoiceStates(this.Strategy.Session).NotInvoiced; } if (!this.ExistSalesOrderPaymentState) { this.SalesOrderPaymentState = new SalesOrderPaymentStates(this.Strategy.Session).NotPaid; } if (!this.ExistOrderDate) { this.OrderDate = this.Session().Now(); } if (!this.ExistEntryDate) { this.EntryDate = this.Session().Now(); } if (!this.ExistPartiallyShip) { this.PartiallyShip = true; } if (!this.ExistTakenBy) { var internalOrganisations = new Organisations(this.Strategy.Session).InternalOrganisations(); if (internalOrganisations.Count() == 1) { this.TakenBy = internalOrganisations.First(); } } if (!this.ExistStore && this.ExistTakenBy) { var stores = new Stores(this.Strategy.Session).Extent(); stores.Filter.AddEquals(M.Store.InternalOrganisation, this.TakenBy); if (stores.Any()) { this.Store = stores.First; } } if (!this.ExistOriginFacility) { this.OriginFacility = this.ExistStore ? this.Store.DefaultFacility : this.Strategy.Session.GetSingleton().Settings.DefaultFacility; } if (!this.ExistOrderNumber && this.ExistStore) { this.OrderNumber = this.Store.NextSalesOrderNumber(this.OrderDate.Year); } }
public static void AppsOnBuild(this Party party, ObjectOnBuild method) { if (!party.ExistLocale && Singleton.Instance(party.Strategy.Session).ExistDefaultInternalOrganisation) { party.Locale = Singleton.Instance(party.Strategy.Session).DefaultInternalOrganisation.Locale; } if (!party.ExistPreferredCurrency && Singleton.Instance(party.Strategy.Session).ExistDefaultInternalOrganisation) { party.PreferredCurrency = Singleton.Instance(party.Strategy.Session).DefaultInternalOrganisation.PreferredCurrency; } }
public void RealTimeOnBuild(ObjectOnBuild method) { new UserGroups(this.strategy.Session).Creators.AddMember(this); new UserGroups(this.strategy.Session).Members.AddMember(this); }
public void AppsOnBuild(ObjectOnBuild method) { if (!this.ExistLocale) { this.Locale = Singleton.Instance(this.Strategy.Session).DefaultLocale; } }