Beispiel #1
0
        private void LoadSanPham()
        {
            try
            {
                SanPhamClient client = new SanPhamClient();
                this.sanpham = client.SanPham_Search("").Tables[0];
                AutoCompleteStringCollection DsMaSanPham  = new AutoCompleteStringCollection();
                AutoCompleteStringCollection DsTenSanPham = new AutoCompleteStringCollection();
                foreach (DataRow row in this.sanpham.Rows)
                {
                    DsMaSanPham.Add(row["MaSanPham"].ToString());
                    DsTenSanPham.Add(row["TenSanPham"].ToString());
                }
                txt_MaSanPham.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
                txt_MaSanPham.AutoCompleteSource       = AutoCompleteSource.CustomSource;
                txt_MaSanPham.AutoCompleteCustomSource = DsMaSanPham;

                txt_TenSanPham.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
                txt_TenSanPham.AutoCompleteSource       = AutoCompleteSource.CustomSource;
                txt_TenSanPham.AutoCompleteCustomSource = DsTenSanPham;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
 private void LoadData(string swhere)
 {
     try
     {
         SanPhamClient client = new SanPhamClient();
         dgv_DanhMucSanPham.DataSource = client.SanPham_Search("").Tables[0];
         FormatGrid();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
 //Search thông tin sách
 private void txt_Search_TextChanged(object sender, EventArgs e)
 {
     try
     {
         SanPhamClient client = new SanPhamClient();
         dgv_DanhMucSanPham.DataSource = client.SanPham_Search(txt_Search.Text).Tables[0];
         FormatGrid();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }