• 大小: 2.57MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-14
  • 语言: C#
  • 标签:

资源简介

C#咖啡厅收费系统源码 包含 点单 追加消费 结账 会员管理 有的还没时间去做. 北大青鸟S1的小组答辩项目

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace index
{
    public partial class accession : Form
    {
        public accession()
        {
            InitializeComponent();
        }

        //点击添加按钮事件
        private void button1_Click(object sender EventArgs e)
        {
            if (get())
            {
                int result = 0;
                try
                {
                    //数据库查询语句
                    string sql = string.Format(“insert into commoidty (CNameCpriceCtype) values (‘{0}‘{1}‘{2}‘)“
                               txtname.Text txtprice.Text cbotype.Text);
                    SqlCommand cmd = new SqlCommand(sql DBHelper.con);
                    DBHelper.con.Open();
                     result = cmd.ExecuteNonQuery();

                }
                catch (Exception ex)
                {

                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    DBHelper.con.Close();
                }
                //判断添加是否成功
                if (result == 1)
                {
                    MessageBox.Show(“添加成功“ “提示“);
                    txtname.Text = ““;
                    txtprice.Text = ““;
                    cbotype.Text = ““;
                }
                else
                {
                    MessageBox.Show(“添加失败“ “提示“);
                }
            }

        }

        //非空验证
        private bool get()
        {
            if (txtname.Text.Trim() == ““)
            {
                MessageBox.Show(“请输入商品名“ “提示“);
                txtname.Focus();
                return false;
            }
            else if (txtprice.Text.Trim() == ““)
            {
                MessageBox.Show(“请输入价格.“ “提示“);
                txtprice.Focus();
                return false;
            }
            else if (cbotype.Text.Trim() == ““)
            {
                MessageBox.Show(“请输入商品类型“);
                cbotype.Focus();
                return false;

            }
            else
            {
                return true;
            }
        }
        //清空事件按钮
        private void btoclean_Click(object sender EventArgs e)
        {
            txtname.Text = ““;
            txtprice.Text = ““;
            cbotype.Text = ““;
        }

        private void button2_Click(object sender EventArgs e)
        {
            this.Close();
        }

        private void accession_Load(object sender EventArgs e)
        {

        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    3145728  2009-08-23 17:27  dd\CoffeeHouse.mdf

     文件        906  2009-08-05 10:59  dd\CoffeeHouse.sln

    ..A..H.     41472  2009-08-25 12:51  dd\CoffeeHouse.suo

     文件    1048576  2009-08-23 17:27  dd\CoffeeHouse_log.ldf

     文件       2839  2009-08-25 12:47  dd\index\accession.cs

     文件       8203  2009-08-25 12:47  dd\index\accession.Designer.cs

     文件      64019  2009-08-25 12:47  dd\index\accession.resx

     文件     995328  2009-08-25 12:47  dd\index\bin\Debug\index.exe

     文件     136704  2009-08-25 12:47  dd\index\bin\Debug\index.pdb

     文件       5632  2009-08-25 12:47  dd\index\bin\Debug\index.vshost.exe

     文件          1  2009-08-24 00:42  dd\index\ClassDiagram1.cd

     文件       6545  2009-08-25 12:03  dd\index\Coffee.csproj

     文件        168  2009-08-24 01:16  dd\index\Coffee.csproj.user

     文件        341  2009-08-24 22:41  dd\index\DBHelper.cs

     文件       8678  2009-08-25 12:47  dd\index\diandan.cs

     文件      13890  2009-08-23 20:15  dd\index\diandan.Designer.cs

     文件     357427  2009-08-23 20:15  dd\index\diandan.resx

     文件       3180  2009-08-25 12:35  dd\index\Enter.cs

     文件       6936  2009-08-25 12:35  dd\index\Enter.Designer.cs

     文件      59065  2009-08-25 12:35  dd\index\Enter.resx

     文件       8274  2009-08-25 12:42  dd\index\insert.cs

     文件      14601  2009-08-23 19:21  dd\index\insert.Designer.cs

     文件     383037  2009-08-23 19:21  dd\index\insert.resx

     文件       2558  2009-08-25 12:47  dd\index\insertvip.cs

     文件       5524  2009-08-25 12:36  dd\index\insertvip.Designer.cs

     文件      31552  2009-08-25 12:36  dd\index\insertvip.resx

     文件      10262  2009-08-23 20:20  dd\index\jiezhang.cs

     文件      18476  2009-08-23 20:20  dd\index\jiezhang.Designer.cs

     文件     383773  2009-08-23 20:20  dd\index\jiezhang.resx

     文件      10447  2009-08-25 11:49  dd\index\MainFrom.cs

............此处省略47个文件信息

评论

共有 条评论

相关资源