Пример #1
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            string lt = "", tg = "", qg = "", tt = "";

            try
            {
                lt = loctheo.Text;
                tg = thoigian.Text;
                qg = quocgia.Text;
                tt = tamtrang.Text;
            }
            catch { }
            MiServiceClient client = new MiServiceClient();

            if (karaoke.Checked == true)
            {
                try
                {
                    gridControl2.DataSource = client.musickaraoke(tbTimkiem.Text, lt, tg, qg, tt);
                }
                catch { gridControl2.DataSource = client.getall(); }
            }
            if (ten.Checked == true)
            {
                try
                {
                    gridControl2.DataSource = client.musicten(tbTimkiem.Text, lt, tg, qg, tt);
                }
                catch { gridControl2.DataSource = client.getall(); }
            }
            if (loi.Checked == true)
            {
                try
                {
                    gridControl2.DataSource = client.musicloi(tbTimkiem.Text, lt, tg, qg, tt);
                }
                catch { gridControl2.DataSource = client.getall(); }
            }
            if (casi.Checked == true)
            {
                try
                {
                    gridControl2.DataSource = client.musiccasi(tbTimkiem.Text, lt, tg, qg, tt);
                }
                catch { gridControl2.DataSource = client.getall(); }
            }
            if (nhacsi.Checked == true)
            {
                try
                {
                    gridControl2.DataSource = client.musicnhacsi(tbTimkiem.Text, lt, tg, qg, tt);
                }
                catch { gridControl2.DataSource = client.getall(); }
            }
            gridControl1.DataSource = gridControl2.DataSource;
        }
Пример #2
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            string lt = "", tg = "", qg = "", tt = "";
                try
                {
                    lt = loctheo.Text;
                    tg = thoigian.Text;
                    qg = quocgia.Text;
                    tt = tamtrang.Text;

                }
                catch { }
                MiServiceClient client = new MiServiceClient();
                if (karaoke.Checked==true)
                {
                    try
                    {
                        gridControl2.DataSource = client.musickaraoke(tbTimkiem.Text, lt, tg, qg, tt);
                    }
                    catch { gridControl2.DataSource = client.getall(); }
                }
                if (ten.Checked==true)
                {
                    try
                    {
                        gridControl2.DataSource = client.musicten(tbTimkiem.Text, lt, tg, qg, tt);
                    }
                    catch { gridControl2.DataSource = client.getall(); }
                }
                if (loi.Checked==true)
                {
                    try
                    {
                        gridControl2.DataSource = client.musicloi(tbTimkiem.Text, lt, tg, qg, tt);
                    }
                    catch { gridControl2.DataSource = client.getall(); }
                }
                if (casi.Checked==true)
                {
                    try
                    {
                        gridControl2.DataSource = client.musiccasi(tbTimkiem.Text, lt, tg, qg, tt);
                    }
                    catch { gridControl2.DataSource = client.getall(); }
                }
                if (nhacsi.Checked == true)
                {
                    try
                    {
                        gridControl2.DataSource = client.musicnhacsi(tbTimkiem.Text, lt, tg, qg, tt);
                    }
                    catch { gridControl2.DataSource = client.getall(); }
                }
                gridControl1.DataSource = gridControl2.DataSource;
        }