Rev | Line | |
---|
[4583] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
[4953] | 5 | using HeuristicLab.Services.Authentication;
|
---|
| 6 | using DA = HeuristicLab.Services.Authentication.DataAccess;
|
---|
| 7 | using DT = HeuristicLab.Services.Authentication.DataTransfer;
|
---|
[4583] | 8 |
|
---|
| 9 | namespace Test
|
---|
| 10 | {
|
---|
| 11 | class Program
|
---|
| 12 | {
|
---|
| 13 | static void Main(string[] args)
|
---|
| 14 | {
|
---|
| 15 |
|
---|
[4953] | 16 | //DA.ClientManagmentDataContext dc = new DA.ClientManagmentDataContext(@"Data Source=.\SQL2008;Initial Catalog=HeuristicLab.ClientManagment;Integrated Security=True");
|
---|
| 17 | DA.ClientManagmentDataContext dc = new DA.ClientManagmentDataContext();
|
---|
| 18 |
|
---|
[4958] | 19 | //if (dc.DatabaseExists())
|
---|
| 20 | //{
|
---|
| 21 | // Console.WriteLine("DB exsits");
|
---|
| 22 | // dc.DeleteDatabase();
|
---|
| 23 | // dc.SubmitChanges();
|
---|
| 24 | // Console.WriteLine("DB deleted");
|
---|
| 25 | //}
|
---|
| 26 | //Console.WriteLine("DB create");
|
---|
| 27 | //dc.CreateDatabase();
|
---|
| 28 | //dc.SubmitChanges();
|
---|
| 29 | //Console.WriteLine("Finished");
|
---|
[4583] | 30 |
|
---|
[4953] | 31 | ClientService cs = new ClientService();
|
---|
| 32 |
|
---|
| 33 | DT.Client c = new DT.Client();
|
---|
| 34 |
|
---|
[4732] | 35 | c.Id = Guid.NewGuid();
|
---|
[4583] | 36 | c.Name = "Eagle-Eye";
|
---|
| 37 | c.Description = "Development-PC";
|
---|
[4694] | 38 | c.IPAdress = "192.168.0.1";
|
---|
[4953] | 39 |
|
---|
[4583] | 40 | //c.ResourceType = "Client";
|
---|
[4953] | 41 | DT.ResourceGroup r = new DT.ResourceGroup();
|
---|
[4583] | 42 | r.Name = "test";
|
---|
| 43 |
|
---|
[4953] | 44 | r.Id = cs.AddResourceGroup(r);
|
---|
| 45 |
|
---|
| 46 | c.ResourceGroup = r.Id;
|
---|
| 47 | c.Id = cs.AddClient(c);
|
---|
| 48 |
|
---|
| 49 | //ResourceResourceGroup rrg = new ResourceResourceGroup();
|
---|
| 50 | //rrg.ResourceGroup = r;
|
---|
| 51 | //rrg.Client = c;
|
---|
[4583] | 52 |
|
---|
| 53 |
|
---|
[4953] | 54 | //dc.GetTable<Resource>().InsertOnSubmit(r);
|
---|
| 55 | //dc.GetTable<Resource>().InsertOnSubmit(c);
|
---|
[4583] | 56 |
|
---|
[4953] | 57 | //dc.GetTable<ResourceResourceGroup>().InsertOnSubmit(rrg);
|
---|
[4583] | 58 |
|
---|
[4953] | 59 | //dc.SubmitChanges();
|
---|
[4583] | 60 |
|
---|
[4953] | 61 |
|
---|
| 62 | // cs.GetClients();
|
---|
[4583] | 63 |
|
---|
[4953] | 64 | //cs.DeleteClient(c);
|
---|
| 65 | cs.DeleteResourceGroup(r);
|
---|
[4583] | 66 |
|
---|
| 67 |
|
---|
| 68 | }
|
---|
| 69 | }
|
---|
| 70 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.