3.0.0.1 Demo repository registration
This commit is contained in:
@@ -0,0 +1,208 @@
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Base.Data
|
||||
{
|
||||
//=======================================================================
|
||||
/// <summary>
|
||||
/// Organisation and User info for Repository initialisation.
|
||||
/// </summary>
|
||||
public class SbmRepositoryPopulationData
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
public SbmRepositoryPopulationData() { }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
|
||||
// Repository configuration
|
||||
public class RepositoryConfigurationData
|
||||
{
|
||||
}
|
||||
|
||||
// Owner Organisation configuration
|
||||
public class OwnerConfigurationData
|
||||
{
|
||||
}
|
||||
|
||||
// User Account.
|
||||
public class UserAccount
|
||||
{
|
||||
public SysId AffiliateIdOwner { get; set; }
|
||||
public String FirstName { get; set; }
|
||||
public String LastName { get; set; }
|
||||
public String Email { get; set; }
|
||||
public String MemberCode { get; set; }
|
||||
/// <summary>
|
||||
/// User (security) code defaults to Email if not specified.
|
||||
/// </summary>
|
||||
public String UserCode { get; set; }
|
||||
public String Password { get; set; }
|
||||
public String SecurityGroupCode { get; set; }
|
||||
}
|
||||
|
||||
// Contacts.
|
||||
public class AffiliateData
|
||||
{
|
||||
protected AffiliateData(Sbm.AffiliateType type) { this.Type = type; }
|
||||
public Sbm.AffiliateType Type { get; }
|
||||
|
||||
// Addresses.
|
||||
public List<AddressData> Addresses { get; } = new List<AddressData>();
|
||||
|
||||
// Associations - Customer.
|
||||
public CustomerData Customer { get; private set; }
|
||||
public void SetCustomer(String code)
|
||||
{
|
||||
Customer = new CustomerData() { Code = code };
|
||||
}
|
||||
public void ClearCustomer() { Customer = null; }
|
||||
|
||||
// Associations - Supplier.
|
||||
public SupplierData Supplier { get; private set; }
|
||||
public void SetSupplier(String code)
|
||||
{
|
||||
Supplier = new SupplierData() { Code = code };
|
||||
}
|
||||
public void ClearSupplier() { Supplier = null; }
|
||||
|
||||
// Associations - Member.
|
||||
public MemberData Member { get; private set; }
|
||||
public void SetMember(String code, String role)
|
||||
{
|
||||
Member = new MemberData() { Code = code, Role = role };
|
||||
}
|
||||
public void ClearMember() { Member = null; }
|
||||
}
|
||||
public class IndividualData : AffiliateData
|
||||
{
|
||||
public IndividualData() : base(Sbm.AffiliateType.Individual) { }
|
||||
public String Title { get; set; }
|
||||
public String Initials { get; set; }
|
||||
public String FirstName { get; set; }
|
||||
public String LastName { get; set; }
|
||||
public String Email { get; set; }
|
||||
public String PhoneMain { get; set; }
|
||||
public String PhoneMobile { get; set; }
|
||||
}
|
||||
public class OrganisationData : AffiliateData
|
||||
{
|
||||
protected OrganisationData(Sbm.AffiliateType type) : base(type) { }
|
||||
public String Name { get; set; }
|
||||
public String Abbr { get; set; }
|
||||
public String Nature { get; set; }
|
||||
public String Contact { get; set; }
|
||||
public String PhoneMain { get; set; }
|
||||
public String PhoneAlt { get; set; }
|
||||
public String VatReg { get; set; }
|
||||
public String CompanyNo { get; set; }
|
||||
public String Website { get; set; }
|
||||
}
|
||||
public class CommercialOrganisationData : OrganisationData
|
||||
{
|
||||
public CommercialOrganisationData() : base(Sbm.AffiliateType.Commercial) { }
|
||||
}
|
||||
public class CharityOrganisationData : OrganisationData
|
||||
{
|
||||
public CharityOrganisationData() : base(Sbm.AffiliateType.Charity) { }
|
||||
}
|
||||
|
||||
// Addresses.
|
||||
public class AddressData
|
||||
{
|
||||
protected AddressData(Sbm.AddressType type)
|
||||
{
|
||||
this.Type = type;
|
||||
}
|
||||
public Sbm.AddressType Type { get; }
|
||||
public String Line1 { get; set; }
|
||||
public String Line2 { get; set; }
|
||||
public String Line3 { get; set; }
|
||||
public String City { get; set; }
|
||||
public String Province { get; set; }
|
||||
public String Postcode { get; set; }
|
||||
public String Country { get; set; }
|
||||
}
|
||||
|
||||
// Associations.
|
||||
public class AssociationData
|
||||
{
|
||||
protected AssociationData(Sbm.AssociationType type)
|
||||
{
|
||||
this.Type = type;
|
||||
}
|
||||
public Sbm.AssociationType Type { get; }
|
||||
public String Code { get; set; }
|
||||
public String Location { get; set; }
|
||||
public String Role { get; set; }
|
||||
public String PhoneMain { get; set; }
|
||||
}
|
||||
public class CustomerData : AssociationData
|
||||
{
|
||||
public CustomerData() : base(Sbm.AssociationType.Customer) { }
|
||||
}
|
||||
public class SupplierData : AssociationData
|
||||
{
|
||||
public SupplierData() : base(Sbm.AssociationType.Supplier) { }
|
||||
}
|
||||
public class MemberData : AssociationData
|
||||
{
|
||||
public MemberData() : base(Sbm.AssociationType.Member) { }
|
||||
}
|
||||
|
||||
// Commodities.
|
||||
public class CommodityData
|
||||
{
|
||||
protected CommodityData(Sbm.CommodityType type)
|
||||
{
|
||||
this.Type = type;
|
||||
}
|
||||
public Sbm.CommodityType Type { get; }
|
||||
public String Code { get; set; }
|
||||
public String Caption { get; set; }
|
||||
public decimal SalePrice { get; set; }
|
||||
}
|
||||
public class StockCommodityData : CommodityData
|
||||
{
|
||||
public StockCommodityData() : base(Sbm.CommodityType.Stock) { }
|
||||
}
|
||||
public class NonStockCommodityData : CommodityData
|
||||
{
|
||||
public NonStockCommodityData() : base(Sbm.CommodityType.NonStock) { }
|
||||
}
|
||||
public class ServiceCommodityData : CommodityData
|
||||
{
|
||||
public ServiceCommodityData() : base(Sbm.CommodityType.Service) { }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
/// <summary>Repository initialisation data.</summary>
|
||||
public SbmRepositoryInitialisationData InitData { get; } = new SbmRepositoryInitialisationData();
|
||||
public SysId AffiliateIdOrganisation { get { return InitData.Organisation.AffiliateId; } }
|
||||
|
||||
/// <summary>Repository congiruation options.</summary>
|
||||
public RepositoryConfigurationData RepositoryConfiguration { get; } = new RepositoryConfigurationData();
|
||||
|
||||
/// <summary>Owner configuration options.</summary>
|
||||
public OwnerConfigurationData OwnerConfiguration { get; } = new OwnerConfigurationData();
|
||||
|
||||
/// <summary>Individuals.</summary>
|
||||
public List<IndividualData> Individuals { get; } = new List<IndividualData>();
|
||||
|
||||
/// <summary>Organisations.</summary>
|
||||
public List<OrganisationData> Organisations { get; } = new List<OrganisationData>();
|
||||
|
||||
/// <summary>Commodities.</summary>
|
||||
public List<CommodityData> Commodities { get; } = new List<CommodityData>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user