Exemple #1
0
        public dynamic GetAPEPDCLServiceStatus_helper(APEPDCLStatus root)
        {
            dynamic obj = new ExpandoObject();

            try
            {
                if (Utils.IsAlphaNumeric(root.REQUEST_NO) && Utils.IsAlphaNumeric(root.MOBILE))
                {
                    var val  = PostData("http://59.144.184.77:8085/EPDCL_GSWS/rest/newConnectionStatus", root);
                    var data = GetSerialzedData <dynamic>(val);
                    obj.Status  = 100;
                    obj.Reason  = "Data Loaded Successfully.";
                    obj.Details = data;
                }
                else
                {
                    obj.Status = 102;
                    obj.Reason = "Error Occured While Getting Status";
                }
                return(obj);
            }
            catch (Exception ex)
            {
                Common_Energy_Error(ex.Message.ToString(), "http://59.144.184.77:8085/EPDCL_GSWS/rest/newConnectionStatus", "2");
                obj.Status = 102;
                obj.Reason = ThirdpartyMessage;
                return(obj);
            }
        }
        public IHttpActionResult GetAPEPDCLServiceStatus(dynamic data)
        {
            string value = token_gen.Authorize_aesdecrpty(data);

            try
            {
                //string value = JsonConvert.SerializeObject(data);
                APEPDCLStatus rootobj = JsonConvert.DeserializeObject <APEPDCLStatus>(value);
                return(Ok(enerhel.GetAPEPDCLServiceStatus_helper(rootobj)));
            }
            catch (Exception ex)
            {
                CatchData.Status = 102;
                CatchData.Reason = EnergyHelper.ThirdpartyMessage;
                return(Ok(CatchData));
            }
        }