Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            /*string filePath = @"DSTL.txt";
             * String[] lines; ;
             * lstTheLoaiBH.Items.Clear();
             *
             * if (System.IO.File.Exists(filePath))
             * {
             *  lines = System.IO.File.ReadAllLines(filePath);
             *  for (int i = 0; i < lines.Length; i++)
             *  {
             *      lstTheLoaiBH.Items.Add(lines[i]);
             *  }
             * }*/
            lstTheLoaiBH.DisplayMember = "TenTL";
            lstTheLoaiBH.ValueMember   = "MaTL";
            lstTheLoaiBH.DataSource    = KetNoiCSDL.LayBang("select * from TheLoai1");


            /*foreach (DataRow dr in KetNoiCSDL.LayBang("select * from TheLoai1").Rows)
             *  lstTheLoaiBH.Items.Add(dr);
             * lstTheLoaiBH.Items.Clear();*/
            /*foreach (TheLoai t in frmThongTin.DSTheLoai)
             * {
             *  lstTheLoaiBH.Items.Add(t);
             * }*/
        }
Exemple #2
0
        void ShowBaiHat()
        {
            /*lstDanhSachBH.Items.Clear();
             * foreach (BaiHat m in DSBaiHat)
             * {
             *  lstDanhSachBH.Items.Add(m);
             * }*/

            lstDanhSachBH.DisplayMember = "TenBH";
            lstDanhSachBH.ValueMember   = "MaBH";
            lstDanhSachBH.DataSource    = KetNoiCSDL.LayBang("select * from BaiHat");
        }
Exemple #3
0
        private void ShowTheLoai()
        {
            /* cboTheLoai.Items.Clear();
             * foreach (TheLoai t in DSTheLoai)
             * {
             *   cboTheLoai.Items.Add(t);
             * }     */

            cboTheLoai.DisplayMember = "TenTL";
            cboTheLoai.ValueMember   = "MaTL";
            cboTheLoai.DataSource    = KetNoiCSDL.LayBang("select * from TheLoai1");
        }
Exemple #4
0
        void ShowTheLoai()
        {
            //lstTheLoaiBH.Items.Clear();

            /* foreach (TheLoai t in frmThongTin.DSTheLoai)
             * {
             *   lstTheLoaiBH.Items.Add(t);
             * }        */
            lstTheLoaiBH.DisplayMember = "TenTL";
            lstTheLoaiBH.ValueMember   = "MaTL";
            lstTheLoaiBH.DataSource    = KetNoiCSDL.LayBang("select * from TheLoai1");
        }
Exemple #5
0
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            if (txtTimKiem.Text != "")
            {
                lstDanhSachBH.DisplayMember = "TenBH";
                lstDanhSachBH.ValueMember   = "MaBH";
                lstDanhSachBH.DataSource    = KetNoiCSDL.LayBang("select * from BaiHat where TenBH Like '%" + txtTimKiem.Text + "%'");
                if (lstDanhSachBH.Items.Count == 0)
                {
                    MessageBox.Show("Bài hát không tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtTimKiem.Text = "";
                    txtTimKiem.Focus();
                    return;
                }

                /*int count = 0;
                 * List<BaiHat> DanhSachTam = new List<BaiHat>();
                 * foreach (BaiHat m1 in DSBaiHat)
                 * {
                 *  if (txtTimKiem.Text.ToLower() == m1.TenBH.ToLower())
                 *  {
                 *      DanhSachTam.Add(m1);
                 *      count++;
                 *  }
                 * }
                 * if(count == 0)
                 * {
                 *  MessageBox.Show("Bài hát không tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 *  lstDanhSachBH.Items.Clear();
                 *  txtTimKiem.Focus();
                 *  return;
                 * }
                 * lstDanhSachBH.Items.Clear();
                 * foreach (BaiHat m in DanhSachTam)
                 * {
                 *      lstDanhSachBH.Items.Add(m);
                 * }*/
            }
            else
            {
                MessageBox.Show("Bạn chưa nhập thông tin tìm kiếm!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }
Exemple #6
0
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            if (txtTimKiem.Text != "")
            {
                lstTheLoaiBH.DisplayMember = "TenTL";
                lstTheLoaiBH.ValueMember   = "MaTL";
                lstTheLoaiBH.DataSource    = KetNoiCSDL.LayBang("select * from TheLoai1 where TenTL Like '%" + txtTimKiem.Text + "%'");
                if (lstTheLoaiBH.Items.Count == 0)
                {
                    MessageBox.Show("Thể loại không tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtTimKiem.Text = "";
                    txtTimKiem.Focus();
                    return;
                }

                /* int count = 0;
                 * List<TheLoai> DanhSachTam = new List<TheLoai>();
                 * foreach (TheLoai t1 in frmThongTin.DSTheLoai)
                 * {
                 *   if (txtTimKiem.Text.ToLower() == t1.TenTL.ToLower())
                 *   {
                 *       DanhSachTam.Add(t1);
                 *       count++;
                 *   }
                 * }
                 * if (count == 0)
                 * {
                 *   MessageBox.Show("Thể loại không tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 *   lstTheLoaiBH.Items.Clear();
                 *   txtTimKiem.Focus();
                 *   return;
                 * }
                 * lstTheLoaiBH.Items.Clear();
                 * foreach (TheLoai t in DanhSachTam)
                 * {
                 *   lstTheLoaiBH.Items.Add(t);
                 * }*/
            }
            else
            {
                MessageBox.Show("Bạn chưa nhập thông tin tìm kiếm!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }
Exemple #7
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            /*lstDanhSachBH.Items.Clear();
             * foreach (BaiHat m in DSBaiHat)
             * {
             *  lstDanhSachBH.Items.Add(m);
             * }*/

            /*string filePath = @"DSBH.txt";
             * string[] lines;
             * lstDanhSachBH.Items.Clear();
             * if (System.IO.File.Exists(filePath))
             * {
             *  lines = System.IO.File.ReadAllLines(filePath);
             *  for (int i = 0; i < lines.Length; i++)
             *  {
             *      lstDanhSachBH.Items.Add(lines[i]);
             *  }
             * }*/
            lstDanhSachBH.DisplayMember = "TenBH";
            lstDanhSachBH.ValueMember   = "MaBH";
            lstDanhSachBH.DataSource    = KetNoiCSDL.LayBang("select * from BaiHat");
        }