酒店客房信息管理系统的设计与实现内容摘要:

= [0].DefaultView。 } catch { return。 } } 18 ( 7) 前台管理员密码修改 图 7 前台管理员密码修改 private void 前台操作员管理 _Load(object sender, EventArgs e) { string ConStr = server=左 PC。 User id=u3。 pwd=39。 12339。 database=酒店客房数据库。 SqlConnection con = new SqlConnection(ConStr)。 ()。 SqlCommand = new SqlCommand(select 用户姓名 from 操作用户 2, con)。 SqlDataReader dr = ()。 ()。 while (()) { (dr[0].ToString())。 } ()。 ()。 } private void button1_Click(object sender, EventArgs e) { string ConStr = server=左 PC。 User id=u3。 pwd=123。 database=酒店客房数据库。 SqlConnection con = new SqlConnection(ConStr)。 using (SqlCommand cmd = new SqlCommand()) { ()。 = con。 =。 = 用户 _update。 SqlParameter[] par ={ new SqlParameter(@name, .Text), new SqlParameter(@pwd,this .textBox2 .Text ), 19 new SqlParameter(@zw ,this .textBox3 .Text ) }。 foreach (SqlParameter parms in par) { (parms)。 } ()。 ()。 (已经成功修改 )。 } } private void button2_Click_1(object sender, EventArgs e) { 显示修改后的数据库信息 m = new 显示修改后的数据库信息 ()。 ()。 } private void 显示修改后的数据库信息 _Load(object sender, EventArgs e) { string ConStr = server=左 PC。 User id=u3。 pwd=123。 database=酒店客房数据库。 SqlConnection con = new SqlConnection(ConStr)。 string SqlStr = select * from 操作用户 2。 SqlDataAdapter ada = new SqlDataAdapter(SqlStr, con)。 DataSet ds = new DataSet()。 (ds)。 = [0].DefaultView。 } ( 8) 前台管理员主界面 图 8 前台管理员主界面 private void Form2_Load(object sender, EventArgs e) { try { string ConStr = server=左 PC。 User id=u3。 pwd=39。 12339。 database=酒店客房数据库。 20 SqlConnection con = new SqlConnection(ConStr)。 string SqlStr = select 客房号 ,客房类型 ,楼层 ,价格 from 客房信息。 SqlDataAdapter ada = new SqlDataAdapter(SqlStr, con)。 DataSet ds = new DataSet()。 (ds)。 = [0].DefaultView。 } catch { return。 } } ( 9) 客房预订界面 图 9 客房预订界面 private void Form3_Load(object sender, EventArgs e) { string ConStr1 = server=左 PC。 User id=u3。 pwd=39。 12339。 database=酒店客房数据库。 SqlConnection con1 = new SqlConnection(ConStr1)。 ()。 SqlCommand 1 = new SqlCommand(select 客房号 from 客房信息 where 客房号 not in (select 客房号 from 客人预订 where 客房状态 is not null), con1)。 SqlDataReader dr1 = ()。 ()。 while (()) { (dr1[0].ToString())。 } ()。 ()。 string ConStr3 = server=左 PC。 User id=u3。 pwd=39。 12339。 database=酒店客房数据库。 21 SqlConnection con3 = new SqlConnection(ConStr3)。 ()。 SqlCommand 3 = new SqlCommand(select distinct 预订方式 from 客房信息 , con3)。 SqlDataReader dr3 = ()。 ()。 while (()) { (dr3[0].ToString())。 } ()。 ()。 } private void button1_Click(object sender, EventArgs e) { if ( == || ==|| ==) { (输入信息不完整,请重新输入。 , 信息提示 , , )。 } else { string ConStr = server=左 PC。 User id=u3。 pwd=39。 12339。 database=酒店客房数据库。 SqlConnection con = new SqlConnection(ConStr)。 StringBuilder strSQL = new StringBuilder()。 (insert into 客人预订 (客房号 ,客房类型 ,定金 ,预订方式 ,客人姓名 ,客房状态 ))。 ( values(39。 + () + 39。 ,39。 + ().ToString() + 39。 ,39。 + ().ToString() + 39。 ,39。 + () + 39。 ,39。 + ().ToString() + 39。 ,39。 + ().ToString() + 39。 ))。 using (SqlCommand cmd = new SqlCommand((), con)) { ()。 ()。 ()。 ()。 } (客房预订成功。 , 信息提示 , , )。 =。 } } 22 private void button3_Click(object sender, EventArgs e) { string ConStr1 = server=左 PC。 User id=u3。 pwd=39。 12339。 database=酒店客房数据库。 SqlConnection mycon = new SqlConnection(ConStr1)。 ()。 SqlCommand cmd = new SqlCommand(select 客房类型 from 客房信息 where 客房号 =39。 + () + 39。 , mycon)。 SqlDataReader drr = ()。 while (()) { = (((0)).ToString())。 } ()。 } ( 10) 客人信息录入界面 图 10 客人信息录入界面 private void Form4_Load(object sender, EventArgs e) { string ConStr = server=左 PC。 User id=u3。 pwd=39。 12339。 database=酒店客房数据库。 SqlConnection con = new SqlConnection(ConStr)。 ()。 SqlCommand = new SqlCommand(select 客房号 from 客人预订 , con)。 SqlDataReader dr = ()。 ()。 while (()) { (dr[0].ToString())。 } ()。 ()。 23 } private void button1_Click(object sender, EventArgs e) {。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。