Example #1
0
        private List <ResultLicenceIDResponse> DisplayLicenseDisc(RiskDetailModel riskDetailModel, string parterToken)
        {
            // List<ResultLicenceIDResponse> list = new List<ResultLicenceIDResponse>();

            ObjToken = IcServiceobj.getToken();
            if (ObjToken != null)
            {
                parternToken = ObjToken.Response.PartnerToken;
            }


            ResultLicenceIDRootObject quoteresponseResult = IcServiceobj.LICResult(riskDetailModel.LicenseId, parternToken);

            if (quoteresponseResult != null && quoteresponseResult.Response.Message.Contains("Partner Token has expired"))
            {
                ObjToken = IcServiceobj.getToken();
                if (ObjToken != null)
                {
                    parternToken = ObjToken.Response.PartnerToken;
                    //  quoteresponse = IcServiceobj.RequestQuote(parternToken, RegistrationNo, suminsured, make, model, PaymentTermId, VehicleYear, CoverTypeId, VehicleUsage, "", (CustomerModel)customerInfo); // uncomment this line
                    quoteresponseResult = IcServiceobj.LICResult(riskDetailModel.LicenseId, parternToken);
                }
            }

            if (quoteresponseResult.Response != null)
            {
                licenseDiskList.Add(quoteresponseResult.Response);
            }

            //
            return(licenseDiskList);
        }
        private void GetVrnLicenseAndInsurace(string vrn)
        {
            vrn = "AAZ1001";
            VehicleDetails vehicleDetails = GetVehicelDetials(vrn);

            if (vehicleDetails != null)
            {
                IcServiceobj = new ICEcashService();
                ObjToken     = IcServiceobj.getToken();
                parternToken = ObjToken.Response.PartnerToken;
            }

            if (vehicleDetails != null && vehicleDetails.LicenseId != null)
            {
                ObjToken = IcServiceobj.getToken();
                if (ObjToken != null)
                {
                    parternToken = ObjToken.Response.PartnerToken;
                }

                ResultLicenceIDRootObject quoteresponseResult = IcServiceobj.LICResult(vehicleDetails.LicenseId, parternToken);
                if (quoteresponseResult.Response != null)
                {
                    lblRegNum.Text = quoteresponseResult.Response.VRN;
                }
            }
        }
Example #3
0
        private List <ResultLicenceIDResponse> DisplayLicenseOnly(RiskDetailModel riskDetailModel, string parterToken) // only for license
        {
            // List<ResultLicenceIDResponse> list = new List<ResultLicenceIDResponse>();

            ResultLicenceIDRootObject quoteresponseResult = IcServiceobj.LICResult(riskDetailModel.LicenseId, parternToken);

            //TPILICResult

            if (quoteresponseResult != null && (quoteresponseResult.Response.Message.Contains("Partner Token has expired") || quoteresponseResult.Response.Message.Contains("Invalid Partner Token")))
            {
                ObjToken = IcServiceobj.getToken();
                if (ObjToken != null)
                {
                    parternToken = ObjToken.Response.PartnerToken;
                    Service_db.UpdateToken(ObjToken);
                    //  quoteresponse = IcServiceobj.RequestQuote(parternToken, RegistrationNo, suminsured, make, model, PaymentTermId, VehicleYear, CoverTypeId, VehicleUsage, "", (CustomerModel)customerInfo); // uncomment this line
                    quoteresponseResult = IcServiceobj.LICResult(riskDetailModel.LicenseId, parternToken);
                }
            }

            if (quoteresponseResult != null && quoteresponseResult.Response != null)
            {
                licenseDiskList.Add(quoteresponseResult.Response);

                if (quoteresponseResult.Response.LicenceCert == null)
                {
                    //MessageBox.Show("Pdf not found for this  certificate.");
                    MyMessageBox.ShowBox("Pdf not found for this  certificate.", "Message");
                    pictureBox2.Visible = false;
                    return(licenseDiskList);
                }

                this.Close();
                CertificateSerialForm obj = new CertificateSerialForm(riskDetailModel, parternToken, quoteresponseResult.Response.LicenceCert);
                obj.Show();
            }
            //
            return(licenseDiskList);
        }
Example #4
0
        private void btnLicSave_Click(object sender, EventArgs e)
        {
            checkVRNwithICEcashResponse response = new checkVRNwithICEcashResponse();

            ObjToken = objfrmQuote.CheckParterTokenExpire();
            if (ObjToken != null)
            {
                parternToken = ObjToken.Response.PartnerToken;
            }

            List <VehicleLicQuote> obj = new List <VehicleLicQuote>();

            //if (objlistRisk != null && objlistRisk.Count > 0)
            //{
            //foreach (var item in objlistRisk)
            //{
            obj.Add(new VehicleLicQuote
            {
                VRN          = txtLicVrn.Text,
                IDNumber     = "ABCDEFGHIJ1",
                ClientIDType = "1",
                LicFrequency = "3"
            });
            //}
            //}

            ResultRootObject quoteresponse = IcServiceobj.LICQuote(obj, ObjToken.Response.PartnerToken);

            response.result = quoteresponse.Response.Result;
            if (response.result == 0)
            {
                response.message = quoteresponse.Response.Quotes[0].Message;
            }
            else
            {
                if (quoteresponse.Response.Quotes != null)
                {
                    List <VehicleLicQuoteUpdate> objLicQuoteUpdate = new List <VehicleLicQuoteUpdate>();
                    foreach (var item in quoteresponse.Response.Quotes.ToList())
                    {
                        objLicQuoteUpdate.Add(new VehicleLicQuoteUpdate
                        {
                            PaymentMethod  = Convert.ToInt32("1"),
                            Status         = "1",
                            DeliveryMethod = Convert.ToInt32("1"),
                            LicenceID      = Convert.ToInt32(item.LicenceID)
                        });
                    }
                    ResultRootObject quoteresponseNew = IcServiceobj.LICQuoteUpdate(objLicQuoteUpdate, ObjToken.Response.PartnerToken);
                    response.result = quoteresponseNew.Response.Result;
                    if (response.result == 0)
                    {
                        response.message = quoteresponse.Response.Quotes[0].Message;
                    }

                    else
                    {
                        if (quoteresponse.Response.Quotes != null)
                        {
                            var LicenceID = quoteresponse.Response.Quotes[0].LicenceID;
                            ResultRootObject quoteresponseResult = IcServiceobj.LICResult(LicenceID, ObjToken.Response.PartnerToken);
                        }
                    }
                }
            }
        }