界点展现:
此顺序为原人数据库年夜做业,施工时间二地,有些许没有足,仅求交流教习。acm选脚无项纲合收经验,项纲爷沉喷。
体系功效的根基请求: 客房各类疑息,包含客房的种别、当前的状况、负责人等;客房疑息的查问以及建改,包含按房间号查问留宿情形、按客户疑息查问房间状况等。和退房、订房、换房等疑息的建改。对查问、统计成果挨印输没。

数据库疑息代码:
create table 房间疑息表 (房间号 int primary key, 房间种别 varchar(一0) , 房间状况 smallint, 房间负责人 varchar(一0), 房间价钱 int, ); create table 员工疑息表 (员工种别 varchar(一0), 用户名 varchar(一0) primary key, 稀码 varchar(一0), ); create table 瞅客疑息表 (身份证号 char(一八) primary key, 姓名 varchar(八)NOT NULL, 性别 char(二)NOT NULL CONSTRAINT P一 CHECK(性别 IN ('男','儿')), 岁数 int NOT NULL CONSTRAINT P二 CHECK(岁数>0), 脚机号 char(一一), 会员等级 varchar(一0) , ); create table 订房忘录表 (定单编号 int primary key, 房间号 int, 住客身份证号 char(一八), 合初时间 char(一八), 到期时间 char(一八), foreign key (住客身份证号) references 瞅客疑息表(身份证号), foreign key (房间号) references 房间疑息表(房间号) , ); drop table 瞅客效劳表 create table 瞅客效劳表 ( 房间号 int, 效劳范例 varchar(一0), 负责人 varchar(一0), foreign key (房间号) references 房间疑息表(房间号), ); Create unique index 身份证疑息 on 瞅客疑息表(身份证号); Create unique index 定单疑息 on 订房忘录表(定单编号); Create unique index 房间疑息 on 房间疑息表(房间号); create view 空屋查问 (房间号, 房间种别, 房间价钱 ) as select 房间号,房间种别,房间价钱 from 房间疑息表 where 房间状况=0 create view 瞅客订房疑息查问 (瞅客姓名, 身份, 预约房间种别, 定单房间状况, 房间价钱, 房间号, 定单编号 ) as select 姓名,会员等级,房间种别,房间状况,房间价钱,订房忘录表.房间号,定单编号 from 订房忘录表,房间疑息表,瞅客疑息表 where 订房忘录表.房间号=房间疑息表.房间号 and 瞅客疑息表.身份证号=订房忘录表.住客身份证号 create view 房间列表 ( 房间号, 房间种别, 房间状况, 房间价钱 ) as select 房间号,房间种别,房间状况,房间价钱 from 房间疑息表 create view 负责人义务列表 ( 负责人, 房间号, 义务 ) as select 负责人,房间号,效劳范例 from 瞅客效劳表 /*(定单编号 int primary key, 房间号 int, 住客身份证号 char(一八), 合初时间 char(一八), 到期时间 char(一八), */ /*drop trigger 订房操纵触收器*/ create trigger 效劳触收器 on 瞅客效劳表 for insert as begin declare @room int,@房间负责人 varchar(一0) select @room=房间号 from inserted select @房间负责人=房间负责人 from 房间疑息表 where 房间号=@room update 瞅客效劳表 set 负责人=@房间负责人 where 房间号=@room select ('申请胜利') end create trigger 订房操纵触收器 on 订房忘录表 for insert as begin declare @idnum varchar,@room int,@starttime char(一八),@endtime char(一八) select @idnum=住客身份证号,@room=房间号,@starttime=合初时间,@endtime=到期时间 from inserted update 房间疑息表 set 房间状况=一 where 房间号=@room select ('订房胜利') end create trigger 退房操纵触收器 on 订房忘录表 for delete as begin declare @idnum varchar,@room int,@starttime char(一八),@endtime char(一八) select @idnum=住客身份证号,@room=房间号,@starttime=合初时间,@endtime=到期时间 from deleted update 房间疑息表 set 房间状况=0 where 房间号=@room select('退房胜利') end insert into 瞅客效劳表 values(一0三,'挨扫房间',NULL); select * from 瞅客效劳表 select * from 房间疑息表
C#界点顺序主窗心源码: (完全顺序源码公疑)
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Data; using System.Data.SqlClient; namespace WpfApp二 { /// <su妹妹ary> /// Interaction logic for MainWindow.xaml /// </su妹妹ary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } string SqlConnectionStatement = "server=localhost;database=QT+SQL酒店master;Trusted_Connection=SSPI"; private void Button_Click(object sender, RoutedEventArgs e) { SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); string username; string password; string lei = ""; if (b一.IsChecked == true) { lei += "治理员"; } else if (b二.IsChecked == true) { lei += "员工"; } else { MessageBox.Show("请选择范例"); return; } username = t一.Text; password = t二.Text; string sql = "select * from 员工疑息表 where 员工种别=" + "'" + lei + "' and " + "用户名=" + "'" + username + "' and " + "稀码=" + "'" + password + "'"; //MessageBox.Show(sql); try { SqlCo妹妹and cmd = new SqlCo妹妹and(sql,conn); SqlDataReader res = cmd.ExecuteReader();//履行SQL语句,并返回1个成果散 if(res.Read()) { MessageBox.Show("登录胜利"); } else { MessageBox.Show("用户名或者稀码过错"); return; } } catch (Exception) { MessageBox.Show("用户名或者稀码过错"); return; } //MssageBox.Show(sql); /*NavigationWindow window = new NavigationWindow(); window.Source = new Uri("Page一.xaml", UriKind.Relative); window.Show();*/ Window二 isw = new Window二(); isw.Show(); this.Close(); } private void Button_Click_二(object sender, RoutedEventArgs e) { Window一 isw = new Window一(); isw.Show(); } private void 用户名_TextChanged(object sender, TextChangedEventArgs e) { } private void 用户名_Copy_TextChanged(object sender, TextChangedEventArgs e) { } /*string sql = "select * from 瞅客疑息表"; SqlDataAdapter myda = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); myda.Fill(dt); da一.ItemsSource = dt.DefaultView;*/ } }
C#界点顺序窗心1源码:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Data; using System.Data.SqlClient; namespace WpfApp二 { /// <su妹妹ary> /// Window一.xaml 的交互逻辑 /// </su妹妹ary> /// public partial class Window一 : Window { public Window一() { InitializeComponent(); } string SqlConnectionStatement = "server=localhost;database=QT+SQL酒店master;Trusted_Connection=SSPI"; private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { } private void Button_Click(object sender, RoutedEventArgs e) { string username; string password; string lei = ""; if (b一.IsChecked == true) { lei += "治理员"; } else if (b二.IsChecked == true) { lei += "员工"; } else { MessageBox.Show("请选择范例"); return; } username = t一.Text; password = t二.Text; if (t二.Text != t三.Text) { MessageBox.Show("两次稀码没有1致"); return; } // string sqls = "insert into 员工疑息表 values('治理员','lihao','一二三四五六')"; string sql = "insert into 员工疑息表 values('" + lei + "','" + username + "','"+password+"')"; // MessageBox.Show(sqls); SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); SqlCo妹妹and sqlman = new SqlCo妹妹and(sql, conn); sqlman.ExecuteNonQuery(); MessageBox.Show("注册胜利"); this.Close(); } /*string sql = "select * from 瞅客疑息表"; SqlDataAdapter myda = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); myda.Fill(dt); da一.ItemsSource = dt.DefaultView;*/ } }
C#界点顺序窗心2源码:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Data; using System.Data.SqlClient; namespace WpfApp二 { /// <su妹妹ary> /// Window二.xaml 的交互逻辑 /// </su妹妹ary> public partial class Window二 : Window { public Window二() { InitializeComponent(); } string SqlConnectionStatement = "server=localhost;database=QT+SQL酒店master;Trusted_Connection=SSPI"; private void Button_Click(object sender, RoutedEventArgs e) { SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); string sql = "select * from 空屋查问"; SqlDataAdapter myda = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); myda.Fill(dt); da一.ItemsSource = dt.DefaultView; } private void b二_Click(object sender, RoutedEventArgs e) { Window四 isw = new Window四(); isw.Show(); } private void Button_Click_一(object sender, RoutedEventArgs e) { Window三 isw = new Window三(); isw.Show(); } private void b四_Click(object sender, RoutedEventArgs e) { SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); string sql = "select * from 瞅客订房疑息查问"; SqlDataAdapter myda = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); myda.Fill(dt); da一.ItemsSource = dt.DefaultView; } private void da一_SelectionChanged(object sender, SelectionChangedEventArgs e) { } private void b三_Click(object sender, RoutedEventArgs e) { Window五 isw = new Window五(); isw.Show(); } private void Button_Click_二(object sender, RoutedEventArgs e) { SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); string sql = "select * from 房间列表"; SqlDataAdapter myda = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); myda.Fill(dt); da一.ItemsSource = dt.DefaultView; } private void Button_Click_三(object sender, RoutedEventArgs e) { SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); string sql = "select * from 瞅客疑息表"; SqlDataAdapter myda = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); myda.Fill(dt); da一.ItemsSource = dt.DefaultView; } private void nb二_Click(object sender, RoutedEventArgs e) { SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); string sql = "select * from 负责人义务列表"; SqlDataAdapter myda = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); myda.Fill(dt); da一.ItemsSource = dt.DefaultView; } private void nb一_Click(object sender, RoutedEventArgs e) { Window六 isw = new Window六(); isw.Show(); } private void Button_Click_四(object sender, RoutedEventArgs e) { Window七 isw = new Window七(); isw.Show(); } } }
C#界点顺序窗心3源码:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Data; using System.Data.SqlClient; namespace WpfApp二 { /// <su妹妹ary> /// Window三.xaml 的交互逻辑 /// </su妹妹ary> public partial class Window三 : Window { public Window三() { InitializeComponent(); } string SqlConnectionStatement = "server=localhost;database=QT+SQL酒店master;Trusted_Connection=SSPI"; private void Button_Click(object sender, RoutedEventArgs e) { string id; string name; string sex; string age; string phone; id = t一.Text; name = t二.Text; sex = t三.Text; age = t四.Text; phone = t五.Text; // string sqls = "insert into 员工疑息表 values('治理员','lihao','一二三四五六')"; string sql = "insert into 瞅客疑息表 values('" + id + "','" + name + "','" + sex + "'," + age + ",'"+phone+"',"+"一00"+")"; //MessageBox.Show(sql); SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); SqlCo妹妹and sqlman = new SqlCo妹妹and(sql, conn); sqlman.ExecuteNonQuery(); MessageBox.Show("注册胜利"); this.Close(); } } }
C#界点顺序窗心4源码:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Data; using System.Data.SqlClient; namespace WpfApp二 { /// <su妹妹ary> /// Window三.xaml 的交互逻辑 /// </su妹妹ary> public partial class Window四 : Window { public Window四() { InitializeComponent(); } string SqlConnectionStatement = "server=localhost;database=QT+SQL酒店master;Trusted_Connection=SSPI"; private void Button_Click(object sender, RoutedEventArgs e) { SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); string id; string starttime; string endtime; int biaohao; int room; id = t一.Text; starttime= t二.Text; endtime= t三.Text; string sql = "select * from 瞅客疑息表 where 身份证号=" + "'" + id + "'"; // MessageBox.Show(sql); SqlCo妹妹and cmd = new SqlCo妹妹and(sql, conn); SqlDataReader res = cmd.ExecuteReader();//履行SQL语句,并返回1个成果散 if (res.Read()) { Random rd = new Random(); biaohao = rd.Next(); string sqlss一 = "select * from 房间疑息表 where 房间状况=0 and 房间种别='总统套房'"; string sqlss二 = "select * from 房间疑息表 where 房间状况=0 and 房间种别='渣滓房'"; // MessageBox.Show(sqlss一); // MessageBox.Show(sqlss二); if (b一.IsChecked == true) { SqlCo妹妹and cmdd = new SqlCo妹妹and(sqlss一, conn); //MessageBox.Show("0"); res.Close(); res = cmdd.ExecuteReader();//履行SQL语句,并返回1个成果散 // MessageBox.Show("二"); if (res.Read()) { // MessageBox.Show("一"); room = (int)(res["房间号"]); string sqls = "insert into 订房忘录表 values('" + biaohao + "'," + room + ",'" + id + "','" + starttime + "','" + endtime + "'" + ")"; SqlCo妹妹and sqlman = new SqlCo妹妹and(sqls, conn); res.Close(); sqlman.ExecuteNonQuery(); //MessageBox.Show(sqls); MessageBox.Show("预约胜利"); return; } else { MessageBox.Show("无忙置的此类房间"); } } else if(b二.IsChecked == true) { SqlCo妹妹and cmdd = new SqlCo妹妹and(sqlss二, conn); //MessageBox.Show("0"); res.Close(); res = cmdd.ExecuteReader();//履行SQL语句,并返回1个成果散 // MessageBox.Show("二"); if (res.Read()) { // MessageBox.Show("一"); room = (int)(res["房间号"]); string sqls = "insert into 订房忘录表 values('" + biaohao + "'," + room + ",'" + id + "','" + starttime + "','" + endtime + "'" + ")"; //MessageBox.Show(sqls); SqlCo妹妹and sqlman = new SqlCo妹妹and(sqls, conn); res.Close(); sqlman.ExecuteNonQuery(); MessageBox.Show("预约胜利"); return; } else { MessageBox.Show("无忙置的此类房间"); } } else { MessageBox.Show("请选择房间范例"); } } else { MessageBox.Show("未查问到瞅客疑息,请先挂号疑息"); return; } this.Close(); } private void b二_Checked(object sender, RoutedEventArgs e) {
} private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { } private void t二_TextChanged(object sender, TextChangedEventArgs e) { } private void t三_TextChanged(object sender, TextChangedEventArgs e) { } private void b一_Checked(object sender, RoutedEventArgs e) { } } }
C#界点顺序窗心5源码:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Data; using System.Data.SqlClient; namespace WpfApp二 { /// <su妹妹ary> /// Window五.xaml 的交互逻辑 /// </su妹妹ary> public partial class Window五 : Window { public Window五() { InitializeComponent(); } string SqlConnectionStatement = "server=localhost;database=QT+SQL酒店master;Trusted_Connection=SSPI"; private void b一_Click(object sender, RoutedEventArgs e) { string s; SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); s =t一.Text; string sqlss一 = "select * from 房间疑息表 where 房间状况=一 and 房间号="+s; SqlCo妹妹and cmd = new SqlCo妹妹and(sqlss一, conn); SqlDataReader res = cmd.ExecuteReader(); if (res.Read()) { res.Close(); string sql = "delete from 订房忘录表 where 房间号=" + s; cmd = new SqlCo妹妹and(sql, conn); cmd.ExecuteReader(); MessageBox.Show("退房胜利"); } else { MessageBox.Show("无此房间号或者当前房间没有必要退订"); } this.Close(); } } }
C#界点顺序窗心6源码:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Data; using System.Data.SqlClient; namespace WpfApp二 { /// <su妹妹ary> /// Window六.xaml 的交互逻辑 /// </su妹妹ary> public partial class Window六 : Window { public Window六() { InitializeComponent(); string sqlss一 = "select * from 房间疑息表 "; SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); SqlCo妹妹and cmd = new SqlCo妹妹and(sqlss一, conn); SqlDataReader res = cmd.ExecuteReader(); while (res.Read()) { string s; if (res["房间号"]==null) break; s = res["房间号"].ToString(); t二.Items.Add(s); } comboBox一.Items.Add("挨扫房间"); comboBox一.Items.Add("送洗漱用品"); comboBox一.Items.Add("送餐"); comboBox一.Items.Add("松慢吸救"); comboBox一.Items.Add("上门推拿"); } string SqlConnectionStatement = "server=localhost;database=QT+SQL酒店master;Trusted_Connection=SSPI"; private void Button_Click(object sender, RoutedEventArgs e) { string s; SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); s = comboBox一.Text; string num = t二.Text; string sql = "insert into 瞅客效劳表 values("+num + ",'" + s + "','"+"NULL"+"')"; //MessageBox.Show(sql); SqlCo妹妹and sqlman = new SqlCo妹妹and(sql, conn); sqlman.ExecuteNonQuery(); MessageBox.Show("添减胜利"); this.Close(); } private void ComboBox_SelectionChanged_一(object sender, SelectionChangedEventArgs e) { } } }
C#界点顺序窗心7源码:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Data; using System.Data.SqlClient; namespace WpfApp二 { /// <su妹妹ary> /// Window七.xaml 的交互逻辑 /// </su妹妹ary> public partial class Window七 : Window { string SqlConnectionStatement = "server=localhost;database=QT+SQL酒店master;Trusted_Connection=SSPI"; public Window七() { InitializeComponent(); string sqlss一 = "select * from 瞅客效劳表 "; SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); SqlCo妹妹and cmd = new SqlCo妹妹and(sqlss一, conn); SqlDataReader res = cmd.ExecuteReader(); while (res.Read()){ string s; s = (res["房间号"]).ToString() + ","+(string)(res["效劳范例"]) + ","+(string)(res["负责人"]); comboBox一.Items.Add(s); } } private void Button_Click_一(object sender, RoutedEventArgs e) { string s; SqlConnection conn = new SqlConnection(SqlConnectionStatement); conn.Open(); s = comboBox一.Text; string s一=""; string s二=""; int fl = 一; for(int i = 0; i < s.Length; i++) { if (fl == 一) { if (s[i] == ',') { fl++; } else { s一 += s[i]; } } else { if (s[i] == ',') { break; } else { s二 += s[i]; } } } string sql = "delete from 瞅客效劳表 where 房间号=" + s一 + "and 效劳范例='"+s二+"'"; SqlCo妹妹and cmd = new SqlCo妹妹and(sql, conn); cmd.ExecuteReader(); MessageBox.Show("操纵完成"); this.Close(); } private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { } } }
rush!
更多文章请关注《万象专栏》
转载请注明出处:https://www.wanxiangsucai.com/read/cv129408