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