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 txtCertificateSerialNumber_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { frmLicence quotObj = new frmLicence(); quotObj.CertificateNumber = txtCertificateSerialNumber.Text; var response = ICEcashService.LICCertConf(RiskDetailModel, ParternToken, txtCertificateSerialNumber.Text); if (response != null && response.Response.Message.Contains("Partner Token has expired")) { ObjToken = IcServiceobj.getToken(); ParternToken = ObjToken.Response.PartnerToken; Service_db.UpdateToken(ObjToken); response = ICEcashService.LICCertConf(RiskDetailModel, ParternToken, txtCertificateSerialNumber.Text); } MessageBox.Show(response.Response.Message); this.Close(); Form1 obj = new Form1(); obj.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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; } } }
//uncomment after getting response from icecash private List <ResultLicenceIDResponse> DisplayLicenseDisc(RiskDetailModel riskDetailModel, string parterToken) { // List<ResultLicenceIDResponse> list = new List<ResultLicenceIDResponse>(); // ResultLicenceIDRootObject quoteresponseResult = IcServiceobj.LICResult(riskDetailModel.LicenseId, parternToken); ResultLicenceIDRootObject quoteresponseResult = ICEcashService.TPILICResult(riskDetailModel, 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 = ICEcashService.TPILICResult(riskDetailModel, 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); }
private void txtCertificateSerialNumber_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (valatedSerialNumber(txtCertificateSerialNumber.Text)) { //else //{ // MessageBox.Show("Please Eneter the correct Serial Number", "Error"); //} frmLicence quotObj = new frmLicence(); quotObj.CertificateNumber = txtCertificateSerialNumber.Text; var response = ICEcashService.LICCertConf(RiskDetailModel, ParternToken, txtCertificateSerialNumber.Text); if (response != null && response.Response.Message.Contains("Partner Token has expired")) { ObjToken = IcServiceobj.getToken(); ParternToken = ObjToken.Response.PartnerToken; Service_db.UpdateToken(ObjToken); response = ICEcashService.LICCertConf(RiskDetailModel, ParternToken, txtCertificateSerialNumber.Text); } CertSerialNoDetailModel model = new CertSerialNoDetailModel(); model.VehicleId = RiskDetailModel.Id; model.CertSerialNo = txtCertificateSerialNumber.Text; SaveCertSerialNum(model); MessageBox.Show(response.Response.Message); this.Close(); Form1 obj = new Form1(); obj.Show(); } else { MessageBox.Show("Please Eneter the correct Serial Number", "Error"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }