C#课程设计餐饮管理系统(6)

2020-02-20 15:01

if (txtpnum.Text == \) {

MessageBox.Show(\数量不能为空\); return; } else {

txtallprice.Text =

Convert.ToString(Convert.ToInt32(txtprice.Text) * Convert.ToInt32(txtpnum.Text)); } } }

private void txtpnum_TextChanged(object sender, EventArgs e) {

if (txtpnum.Text == \) {

MessageBox.Show(\数量不能为空\); return; } else {

if (Convert.ToInt32(txtpnum.Text) < 1) {

MessageBox.Show(\不能为小于的数字\); return; } else {

txtallprice.Text =

Convert.ToString(Convert.ToInt32(txtprice.Text) * Convert.ToInt32(txtpnum.Text)); } } }

private void GetData()

26

{

SqlConnection conn = BaseClass.DBConn.CyCon(); SqlDataAdapter sda = new SqlDataAdapter(\

foodname,foodsum,foodallprice,waitername,beizhu,zhuotai,datatime ,ID from tb_GuestFood where zhuotai='\ + RName + \, conn); DataSet ds = new DataSet(); sda.Fill(ds);

dgvFoods.DataSource = ds.Tables[0]; }

private void txtpnum_KeyPress(object sender, KeyPressEventArgs e) {

if ((e.KeyChar != 8 && !char.IsDigit(e.KeyChar)) && e.KeyChar != 13)

{

MessageBox.Show(\请输入数字\); e.Handled = true; } }

private void btnDelete_Click(object sender, EventArgs e) {

if (dgvFoods.SelectedRows.Count > 0) {

//string names = dgvFoods.SelectedCells[0].Value.ToString(); int intID =

Convert.ToInt32(dgvFoods.CurrentRow.Cells[7].Value);

SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open();

//SqlCommand cmd = new SqlCommand(\tb_GuestFood where foodname='\conn);

SqlCommand cmd = new SqlCommand(\tb_GuestFood where ID = '\ + intID + \, conn); cmd.ExecuteNonQuery();

27

conn.Close(); GetData(); } }

private void btnSave_Click(object sender, EventArgs e) {

if (txtName.Text == \ || txtNum.Text == \|| txtprice.Text == \) {

MessageBox.Show(\请将选择菜系\); return; } else {

if (txtpnum.Text == \) {

MessageBox.Show(\数量不能为空\); return; } else {

if (Convert.ToInt32(txtpnum.Text) <= 0) {

MessageBox.Show(\请输入消费数量\); return; } else {

SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open();

SqlCommand cmd = new SqlCommand(\tb_GuestFood(foodnum,foodname,foodsum,foodallprice,waitername,beizhu,zhuotai,datatime) values('\ + txtNum.Text.Trim() + \ + txtName.Text.Trim() + \ + txtpnum.Text.Trim() + \ + Convert.ToDecimal(txtallprice.Text.Trim()) + \ + cbWaiter.SelectedItem.ToString() + \ + txtbz.Text.Trim() + \ + RName + \ +

28

DateTime.Now.ToString() + \, conn);

cmd.ExecuteNonQuery(); conn.Close(); GetData(); } } } }

private void btnExit_Click(object sender, EventArgs e) {

this.Close(); }

private void groupBox2_Enter(object sender, EventArgs e) {

}

} }

运行结果

29

第五部分 结束语

经过这次开发基C#的餐饮管理系统系统的设计与实现的设计,使我对C#有较深的认识及体会。在本开发系统时,由于是本人初次接触有关C#领域;在知识、经验方面都存在着太多的不足。另外,在开发的整个过程中,时间也较仓促。因此,该系统必然会存在很多不足。因为对整个学校的管理模式不够了解及对整个系统的流程不够熟悉,在需求分析阶段用户的需求未能做到完全满足,如系统还没做到请假信息的管理,不能从考核信息中得出考核工资等等。在系统功能上,还有部分问题是我还没有考虑到的,所以本系统还有继续开发一定空

30


C#课程设计餐饮管理系统(6).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:[思想汇报]20XX年7月入党积极分子思想汇报范文:为实现目标而奋

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: