您好,欢迎光临本网站![请登录][注册会员]  
文件名称: c# cs2005家庭管理系统
  所属分类: 其它
  开发工具:
  文件大小: 171kb
  下载次数: 0
  上传时间: 2009-02-09
  提 供 者: dongh*****
 详细说明: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using System.Collections; namespace home { public partial class cords : Form { public int id; public Form3 frm3; data dataconn = new data(); public cords(int cid, Form3 myfrm) { InitializeComponent(); id = cid; frm3 = myfrm; string p p = ""; if (id == 0) { this.button3.Visible = true; this.button1.Visible = false; } else { this.button3.Visible = false; this.button1.Visible = true; SqlDataReader dr = dataconn.read("select * from cords where id = " + id); while (dr.Read()) { this.product.Text = dr["product"].ToString(); this.price.Text = dr["price"].ToString(); this.spend.Text = dr["spend"].ToString(); this.ctime.Text = dr["ctime"].ToString(); this.cname.Text = dr["cname"].ToString(); this.content.Text = dr["content"].ToString(); pp = dr["ptype"].ToString(); } dr.Close(); } SqlDataReader dr1 = dataconn.read("select * from ptype"); ArrayList list = new ArrayList(); if (dr1.HasRows) { while (dr1.Read()) { list.Add(new DictionaryEntry(dr1["ptype"].ToString(), dr1["ptype"].ToString())); } this.ptype.DataSource = list; this.ptype.DisplayMember = "key"; this.ptype.ValueMember = "value"; } dr1.Close(); this.ptype.SelectedValue = pp; } private void button1_Click(object sender, EventArgs e) { if (product.Text == "") { MessageBox.Show("产品名称不能为空!", "友情提示"); return; } string weekday = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(ctime.Value.DayOfWeek); SqlDataReader dr1 = dataconn.read("select * from ptype where ptype = '" + ptype.Text + "'"); if (!dr1.HasRows) { dataconn.update("insert into ptype(ptype) values('" + ptype.Text + "')"); } dr1.Close(); dataconn.update("update cords set product = '" + product.Text + "', ptype = '" + ptype.Text + "', price = '" + price.Text + "', spend='" + spend.Text + "',ctime='" + ctime.Text + "',weekday='" + weekday + "',cname='" + cname.Text + "',content='" + content.Text + "' where id = " + id); this.DialogResult = DialogResult.OK; this.frm3.page = 2; this.frm3.getpagecount(); this.frm3.kk(0); this.Close(); } private void button2_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; this.Close(); } private void cords_Closing(object sender, System.ComponentModel.CancelEventArgs e) { this.DialogResult = DialogResult.OK; this.Close(); } private void button3_Click(object sender, EventArgs e) { if (product.Text == "") { MessageBox.Show("产品名称不能为空!", "友情提示"); return; } try { double cc = Convert.ToDouble(price.Text); } catch { MessageBox.Show("单价输入有误!", "友情提示"); return; } try { double cc = Convert.ToDouble(spend.Text); } catch { MessageBox.Show("费用输入有误!", "友情提示"); return; } string weekday = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(ctime.Value.DayOfWeek); SqlDataReader dr1 = dataconn.read("select * from ptype where ptype = '" + ptype.Text + "'"); if (!dr1.HasRows) { dataconn.update("insert into ptype(ptype) values('" + ptype.Text + "')"); } dr1.Close(); dataconn.update("insert into cords(product,ptype,price,spend,ctime,weekday,cname,content) values('" + product.Text + "','" + ptype.Text + "','" + price.Text + "', '" + spend.Text + "','" + ctime.Text + "','" + weekday + "','" + cname.Text + "','" + content.Text + "')"); this.DialogResult = DialogResult.OK; this.frm3.page = 2; this.frm3.getpagecount(); this.frm3.kk(0); this.Close(); } private void button4_Click(object sender, EventArgs e) { dataconn.update("delete from ptype where ptype = '" + ptype.Text + "'"); SqlDataReader dr1 = dataconn.read("select * from ptype"); ArrayList list = new ArrayList(); if (dr1.HasRows) { while (dr1.Read()) { list.Add(new DictionaryEntry(dr1["ptype"].ToString(), dr1["ptype"].ToString())); } this.ptype.DataSource = list; this.ptype.DisplayMember = "key"; this.ptype.ValueMember = "value"; } dr1.Close(); } } } ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: c# cs2005家庭管理系统
 输入关键字,在本站1000多万海量源码库中尽情搜索: