public TaroltEljarasArgumentum LoadXmlById(int id) { TaroltEljarasArgumentum t = null; using (var ctx = new AllContext(serverName, baseName, userName, password)) { var query = ctx.TaroltEljarasArgumentums .Where(ss => ss.id == id) .FirstOrDefault <TaroltEljarasArgumentum>(); t = query; } string xml = t.serialization; TaroltEljarasArgumentum tResult = null; XmlSerializer serializer = new XmlSerializer(typeof(TaroltEljarasArgumentum)); StringReader reader = new StringReader(xml); tResult = (TaroltEljarasArgumentum)serializer.Deserialize(reader); reader.Close(); return(tResult); }
public void addNew(TaroltEljarasArgumentum _TaroltEljarasArgumentum) { using (var ctx = new AllContext(serverName, baseName, userName, password)) { ctx.TaroltEljarasArgumentums.Add(_TaroltEljarasArgumentum); ctx.SaveChanges(); } }
public TaroltEljarasArgumentum findFirstById(int id) { TaroltEljarasArgumentum t = null; using (var ctx = new AllContext(serverName, baseName, userName, password)) { var query = ctx.TaroltEljarasArgumentums .Where(ss => ss.id == id) .FirstOrDefault <TaroltEljarasArgumentum>(); t = query; } return(t); }
public List <TaroltEljarasArgumentum> GetParameters(string name) { Program program = new Program(); List <TaroltEljarasArgumentum> lista = new List <TaroltEljarasArgumentum>(); SqlConnection connection = program.DatabaseConnection; SqlCommand cmd = new SqlCommand(name, connection); cmd.CommandType = CommandType.StoredProcedure; //connection.Open(); SqlCommandBuilder.DeriveParameters(cmd); foreach (SqlParameter p in cmd.Parameters) { TaroltEljarasArgumentum taroltEljarasArgumentum = new TaroltEljarasArgumentum(); taroltEljarasArgumentum.BelsoNev = p.ParameterName; taroltEljarasArgumentum.Adattipus = p.SqlDbType.ToString(); taroltEljarasArgumentum.Iranya = p.Direction.ToString(); lista.Add(taroltEljarasArgumentum); } return(lista); }
public void SaveWithXml(TaroltEljarasArgumentum _TaroltEljarasArgumentum) { string xml = ""; XmlSerializer serializer = new XmlSerializer(typeof(TaroltEljarasArgumentum)); StringWriter stringWriter = new StringWriter(); XmlWriter xmlWriter = XmlWriter.Create(stringWriter); serializer.Serialize(xmlWriter, _TaroltEljarasArgumentum); xml = stringWriter.ToString(); _TaroltEljarasArgumentum.serialization = xml; using (var ctx = new AllContext(serverName, baseName, userName, password)) { ctx.TaroltEljarasArgumentums.Add(_TaroltEljarasArgumentum); ctx.SaveChanges(); } }
public GetObjectResponse SaveWithXml(TaroltEljarasArgumentum _TaroltEljarasArgumentum) { var response = new GetObjectResponse(); try { _TaroltEljarasArgumentumEntityMethods.SaveWithXml(_TaroltEljarasArgumentum); response.Result = new Ac4yProcessResult() { Code = "1" }; } catch (Exception exception) { response.Result = (new Ac4yProcessResult() { Code = "-1", Message = exception.Message }); } return(response); }
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); } }