示例#1
0
        private void bntOK_Click(object sender, EventArgs e)
        {
            tb_computer computer = new tb_computer();

            if (txtUser.Text == "")
            {
                MessageBox.Show("登录名称不能为空!");
                txtUser.Focus();
                return;
            }
            if (txtPwd.Text == "")
            {
                MessageBox.Show("登录密码不能为空!");
                txtPwd.Focus();
                return;
            }
            if (cmbLogin.Text == "")
            {
                MessageBox.Show("请选择登录界面");
                cmbLogin.Focus();
                return;
            }
            computer.strcmp_name = txtUser.Text;
            computer.strcmp_Paww = txtPwd.Text;
            if (computer.tb_computerLogin(computer, 2) == 1)
            {
                if (cmbLogin.Text == "后台数据维护")
                {
                    frmMain frm = new frmMain();
                    frm.Show();
                    this.Hide();
                }
                if (cmbLogin.Text == "系统点歌")
                {
                    frmDaiGe daige = new frmDaiGe();
                    daige.Show();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("登录失败!");
                txtPwd.Text   = "";
                txtUser.Text  = "";
                cmbLogin.Text = "";
                txtUser.Focus();
            }
        }
示例#2
0
        tbMusicnfoMenthod tbMusice = new tbMusicnfoMenthod();//实例方法类

        private void bntOK_Click(object sender, EventArgs e)
        {
            if (txtName.Text == "")
            {
                MessageBox.Show("输入正确的查询条件!");
                txtName.Focus();
                return;
            }
            frmDaiGe daige = (frmDaiGe)this.Owner; //实例窗体对象

            if (intFalg == 1)                      //数字
            {
                //调用方法查找结果,填冲控件
                if (tbMusice.tbFill(daige.lvPlay, txtName.Text.Trim(), 1) != 0)
                {
                    intFalg = 0;
                    this.Close();
                }
                else
                {
                    intFalg = 1;
                    MessageBox.Show("没有查到结果,请输入其它条件");
                    txtName.Text = "";
                    txtName.Focus();
                }
            }
            if (intFalg == 2)//拼音
            {
                if (tbMusice.tbFill(daige.lvPlay, txtName.Text.Trim(), 2) != 0)
                {
                    intFalg = 0;
                    this.Close();
                }
                else
                {
                    intFalg = 2;
                    MessageBox.Show("没有结查,请输入其它条件");
                    txtName.Text = "";
                    txtName.Focus();
                }
            }
            if (intFalg == 3)//明星
            {
                if (tbMusice.tbFill(daige.lvPlay, txtName.Text.Trim(), 3) != 0)
                {
                    intFalg = 0;
                    this.Close();
                }
                else
                {
                    intFalg = 3;
                    MessageBox.Show("没有结查,请输入其它条件");
                    txtName.Text = "";
                    txtName.Focus();
                }
            }
            if (intFalg == 4)//歌名
            {
                if (tbMusice.tbFill(daige.lvPlay, txtName.Text.Trim(), 4) != 0)
                {
                    intFalg = 0;
                    this.Close();
                }
                else
                {
                    intFalg = 4;
                    MessageBox.Show("没有结查,请输入其它条件\n 可以断续输入查询条件或退出", "查询提示");
                    txtName.Text = "";
                    txtName.Focus();
                }
            }
        }