📄 fyd.cs
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace bggl.cs
{
/// <summary>
/// fyd 的摘要说明。
/// </summary>
public class fyd
{
bggl.conn.conn con=new bggl.conn.conn();
DataSet objset=new DataSet();
public fyd()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public DataSet selyd() //查询预约表
{
try
{
string str="select yid as 编号,yname as 客人姓名,yphone as 客人电话,yctype as 餐厅类型,czid as 餐桌号,yktype as 客人类型,ytime as 预约时间,dtime as 用餐时间 from BG_YD";
objset=con.selectexe(str,"BG_YD");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return objset;
}
public bool insertyd(string name,string phone,string type,string zwh,string ktype,string ydtime,string yctime) //添加预约表
{
try
{
string str="insert into BG_YD values('"+name+"','"+phone+"','"+type+"','"+zwh+"','"+ktype+"','"+ydtime+"','"+yctime+"')";
con.execomm(str);
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return true;
}
public bool deleteyd(string zwh) //删除预约表
{
try
{
string str="delete from BG_YD where czid like '"+zwh+"'";
con.execomm(str);
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return true;
}
public bool updateyd(int id,string name,string phone,string type,string zwh,string ktype,string ydtime,string yctime)
{
try
{
string str="update BG_YD set yname='"+name+"',yphone='"+phone+"',yctype='"+type+"',czid='"+zwh+"',yktype='"+ktype+"',ytime='"+ydtime+"',dtime='"+yctime+"' where yid="+id+"";
con.execomm(str);
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return true;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -