예제 #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();
        }