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

超市收银系统(流程图+摘要+任务书+开题报告+ER图+源程序) 第14页
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;

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

        private void button1_Click(object sender, EventArgs e)
        {
            User manageU = new User();
            manageU.Show();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            member mem = new member();
            mem.Show();
        }

        private void button4_Click(object sender, EventArgs e)
        {

        }

        private void button5_Click(object sender, EventArgs e)
        {
            ProductMange proManage = new ProductMange();
            proManage.Show();
        }
    }
}
using System;
/************************************************************************************
 * 作    者: 王 X
 * 创建日期:20XX.05.01
 * 描    述:用户修改密码
 * 名    称:密码更改
 * *****************************************************************************/
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 Alter : Form
    {
        public Alter()
        {
            InitializeComponent();
        }

        private void conform_Click(object sender, EventArgs e)
        {
            UpdateData();
        }
        public void UpdateData()
        {
            int userid = int.Parse(this.userid.Text);
            string username = this.username.Text;
            int oldpassword = int.Parse(this.oldpwd.Text);
            int newpassword = int.Parse(this.newpwd.Text);
            string updateUser = "UPDATE [user] SET username = '" + username + "'," +
"password = " + newpassword + " WHERE (userid = " + userid + ")";
           
            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(updateUser, conn);
                conn.Open();
               
                int rowReturn = command.ExecuteNonQuery();

                Console.WriteLine(rowReturn +"");

                flaglable.Text = "Update OK";
            }

        }

        private void cansle_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
/************************************************************************
 * 作    者: 王 X
 * 创建日期:20XX.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 AterProduct : Form
    {
        public AterProduct()
        {
            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);
            float total = float.Parse(this.total.Text);
string updateUser = @"UPDATE Product SET productname = '" + productname + "', unit = '" + unit +
"', priceperunit = " + priceperunit + ", number = " + number + ", total = " + total + " WHERE (productid = " + productid + ")";

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

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有