public List <TaroltEljaras> GetTaroltEljaras(string name) { string taroltEljarasName = name; List <string> storedProceduresName = new List <string>(); List <TaroltEljaras> taroltEljarasLista = new List <TaroltEljaras>(); string queryString = "select SPECIFIC_NAME from information_schema.routines where routine_type = 'PROCEDURE' and(SPECIFIC_NAME = @aTaroltEljarasNev)"; using (SqlConnection connection = _Connection) { SqlCommand command = new SqlCommand( queryString, connection); command.Parameters.Add("@aTaroltEljarasNev", SqlDbType.VarChar).Value = taroltEljarasName; //connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { Console.WriteLine(reader.FieldCount); while (reader.Read()) { storedProceduresName.Add(reader[0].ToString()); } } } foreach (var storProc in storedProceduresName) { TaroltEljaras taroltEljaras = new TaroltEljaras(); taroltEljaras.Megnevezes = storProc; taroltEljaras.ArgumentumLista = (this.GetParameters(storProc)); taroltEljarasLista.Add(taroltEljaras); } return(taroltEljarasLista); }
public TaroltEljaras LoadXmlById(int id) { TaroltEljaras t = null; using (var ctx = new AllContext(serverName, baseName, userName, password)) { var query = ctx.TaroltEljarass .Where(ss => ss.id == id) .FirstOrDefault <TaroltEljaras>(); t = query; } string xml = t.serialization; TaroltEljaras tResult = null; XmlSerializer serializer = new XmlSerializer(typeof(TaroltEljaras)); StringReader reader = new StringReader(xml); tResult = (TaroltEljaras)serializer.Deserialize(reader); reader.Close(); return(tResult); }
public void addNew(TaroltEljaras _TaroltEljaras) { using (var ctx = new AllContext(serverName, baseName, userName, password)) { ctx.TaroltEljarass.Add(_TaroltEljaras); ctx.SaveChanges(); } }
public TaroltEljaras deser(string xml) { TaroltEljaras result = null; XmlSerializer serializer = new XmlSerializer(typeof(TaroltEljaras)); using (TextReader reader = new StringReader(xml)) { result = (TaroltEljaras)serializer.Deserialize(reader); } return(result); }
public TaroltEljaras LoadXmlByGuid(string guid) { TaroltEljaras t = null; using (var ctx = new AllContext(serverName, baseName, userName, password)) { var query = ctx.TaroltEljarass .Where(ss => ss.GUID == guid) .FirstOrDefault <TaroltEljaras>(); t = query; } return(t); }
public TaroltEljaras findFirstById(int id) { TaroltEljaras t = null; using (var ctx = new AllContext(serverName, baseName, userName, password)) { var query = ctx.TaroltEljarass .Where(ss => ss.id == id) .FirstOrDefault <TaroltEljaras>(); t = query; } return(t); }
public void SaveWithXml(TaroltEljaras _TaroltEljaras) { string xml = ""; XmlSerializer serializer = new XmlSerializer(typeof(TaroltEljaras)); StringWriter stringWriter = new StringWriter(); XmlWriter xmlWriter = XmlWriter.Create(stringWriter); serializer.Serialize(xmlWriter, _TaroltEljaras); xml = stringWriter.ToString(); _TaroltEljaras.serialization = xml; using (var ctx = new AllContext(serverName, baseName, userName, password)) { ctx.TaroltEljarass.Add(_TaroltEljaras); ctx.SaveChanges(); } }
public GetObjectResponse Save(TaroltEljaras _TaroltEljaras) { var response = new GetObjectResponse(); try { _TaroltEljarasEntityMethods.addNew(_TaroltEljaras); response.Result = new Ac4yProcessResult() { Code = "1" }; } catch (Exception exception) { response.Result = (new Ac4yProcessResult() { Code = "-1", Message = exception.Message }); } return(response); }
public GetObjectResponse SaveWithXml(TaroltEljaras _TaroltEljaras) { return(_TaroltEljarasPersistentService.SaveWithXml(_TaroltEljaras)); }
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); } }