C#课程设计餐饮管理系统 下载本文

}

private void contextMenuStrip1_Opened(object sender, EventArgs e) {

} } }

主框架运行实现

4.3日历模块

using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Linq;

21

using System.Windows.Forms;

namespace MrCy {

public partial class frmCalender : Form {

public frmCalender() {

InitializeComponent(); }

private void frmCalender_Load(object sender, EventArgs e) {

} } }

运行界面如下图

22

4.4菜单模块

using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Linq;

using System.Windows.Forms; using System.Data.SqlClient; namespace MrCy {

public partial class frmDC : Form {

public frmDC() {

InitializeComponent(); }

public string RName;

private void frmDC_Load(object sender, EventArgs e) {

this.Text = RName + \点/加菜\;

TreeNode newnode1 = tvFood.Nodes.Add(\锅底\); TreeNode newnode2 = tvFood.Nodes.Add(\配菜\); TreeNode newnode3 = tvFood.Nodes.Add(\烟酒\); TreeNode newnode4 = tvFood.Nodes.Add(\主食\); SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open();

SqlCommand cmd = new SqlCommand(\foodty='1'\, conn);

SqlDataReader sdr = cmd.ExecuteReader(); while (sdr.Read()) {

23

newnode1.Nodes.Add(sdr[3].ToString().Trim()); }

sdr.Close();

cmd = new SqlCommand(\, conn);

sdr = cmd.ExecuteReader(); while (sdr.Read()) {

newnode2.Nodes.Add(sdr[3].ToString().Trim()); }

sdr.Close();

cmd = new SqlCommand(\, conn);

sdr = cmd.ExecuteReader(); while (sdr.Read()) {

newnode3.Nodes.Add(sdr[3].ToString().Trim()); }

sdr.Close();

cmd = new SqlCommand(\, conn);

sdr = cmd.ExecuteReader(); while (sdr.Read()) {

newnode4.Nodes.Add(sdr[3].ToString().Trim()); }

sdr.Close();

cmd = new SqlCommand(\,conn); sdr = cmd.ExecuteReader(); while (sdr.Read()) {

cbWaiter.Items.Add(sdr[\].ToString().Trim()); }

cbWaiter.SelectedIndex = 0; sdr.Close();

24