예제 #1
0
        private void main_but_OK_Click(object sender, EventArgs e)
        {
            User       current_usr = new User();
            SqlCommand command     = new SqlCommand();

            command.Connection  = con;
            command.CommandType = CommandType.Text;
            command.CommandText = "Select * from NHANVIEN where (username=@user) and (pass=@pass)";
            command.Parameters.Add("@user", SqlDbType.NVarChar, 50).Value = main_box_uname.Text;
            command.Parameters.Add("@pass", SqlDbType.NVarChar, 50).Value = main_box_pword.Text;
            da.SelectCommand = command;
            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                QuanLy      ql  = new QuanLy();
                delPassData del = new delPassData(ql.funData);
                del(this.main_box_uname);
                ql.Show();
                Hide();
            }
            else
            {
                MessageBox.Show("Đăng nhập thất bại. Sai mật khẩu hoặc tên tài khoản");
            }
        }
예제 #2
0
        private void main_but_OK_Click(object sender, EventArgs e)
        {
            User current_usr = new User();
            SqlCommand command = new SqlCommand();
            command.Connection = con;
            command.CommandType = CommandType.Text;
            command.CommandText = "Select * from NHANVIEN where (username=@user) and (pass=@pass)";
            command.Parameters.Add("@user", SqlDbType.NVarChar, 50).Value = main_box_uname.Text;
            command.Parameters.Add("@pass", SqlDbType.NVarChar, 50).Value = main_box_pword.Text;
            da.SelectCommand = command;
            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {

                QuanLy ql = new QuanLy();
                delPassData del = new delPassData(ql.funData);
                del(this.main_box_uname);
                ql.Show();
                Hide();
            }
            else
            {
                MessageBox.Show("Đăng nhập thất bại. Sai mật khẩu hoặc tên tài khoản");
            }
        }
예제 #3
0
파일: Login.cs 프로젝트: pro4m/Bai_tap_nhom
 private void main_but_OK_Click(object sender, EventArgs e)
 {
     //truy van csdl xem co nguoi dung ko
     //Nếu có khai báo biến người dùng  , mở form quản lí
     User current_usr = new User();
     //đẩy thông tin người dùng vào curren_user
     QuanLy formQL = new QuanLy(current_usr);
     formQL.Show();
     this.Hide();
 }
예제 #4
0
파일: Login.cs 프로젝트: pro4m/Bai_tap_nhom
        private void main_but_OK_Click(object sender, EventArgs e)
        {
            //truy van csdl xem co nguoi dung ko
            //Nếu có khai báo biến người dùng  , mở form quản lí
            User current_usr = new User();
            //đẩy thông tin người dùng vào curren_user
            QuanLy formQL = new QuanLy(current_usr);

            formQL.Show();
            this.Hide();
        }