本文实例为大家分享了C#实现餐饮管理系统的具体代码,供大家参考,具体内容如下
此系统采用C#语言的Winfrom和ADO.NET技术搭建的简单的CS系统。
部分代码:
frmBook.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DAL;
namespace Catering
{
public partial class frmBook : Form
{
public frmBook()
{
InitializeComponent();
}
public void getData()
{
string Filter = " WHERE 1 = 1 ";
if (txtName.Text.Trim() != "")
{
Filter += " AND Name Like '%" + txtName.Text + "%'";
}
BookEntity book = new BookEntity();
DataTable dt = book.Query(Filter);
this.dataGridView1.DataSource = dt;
for (int i = 1; i < this.dataGridView1.Columns.Count; i++)
{
this.dataGridView1.Columns[i].ReadOnly = true;
}
}
private void frmBook_Load(object sender, EventArgs e)
{
getData();
}
//全选
private void btnChose_Click(object sender, EventArgs e)
{
bool b = false;
if (btnChose.Text == "全 选")
{
b = true;
btnChose.Text = "取消全选";
}
else
{
b = false;
btnChose.Text =