Last change
on this file since 4728 was
4694,
checked in by fruehrli, 14 years ago
|
#1197
Administration methods updated
WinForm for administration added
Demo WebService added
|
File size:
1.5 KB
|
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 |
|
---|
[4694] | 14 | ClientManagmentDataContext dc = new ClientManagmentDataContext(@"Data Source=nb-1\sqlexpress;Initial Catalog=HeuristicLab.ClientManagment;Integrated Security=SSPI;");
|
---|
| 15 |
|
---|
| 16 | if (dc.DatabaseExists()) {
|
---|
| 17 | Console.WriteLine("DB exsits");
|
---|
| 18 | dc.DeleteDatabase();
|
---|
| 19 | Console.WriteLine("DB deleted");
|
---|
| 20 | }
|
---|
| 21 | Console.WriteLine("DB create");
|
---|
| 22 | dc.CreateDatabase();
|
---|
| 23 | Console.WriteLine("Finished");
|
---|
| 24 |
|
---|
[4583] | 25 |
|
---|
| 26 | Client c = new Client();
|
---|
| 27 |
|
---|
| 28 | c.ResourceID = Guid.NewGuid();
|
---|
| 29 | c.Name = "Eagle-Eye";
|
---|
| 30 | c.Description = "Development-PC";
|
---|
[4694] | 31 | c.IPAdress = "192.168.0.1";
|
---|
[4583] | 32 | //c.ResourceType = "Client";
|
---|
| 33 | ResourceGroup r = new ResourceGroup();
|
---|
| 34 | r.Name = "test";
|
---|
| 35 |
|
---|
| 36 | ResourceResourceGroup rrg = new ResourceResourceGroup();
|
---|
| 37 | rrg.ResourceGroup = r;
|
---|
| 38 | rrg.Client = c;
|
---|
| 39 |
|
---|
| 40 |
|
---|
| 41 | dc.GetTable<Resource>().InsertOnSubmit(r);
|
---|
| 42 | dc.GetTable<Resource>().InsertOnSubmit(c);
|
---|
| 43 |
|
---|
| 44 | dc.GetTable<ResourceResourceGroup>().InsertOnSubmit(rrg);
|
---|
| 45 |
|
---|
| 46 | dc.SubmitChanges();
|
---|
| 47 |
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | }
|
---|
| 52 | }
|
---|
| 53 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.