示例#1
0
文件: Program.cs 项目: PricaMilos/RES
        static void Main(string[] args)
        {
            StringToJSONConverter stringToJSON = new StringToJSONConverter();
            string URL = "";

            while (true)
            {
                Console.WriteLine("Unesite URL: ");
                URL = Console.ReadLine();

                string jsonRequest = stringToJSON.Convert(URL);
                Console.WriteLine(jsonRequest);

                XNode xmlNode = JsonConvert.DeserializeXNode(jsonRequest, "Request");

                CommunicationBusService CBService = new CommunicationBusService(xmlNode);
                Console.WriteLine(CBService.Run(xmlNode));

                XElement element = xmlNode.Document.Element("Request");
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            StringToJSONConverter stringToJSON = new StringToJSONConverter();
            char   exit     = 'a';
            string URL      = "";
            bool   urlValid = false;
            string zahtev   = "";

            while (exit.ToString().ToUpper() != "X")
            {
                while (!urlValid)
                {
                    Console.WriteLine("Unesite URL: ");
                    URL      = Console.ReadLine();
                    zahtev   = stringToJSON.Convert(URL);
                    urlValid = true;
                }
                string jsonZahtev = stringToJSON.Convert(URL);
                Console.WriteLine(jsonZahtev);


                XNode xmlNode = JsonConvert.DeserializeXNode(jsonZahtev, "Zahtev");

                CommunicationBusService CBService = new CommunicationBusService(xmlNode);
                Console.WriteLine(CBService.Run(xmlNode));

                XElement element = xmlNode.Document.Element("Zahtev");
                Console.WriteLine(element.ToString());

                //Console.WriteLine(XMLToDBAdapter.XMLToSql(xmlNode));

                urlValid = false;
                //Izlaz
                Console.WriteLine("Unesite 'X' da izadjete iz aplikacije" + System.Environment.NewLine);
                exit = Console.ReadKey().KeyChar;
            }
        }