Free cookie consent management tool by TermsFeed Policy Generator

source: branches/ClientManagement/HeuristicLab.Services.Authentication/Test/Program.cs @ 4728

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
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Services.Authentication.DataAccess;
6
7namespace Test
8{
9    class Program
10    {
11        static void Main(string[] args)
12        {
13
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                     
25           
26            Client c = new Client();
27
28            c.ResourceID = Guid.NewGuid();
29            c.Name = "Eagle-Eye";
30            c.Description = "Development-PC";
31            c.IPAdress = "192.168.0.1";
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.