?? fyd.cs
字號(hào):
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: 在此處添加構(gòu)造函數(shù)邏輯
//
}
public DataSet selyd() //查詢預(yù)約表
{
try
{
string str="select yid as 編號(hào),yname as 客人姓名,yphone as 客人電話,yctype as 餐廳類型,czid as 餐桌號(hào),yktype as 客人類型,ytime as 預(yù)約時(shí)間,dtime as 用餐時(shí)間 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) //添加預(yù)約表
{
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) //刪除預(yù)約表
{
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;
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -