Ejemplo n.º 1
0
 public 存款界面(主界面 f, SQL sq, string id)
 {
     InitializeComponent();
     this.f  = f;
     this.id = id;
     this.sq = sq;
 }
Ejemplo n.º 2
0
 public 取款界面(SQL sq, string id, 主界面 f)
 {
     InitializeComponent();
     this.sq = sq;
     this.id = id;
     this.f  = f;
 }
Ejemplo n.º 3
0
        private void button_登陆_Click(object sender, EventArgs e)
        {
            user s  = new user();
            用户账户 gg = new 用户账户();

            user_name = textBox_用户名.Text.Trim();
            user_mima = textBox_密码.Text.Trim();
            try
            {
                if (textBox_用户名.TextLength < 1)
                {
                    MessageBox.Show("用户名不能为空,请输入用户名");
                }
                else
                if (textBox_密码.TextLength < 1)
                {
                    MessageBox.Show("密码不能为空,请输入密码");
                }
                else
                if (!s.user_save(sq, textBox_用户名.Text.Trim()))
                {
                    MessageBox.Show("用户名错误,请输入正确的用户名");
                }
                else
                {
                    this.Visible     = false;
                    textBox_用户名.Text = "";
                    textBox_密码.Text  = "";
                    if (s.user_land(sq, user_name, user_mima))
                    {
                        id = sq.sql_select("select * from 用户 where 用户名=" + user_name + "", "id");
                        if (!gg.user_save(sq, id))
                        {
                            gg.user_add(sq, id, id);
                        }
                        主界面 f = new 主界面(sq, id, this);
                        f.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("密码错误");
                        this.Visible = true;
                    }
                }
            }
            catch (Exception exx)
            {
                MessageBox.Show(exx.Message);
            }
        }