public List <string> WriteOutAc4yObjectNameList() { StringToPascalCase stringToPascalCase = new StringToPascalCase(); List <string> names = new List <string>(); ListInstanceByNameResponse listInstanceByNameResponse = new Ac4yObjectObjectService(sqlConnection).ListInstanceByName( new ListInstanceByNameRequest() { TemplateName = TemplateName } ); foreach (var element in listInstanceByNameResponse.Ac4yObjectList) { string xml = serialize(element, typeof(Ac4yObject)); string templateSimpledId = stringToPascalCase.Convert(element.TemplatePublicHumanId).ToUpper(); string name = element.SimpledHumanId + "@" + templateSimpledId + "@Ac4yObject"; names.Add(name); writeOut(xml, name, outPath); } return(names); }
public List <SerializationObject> GetXmlsMethod(SqlConnection sqlConnection, SqlConnection sqlConnectionXML, string templateName) { sqlConnection.Open(); StringToPascalCase stringToPascalCase = new StringToPascalCase(); List <SerializationObject> xmls = new List <SerializationObject>(); List <Xmls> guids = new List <Xmls>(); ListInstanceByNameResponse listInstanceByNameResponse = new Ac4yObjectObjectService(sqlConnection).ListInstanceByName( new ListInstanceByNameRequest() { TemplateName = templateName } ); string sql = "select GUID, serialization from Ac4yXMLObjects;"; using (SqlConnection connection = sqlConnectionXML) { SqlCommand command = new SqlCommand( sql, connection); using (SqlDataReader reader = command.ExecuteReader()) { Console.WriteLine(reader.FieldCount); while (reader.Read()) { Xmls xmlsObj = new Xmls() { serialization = reader.GetValue(1).ToString(), guid = reader.GetValue(0).ToString() }; guids.Add(xmlsObj); } } } foreach (var tabla in listInstanceByNameResponse.Ac4yObjectList) { foreach (var xml in guids) { if (xml.guid.Equals(tabla.GUID)) { string templateSimpledId = stringToPascalCase.Convert(templateName).ToUpper(); SerializationObject serializationObject = new SerializationObject() { fileName = tabla.SimpledHumanId + "@" + templateSimpledId, xml = xml.serialization }; xmls.Add(serializationObject); break; } } } return(xmls); }
public void Load() { Ac4yObjectObjectService ac4YObjectObjectService = new Ac4yObjectObjectService(sqlConnection); try { string[] files = Directory.GetFiles(outPath, "*.xml", SearchOption.TopDirectoryOnly); Console.WriteLine(files.Length); foreach (var _file in files) { string _filename = Path.GetFileNameWithoutExtension(_file); Console.WriteLine(_filename); System.IO.File.Move(outPath + _filename + ".xml", outPathProcess + _filename + ".xml"); string xml = readIn(_filename, outPathProcess); Ac4yObject tabla = (Ac4yObject)Deserialize(xml, typeof(Ac4yObject)); SetByGuidAndNamesResponse response = ac4YObjectObjectService.SetByGuidAndNames( new SetByGuidAndNamesRequest() { TemplateName = tabla.TemplateHumanId, Name = tabla.HumanId, Guid = tabla.GUID } ); if (response.Result.Success()) { System.IO.File.Move(outPathProcess + _filename + ".xml", outPathSuccess + _filename + ".xml"); } else { System.IO.File.Move(outPathProcess + _filename + ".xml", outPathError + _filename + ".xml"); } } } catch (Exception _exception) { Console.WriteLine(_exception.Message); } }
public void WriteOutAc4yObjectAll() { StringToPascalCase stringToPascalCase = new StringToPascalCase(); ListInstanceResponse listInstanceResponse = new Ac4yObjectObjectService(sqlConnection).ListInstance( new ListInstanceRequest() { } ); foreach (var element in listInstanceResponse.Ac4yObjectList) { string xml = serialize(element, typeof(Ac4yObject)); string templateSimpledId = stringToPascalCase.Convert(element.TemplatePublicHumanId).ToUpper(); writeOut(xml, element.SimpledHumanId + "@" + templateSimpledId + "@Ac4yObject", outPath); } }
public MainWindow() { InitializeComponent(); conn.Open(); ListInstanceByNameResponse listInstanceByNameResponse = new Ac4yObjectObjectService(conn).ListInstanceByName( new ListInstanceByNameRequest() { TemplateName = "Tábla" } ); Ac4yObjectHomeList = listInstanceByNameResponse.Ac4yObjectHomeList; foreach (Ac4yObjectHome home in Ac4yObjectHomeList) { zoneList.Add(home.HumanId); } lbOne.ItemsSource = zoneList; }
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); } }