public dynamic GetClaimStatus(Datum oj) { dynamic obj = new ExpandoObject(); SERPSPHelper SERPsphel = new SERPSPHelper(); try { SerpBima.vvclaimstatus serpbima = new SerpBima.vvclaimstatus(); var data = serpbima.checkcbclaim("CIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL", oj.claimuid); ClaimObject objroot = JsonConvert.DeserializeObject <ClaimObject>(data); var sts = objroot.Data[0].Sts; if (sts != null && sts != "") { obj.Status = "Success"; obj.Reason = ""; obj.Details = objroot; obj.TrackDetails = objroot.Data[0].TrackingData; obj.ClaimStatus = sts; } else { obj.Status = "Failure"; obj.Reason = "No Data Found"; } } catch (WebException wex) { string mappath = HttpContext.Current.Server.MapPath("BimaClaimStatusLogs"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, "Error from GetClaimStatus API:" + wex.Message.ToString())); throw wex; } return(obj); }
public dynamic GetDistricts(Datum oj) { dynamic obj = new ExpandoObject(); SERPSPHelper SERPsphel = new SERPSPHelper(); try { ClaimRegistration.ClaimRegistration district = new ClaimRegistration.ClaimRegistration(); var data = district.GetDistricts("f0ebb6327edf9c44b"); ClaimObject objroot = JsonConvert.DeserializeObject <ClaimObject>(data); var sts = objroot.Data; if (sts != null) { obj.Status = "Success"; obj.Reason = ""; obj.Details = objroot.Data; } else { obj.Status = "Failure"; obj.Reason = "No Data Found"; } } catch (WebException wex) { string mappath = HttpContext.Current.Server.MapPath("BimaRegistrationLogs"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, "Error from GetDistricts API:" + wex.Message.ToString())); throw wex; } return(obj); }
public dynamic BimaRegistration(BimaRegistration oj) { dynamic obj = new ExpandoObject(); SERPSPHelper SERPsphel = new SERPSPHelper(); try { string incidentdate = Convert.ToDateTime(oj.Incident_Date).ToString("MM/dd/yyyy"); string accidentdate = Convert.ToDateTime(oj.Accident_Date).ToString("MM/dd/yyyy"); ClaimRegistration.ClaimRegistration bhimareg = new ClaimRegistration.ClaimRegistration(); var data = bhimareg.Insertclaimdata("f0ebb6327edf9c44b", oj.Uid, oj.Did, incidentdate, oj.Incident_Time, accidentdate, oj.Accident_Time, oj.Claimtype, oj.Cause, oj.CauseSubReason, oj.Nominee_Phone, oj.Nominee_Name, oj.Nom_Uid, oj.Incident_Type, oj.incident_Place, oj.Accident_Place, oj.Informer_Phone, oj.Informed_By, oj.Reg_User, oj.Remarks, oj.Street, oj.Door_Num, oj.Ward, oj.Village_Name, oj.Gram_Panchayat, oj.Mandal_Name, oj.EID, oj.Pol_Pincode, oj.Nom_EID, oj.Nom_Pincode, oj.VV_Name, oj.VV_Phone, oj.VS_id, oj.VS_Location, oj.VS_Panchayat, oj.EntryBy, oj.GSWS_ID); ClaimObject objroot = JsonConvert.DeserializeObject <ClaimObject>(data); var sts = objroot.Data; if (sts != null) { transactionModel objtrans = new transactionModel(); objtrans.TYPE = "2"; objtrans.TXN_ID = oj.GSWS_ID; objtrans.DEPT_ID = "3103"; objtrans.DEPT_TXN_ID = objroot.Data[0].claimuid; objtrans.BEN_ID = objroot.Data[0].Uid_Num; objtrans.STATUS_CODE = objroot.Data[0].Sts; objtrans.REMARKS = objroot.Data[0].Msg; DataTable dt = new transactionHelper().transactionInsertion(objtrans); if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString() == "1") { obj.Status = "Success"; obj.Reason = objroot.Data[0].Msg; obj.Details = objroot.Data; obj.Registrationsts = objroot.Data[0].Sts; } else { obj.Status = "Success"; obj.Reason = objroot.Data[0].Msg; obj.Details = objroot.Data; obj.Registrationsts = objroot.Data[0].Sts; } } else { obj.Status = "Failure"; obj.Reason = "No Data Found"; } } catch (WebException wex) { string mappath = HttpContext.Current.Server.MapPath("BimaRegistrationLogs"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, "Error from BimaRegistration API:" + wex.Message.ToString())); throw wex; } return(obj); }