using System; using System.Collections.Generic; using System.Linq; using System.Text; using HeuristicLab.Services.Authentication; using DA = HeuristicLab.Services.Authentication.DataAccess; using DT = HeuristicLab.Services.Authentication.DataTransfer; namespace Test { class Program { static void Main(string[] args) { //DA.ClientManagmentDataContext dc = new DA.ClientManagmentDataContext(@"Data Source=.\SQL2008;Initial Catalog=HeuristicLab.ClientManagment;Integrated Security=True"); DA.ClientManagmentDataContext dc = new DA.ClientManagmentDataContext(); //if (dc.DatabaseExists()) //{ // Console.WriteLine("DB exsits"); // dc.DeleteDatabase(); // dc.SubmitChanges(); // Console.WriteLine("DB deleted"); //} //Console.WriteLine("DB create"); //dc.CreateDatabase(); //dc.SubmitChanges(); //Console.WriteLine("Finished"); ClientService cs = new ClientService(); DT.Client c = new DT.Client(); c.Id = Guid.NewGuid(); c.Name = "Eagle-Eye"; c.Description = "Development-PC"; c.IPAdress = "192.168.0.1"; //c.ResourceType = "Client"; DT.ResourceGroup r = new DT.ResourceGroup(); r.Name = "test"; r.Id = cs.AddResourceGroup(r); c.ResourceGroup = r.Id; c.Id = cs.AddClient(c); //ResourceResourceGroup rrg = new ResourceResourceGroup(); //rrg.ResourceGroup = r; //rrg.Client = c; //dc.GetTable().InsertOnSubmit(r); //dc.GetTable().InsertOnSubmit(c); //dc.GetTable().InsertOnSubmit(rrg); //dc.SubmitChanges(); // cs.GetClients(); //cs.DeleteClient(c); cs.DeleteResourceGroup(r); } } }