示例#1
0
文件: Login.cs 项目: amrhany20/iShop
 private void button1_Click(object sender, EventArgs e)
 {
     if (checkBox1.Checked)
     {
         var admin = Public.AdminLogIn(Public.admins, textBox1.Text, textBox2.Text);
         if (Public.admins.Contains(admin))
         {
             MessageBox.Show("Hello,\n " + admin.getUsername(), "Success");
             admin_interface f1 = new admin_interface();
             this.Hide();
             f1.ShowDialog();
             this.Close();
         }
         else
         {
             MessageBox.Show("Invalid username or password", "Login error");
         }
     }
     else
     {
         Public.user = Public.UserLogIn(Public.users, textBox1.Text, textBox2.Text);
         if (Public.users.Contains(Public.user))
         {
             Form1 f1 = new Form1();
             this.Hide();
             f1.ShowDialog();
             this.Close();
         }
         else
         {
             MessageBox.Show("Invalid username or password", "Login error");
         }
     }
 }
示例#2
0
        private void button5_Click(object sender, EventArgs e)
        {
            admin_interface f1 = new admin_interface();

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