Ejemplo n.º 1
0
        public bool EndorsementPrecheck()
        {
            master.IsSessionAvailable();
            var userInfo = CommonMethods.GetUserDetails();
            var service  = CommonMethods.GetLogedInService();

            var req = new TravelEndorsementPreCheckRequest
            {
                DocNo = ddlTravelPolicies.SelectedIndex > 0 ? ddlTravelPolicies.SelectedItem.Text : string.Empty
            };

            var result = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                           <BKIC.SellingPoint.DTO.RequestResponseWrappers.TravelEndorsementPreCheckResponse>,
                                           BKIC.SellingPoint.DTO.RequestResponseWrappers.TravelEndorsementPreCheckRequest>
                             (BKIC.SellingPoint.DTO.Constants.TravelEndorsementURI.EndorsementPreCheck, req);

            if (result.StatusCode == 200 && result.Result.IsTransactionDone)
            {
                return(result.Result.IsAlreadyHave);
            }
            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Check the if the policy already have saved endorsement,if it is there don't allow to pass the new endorsement.
 /// </summary>
 /// <param name="request">Endorsement precheck request.</param>
 /// <returns>Returns there an endorsemnt with saved staus or not.</returns>
 public TravelEndorsementPreCheckResponse EndorsementPrecheck(TravelEndorsementPreCheckRequest request)
 {
     try
     {
         SqlParameter[] paras = new SqlParameter[]
         {
             new  SqlParameter("@docNo", request.DocNo),
             new SqlParameter("@type", Constants.Insurance.Travel)
         };
         List <SPOut> outParams = new List <SPOut>()
         {
             new SPOut()
             {
                 OutPutType = SqlDbType.Bit, ParameterName = "@IsAlreadyHaveEndorsement", Precision = 38, Scale = 3
             },
         };
         var      alreadyHave = false;
         object[] dataSet     = BKICSQL.GetValues(AdminSP.EndorsementPreCheck, paras, outParams);
         if (dataSet != null && dataSet[0] != null)
         {
             alreadyHave = string.IsNullOrEmpty(dataSet[0].ToString()) ? false : Convert.ToBoolean(dataSet[0].ToString());
         }
         return(new TravelEndorsementPreCheckResponse()
         {
             IsTransactionDone = true,
             IsAlreadyHave = alreadyHave,
             EndorsementNo = ""
         });
     }
     catch (Exception ex)
     {
         return(new TravelEndorsementPreCheckResponse()
         {
             IsTransactionDone = false,
             TransactionErrorMessage = ex.Message
         });
     }
 }