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

资源简介

C#咖啡厅系统源码C#咖啡厅系统源码C#咖啡厅系统源码

资源截图

代码片段和文件信息

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)
        {

        }

    }
}

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

     文件      31552  2009-08-25 12:51  vipchongzhi.resx

     文件       2183  2009-08-25 12:51  vipchongzhi.cs

     文件       4531  2009-08-25 12:51  vipchongzhi.Designer.cs

     文件        125  2007-03-27 14:33  最新Asp.Net源码下载.url

     文件     995328  2009-09-01 13:33  bin\Debug\index.exe

     文件     157184  2009-09-01 13:33  bin\Debug\index.pdb

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

     文件    3145728  2009-09-01 13:41  DB_51aspx\CoffeeHouse.mdf

     文件    1048576  2009-09-01 13:41  DB_51aspx\CoffeeHouse_log.ldf

     文件        540  2009-08-24 02:12  obj\Coffee.csproj.FileList.txt

     文件       6542  2009-09-01 13:42  obj\Coffee.csproj.FileListAbsolute.txt

     文件       1388  2009-09-01 13:16  obj\Debug\Coffee.csproj.GenerateResource.Cache

     文件      39371  2009-08-25 12:47  obj\Debug\index.accession.resources

     文件     234700  2009-08-25 11:09  obj\Debug\index.diandan.resources

     文件      36072  2009-08-25 12:35  obj\Debug\index.Enter.resources

     文件     995328  2009-09-01 13:33  obj\Debug\index.exe

     文件     252052  2009-08-25 11:09  obj\Debug\index.insert.resources

     文件      17524  2009-08-25 12:36  obj\Debug\index.insertvip.resources

     文件     252052  2009-08-25 11:09  obj\Debug\index.jiezhang.resources

     文件      33674  2009-08-25 11:49  obj\Debug\index.MainFrom.resources

     文件      17524  2009-09-01 13:16  obj\Debug\index.password.resources

     文件     157184  2009-09-01 13:33  obj\Debug\index.pdb

     文件        180  2009-08-25 11:09  obj\Debug\index.Properties.Resources.resources

     文件      17524  2009-08-25 12:36  obj\Debug\index.vip.resources

     文件      17524  2009-09-01 13:16  obj\Debug\index.vipchongzhi.resources

     文件       4608  2009-08-18 13:05  obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       1158  2009-08-05 08:45  Properties\AssemblyInfo.cs

     文件       2834  2009-08-18 13:05  Properties\Resources.Designer.cs

     文件       5612  2009-08-05 08:45  Properties\Resources.resx

     文件       1103  2009-08-18 13:05  Properties\Settings.Designer.cs

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

评论

共有 条评论

相关资源