开发工具:
文件大小: 1mb
下载次数: 0
上传时间: 2015-04-09
详细说明: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using System.Timers; //Download by http://www.codefans.net namespace qwe { public partial class F_main : Form { //定义SqlDataAdapter的引用 SqlDataAdapter da = new SqlDataAdapter(); //定义Datast的引用 DataSet ds = new DataSet(); public F_main() { string skin = &qu ot;skin/DiamondBlue.ssk"; InitializeComponent(); skinEngine1.SkinFile = skin; } private void F_main_Load(object sender, EventArgs e) { //定义SQL语句 string str_sql = string.Format("select cardid,cardnumber,cardbalance,transacttime from cardinfo"); //生成适配器实例 da = new SqlDataAdapter(str_sql,share.con); //填充数据 da.Fill(ds); //绑定数据源 dgv_data.DataSource = ds.Tables[0]; } public void shuaxin() { ds.Tables[0].Clear(); da.Fill(ds.Tables[0]); } private void btn_zc_Click(object sender, EventArgs e) { F_zhuce w = new F_zhuce(); w.ShowDialog(); } private void btn_close_Click(object sender, EventArgs e) { this.Close(); } private void btn_chaxun_Click(object sender, EventArgs e) { if (txt_ID.Text != "") { //执行SQL语句 string str_sql1 = string.Format("select count(*) from cardinfo where cardnumber = '{0}'", txt_ID.Text); //创建命名对象 SqlCommand cmd1 = new SqlCommand(str_sql1, share.con); //打开连接 share.con.Open(); //执行操作 int k = Convert.ToInt32(cmd1.ExecuteScalar()); share.con.Close(); if (k > 0) { F_chaxun a = new F_chaxun(); //执行SQL语句 string str_sql = string.Format("select cardnumber,cardpassword,cardbalance,transacttime from cardinfo where cardnumber = '{0}'", txt_ID.Text); //创建命名对象 SqlCommand cmd = new SqlCommand(str_sql, share.con); //打开连接 share.con.Open(); //执行操作 SqlDataReader reader = cmd.ExecuteReader(); //如果读取到数据就将其显示出来 if (reader.Read()) { a.txt_user.Text = reader[0].ToString(); a.txt_mima.Text = reader[1].ToString(); a.txt_yu_e.Text = reader[2].ToString(); a.txt_xiaji.Text = reader[3].ToString(); } share.con.Close(); a.ShowDialog(); } else { MessageBox.Show("没有该会员!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("请输入要查询的会员ID","操作提示",MessageBoxButtons.OK,MessageBoxIcon.Error); } } private void timer1_Tick(object sender, EventArgs e) { this.lbl_time.Text = "现在时间:"+DateTime.Now.ToString(); } private void F_main_FormClosed(object sender, FormClosedEventArgs e) { } private void F_main_FormClosed_1(object sender, FormClosedEventArgs e) { Application.Exit(); } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { } private void 会员上机ToolStripMenuItem_Click(object sender, EventArgs e) { F_shangji b = new F_shangji(); b.ShowDialog(); } private void btn_updata_Click(object sender, EventArgs e) { F_updatapass m = new F_updatapass(); m.ShowDialog(); } private void btn_del_Click(object sender, EventArgs e) { F_del k = new F_del(); k.ShowDialog(); } private void btn_cz_Click(object sender, EventArgs e) { F_jiaofei qq = new F_jiaofei(); qq.ShowDialog(); } private void 会员下机ToolStripMenuItem_Click(object sender, EventArgs e) { F_xiaji t = new F_xiaji(); t.ShowDialog(); } private void 上机ToolStripMenuItem_Click(object sender, EventArgs e) { F_zhuce w = new F_zhuce(); w.ShowDialog(); } private void 下机ToolStripMenuItem_Click(object sender, EventArgs e) { F_updatapass m = new F_updatapass(); m.ShowDialog(); } private void 网卡充值ToolStripMenuItem_Click(object sender, EventArgs e) { F_jiaofei qq = new F_jiaofei(); qq.ShowDialog(); } private void 会员注销ToolStripMenuItem_Click(object sender, EventArgs e) { F_del k = new F_del(); k.ShowDialog(); } private void 退出系统ToolStripMenuItem_Click(object sender, EventArgs e) { this.Close(); } private void 关于ToolStripMenuItem_Click(object sender, EventArgs e) { F_help a = new F_help(); a.ShowDialog(); } private void 会员换机ToolStripMenuItem_Click(object sender, EventArgs e) { F_huanji1 a = new F_huanji1(); a.ShowDialog(); } private void panel2_Paint(object sender, PaintEventArgs e) { } private void 银色清爽ToolStripMenuItem_Click(object sender, EventArgs e) { string skin = "skin/MacOS.ssk"; skinEngine1.SkinFile = skin; } private void 黑色大气ToolStripMenuItem_Click(object sender, EventArgs e) { string skin = "skin/Calmness.ssk"; skinEngine1.SkinFile = skin; } private void 漂亮红色ToolStripMenuItem_Click(object sender, EventArgs e) { string skin = "skin/DiamondBlue.ssk"; skinEngine1.SkinFile = skin; } private void 绿色春意ToolStripMenuItem_Click(object sender, EventArgs e) { string skin = "skin/OneGreen.ssk"; skinEngine1.SkinFile = skin; } private void 黄色秋凉ToolStripMenuItem_Click(object sender, EventArgs e) { string skin = "skin/XPOrange.ssk"; skinEngine1.SkinFile = skin; } private void lbl_time_Click(object sender, EventArgs e) { } private void 刷新ToolStripMenuItem_Click(object sender, EventArgs e) { shuaxin(); } private void cms_youjian_Opening(object sender, CancelEventArgs e) { } private void wuliaToolStripMenuItem_Click(object sender, EventArgs e) { F_zhuce w = new F_zhuce(); w.ShowDialog(); } private void 密码修改ToolStripMenuItem_Click(object sender, EventArgs e) { F_updatapass m = new F_updatapass(); m.ShowDialog(); } private void 网卡充值ToolStripMenuItem1_Click(object sender, EventArgs e) { F_jiaofei qq = new F_jiaofei(); qq.ShowDialog(); } private void 会会员注销ToolStripMenuItem_Click(object sender, EventArgs e) { F_del k = new F_del(); k.ShowDialog(); } private void 会员上机ToolStripMenuItem1_Click(object sender, EventArgs e) { F_shangji b = new F_shangji(); b.ShowDialog(); } private void 会员下机ToolStripMenuItem1_Click(object sender, EventArgs e) { F_xiaji t = new F_xiaji(); t.ShowDialog(); } private void 会员换机ToolStripMenuItem1_Click(object sender, EventArgs e) { F_huanji1 a = new F_huanji1(); a.ShowDialog(); } private void groupBox1_Enter(object sender, EventArgs e) { } private void panel4_Paint(object sender, PaintEventArgs e) { } private void pictureBox1_Click(object sender, EventArgs e) { } private void groupBox1_Enter_1(object sender, EventArgs e) { } private void label4_Click(object sender, EventArgs e) { } private void label5_Click(object sender, EventArgs e) { } private void groupBox4_Enter(object sender, EventArgs e) { } private void groupBox2_Enter(object sender, EventArgs e) { } private void dgv_data_SelectionChanged(object sender, EventArgs e) { if (dgv_data.SelectedRows.Count < 1) { return; } txt_name.Text = (string)dgv_data.SelectedRows[0].Cells["cardnumber"].Value; txt_balance.Text = Convert.ToString((int)dgv_data.SelectedRows[0].Cells["cardbalance"].Value); txt_time.Text = Convert.ToString(dgv_data.SelectedRows[0].Cells["transacttime"].Value); } private void button3_Click(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { } private void btn_jiqiadd_Click(object sender, EventArgs e) { } private void label5_Click_1(object sender, EventArgs e) { } private void groupBox3_Enter(object sender, EventArgs e) { } } } ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.