public bool CheckPolicyNumberValidity(ClaimRequest_ML ml)
        {
            try
            {
                var DataDic = new Dictionary<string, object>
                {
                    {"@policy_id",ml.PolicyId}
                };

                DBAccessController db = new DBAccessController();
                var dt = db.RetriveRecordsWithPara(StoredProcedures.sp_GetPolicyDetails, DataDic);
                if (dt.Rows.Count > 0)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception)
            {
                
                throw;
            }
        }
 public int AddClaimRequest(ClaimRequest_ML ml)
 {
     if (CheckPolicyNumberValidity(ml))
     {
         try
         {
             var DataDic = new Dictionary<string, object>
         {
             {"@PolicyId", ml.PolicyId},
             {"@Latitude",ml.Latitude},
             {"@Longitude",ml.Longitude},
             {"@status",ml.Status},
             {"@submittime",ml.SubmitTime}
         };
             new DBAccessController().InsertRecord(StoredProcedures.sp_AddClaimRequest, DataDic);
             return 0;
         }
         catch (System.Exception)
         {
             return 2;
         }
     }
     else
     {
         return 1;
     }
     
     
 }
        public ClaimRequest_ML CreateClaimRequestObject(string claimRequest)
        {
            try
            {
                //var obj = JObject.Parse(claimRequest);
                var jArray = JObject.Parse(claimRequest);
                var claimRequestObj = new ClaimRequest_ML(jArray["PolicyId"].ToString(), jArray["Latitude"].ToString(), jArray["Longitude"].ToString(), jArray["Status"].ToString(), DateTime.Now);               
                return claimRequestObj;
            }
            catch (Exception)
            {

                throw;
            }
        }
 public bool UpdateClaimRequest(ClaimRequest_ML ml)
 {
     try
     {
         var DataDic = new Dictionary<string, object>
         {
             {"@claimRequestId",ml.Id},
             {"@EmpId",ml.RespondEmployeeId},
             {"@status",ml.Status},
             {"@respondtime",ml.RespondTime}
         };
         new DBAccessController().InsertRecord(StoredProcedures.sp_UpdateClaimRequest, DataDic);
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
        protected void btnResponded_ServerClick(object sender, EventArgs e)
        {
            try
            {
                var ml = new ClaimRequest_ML()
                {
                    Id=Convert.ToInt32(id.Text),
                    RespondEmployeeId=3,
                    Status = "Responded",
                    RespondTime = DateTime.Now
                };
                var result = new ClaimRequest_BL().UpdateClaimRequest(ml);

                if (result)
                {
                    GetClaimRequests();
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "script", "<script type='text/javascript'>$( document ).ready(function() { $('#DetailsModal').modal('hide')});</script>", false);
                }
            }
            catch (Exception)
            {
                
                throw;
            }
        }