FrmGeQu.cs
资源名称:KTV.rar [点击查看]
上传用户:fzwcsgshou
上传日期:2022-07-30
资源大小:28414k
文件大小:5k
源码类别:
行业应用
开发平台:
Visual C++
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Data.SqlClient;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace KTVAdmin.GeQuGuanLi
- {
- public partial class FrmGeQu : Form
- {
- public FrmGeQu()
- {
- InitializeComponent();
- }
- public int RID = 0;
- public int SID = 0;
- private void FrmGeQu_Load(object sender, EventArgs e)
- {
- DataSet dsRName = new DataSet();
- dsRName = KTVData.KTVDB.SelectGeShou("", "");
- cmbRName.DisplayMember = "歌手姓名";
- cmbRName.ValueMember = "歌手编号";
- cmbRName.DataSource = dsRName.Tables[0];
- txtCiShu.Enabled = true;
- if (SID != 0)
- {
- label7.Text = "歌曲信息修改";
- this.Text = "歌曲信息修改";
- DataSet ds=new DataSet();
- ds=KTVData.KTVDB.SelectOneGeQu(SID);
- if (ds.Tables[0].Rows.Count > 0)
- {
- cmbRName.Text = ds.Tables[0].Rows[0]["歌手"].ToString();
- cmbYuYan.Text = ds.Tables[0].Rows[0]["语言"].ToString();
- cmbZiMu.Text = ds.Tables[0].Rows[0]["首字母"].ToString();
- cmbClass.Text = ds.Tables[0].Rows[0]["类型"].ToString();
- txtSName.Text = ds.Tables[0].Rows[0]["歌曲名称"].ToString();
- txtWiZhi.Text = ds.Tables[0].Rows[0]["存放位置"].ToString();
- RID = int.Parse(ds.Tables[0].Rows[0]["歌手编号"].ToString());
- txtCiShu.Text = ds.Tables[0].Rows[0]["点击次数"].ToString();
- }
- }
- }
- private void btnLiuLan_Click(object sender, EventArgs e)
- {
- openFileDialog1.ShowDialog();
- txtWiZhi.Text = openFileDialog1.FileName;
- }
- private void btnOk_Click(object sender, EventArgs e)
- {
- if (cmbClass.Text.Trim() == "--请选择--" || cmbClass.Text.Trim() == "")
- {
- MessageBox.Show("请选择歌曲类型!!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (cmbZiMu.Text.Trim() == "--请选择--" || cmbZiMu.Text.Trim() == "")
- {
- MessageBox.Show("请选择歌曲的首字母!!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (cmbYuYan.Text.Trim() == "--请选择--" || cmbYuYan.Text.Trim() == "")
- {
- MessageBox.Show("请选择歌曲语言!!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (cmbRName.Text.Trim() == "--请选择--" || cmbRName.Text.Trim()=="")
- {
- MessageBox.Show("请选择歌手!!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- int CiShu = 0;
- try
- {
- CiShu = int.Parse(txtCiShu.Text.Trim());
- }
- catch
- {
- CiShu = 0;
- }
- try
- {
- RID = int.Parse(cmbRName.SelectedValue.ToString());
- }
- catch
- {
- }
- if (KTVData.KTVDB.AdminGeQu(SID, txtSName.Text.Trim(), cmbYuYan.Text.Trim(), cmbClass.Text.Trim(), RID, cmbZiMu.Text.Trim(), CiShu, txtWiZhi.Text.Trim()))
- {
- MessageBox.Show("歌曲信息更新成功!!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- if (SID != 0)
- {
- this.DialogResult = DialogResult.Yes;
- this.Close();
- }
- }
- else
- {
- MessageBox.Show("歌曲信息更新失败,您可以重新选择,再更新!!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- private void cmbRName_SelectedIndexChanged(object sender, EventArgs e)
- {
- try
- {
- RID = int.Parse(cmbRName.SelectedValue.ToString());
- }
- catch
- {
- }
- }
- private void btnExit_Click(object sender, EventArgs e)
- {
- if (SID != 0)
- {
- this.DialogResult = DialogResult.No;
- this.Close();
- }
- else
- {
- this.Close();
- }
- }
- }
- }