Пример #1
0
        //登陆用户
        private void button_登录_Click(object sender, EventArgs e)
        {
            user us = new user();

            try
            {
                if (textBox_用户名.Text.Length <= 0)
                {
                    MessageBox.Show("请输入用户名");
                }
                else
                if (us.user_live(sql, textBox_用户名.Text.Trim()) == false)
                {
                    MessageBox.Show("该用户不存在");
                }
                else
                if (us.user_land(sql, this, textBox_用户名.Text.Trim(), textBox_密码.Text.Trim()))
                {
                    if (!this.live(us.get_lx(sql, textBox_用户名.Text.Trim()), us.get_id(sql, textBox_用户名.Text.Trim())))
                    {
                        add(us.get_lx(sql, textBox_用户名.Text.Trim()), us.get_id(sql, textBox_用户名.Text.Trim()));
                    }
                    this.Visible = false;
                    操作窗口 f = new 操作窗口(sql, us.get_id(sql, textBox_用户名.Text.Trim()), us.get_lx(sql, textBox_用户名.Text.Trim()));
                    f.ShowDialog();
                }
            }
            catch (Exception cv)
            {
                MessageBox.Show(cv.Message);
            }
        }
Пример #2
0
 public 退出界面(操作窗口 c)
 {
     InitializeComponent();
     this.f = c;
 }