예제 #1
0
        static void Main(string[] args)
        {
            Person p = new Person();
               List<Product> lps = new List<Product>();
               List<Product> lpp = new List<Product>();
            ServiceStoreClient StoreProxy = new ServiceStoreClient();

              Console.WriteLine("test console is running");
              Console.WriteLine(StoreProxy.startup());
              Console.WriteLine("startup completed");
              Console.WriteLine(StoreProxy.signup("Henk"));
              Console.WriteLine("start login");
              p = (Person)StoreProxy.login("Henk", "Henk123");
               Console.WriteLine(p.Name);
               if (StoreProxy.buyProduct(StoreProxy.getProduct(1), 2, p))
               {
                   Console.WriteLine("nice");
               }
               else
               {
                   Console.WriteLine("error");
               }

             Console.ReadKey();
        }
        private void btlogin_Click(object sender, RoutedEventArgs e)
        {
            lberror.Content = "";
            ServiceStoreClient ssc = new ServiceStoreClient();
            if (ssc.login(tbname.Text, tbpw.Password) != null)
            {
                ClientController.loginperson = ssc.login(tbname.Text, tbpw.Password);
                NavigationWindow nw = new NavigationWindow();
                nw.ShowsNavigationUI = false;
                nw.Navigate(new StorePage());
                nw.Show();

                ClientController.GetWindow(this).Close();
            }
            else
            {
                lberror.Content = "username or password are not valid";
            }
        }