Esempio n. 1
0
 public Ac4yXMLObjectPersistentService(string sName, string newBaseName, string uName, string pwd)
 {
     serverName = sName;
     baseName   = newBaseName;
     userName   = uName;
     password   = pwd;
     _Ac4yXMLObjectEntityMethods = new Ac4yXMLObjectEntityMethods(sName, newBaseName, uName, pwd);
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello adfgarfdvWorld!");
            Program program = new Program();

            try
            {
                string[] files =
                    Directory.GetFiles("d:\\Server\\Visual_studio\\output_Xmls\\StorProcs\\", "*.xml", SearchOption.TopDirectoryOnly);

                string[] tablak =
                    Directory.GetFiles("d:\\Server\\Visual_studio\\output_Xmls\\arntesztTablak\\", "*.xml", SearchOption.TopDirectoryOnly);

                Console.WriteLine(files.Length);
                conn.Open();

                foreach (var tabla in tablak)
                {
                    string _tablaFilename = Path.GetFileNameWithoutExtension(tabla);
                    Console.WriteLine(_tablaFilename);
                    Tabla       tablaObj       = new Tabla();
                    TablaOszlop TablaOszlopObj = new TablaOszlop();

                    string textFile = Path.Combine("d:\\Server\\Visual_studio\\output_Xmls\\arntesztTablak\\", _tablaFilename + ".xml");

                    string text = File.ReadAllText(textFile);
                    tablaObj = (Tabla)program.deser(text, typeof(Tabla));
                    string originName = tablaObj.Megnevezes;
                    Ac4yXMLObjectEntityMethods ac4YXMLObjectEntityMethods = new Ac4yXMLObjectEntityMethods(APPSETTINGS_SERVER, APPSETTINGS_DATABASE, APPSETTINGS_USER, APPSETTINGS_PASSWORD);
                    Ac4yObjectObjectService    ac4YObjectObjectService    = new Ac4yObjectObjectService(conn);

                    foreach (TablaOszlop oszlop in tablaObj.TablaOszlopLista)
                    {
                        SetByNamesResponse response = ac4YObjectObjectService.SetByNames(
                            new SetByNamesRequest()
                        {
                            TemplateName = "tábla oszlop", Name = oszlop.Kod
                        }
                            );

                        string argText = program.GetAsXml(oszlop);
                        ac4YXMLObjectEntityMethods.addNew(new Ac4yXMLObject()
                        {
                            serialization = argText, GUID = response.Ac4yObjectHome.GUID
                        });

                        /*
                         * Console.WriteLine(oszlop.Kod);
                         * Ac4yAssociationObjectService.SetByNamesResponse setByNamesResponse =
                         *     new Ac4yAssociationObjectService(conn).SetByNames(
                         *         new Ac4yAssociationObjectService.SetByNamesRequest() { originTemplateName = "tábla", originName = originName, targetTemplateName = "tábla oszlop", targetName = oszlop.Kod, associationPathName = "tábla.oszlop" }
                         *     );
                         *
                         */
                    }
                }

                foreach (var _file in files)
                {
                    string _filename = Path.GetFileNameWithoutExtension(_file);
                    Console.WriteLine(_filename);
                    TaroltEljaras           taroltEljaras    = new TaroltEljaras();
                    TaroltEljarasArgumentum taroltEljarasArg = new TaroltEljarasArgumentum();


                    string textFile = Path.Combine("d:\\Server\\Visual_studio\\output_Xmls\\StorProcs\\", _filename + ".xml");

                    string text = File.ReadAllText(textFile);
                    taroltEljaras = (TaroltEljaras)program.deser(text, typeof(TaroltEljaras));
                    string originName = taroltEljaras.Megnevezes;
                    Ac4yXMLObjectEntityMethods ac4YXMLObjectEntityMethods = new Ac4yXMLObjectEntityMethods(APPSETTINGS_SERVER, APPSETTINGS_DATABASE, APPSETTINGS_USER, APPSETTINGS_PASSWORD);
                    Ac4yObjectObjectService    ac4YObjectObjectService    = new Ac4yObjectObjectService(conn);

                    foreach (TaroltEljarasArgumentum arg in taroltEljaras.ArgumentumLista)
                    {/*
                      * SetByNamesResponse response = ac4YObjectObjectService.SetByNames(
                      *     new SetByNamesRequest() { TemplateName = "tárolt eljárás argumentum", Name = arg.BelsoNev }
                      *     );
                      *
                      * string argText = program.GetAsXml(arg);
                      * ac4YXMLObjectEntityMethods.addNew(new Ac4yXMLObject() { serialization = argText, GUID = response.Ac4yObjectHome.GUID });
                      *
                      * /* Console.WriteLine(arg.BelsoNev);
                      *  Ac4yAssociationObjectService.SetByNamesResponse setByNamesResponse =
                      *      new Ac4yAssociationObjectService(conn).SetByNames(
                      *          new Ac4yAssociationObjectService.SetByNamesRequest() { originTemplateName = "tárolt eljárás", originName = originName, targetTemplateName = "tárolt eljárás argumentum", targetName = arg.BelsoNev, associationPathName = "tárolt eljárás.Argumentum" }
                      *      );*/
                    }
                }
            }catch (Exception exception)
            {
                Console.WriteLine(exception.Message);
            }
        }