Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public IHttpActionResult BimaRegistration(dynamic data)
        {
            string value = token_gen.Authorize_aesdecrpty(data);

            try
            {
                //string value = JsonConvert.SerializeObject(data);
                BimaRegistration rootobj = JsonConvert.DeserializeObject <BimaRegistration>(value);
                return(Ok(SERPhel.BimaRegistration(rootobj)));
            }
            catch (Exception ex)
            {
                CatchData.Status = "Failure";
                CatchData.Reason = SERPHelper.ThirdpartyMessage;
                return(Ok(CatchData));
            }
        }