c论文通讯录管理系统(编辑修改稿)内容摘要:

修改类别 /// summary /// 修改类别 /// /summary /// returns/returns public bool ClsUpdate() { SqlConnection conn = new SqlConnection()。 SqlCommand cmd = ()。 = update classes set ClassName=39。 + ClassName + 39。 ,orderby= + OrderBy + ,ClassTel=39。 +ClassTel +39。 ,ClassAddress=39。 +ClassAddress +39。 where ClassID= + ClassID。 try { ()。 ()。 return true。 } catch { return false。 通讯录管理系统 11 } finally { ()。 } } endregion region bool ClsDel 删除类别 /// summary /// 删除类别 /// /summary /// returns/returns public bool ClsDel() { SqlConnection conn=new SqlConnection()。 SqlCommand cmd=()。 =delete from classes where classid=+ClassID。 try { ()。 ()。 return true。 } catch { return false。 } finally { ()。 } } endregion 通讯录管理系统 12 region DataSet ClsSelect 查询类别表中的内容 /// summary /// 查询类别表中的内容,返回 dataset /// /summary /// returns/returns public DataSet ClsSelect() { SqlDataAdapter DApt=new SqlDataAdapter(select classid as 编号 ,className as 姓名 ,orderby as 年龄 ,classTel as 电话 ,classAddress as 地址 from Classes order by orderby asc,)。 DataSet ds=new DataSet()。 (ds)。 return ds。 } endregion } } 登录模块的实现 登录模块是系统中重要的组成部分,当用户进入系统时必须先通过身份验证,即验证用户登录时输入的用户名和密码是否与数据库中数据表的相关信息相符,并验证校验码是否正确 .如果通过验证,则将用户对象存入 session 中 . 登陆界面如下: 通讯录管理系统 13 关键代码如下: using System。 using。 using。 using。 using。 using。 using。 using。 namespace 通讯录管理系统 { public partial class FormLogin : Form { public int count = 0。 public FormLogin() { InitializeComponent()。 } private void button2_Click(object sender, EventArgs e) { ()。 通讯录管理系统 14 } private void button1_Click(object sender, EventArgs e) { if (()) { (帐号不能为空 )。 ()。 return。 } else if (()) { (密码不能为空 )。 ()。 return。 } else { string sql = select * from admin where userName=39。 + + 39。 and userPass=39。 + + 39。 SqlConnection conn = new SqlConnection()。 SqlCommand cmd = new SqlCommand(sql, conn)。 ()。 SqlDataReader dr = ()。 if (()) { FormMain fm = new FormMain()。 ()。 ()。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。