📄 zuowei.cs
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace bggl.cs
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
public class Class1
{
conn.conn con =new bggl.conn.conn();
DataSet objset=new DataSet();
public Class1()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public DataSet selecttree() //查询餐厅类型表以风格为条件
{
string selectsql="select CTqy from BG_CTtype";
try
{
objset=con.selectexe(selectsql,"BG_CTtype");
}
catch(Exception e)
{
MessageBox.Show(e.ToString());
}
return objset;
}
public DataSet selectlistview() //查询座位表
{
string selectsql="select * from BG_CTset";
try
{
objset=con.selectexe(selectsql,"BG_CTset");
}
catch(Exception e)
{
MessageBox.Show(e.ToString());
}
return objset;
}
// public DataSet selechuan(string weizhi)
// {
// string sql="select * from BG_CTset where czid='"+whezhi+"'";
// try
// {
// objset=con.selectexe(sql,"BG_CTset");
// }
// catch(Exception e)
// {
// MessageBox.Show(e.ToString());
// }
// }
public bool updatekaidan(string czid,string cname,string crs,string carea,string kh,string czk,string ctime,string cperson,string cremark,string cempty) //开单
{
try
{
string str=null;
str="update BG_CTset set cempty='正在使用' , crs='"+crs+"',kh='"+kh+"',ctime='"+ctime+"',cperson='"+cperson+"',cremark='"+cremark+"',cname='"+cname+"',czk='"+czk+"' where czid='"+czid+"' and carea='"+carea+"'";
return con.execomm(str);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
return false;
}
}
public DataSet settype() //frmdesk界面中的餐厅类型
{
try
{
objset=con.selectexe("select distinct CTqy from BG_CTtype","BG_CTtype");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return objset;
}
public bool addcanzhuo(string setid,string settype) //添加餐桌
{
try
{
string str=null;
str="insert into BG_CTset values('"+setid+"','"+settype+"','','','','','','','','')";
con.execomm(str);
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return true;
}
public bool delcanzhuo(string setid,string settype) //删除餐桌
{
try
{
string str=null;
str="delete from BG_CTset where czid='"+setid+"'and carea='"+settype+"'";
con.execomm(str);
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return true;
}
public DataSet selempty() //显示空
{
try
{
string str=null;
str="select * from BG_CTset where cempty=''";
objset=con.selectexe(str,"BG_CTset");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return objset;
}
public DataSet seluse() //显示正在使用
{
try
{
string str=null;
str="select * from BG_CTset where cempty='正在使用'";
objset=con.selectexe(str,"BG_CTset");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return objset;
}
public DataSet selstop() //显示停用
{
try
{
string str=null;
str="select * from BG_CTset where cempty='停用'";
objset=con.selectexe(str,"BG_CTset");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return objset;
}
public DataSet selyuyue() //显示预约
{
try
{
string str=null;
str="select * from BG_CTset where cempty='预定'";
objset=con.selectexe(str,"BG_CTset");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return objset;
}
// public bool insertset() //将开单的内容插入进去
// {
// try
// {
// string str=null;
// str="insert into BG_CTset values()"
// }
// }
public DataSet selzuowei() //用于刷新页面
{
try
{
objset=con.selectexe("select * from BG_CTset","BG_CTset");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return objset;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -