diff --git a/ELT.Client/Connected Services/ELTOsago/Reference.cs b/ELT.Client/Connected Services/ELTOsago/Reference.cs index 14a9bd7..510c7d1 100644 --- a/ELT.Client/Connected Services/ELTOsago/Reference.cs +++ b/ELT.Client/Connected Services/ELTOsago/Reference.cs @@ -3586,64 +3586,64 @@ namespace ELTOsago { [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=0)] - public ELTOsago.AuthInfo AuthInfo; + public ELTOsago.AuthInfo AuthInfo { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=1)] - public string TrafficSource; + public string TrafficSource { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=2)] - public int UW3; + public int UW3 { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=3)] - public string InsuranceCompany; + public string InsuranceCompany { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=4)] - public int InsurerType; + public int InsurerType { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=5)] - public int OwnerType; + public int OwnerType { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=6)] - public int ContractOptionId; + public int ContractOptionId { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=7)] - public int ContractStatusId; + public int ContractStatusId { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=8)] - public int Analytics; + public int Analytics { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=9)] - public ELTOsago.PreviousPolicy PreviousPolicy; + public ELTOsago.PreviousPolicy PreviousPolicy { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=10)] - public string UsagePlace; + public string UsagePlace { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=11)] - public int TSToRegistrationPlace; + public int TSToRegistrationPlace { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=12)] - public System.DateTime ContractBeginDate; + public System.DateTime ContractBeginDate { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=13)] - public int Duration; + public int Duration { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=14)] - public ELTOsago.OSAGOFullCalculationCarInfo CarInfo; + public ELTOsago.OSAGOFullCalculationCarInfo CarInfo { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=15)] - public bool GrossViolations; + public bool GrossViolations { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=16)] - public ELTOsago.PhysicalPerson Insurer; + public ELTOsago.PhysicalPerson Insurer { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=17)] - public ELTOsago.PhysicalPerson Owner; + public ELTOsago.PhysicalPerson Owner { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=18)] - public int DriversCount; + public int DriversCount { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=19)] - public ELTOsago.FullDriver[] FullDriversInfo; + public ELTOsago.FullDriver[] FullDriversInfo { get; set; } public OSAGOFullCalculationRequest() { @@ -3763,121 +3763,121 @@ namespace ELTOsago { [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=0)] - public ELTOsago.AuthInfo AuthInfo; + public ELTOsago.AuthInfo AuthInfo { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=1)] - public string NumCalc; + public string NumCalc { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=2)] - public string Login; + public string Login { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=3)] - public string TrafficSource; + public string TrafficSource { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=4)] - public int UW3; + public int UW3 { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=5)] - public string InsuranceCompany; + public string InsuranceCompany { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=6)] - public int InsurerType; + public int InsurerType { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=7)] - public int OwnerType; + public int OwnerType { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=8)] - public int ContractOptionId; + public int ContractOptionId { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=9)] - public int ContractStatusId; + public int ContractStatusId { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=10)] - public string UsagePlace; + public string UsagePlace { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=11)] - public int TSToRegistrationPlace; + public int TSToRegistrationPlace { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=12)] - public ELTOsago.TSType TSType; + public ELTOsago.TSType TSType { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=13)] - public bool UseWithTrailer; + public bool UseWithTrailer { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=14)] - public double VehiclePower; + public double VehiclePower { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=15)] - public int Duration; + public int Duration { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=16)] - public int DriversCount; + public int DriversCount { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=17)] - public ELTOsago.Driver[] Drivers; + public ELTOsago.Driver[] Drivers { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=18)] - public string BonusMalus; + public string BonusMalus { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=19)] - public string KBM; + public string KBM { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=20)] - public bool GrossViolations; + public bool GrossViolations { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=21)] - public string VehicleYear; + public string VehicleYear { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=22)] - public string Mark; + public string Mark { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=23)] - public string Model; + public string Model { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=24)] - public ELTOsago.Modification Modification; + public ELTOsago.Modification Modification { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=25)] - public string MarkPTS; + public string MarkPTS { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=26)] - public string ModelPTS; + public string ModelPTS { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=27)] - public ELTOsago.Vehicle Vehicle; + public ELTOsago.Vehicle Vehicle { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=28)] - public ELTOsago.RegDoc RegDoc; + public ELTOsago.RegDoc RegDoc { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=29)] - public ELTOsago.TechnicalInspection TechnicalInspection; + public ELTOsago.TechnicalInspection TechnicalInspection { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=30)] - public int PurposeUse; + public int PurposeUse { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=31)] - public bool IsRental; + public bool IsRental { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=32)] - public ELTOsago.PreviousPolicy PreviousPolicy; + public ELTOsago.PreviousPolicy PreviousPolicy { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=33)] - public ELTOsago.PhysicalPerson Insurer; + public ELTOsago.PhysicalPerson Insurer { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=34)] - public ELTOsago.PhysicalPerson Owner; + public ELTOsago.PhysicalPerson Owner { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=35)] - public ELTOsago.FullDriver[] FullDriversInfo; + public ELTOsago.FullDriver[] FullDriversInfo { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=36)] - public System.DateTime ContractBegin; + public System.DateTime ContractBegin { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=37)] - public System.DateTime ContractEnd; + public System.DateTime ContractEnd { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=38)] - public System.DateTime ContractSign; + public System.DateTime ContractSign { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=39)] [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] @@ -3904,13 +3904,13 @@ namespace ELTOsago public System.Nullable ThirdPeriodEnd; [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=45)] - public string PolicyNumber; + public string PolicyNumber { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=46)] - public ELTOsago.BSO BSO; + public ELTOsago.BSO BSO { get; set; } [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://elt-poisk.com/", Order=47)] - public ELTOsago.A7 A7; + public ELTOsago.A7 A7 { get; set; } public OSAGOSaveRequest() { diff --git a/ELT.Client/Managers/Insurance/OsagoManager.cs b/ELT.Client/Managers/Insurance/OsagoManager.cs index 60bdfb6..f19871c 100644 --- a/ELT.Client/Managers/Insurance/OsagoManager.cs +++ b/ELT.Client/Managers/Insurance/OsagoManager.cs @@ -45,7 +45,7 @@ namespace ELT.Client.Managers.Insurance if (string.IsNullOrEmpty(res.Error)) result.Add(companyId, res); } - catch (Exception) + catch (Exception ex) { } })); diff --git a/ELT/Controllers/InsuranceController.cs b/ELT/Controllers/InsuranceController.cs index 965016f..b5bd187 100644 --- a/ELT/Controllers/InsuranceController.cs +++ b/ELT/Controllers/InsuranceController.cs @@ -4,6 +4,8 @@ using ELT.Client.Models.Insurance.Request; using ELTKasko; using ELTOsago; using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; namespace ELT.Controllers { @@ -12,25 +14,27 @@ namespace ELT.Controllers public class InsuranceController : ControllerBase { [HttpPost("[action]")] - public ActionResult> CalculateKasko( + public ActionResult CalculateKasko( [FromBody] CalculateKaskoRequest calculateKaskoRequest) { var preRequestManager = new PreRequestManager(); var preRequestData = preRequestManager.GetPreRequestData(calculateKaskoRequest.Preparams); var kaskoManager = new KaskoManager(); - return kaskoManager.Calculate(calculateKaskoRequest, preRequestData); + var res = kaskoManager.Calculate(calculateKaskoRequest, preRequestData); + return JsonConvert.SerializeObject(res, new JsonSerializerSettings()); } [HttpPost("[action]")] - public ActionResult> CalculateOsago( + public ActionResult CalculateOsago( [FromBody] CalculateOsagoRequest calculateOsagoRequest) { var preRequestManager = new PreRequestManager(); var preRequestData = preRequestManager.GetPreRequestData(calculateOsagoRequest.Preparams); var osagoManager = new OsagoManager(); - return osagoManager.Calculate(calculateOsagoRequest, preRequestData); + var res = osagoManager.Calculate(calculateOsagoRequest, preRequestData); + return JsonConvert.SerializeObject(res, new JsonSerializerSettings()); } } } \ No newline at end of file