public int GetPolicyRenewalCount() { master.IsSessionAvailable(); var userInfo = CommonMethods.GetUserDetails(); var service = CommonMethods.GetLogedInService(); int renewalCount = 0; var motorreq = new BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyMotorRequest { AgentCode = userInfo.AgentCode, Agency = userInfo.Agency, AgentBranch = userInfo.AgentBranch, IncludeHIR = false, IsRenewal = false, DocumentNo = txtMotorEndorsementSearch.Text.Trim() }; //Get PolicyNo by Agency var motorPolicies = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper <BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyMotorPolicyResponse>, BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyMotorRequest> (BKIC.SellingPoint.DTO.Constants.MotorURI.GetMotorPoliciesEndorsement, motorreq); if (motorPolicies.StatusCode == 200 && motorPolicies.Result.IsTransactionDone && motorPolicies.Result.AgencyMotorPolicies.Count > 0) { renewalCount = motorPolicies.Result.AgencyMotorPolicies[0].RenewalCount; } return(renewalCount); }
public RR.AgencyMotorPolicyResponse GetMotorAgencyPolicy(RR.AgencyMotorRequest request) { try { if (ModelState.IsValid) { BLO.AgencyMotorRequest motor = _mapper.Map <RR.AgencyMotorRequest, BLO.AgencyMotorRequest>(request); BLO.AgencyMotorPolicyResponse result = _motorInsuranceRepository.GetMotorAgencyPolicy(motor); return(_mapper.Map <BLO.AgencyMotorPolicyResponse, RR.AgencyMotorPolicyResponse>(result)); } else { var message = string.Join(" | ", ModelState.Values.SelectMany(v => v.Errors).Select(e => e.ErrorMessage)); return(new RR.AgencyMotorPolicyResponse() { IsTransactionDone = false, TransactionErrorMessage = message }); } } catch (Exception ex) { return(new RR.AgencyMotorPolicyResponse { IsTransactionDone = true, TransactionErrorMessage = ex.Message }); } }
protected void Changed_CPR(object sender, EventArgs e) { try { master.IsSessionAvailable(); var userInfo = CommonMethods.GetUserDetails(); var service = CommonMethods.GetLogedInService(); var motorreq = new BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyMotorRequest { AgentCode = userInfo.AgentCode, Agency = userInfo.Agency, AgentBranch = userInfo.AgentBranch, CPR = ddlCPR.SelectedIndex > 0 ? ddlCPR.SelectedItem.Text.Trim() : string.Empty, Type = Constants.Motor, isEndorsement = true }; //Get PolicyNo by Agency var motorPolicies = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper <BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyMotorPolicyResponse>, BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyMotorRequest> (BKIC.SellingPoint.DTO.Constants.MotorURI.GetMotorPoliciesByTypeByCPR, motorreq); ddlMotorPolicies.Items.Clear(); if (motorPolicies.StatusCode == 200 && motorPolicies.Result.IsTransactionDone && motorPolicies.Result.AgencyMotorPolicies.Count > 0) { policyList = motorPolicies.Result.AgencyMotorPolicies; ddlMotorPolicies.DataSource = motorPolicies.Result.AgencyMotorPolicies; ddlMotorPolicies.DataTextField = "DOCUMENTNO"; ddlMotorPolicies.DataValueField = "DOCUMENTNO"; ddlMotorPolicies.DataBind(); ddlMotorPolicies.Items.Insert(0, new ListItem("--Please Select--", "none")); } Page_CustomValidate(); } catch (Exception ex) { //throw ex; } finally { master.ShowLoading = false; } }
public RR.AgencyMotorPolicyResponse GetMotorPoliciesByTypeByCPR(RR.AgencyMotorRequest request) { try { BLO.AgencyMotorRequest motor = _mapper.Map <RR.AgencyMotorRequest, BLO.AgencyMotorRequest>(request); BLO.AgencyMotorPolicyResponse result = _motorInsuranceRepository.GetMotorPoliciesByTypeByCPR(motor); return(_mapper.Map <BLO.AgencyMotorPolicyResponse, RR.AgencyMotorPolicyResponse>(result)); } catch (Exception ex) { return(new RR.AgencyMotorPolicyResponse { IsTransactionDone = false, TransactionErrorMessage = ex.Message }); } }
private void GetMotorPoliciesByCPR() { master.IsSessionAvailable(); var userInfo = CommonMethods.GetUserDetails(); var service = CommonMethods.GetLogedInService(); var motorreq = new BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyMotorRequest { AgentCode = userInfo.AgentCode, Agency = userInfo.Agency, AgentBranch = userInfo.AgentBranch, CPR = txtCPRSearch.Text.Trim(), Type = Constants.Motor, isEndorsement = true }; //Get PolicyNo by Agency var motorPolicies = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper <BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyMotorPolicyResponse>, BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyMotorRequest> (BKIC.SellingPoint.DTO.Constants.MotorURI.GetMotorPoliciesByTypeByCPR, motorreq); ddlMotorPolicies.Items.Clear(); if (motorPolicies.StatusCode == 200 && motorPolicies.Result.IsTransactionDone && motorPolicies.Result.AgencyMotorPolicies.Count > 0) { policyList = motorPolicies.Result.AgencyMotorPolicies; ddlMotorPolicies.DataSource = motorPolicies.Result.AgencyMotorPolicies; ddlMotorPolicies.DataTextField = "DOCUMENTNO"; ddlMotorPolicies.DataValueField = "DOCUMENTRENEWALNO"; ddlMotorPolicies.DataBind(); ddlMotorPolicies.Items.Insert(0, new ListItem("--Please Select--", "none")); } ClearControls(); }