Exemple #1
0
        static public string TestPolicy(PolicyDocumentEntity policyDoc, QueryEntity cie)
        {
            xmlGenerate gen     = new xmlGenerate();
            string      request = gen.generate(cie);
            string      policy  = gen.generate(policyDoc);

            string res = string.Empty;

            try
            {
#if REMOTE_SERVICE
                policyService.TestPolicy policyService = new PolicyBuilder.policyService.TestPolicy();
                res = policyService.Test(policy, request);
#else
                policyShimLib.TestPolicyClass tpc = new policyShimLib.TestPolicyClass();
                res = tpc.Test(policy, request);
#endif
            }
            catch (Exception ex)
            {
                res = "!!service down!! - try refresh " + ex.Message;
            }

            return(res);
        }
        public string GetDocumentXML(int docId)
        {
            string xml = string.Empty;

            PolicyDocumentEntity pde = new PolicyDocumentEntity(docId);
            xmlGenerate gen = new xmlGenerate();
            xml = gen.generate(pde);

            return xml;
        }
Exemple #3
0
        public string GetDocumentXML(int docId)
        {
            string xml = string.Empty;

            PolicyDocumentEntity pde = new PolicyDocumentEntity(docId);
            xmlGenerate          gen = new xmlGenerate();

            xml = gen.generate(pde);

            return(xml);
        }
        public static string TestPolicy(PolicyDocumentEntity policyDoc, QueryEntity cie)
        {
            xmlGenerate gen = new xmlGenerate();
            string request = gen.generate(cie);
            string policy = gen.generate(policyDoc);

            string res = string.Empty;
            try
            {
            #if REMOTE_SERVICE
                policyService.TestPolicy policyService = new PolicyBuilder.policyService.TestPolicy();
                res = policyService.Test(policy, request);
            #else
                policyShimLib.TestPolicyClass tpc = new policyShimLib.TestPolicyClass();
                res = tpc.Test(policy, request);
            #endif
            }
            catch (Exception ex)
            {
                res = "!!service down!! - try refresh " + ex.Message;
            }

            return res;
        }
Exemple #5
0
        public ActionResult DownloadPolicyDoc(policyData vData, int id)
        {
            vData.PolicyDocument = new PolicyDocumentEntity(id);

            string      path       = string.Format("~/exports/{0}.xml", Path.GetRandomFileName());
            string      mappedPath = Server.MapPath(path);
            xmlGenerate gen        = new xmlGenerate();
            string      xml        = gen.generate(vData.PolicyDocument);

            StreamWriter sw = new StreamWriter(mappedPath);

            sw.Write(xml);
            sw.Close();

            return(File(mappedPath, "text/xml", vData.PolicyDocument.Name + ".xml"));
        }
        public ActionResult DownloadPolicyDoc(policyData vData, int id)
        {
            vData.PolicyDocument = new PolicyDocumentEntity(id);

            string path = string.Format("~/exports/{0}.xml", Path.GetRandomFileName());
            string mappedPath = Server.MapPath(path);
            xmlGenerate gen = new xmlGenerate();
            string xml = gen.generate(vData.PolicyDocument);

            StreamWriter sw = new StreamWriter(mappedPath);
            sw.Write(xml);
            sw.Close();

            return File(mappedPath, "text/xml", vData.PolicyDocument.Name + ".xml");
        }