毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

超市收银系统(流程图+摘要+任务书+开题报告+ER图+源程序) 第13页

更新时间:2010-5-14:  来源:毕业论文
超市收银系统(流程图+摘要+任务书+开题报告+ER图+源程序) 第13页
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 System.Data.SqlClient;
using System.Data.Sql;
using System.Data.SqlServerCe;//由于数据库原因,所以选择了SqlServerCe Compact

namespace SuperDesign
{
    public partial class Addmember : Form
    {
        public Addmember()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int memberid = int.Parse(this.memid.Text);
            string membername = this.memname.Text;
            float total = float.Parse(this.total.Text);


string insertSql = "INSERT INTO member (memberid, membername, total) VALUES ("+memberid +", '"+membername+"' ,"+total+")";//插入会员
            string connectionString =
@"Data Source=|DataDirectory|\SuperMarket.sdf;Password=123456";
            using (System.Data.SqlServerCe.SqlCeConnection conn = new System.Data.SqlServerCe.SqlCeConnection(connectionString))//连接数据库
            {

SqlCeCommand command = new SqlCeCommand(insertSql, conn);
                conn.Open();//打开数据库
                int rowReturn = command.ExecuteNonQuery();//执行cmd
                flaglable.Text = "insert ok" + rowReturn;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int memberid = int.Parse(this.memid.Text);
            string deleteSql = "DELETE [member] WHERE memberid = "+memberid;//删除会员
            string connectionString =
@"Data Source=|DataDirectory|\SuperMarket.sdf;Password=123456";
            using (System.Data.SqlServerCe.SqlCeConnection conn = new System.Data.SqlServerCe.SqlCeConnection(connectionString))
            {

                SqlCeCommand command = new SqlCeCommand(deleteSql, conn);
                conn.Open();
                int rowReturn = command.ExecuteNonQuery();
                flaglable.Text = "delete ok" + rowReturn;
            }
        }
    }
}


/********************************************************************
 * 作    者: 王 宇
 * 创建日期:2008.05.01
 * 描    述:管理员向数据库中添加商品的具体信息
 * 名    称:添加商品
 * ********************************************************************/

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 System.Data.SqlClient;
using System.Data.Sql;
using System.Data.SqlServerCe;
namespace SuperDesign
{
    public partial class AddProduct : Form
    {
        public AddProduct()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int productid = int.Parse(this.productid.Text);
            string productname = this.productname.Text;
            string unit = this.unit.Text;
            int number = int.Parse(this.number.Text);
            float priceperunit = float.Parse(this.priceperunit.Text);
            fl www.751com.cn  productname + "'" + "," +  "'"+unit + "'"+ "," + number + "," + priceperunit + "," + total + ")";
            string connectionString =
@"Data Source=|DataDirectory|\SuperMarket.sdf;Password=123456";
            using (System.Data.SqlServerCe.SqlCeConnection conn = new System.Data.SqlServerCe.SqlCeConnection(connectionString))
            {

                SqlCeCommand command = new qlCeCommand(insertSql,conn);
                conn.Open();
                int rowReturn = command.ExecuteNonQuery();

 << 上一页  [11] [12] [13] [14] 下一页

超市收银系统(流程图+摘要+任务书+开题报告+ER图+源程序) 第13页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。