Example #1
0
        public dynamic GetEchallanStatus(EchallanModel obj)
        {
            try
            {
                var data = GetEchallansData("https://echallanapp.com/api/RTG/searchRc/" + obj.VehicleNum, "82185fc39c0201c8513041f288936a8a8c4a09707bf55bb0adc9207b42d22872");


                return(JsonConvert.DeserializeObject <dynamic>(data));
            }
            catch (Exception ex)
            {
                dynamic obj1      = new ExpandoObject();
                string  mappath   = HttpContext.Current.Server.MapPath("HomeExceptionLogs");
                Task    WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath, "GetPropertyStatus API:" + ex.Message.ToString()));

                obj1.status = "Failure";
                obj1.Data   = "";
                obj1.Reason = CommonSPHel.ThirdpartyMessage;
                return(obj);
            }
        }
        public IHttpActionResult EchallanStatus(dynamic data)
        {
            string jsondata = token_gen.Authorize_aesdecrpty(data);

            try
            {
                EchallanModel obj = JsonConvert.DeserializeObject <EchallanModel>(jsondata);
                if (Utils.IsAlphaNumeric(obj.VehicleNum))
                {
                    return(Ok(_lhms.GetEchallanStatus(obj)));
                }
                else
                {
                    RData.status = 102;
                    RData.Reason = "Error Occured While Getting Data.";
                    return(Ok(RData));
                }
            }
            catch (Exception ex)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
            }
        }