📄 frmcaidanadd.cs
字号:
using System;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
namespace bggl.cs
{
/// <summary>
/// frmcaidanadd 的摘要说明。
/// </summary>
public class frmcaidanadd
{
conn.conn tianchong=new bggl.conn.conn();
DataSet objset=new DataSet ();
public frmcaidanadd()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public DataSet selectcaidan(int weizhi)
{
try
{
objset=tianchong.selectexe("select * from BG_Menu where mid='"+weizhi+"'","BG_Menu");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return objset;
}
public DataSet selectmenule()
{
try
{
objset=tianchong.selectexe("select mid as 菜单编号,mtype as 菜型,mname as 菜名,mcpuid as 菜名编号,mprice as 单价 from BG_Menu","BG_Menu");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message);
}
return objset;
}
public bool addcaidan(string type,string name,string cdid,string price)
{
try
{
string str=null;
str="insert into BG_Menu values('"+type+"','"+name+"','"+cdid+"',"+price+",0) ";
tianchong.execomm(str);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
return true;
}
public bool updatecaidan(int id,string type,string name,string cdid,string price)
{
try
{
string str=null;
str="update BG_Menu set mtype='"+type+"',mname='"+name+"',mcpuid='"+cdid+"',mprice="+price+" where mid="+id+"";
tianchong.execomm(str);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
return true;
}
public bool deletecaidan(int id)
{
try
{
string str=null;
str="delete from BG_Menu where mid like "+id+"";
tianchong.execomm(str);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
return true;
}
public DataSet selectmenutype(string cttype)
{
string str=null;
str="select mid as 编号,mtype as 菜单类型,mname as 菜单名,mcpuid as 菜单编号,mprice as 菜单价格,mbit as 是否点单 from BG_Menu where mtype in (select CTzs from BG_CTtype where CTqy='"+cttype+"')";
try
{
objset=tianchong.selectexe(str,"BG_Menu");
}
catch(SqlException ex)
{
MessageBox.Show(ex.Message.ToString());
}
return objset;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -