Пример #1
0
        public void Update(TaiKhoan info)
        {
            string sqlQuery = "update TaiKhoan" +
                              " set MatKhau='" + info.MatKhau + "'" +
                              "where TenDangNhap='" + info.TenDangNhap + "'";

            ExecuteNonQuery(sqlQuery);
        }
Пример #2
0
        public void Insert(TaiKhoan info)
        {
            string sqlQuery = "insert into TaiKhoan values ('" +
                info.TenDangNhap + "','" +             
                info.MatKhau + "')";

            ExecuteNonQuery(sqlQuery);
        }
Пример #3
0
        public List<TaiKhoan> GetList()
        {
            List<TaiKhoan> list = new List<TaiKhoan>();

            string sqlQuery = "select * from TaiKhoan";

            reader = ExecuteReader(sqlQuery);

            while (reader.Read())
            {
                TaiKhoan tacGia = new TaiKhoan();

                tacGia.MatKhau = reader["MatKhau"].ToString();
                tacGia.TenDangNhap = reader["TenDangNhap"].ToString();

                list.Add(tacGia);
            }

            return list;
        }
Пример #4
0
        private void btThem_Click(object sender, RoutedEventArgs e)
        {
            TaiKhoan taiKhoan = new TaiKhoan() { TenDangNhap = tbTaiKhoan.Text, MatKhau = tbMatKhau.Text };

            TaiKhoanBUS bus = new TaiKhoanBUS();

            try
            {
                bus.Insert(taiKhoan);

                MessageBox.Show("Thêm thành công !");
            }
            catch (Exception)
            {
                MessageBox.Show("Thêm thất bại !");
            }
            

            LoadData();
        }
Пример #5
0
 public void Update(TaiKhoan info)
 {
     data.Update(info);
 }
Пример #6
0
 public void Insert(TaiKhoan info)
 {
     data.Insert(info);
 }