版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
数据库应用系统软件作品说明书小型电子商务图书数据管理系统源代码usingusingusing数据库应用系统软件作品说明书小型电子商务图书数据管理系统源代码usingusingusingusingusingnamespace数据{publicpartialclass用户登录:{public用户{}privatevoidbutton3_Click(objectsender,EventArgs{登陆lvFrm=new登陆}SqlConnectionpublicstaticstringpublicstaticstringprivatevoidbtnLogin_Click(objectsender,EventArgs{conn=new }SqlConnectionpublicstaticstringpublicstaticstringprivatevoidbtnLogin_Click(objectsender,EventArgs{conn=new conn.Open();//打开数SqlCommandcmd=newstringstrsql="select*fromCustomerwhere++"andCpass="+cmd=newSqlCommand(strsql,SqlDataReaderrd=if{BuylvFrm=newHide();用户购买frm2=new用户购买intint.TryParse(txtUserName.Text,outfrm2.STR=}{label4.Text=请正确输入用户名与txtUserPwd.Text=}}privatevoidbutton2_Click(objectsender,{注册lvFrm=new注册}privatevoid{注册lvFrm=new注册}privatevoid用户登录_Load(objectsender,EventArgs{}}}用户登录系统后的购买界面的设考虑到我和管理员的管理系统要合并为同一个完整系统,我在编写用户购买界面时减少了窗体的数量,但是主体功能都在。此处了窗体传值技术、DataGridView控件展示数据库的图书表,订单下图展示了用户登录后的图书查询、图书购买、订单形成、订单查询的操作用户登录后的用户查询所用户查询所有图书的以上三图展以上三图展示用户提交订单并成功用户查询订单源代码usingusingusingusingusing用户查询订单源代码usingusingusingusingusingnamespace数据{publicpartialclass用户购买:{public用户{}privatestringstr;//定义的私有publicstringSTR//为窗体Form2定义的属{get//读{return}set//{str=}}privatevoidlabel5_Click(objectsender,EventArgs{}privatevoidlabel1_Click(objectsender,EventArgs{}SqlConnectionprivatevoidbtnselect_Click(objectsender,EventArgs{conn=newset//{str=}}privatevoidlabel5_Click(objectsender,EventArgs{}privatevoidlabel1_Click(objectsender,EventArgs{}SqlConnectionprivatevoidbtnselect_Click(objectsender,EventArgs{conn=newSqlConnection("DataSource=(local);InitialSqlCommandcmd=newSqlCommand("select*frombooks",SqlDataAdaptersda=newsda.SelectCommand=DataSetds=newsda.Fill(ds,dataGridView1.DataSource=号 称"类别号数 价"数量"; "出版社代号"版次";="第一作者 "出版年月"内容简介}privatevoiddataGridView1_CellClick(object{txtID.Text }privatevoidCalc_Click(objectsender,EventArgs{floata,b,if(float.TryParse(txtPrice.Textouta)&&float.TryParse(txtBquanity.Textoutb))//关于TryParse的使用方法充privatevoidCalc_Click(objectsender,EventArgs{floata,b,if(float.TryParse(txtPrice.Textouta)&&float.TryParse(txtBquanity.Textoutb))//关于TryParse的使用方法充知识{sum=a*txtjin.Text=}{MessageBox.Show("计算出错}}privatevoidbutton1_Click(objectsender,EventArgs{Randomrad=newRandom();//实例化随机数产生器intvalue=rad.Next(1000,10000rad生成大于等于1000,小于等于9999的随机txtRandom.Text= value.ToString();label控件label1显示产生的四位随机}SqlConnectionSqlCommandprivatevoidbtnSubmit_Click(objectsender,EventArgs{conn1=newSqlConnection("DataSource=(local);InitialCatalog=bookstore;IntegratedSqlCommandcmd=newcmd.Connection=cmd.CommandText="insertintoborder(Ono,Cno,bno,quantity,price,paytype,cstatus)values("++","+txtCID.Text.Trim()+","txtID.Text+","+txtBquanity.Text.Trim()+","txtjin.Text.Trim()+","+"'"txtFang.Text.Trim()+"'"+","this.la.Text.Trim().ToString()+cmd.CommandType=MessageBox.Show("提交成功cmd.CommandText="updatebookssetquantity=quantity-"+txtBquanity.Text.Trim()+"wherebno="cmd.CommandType=cmd.CommandText="insertintobsend(Ono,Stype,Sdate)values("+txtRandom.Text+","cmd.CommandText="updatebookssetquantity=quantity-"+txtBquanity.Text.Trim()+"wherebno="cmd.CommandType=cmd.CommandText="insertintobsend(Ono,Stype,Sdate)values("+txtRandom.Text+","this.la.Text.Trim().ToString()+","this.la.Text.Trim().ToString()+cmd.CommandType=}privatevoidbtncheck_Click(objectsender,EventArgs{conn=newSqlConnection("DataSource=(local);InitialCatalog=bookstore;IntegratedSqlCommandcmd=newSqlCommand("select*fromborderwhereCno="+SqlDataAdaptersda=newsda.SelectCommand=DataSetds=newsda.Fill(ds,dataGridView2.DataSource=="订单编号="客户编号="图书编号="数量"; 额"付款方式"订单状态}privatevoiddataGridView1_CellContentClick(objectsender,{}privatevoidlabel3_Click(objectsender,EventArgs{}privatevoidtxtBquanity_TextChanged(objectsender,{}privatelabel4_Click(objectsender,EventArgs{}privatelabel9_Click(objectsender,EventArgs{}privateprivatevoidtxtBquanity_TextChanged(objectsender,{}privatelabel4_Click(objectsender,EventArgs{}privatelabel9_Click(objectsender,EventArgs{}privatebutton2_Click(objectsender,EventArgs{用户登录lvFrm=new用户登录}privatevoidcomboBox1_SelectedIndexChanged(object{}privatevoidBuy_Load(objectsender,EventArgs{txtFang.DropDownStyle=txtFang.Items.Add("货到付款txtFang.Items.Add("网上支付txtCID.Text=}privatevoidtxtPrice_TextChanged(objectsender,{}privatevoidtxtjin_TextChanged(objectsender,EventArgs{}}}用户注用户注}}}用户注用户注册后,数据自动插入数据库中的Customer表中,并在界面处设计了返回登陆窗的下图展示用户注册的源代码usingusingusingusingusingnamespace数据源代码usingusingusingusingusingnamespace数据{publicpartialclass注册:{public注册{}privatevoidFormCZ_Load(objectsender,{}privatevoidbtnreg_Click(objectsender,EventArgs{ClsDB.ClsDBControlDBC=new数据库stringstrSql="insertintoCustomervalues('"+this.txtZUserid.Text.Trim().ToString()+this.txtZUsername.Text.Trim().ToString()+"','"ClsDB.ClsDBControlDBC=new数据库stringstrSql="insertintoCustomervalues('"+this.txtZUserid.Text.Trim().ToString()+this.txtZUsername.Text.Trim().ToString()+"','"+this.txtZUserpwd.Text.Trim().ToString()+this.txtZuseradd.Text.Trim().ToString()+this.txtZUsermail.Text.Trim().ToString()+this.txtZUserpost.Text.Trim().ToString()+ if{MessageBox.Show("注册成功}}privatevoidbutton1_Click(objectsender,{用户登录lvFrmnew用户登录}}}usingusingusingusingusingusingusingusingusingnamespace数据{publicpartialclass管理员登陆usingusingusingusingusingusingusingnamespace数据{publicpartialclass管理员登陆:{public管理员登陆{}privatevoid管理员登陆_Load(objectsender,EventArgs{}privatevoidbutton1_Click(objectsender,EventArgs{用户登录lvFrmnew用户登录}privatevoidtextBox2_TextChanged(objectsender,EventArgs{}SqlConnectionSqlCommandprivatevoidadlog_Click(objectsender,EventArgs{conn1=newSqlConnection("DataSource=(local);InitialCatalog=bookstore;IntegratedSqlCommandcmd1=newcmd1.Connection=cmd1.CommandText="select*fromadmwhereadmname="+"'"++"andadmpass="+cmd1.CommandType=SqlDataReaderrd=if{管理目录lvFrmnew管理目录}{txtadid.Text=cmd1.CommandType=SqlDataReaderrd=if{管理目录lvFrmnew管理目录}{txtadid.Text=txtadpsd.Text=MessageBox.Show("输入有误,请重新输}}privatevoidlabel4_Click(objectsender,EventArgs{}privatevoidsuplog_Click(objectsender,EventArgs{if(txtadid.Text=="super"&&txtadpsd.Text=={superlvFrm=new}{txtadid.Text=txtadpsd.Text=MessageBox.Show("输入有误,请重新输}}}}usingusingusingusingusingusingusingusingusingnamespaceusingusingusingusingusingusingusingusingusingnamespace数据{publicpartialclasssuper:{public{}privatevoidbutton2_Click(objectsender,EventArgs{管理员登陆lvFrm=new管理员登陆}privatevoidbutton3_Click(objectsender,EventArgs{用户登录lvFrmnew用户登录}privatevoidbutton4_Click(objectsender,EventArgs{intdelRowIndex=if(delRowIndex!=用户登录lvFrmnew用户登录}privatevoidbutton4_Click(objectsender,EventArgs{intdelRowIndex=if(delRowIndex!=-//然后调用保存按钮保存删除}SqlConnectionSqlDataAdapterDataSetprivatevoidsuper_Load(objectsender,EventArgs{conn=newSqlConnection("DataSource=(local);InitialSqlCommandcmd=newSqlCommand("SELECT*FROMadm",sda=newsda.SelectCommand=ds=newsda.Fill(ds,="="="}privatevoidbutton1_Click(objectsender,EventArgs{DataTabledt=sda.FillSchema(dt,SqlCommandBuildercmdbuider=new"}privatevoidbutton5_Click(objectsender,EventArgs{管理目录lvFrmnew管理目录}}}usingusingusingusingusing}}}usingusingusingusingusingusingusingusingnamespace数据{publicpartialclass管理目录:{public管理目录{}privatevoidbutton4_Click(objectsender,EventArgs{出版商lvFrmnew出版商}privatepublic管理目录{}privatevoidbutton4_Click(objectsender,EventArgs{出版商lvFrmnew出版商}privatevoidbutton1_Click(objectsender,EventArgs{图书类别lvFrmnew图书类别}privatevoidbutton7_Click_1(objectsender,EventArgs{管理员登陆lvFrmnew管理员登陆}privatevoidbutton2_Click(objectsender,EventArgs{图书lvFrmnew图书}privatevoidbutton3_Click(objectsender,EventArgs{订单管理lvFrmnew订单管理}privatevoidbutton5_Click(objectsender,EventArgs{客户管理lvFormnew客户管理}privatevoidbutton6_Click(objectsender,EventArgs{发货信息管理}privatevoidbutton6_Click(objectsender,EventArgs{发货信息管理lvForm=new发货信息管理}privatevoidtextBox1_TextChanged(objectsender,EventArgs{}privatevoid管理目录_Load(objectsender,EventArgs{}}}usingusingusingusingusingusingusingusingusingnamespace数据{publicpartialclass图书类别:usingusingusingusingusingusingusingusingnamespace数据{publicpartialclass图书类别:{SqlConnectionSqlDataAdapterDataSetpublic图书类别{}privatevoidForm4_Load(objectsender,EventArgs{conn=newSqlConnection("DataSource=(local);InitialSqlCommandcmd=newSqlCommand("SELECT*FROMType",sda=newsda.SelectCommand=ds=newsda.Fill(ds,="="}privatevoidbutton1_Click(objectsender,EventArgs{ if{{"}catch(Exception{"}DataTabledt=sda.FillSchema DataRowdr=dt.Rows.Find(textBox1.Text}catch(Exception{"}DataTabledt=sda.FillSchema DataRowdr=dt.Rows.Find(textBox1.Text dr["名称"]=SqlCommandBuildercmdbuider=new"}privatevoiddataGridView1_CellContentClick(objectsender,DataGridViewCellEventArgs{}privatevoiddataGridView1_CellClick(objectsender,DataGridViewCellEventArgs{//textBox1.Text=//textBox2.Text="}privatevoidtextBox1_TextChanged(objectsender,EventArgs{}privatevoidbutton2_Click(objectsender,EventArgs{管理目录lvFrmnew管理目录}privatevoidbutton3_Click(objectsender,EventArgs{管理员登陆lvFrm=new管理员登陆}privatevoidbutton4_Click(objectsender,EventArgs{intdelRowIndex=if}privatevoidbutton4_Click(objectsender,EventArgs{intdelRowIndex=if(delRowIndex!=-//然后调用保存按钮保存删除}}}usingusingusingusingusingusingusingusingusingnamespace数据{publicpartialclass出版商:{SqlConnectionSqlDataAdapterDataSetpublic出版商{}privatevoidusingnamespace数据{publicpartialclass出版商:{SqlConnectionSqlDataAdapterDataSetpublic出版商{}privatevoid出版商_Load(objectsender,EventArgs{conn=newSqlConnection("DataSource=(local);InitialSqlCommandcmd=newSqlCommand("SELECT*FROMpublisher",sda=newsda.SelectCommand=ds=newsda.Fill(ds,"=""="="=}privatevoidbutton1_Click(objectsender,EventArgs{DataTabledt=sda.FillSchema(dt,SqlCommandBuildercmdbuider=new"}privatevoidbutton2_Click(objectsender,EventArgs{管理目录lvFrmnew管理目录}privatevoidbutton3_Click(objectsender,EventArgs{管理员登陆lvFrm=}privatevoidbutton3_Click(objectsender,EventArgs{管理员登陆lvFrm=new管理员登陆}privatevoidbutton4_Click(objectsender,EventArgs{intdelRowIndex=if(delRowIndex!=-//然后调用保存按钮保存删除}}}usingusingusingusingusingusingusingusingusingnamespace数据{publicpartialclass图书:{SqlConnectionusingusingusingusingusingusingusingusingnamespace数据{publicpartialclass图书:{SqlConnectionSqlDataAdapterDataSetpublic图书{}privatevoid图书_Load(objectsender,EventArgs{conn=newSqlConnection("DataSource=(local);InitialSqlCommandcmd=newSqlCommand("SELECT*FROMbooks",sda=newsda.SelectCommand=ds=newsda.Fill(ds,="="=""="=""="=="}privatevoidbutton1_Click(objectsender,EventArgs{DataTabledt=sda.FillSchema(dt,SqlCommandBuildercmdbuider=newprivatevoidbutton1_Click(objectsender,EventArgs{DataTabledt=sda.FillSchema(dt,SqlCommandBuildercmdbuider=new"}privatevoidbutton2_Click(objectsender,EventArgs{管理目录lvFrmnew管理目录}privatevoidbutton3_Click(objectsender,EventArgs{管理员登陆lvFrm=new管理员登陆}privatevoidbutton4_Click(objectsender,EventArgs{intdelRowIndex=if(delRowIndex!=-//然后调用保存按钮保存删除}}}usingusingusingusingusingusingusingusingusingusingusingusingusingusingusingusingusingusingnamespace数据{publicpartialclass图书类别:{SqlConnectionSqlDataAdapterDataSetpublic图书类别{}privatevoidForm4_Load(objectsender,EventArgs{conn=newSqlConnection("DataSource=(local);InitialCatalog=bookstore;IntegratedSqlCommandcmd=newSqlCommand("SELECT*FROMType",sda=newsda.SelectCommand=ds=newsda.Fill(ds,="="}privatesda=newsda.SelectCommand=ds=newsda.Fill(ds,="="}privatevoidbutton1_Click(objectsender,EventArgs{if{{"}catch(Exception{"}DataTabledt=sda.FillSchemaDataRowdr=dt.Rows.Find(textBox1.Textdr["名称"]=SqlCommandBuildercmdbuider=new"}privatevoiddataGridView1_CellContentClick(objectsender,DataGridViewCellEventArgs{}privatevoiddataGridView1_CellClick(objectsender,DataGridViewCellEventArgs{//textBox1.Text=//textBox2.Text="}privatevoidtextBox1_TextChanged(objectsender,EventArgs{}privatevoidbutton2_Click(objectsender,EventArgs{管理}privatevoidtextBox1_TextChanged(objectsender,EventArgs{}privatevoidbutton2_Click(objectsender,EventArgs{管理目录lvFrmnew管理目录}privatevoidbutton3_Click(objectsender,EventArgs{管理员登陆lvFrm=new管理员登陆}privatevoidbutton4_Click(objectsender,EventArgs{intdelRowIndex=if(delRowIndex!=-//然后调用保存按钮保存删除}}}usingusingusingusingusingusingusingusingusingusingusingusingusingusingnamespace数据{publicpartialclass订单管理:{SqlConnectionSqlDataAdapterDataSetpublic订单管理{}privatevoidnamespace数据{publicpartialclass订单管理:{SqlConnectionSqlDataAdapterDataSetpublic订单管理{}privatevoid订单管理_Load(objectsender,EventArgs{comboBox1.DropDownStyle=comboBox1.Items.Add("货到付款comboBox1.Items.Add("网上支付conn=newSqlConnection("DataSource=(local);InitialSqlCommandcmd=newSqlCommand("SELECT*FROMborder",sda=newsda.SelectCommand=ds=newsda.Fill(ds,"="="=="""}privatevoidbutton1_Click(objectsender,EventArgs{DataTabledt=sda.FillSchema(dt,SqlCommandBuildercmdbuider=new"}privatevoidbutton2_Click(objectsender,EventArgs{管理目录lvFrmnew管理目录}privatevoidbutton3_Click(objectsender,EventArgs{管理员登陆lvFrm=new管理{管理目录lvFrmnew管理目录}privatevoidbutton3_Click(objectsender,EventArgs{管理员登陆lvFrm=new管理员登陆}SqlConnectionSqlCommandprivatevoidbutton4_Click(objectsender,EventArgs{conn1=newSqlConnection("DataSource=(local);InitialCatalog=bookstore;IntegratedSqlCommandcmd=newcmd.Connection=cmd.CommandText="updatebookssetquantity=quantity+"+++cmd.CommandType=cmd.CommandText="deletefrombsendwhereOno="+cmd.CommandType=intdelRowIndex=if(delRowIndex!=-//然后调用保存按钮保存删除//}privatevoidlabel1_Click(objectsender,EventArgs{}privatevoidcheck_Click(objectsender,EventArgs{conn=newSqlConnection("DataSource=(local);InitialCatalog=bookstore;Integratedprivatevoidcheck_Click(objectsender,EventArgs{conn=newSqlConnection("DataSource=(local);InitialCatalog=bookstore;IntegratedSqlCommandcmd=newSqlCommand("SELECT*FROMborderwherepaytype="+"'"+comboBox1.Text+"'",sda=newsda.SelectCommand=ds=newsda.Fill(ds,"="="=="""}privatevoidcomboBox1_SelectedIndexChanged(objectsender,EventArgs{}}}usingusingu
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024至2030年中国工控专用鼠标数据监测研究报告
- 2024至2030年中国多点控制单元数据监测研究报告
- 2024至2030年中国医护工作服行业投资前景及策略咨询研究报告
- 2024至2030年中国以太网供电模块数据监测研究报告
- 2024至2030年中国1-氯乙基异丙基碳酸酯数据监测研究报告
- 2024年中国PVC线槽市场调查研究报告
- 2024八年级数学上册提练第6招巧用一次函数解决方案设计与选择问题习题课件新版沪科版
- 2024八年级数学上册第11章平面直角坐标系11.1平面内点的坐标第2课时上课课件新版沪科版
- 2024八年级数学上册第四章图形的平移与旋转2图形的旋转第2课时旋转画图习题课件鲁教版五四制
- 2024八年级数学上册阶段专训第10招判定平行四边形的四种常用方法习题课件鲁教版五四制
- 专业技术职务任职资格评审表高级
- 智能化工程验收一般规范
- gsk983ma铣床加工中心数控系统使用手册2010年4月
- 进展性卒中内科治疗
- 工程推动会监理单位总监办发言稿
- 食品生产企业停产报告书2
- 数控雕刻机设计
- 凡奇创意中旅阿那亚九龙湖整合营销方案
- 医学院外科学胸部疾病教案
- 高中美术 第三课 光色变奏-色彩基础知识与应用-教案
- 国际化学品安全告知卡(甲烷)
评论
0/150
提交评论