FrmGeShouList.cs
资源名称:KTV.rar [点击查看]
上传用户:fzwcsgshou
上传日期:2022-07-30
资源大小:28414k
文件大小:3k
源码类别:
行业应用
开发平台:
Visual C++
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace KTV
- {
- public partial class FrmGeShouList : Form
- {
- public FrmGeShouList()
- {
- InitializeComponent();
- }
- private void FrmGeShouList_Load(object sender, EventArgs e)
- {
- dataGridView1.DataSource = ds.Tables[0];
- dsList.Tables.Add();
- dsList.Tables[0].Columns.Add("歌手编号");
- dsList.Tables[0].Columns.Add("歌手姓名");
- listBox1.DisplayMember = "歌手姓名";
- listBox1.ValueMember = "歌手编号";
- listBox1.DataSource = dsList.Tables[0];
- }
- public DataSet ds = new DataSet();
- public DataSet dsList = new DataSet();
- private void btnAdd_Click(object sender, EventArgs e)
- {
- dsList.Tables[0].Rows.Add();
- dsList.Tables[0].Rows[dsList.Tables[0].Rows.Count - 1]["歌手姓名"] = dataGridView1.CurrentRow.Cells["歌手姓名"].Value.ToString();
- dsList.Tables[0].Rows[dsList.Tables[0].Rows.Count - 1]["歌手编号"] = dataGridView1.CurrentRow.Cells["歌手编号"].Value.ToString();
- }
- private void btnDel_Click(object sender, EventArgs e)
- {
- dsList.Tables[0].Rows.RemoveAt(listBox1.SelectedIndex);
- }
- private void btnOk_Click(object sender, EventArgs e)
- {
- if (listBox1.Items.Count > 0)
- {
- DataSet dsGeQu = new DataSet();
- int i = 0;
- for (int j = 0; j < listBox1.Items.Count; j++)
- {
- i = int.Parse(dsList.Tables[0].Rows[j]["歌手编号"].ToString());
- if (dsGeQu.Tables.Count < 1)
- {
- dsGeQu = KTVData.KTVDB.SelectGeShouDeGe(i);
- }
- else
- {
- dsGeQu.Merge(KTVData.KTVDB.SelectGeShouDeGe(i));
- }
- }
- FrmXuanGe FrmXuanGe1 = new FrmXuanGe();
- FrmXuanGe1.ds = dsGeQu;
- FrmXuanGe1.Show();
- this.Close();
- }
- else
- {
- MessageBox.Show("没有选择不能确定,您可以直接退出放弃选择!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- MessageBox.Show("需要硬件设备支持!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- private void button1_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }