Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
themeRDark
titleC# - Create an a insurance policy
linenumberstrue
collapsetrue
// Create Insurance Policy
var client = new BFSServiceReference.bfsapiSoapClient();

var credentials = new BFSServiceReference.Credentials()
{
    UserName = bfsusername, //Username of administrative user in your instance of BFS
    Password = bfspassword, //Password of the administrative user in your instance of BFS
};

var response = client.CreateInsurancePolicy(new BFSServiceReference.CreateInsurancePolicyRequest()
{
    Credentials = credentials,

    identify = bfsidentifier, //Identifier is a unique token for your instance of BFS    

    Entities = new[]
    {
        new InsurancePolicy()
        {
            AccountId = new Guid("28cb5e31-600e-4a17-b2a7-131e2b233c8f"),
            OwnerId = new Guid("b710db8e-06b3-4e5b-aa7f-4ad9ef93bb91"),
            ExpirationDate = DateTime.Today.AddMonths(1),
            ExternalReference = "My insurance policy",
            InsuranceProgramId = new Guid(""),
            Premium = 100M,
			PolicyPeriod = 1,
            PremiumFrequency = 1,
            SignDate = DateTime.Today,
            Status = 1,
            InitialActivationDate = DateTime.Today,
            PeriodStartDate = DateTime.Today,
            PeriodEndDate = DateTime.Today.AddMonths(1)                        
        },
    }

});

foreach (var c in response.Entities)
{
    Console.WriteLine(c.BrickId + ", " + c.OwnerId);
}

...