public int InsertPolicy(int CustID) { CBLServiceReference.EpicSDK_2017_02Client EpicSDKClient = new CBLServiceReference.EpicSDK_2017_02Client(); CBLServiceReference.PolicyGetResult oPolicyResult = new CBLServiceReference.PolicyGetResult(); CBLServiceReference.PolicyFilter oPolicyFilter = new CBLServiceReference.PolicyFilter(); CBLServiceReference.Policy pol = new CBLServiceReference.Policy(); pol.AccountID = CustID; pol.EffectiveDate = new DateTime(2020, 10, 01); pol.ExpirationDate = new DateTime(2021, 09, 30); pol.IssuingCompanyLookupCode = "SASKA1"; pol.StatusCode = "NEW"; pol.PolicyTypeCode = "BLIA"; pol.Description = "Commercial General Liability/PAL/Special Events"; pol.LineTypeCode = "BLIA"; pol.IssuingLocationCode = "ON"; pol.AgencyCode = "66"; pol.BranchCode = "HIG"; pol.DepartmentCode = "CL"; pol.ProfitCenterCode = "CIPU"; pol.PolicyNumber = "TEST123AC"; IPolicyID = EpicSDKClient.Insert_Policy(oMessageHeader, pol); Console.WriteLine(IPolicyID); //EpicSDKClient.Close(); return(IPolicyID); }
public int InsertPolicySQL(string polNum) { CBLServiceReference.EpicSDK_2017_02Client EpicSDKClient = new CBLServiceReference.EpicSDK_2017_02Client(); CBLServiceReference.PolicyGetResult oPolicyResult = new CBLServiceReference.PolicyGetResult(); CBLServiceReference.PolicyFilter oPolicyFilter = new CBLServiceReference.PolicyFilter(); CBLServiceReference.Policy pol = new CBLServiceReference.Policy(); SqlConnection conn = new SqlConnection(ConnectionString); //List<EpicIntegrator.Policy> pols = new List<EpicIntegrator.Policy>(); //List<EpicIntegrator.Policy> polFirst = new List<EpicIntegrator.Policy>(); string SQL = System.IO.File.ReadAllText(@"C:\Users\Abhishek\Documents\Abhi _ IMP\Sep29\SQLpolDetails.txt"); string query = SQL + polNum + "';"; //Console.WriteLine(query); SqlCommand command = new SqlCommand(query, conn); conn.Open(); SqlDataReader rdr = command.ExecuteReader(); if (rdr.HasRows) { while (rdr.Read()) { pol.AccountID = Convert.ToInt32(rdr["UniqEntity"].ToString()); //pol.EffectiveDate = new DateTime(2000, 01, 01); //pol.ExpirationDate = new DateTime(2000, 01, 01); pol.EffectiveDate = Convert.ToDateTime(rdr["EffectiveDate"]); pol.ExpirationDate = Convert.ToDateTime(rdr["ExpirationDate"]); pol.IssuingCompanyLookupCode = rdr["LookupCode"].ToString(); pol.StatusCode = rdr["CdLineStatusCode"].ToString(); pol.PolicyTypeCode = "BLIA"; pol.Description = "Commercial General Liability/PAL/Special Events"; pol.LineTypeCode = "BLIA"; pol.IssuingLocationCode = rdr["CdStateCodeIssuing"].ToString(); pol.AgencyCode = rdr["AgencyCode"].ToString(); pol.BranchCode = rdr["BranchCode"].ToString(); pol.DepartmentCode = rdr["DepartmentCode"].ToString(); pol.ProfitCenterCode = rdr["ProfitCenterCode"].ToString(); pol.PolicyNumber = rdr["PolicyNumber"].ToString() + "SDK"; IPolicyID = EpicSDKClient.Insert_Policy(oMessageHeader, pol); } } else { IPolicyID = 0; } rdr.Close(); return(IPolicyID); }