示例#1
0
文件: Form1.cs 项目: optimisa96/Shop
 private void lblGoToRegister_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (cbType.SelectedItem.ToString() == "User")
     {
         RegisterForm registerForm = new RegisterForm(this.client);
         this.Hide();
         DialogResult res = registerForm.ShowDialog();
         if (res == DialogResult.OK)
         {
             ClientForm clientForm = new ClientForm(this.client, registerForm.registeredUser.name, registerForm.registeredUser.password);
             clientForm.ShowDialog();
             this.Close();
         }
         this.Show();
     }
     else if (cbType.SelectedItem.ToString() == "Store")
     {
         RegisterStoreForm registerForm = new RegisterStoreForm(this.client);
         this.Hide();
         DialogResult res = registerForm.ShowDialog();
         if (res == DialogResult.OK)
         {
             StoreForm storeForm = new StoreForm(this.client, registerForm.registeredStore.name, registerForm.registeredStore.password);
             storeForm.ShowDialog();
             this.Close();
         }
         this.Show();
     }
 }
示例#2
0
文件: Form1.cs 项目: optimisa96/Shop
        private void loginStore()
        {
            List <Store> stores = this.client.Cypher.Match("(store:Store { name: '" + this.txtEmailOrStoreName.Text
                                                           + "', password: '******' })")
                                  .Return <Store>("store")
                                  .Results
                                  .ToList <Store>();

            if (stores.Count == 0)
            {
                MessageBox.Show("Invalid store name or password");
                return;
            }

            StoreForm storeForm = new StoreForm(this.client, stores[0].name, stores[0].password);

            this.Hide();
            storeForm.ShowDialog();
            this.Close();
        }