Example #1
0
        public dynamic GetSpandanaDepartment(SpandanaInputdata objinput)
        {
            try
            {
                var druflag = "?ruFlag=" + objinput.ruFlag;

                var data = new EncryptDecrypt().GetspandanaData(sapandanaurl.depturl + druflag, objinput.token);

                dynamic objdata = JsonConvert.DeserializeObject <dynamic>(data);

                return(objdata);
            }
            catch (Exception ex)
            {
                Common_Revenue_Error(ex.Message.ToString(), "depturl", "2");
                string mappath   = HttpContext.Current.Server.MapPath("SpandanaExceptionLogs");
                Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, "Error From GetSpandanaDepartment:" + ex.Message.ToString()));
                throw ex;
            }
        }
Example #2
0
        public dynamic getkeywordsubsubject(SpandanaInputdata objinput)
        {
            try
            {
                var druflag = "?ruFlag=" + objinput.ruFlag;


                var data = new EncryptDecrypt().GetspandanaData(sapandanaurl.searchkeywordurl + druflag, objinput.token);

                dynamic objdata = JsonConvert.DeserializeObject <dynamic>(data);

                return(objdata);
            }
            catch (Exception ex)
            {
                Common_Revenue_Error(ex.Message.ToString(), "https://www.spandana.ap.gov.in/api/ExternalUser/GetKeywordSubSubjectsrdurl", "2");
                string mappath   = HttpContext.Current.Server.MapPath("SpandanaExceptionLogs");
                Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, "Error From getkeywordsubsubject:" + ex.Message.ToString()));
                throw ex;
            }
        }
        public IHttpActionResult GetSpandanaDepartments(dynamic data)
        {
            string value = token_gen.Authorize_aesdecrpty(data);

            try
            {
                //string value = JsonConvert.SerializeObject(data);
                SpandanaInputdata rootobj = JsonConvert.DeserializeObject <SpandanaInputdata>(value);

                if (rootobj.ftype == "1")            //departments
                {
                    return(Ok(Revenuehel.GetSpandanaDepartment(rootobj)));
                }
                else if (rootobj.ftype == "2")                 //subject
                {
                    return(Ok(Revenuehel.Getsubject(rootobj)));
                }
                else if (rootobj.ftype == "3")                 // sub subject
                {
                    return(Ok(Revenuehel.GetSubSubject(rootobj)));
                }
                else if (rootobj.ftype == "4")                //search keyword
                {
                    return(Ok(Revenuehel.getkeywordsubsubject(rootobj)));
                }
                else
                {
                    return(Ok(Revenuehel.GetSpandanaDepartment(rootobj)));
                }
            }
            catch (Exception ex)
            {
                CatchData.Status = "Failure";
                CatchData.Reason = CommonSPHel.ThirdpartyMessage;
                return(Ok(CatchData));
            }
        }