예제 #1
0
 static void Main(string[] args)
 {
     using (ServiceHost host = new ServiceHost(typeof(SyncService.HelloService)))
     {
         host.Open();
         Console.WriteLine("Service started @t " + DateTime.Now.ToShortDateString());
         var db     = new Entities();
         var adress = new AdressSet();
         adress.Name    = "Avenue de savigny";
         adress.Street  = "44";
         adress.ZipCode = "93600";
         db.AdressSets.Add(adress);
         db.SaveChanges();
         Console.ReadLine();
     }
 }
예제 #2
0
        public static void AddEvent()
        {
            Console.WriteLine();
            Console.WriteLine("|----------- EventAdd Test ----------|");
            Console.WriteLine();
            SyncWolrdServiceClient client = new SyncWolrdServiceClient();
            EventSet  e       = new EventSet();
            AdressSet address = new AdressSet();

            Console.Write("Event Name = ");
            e.Name = Console.ReadLine().Trim();
            Console.Write("Event Description = ");
            e.Description = Console.ReadLine().Trim();
            Console.Write("Event Type = ");
            e.Type = Console.ReadLine().Trim();
            Console.Write("Street number = ");
            address.Street = Console.ReadLine().Trim();
            Console.Write("Street name = ");
            address.Name = Console.ReadLine().Trim();
            Console.Write("Zip Code = ");
            address.ZipCode = Console.ReadLine().Trim();
            e.AdressSet     = address;
            Console.WriteLine("Result = " + client.AddEvent(e));
        }