FrmGeShouAdd.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.Data.SqlClient;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace KTVAdmin.GeShouGuanLi
- {
- public partial class FrmGeShouAdd : Form
- {
- public FrmGeShouAdd()
- {
- InitializeComponent();
- }
- public int RID = 0;
- private void btnAdd_Click(object sender, EventArgs e)
- {
- if (txtName.Text.Trim() == "")
- {
- MessageBox.Show("歌手姓名不能为空!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- return;
- }
- if (cmbSex.Text.Trim() == "")
- {
- MessageBox.Show("请选择歌手类型!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- return;
- }
- if (cmbDiQu.Text.Trim() == "")
- {
- MessageBox.Show("请选择歌手地区!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- return;
- }
- if (KTVData.KTVDB.AdminGeShou(RID, txtName.Text.Trim(), cmbSex.Text.Trim(), cmbDiQu.Text.Trim()))
- {
- MessageBox.Show("歌手信息更新成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- if (RID != 0)
- {
- this.DialogResult = DialogResult.Yes;
- this.Close();
- }
- else
- {
- txtName.Text = "";
- cmbSex.Text = "男";
- cmbDiQu.Text = "内地";
- }
- }
- else
- {
- MessageBox.Show("歌手信息更新失败,对此我们感到非常抱歉,您可以重新打开窗体再来更新歌手信息!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- }
- }
- private void FrmGeShouAdd_Load(object sender, EventArgs e)
- {
- if (RID != 0)
- {
- this.Text = "歌手信息修改";
- label1.Text = "歌手信息修改";
- DataSet ds = new DataSet();
- ds = KTVData.KTVDB.SelectGeShou(RID);
- if (ds.Tables[0].Rows.Count < 1)
- {
- MessageBox.Show("没有此信息的歌手,请重新选择!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- }
- txtName.Text = ds.Tables[0].Rows[0]["歌手姓名"].ToString();
- cmbSex.Text = ds.Tables[0].Rows[0]["性别"].ToString();
- cmbDiQu.Text = ds.Tables[0].Rows[0]["地区"].ToString();
- }
- }
- private void btnExit_Click(object sender, EventArgs e)
- {
- if (RID == 0)
- {
- this.Close();
- }
- else
- {
- this.DialogResult = DialogResult.No;
- this.Close();
- }
- }
- }
- }