16466根2素材源碼開發(fā)源代碼_第1頁
16466根2素材源碼開發(fā)源代碼_第2頁
16466根2素材源碼開發(fā)源代碼_第3頁
16466根2素材源碼開發(fā)源代碼_第4頁
16466根2素材源碼開發(fā)源代碼_第5頁
已閱讀5頁,還剩32頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

usingusingSystem.ComponentModel;usingSystem.Data;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;{publicpartialclass{{}privatevoid der,EventArgs{lvFrmnew}SqlConnectionpublicstaticstringuserID;publicstaticstringprivatevoid der,EventArgs{connnewSqlConnection(DataSource=(local);InitialCatalog=bookstore;IntegratedSecurity=TrueSqlCommandcmd=newstringstrsql=select*fromCustomerwhereCno=++andCpass=+txtUserPwd.Text;cmd=newSqlCommand(strsql,conn);SqlDataReaderrd=cmd.ExecuteReader();if(rd.HasRows){ BuylvFrm=newBuy();Hide();用戶frm2=new用戶();int}{label4.Text=請正確輸入用戶名與;txtUserPwd.Text=null;}}privatevoid der,EventArgs{lvFrm=new();}privatevoid用戶登錄 der,EventArgs{}}}考慮到和管理員的管理系統(tǒng)要合并為同一個完整系統(tǒng),在編寫用戶界面時減少了窗體的數(shù)量,但是主體功能都在。此處用到了窗體傳值技術(shù)、DataGridView控件展示數(shù)據(jù)庫的表,訂單表。usingusingSystem.ComponentModel;usingSystem.Data;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;{publicpartialclass用戶:{public用戶{}privatestringstr;//定義的私有變量{get{return}{str=}}privatevoid der,EventArgs{}privatevoid der,EventArgs{}SqlConnectionprivatevoid der,EventArgs{conn=newSqlConnection(DataSource=(local);InitialCatalog=bookstore;IntegratedSecurity=True);SqlCommandcmd=newSqlCommand(select*frombooks,conn);SqlDataAdaptersda=newSqlDataAdapter();sda.SelectCommand=cmd;DataSetds=newDataSet();sda.Fill(ds,books);dataGridView1.DataSource=ds.Tables[0];dataGridView1.Columns[bno].HeaderText=編號;dataGridView1.Columns[bname].HeaderText=名稱;dataGridView1.Columns[tno].HeaderText=類別號;dataGridView1.Columns[page].HeaderText=頁數(shù);dataGridView1.Columns[price].HeaderText=單價;dataGridView1.Columns[ty].HeaderText=數(shù)量;dataGridView1.Columns[pbsno].HeaderText=代號;dataGridView1.Columns[edition].HeaderText=版次;dataGridView1.Columns[first_authorHeaderTextdataGridView1.Columns[date_of_publish].HeaderText=年月;dataGridView1.Columns[description].HeaderText=內(nèi)容簡介;}privatevoid der,DataGridViewCellEventArgs{txtID.Text=dataGridView1.SelectedCells[0].Value.ToString();}privatevoid der,EventArgs{floata,b,{sum=a*}{}}privatevoid der,EventArgs{}SqlCommandcmd;privatevoid der,EventArgs{conn1=newSqlConnection(DataSource=(local);InitialCatalog=bookstore;IntegratedSecurity=True);SqlCommandcmd=newSqlCommand();cmd.Connection=conn1;cmd.CommandText=insertintoborder(Ono,Cno,bno,ty,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=CommandType.Text;MessageBox.Show(提交成功!);cmd.CommandText=updatebookssetty=ty-+txtBquanity.Text.Trim()+wherebno=+cmd.CommandText=insertintobsend(Ono,Stype,Sdate)values(+txtRandom.Text+,+this.la.Text.Trim().ToString()+,+this.la.Text.Trim().ToString()+);;cmd.CommandType=CommandType.Text;}privatevoid der,EventArgs{conn=newSqlConnection(DataSource=(local);InitialCatalog=bookstore;IntegratedSecurity=True);SqlCommandcmd=newSqlCommand(select*fromborderwhereCno=+this.txtCID.Text,conn);SqlDataAdaptersda=newSqlDataAdapter();sda.SelectCommand=cmd;DataSetds=newDataSet();sda.Fill(ds,broder);dataGridView2.DataSource=ds.Tables[0];dataGridView2.Columns[Ono].HeaderText=訂單編號;dataGridView2.Columns[Cno].HeaderText=客戶編號;dataGridView2.Columns[bno].HeaderText=編號;dataGridView2.Columns[ty].HeaderText=數(shù)量;dataGridView2.Columns[price].HeaderText=金額;dataGridView2.Columns[paytypeHeaderTextdataGridView2.Columns[CstatusHeaderText}privatevoid der,DataGridViewCellEventArgs{}privatevoid der,EventArgs{}privatevoid der,EventArgs{}privatevoid der,EventArgs{}privatevoid der,EventArgs{}privatevoid der,EventArgs{lvFrmnew}privatevoid der,EventArgs{}privatevoid der,EventArgs{txtFang.Items.Add(貨到付款);txtCID.Text=str;}privatevoid der,EventArgs{}privatevoid der,EventArgs{}}}usingSystem.ComponentModel;usingSystem.Data;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;{publicpartialclass:{public{}privatevoid der,EventArgs{}privatevoid der,EventArgs{ClsDB.ClsDBControlDBCnewstringstrSql=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()+,+this.txtZUserphext.Trim().ToString()+);if(DBC.insertDB(strSql)){MessageBox.Show(成功!}}privatevoid der,EventArgs{用戶登錄lvFrmnew}}}usingusingSystemData;usingSystemLinq;usingSystemText;usingSystemDataSql;namespace{publicpartialclass{public管理員登陸{}privatevoid管理員登陸 {} {lvFrmnew用戶登錄();lvFrmShow();} {}SqlCommandcmd1; {conn1Open();cmd1Connection=conn1;+"andadmpass="+txtadpsdcmd1ExecuteNonQuery();if(rdHasRows){ lvFrm=new管理 lvFrmShow();}{txtadidText=null;}conn1} {} {if(txtadidText=="super"&&txtadpsdText=={lvFrmShow();}{txtadidText=null;}}}}usingusingSystemComponentModel;usingSystemData;usingSystemLinq;usingSystemText;usingSystemDataSql;namespace{publicpartialclasssuper:{public{} {lvFrmnew管理員登陸();lvFrmShow();} {lvFrmnew用戶登錄();lvFrmShow();} {if(delRowIndex!=-1)button1PerformClick();}SqlConnectionconn;SqlDataAdaptersda;DataSetds; {SqlCommandcmd=newSqlCommand("SELECT*FROMadm",conn);sdaSelectCommand=cmd;ds=newDataSet();sdaFill(ds,dataGridView1DataSource=dsTables[0];} {DataTabledt=dssdaUpdate(dt);,} { lvFrm=new管 }}}usingusingSystemComponentModel;usingSystemData;usingSystemLinq;usingSystemText;namespace{publicpartialclass管 :{public管 {} {商lvFrm=new商();lvFrmShow();} {類別lvFrm=new類別();lvFrmShow();} {管理員登陸lvFrmnew();lvFrmShow();} {lvFrm=new();lvFrmShow();} {lvFrmnew訂單管理();lvFrmShow();} {lvFormnew客戶管理();lvFormShow();} {lvFormnew發(fā)貨信息管理();lvFormShow();} {}privatevoid管 {}}}usingusingSystemComponentModel;usingSystemData;usingSystemLinq;usingSystemText;usingSystemDataSql;namespace{publicpartialclass類別:{SqlConnectionconn;SqlDataAdaptersda;DataSetds;public類別{} {SqlCommandcmd=newSqlCommand("SELECT*FROMType",conn);sdaSelectCommand=cmd;ds=newDataSet();sdaFill(ds,dataGridView1Columns["tno"]HeaderText="類別編號";} { if(ds{{}{,"}DataTabledt=ds sdaUpdate(dt);,}privatevoid {}privatevoid {//textBox1Text=dataGridView1SelectedCells[0]Value ",} {} { lvFrm=new管理 lvFrmShow();} {lvFrmnew管理員登陸();lvFrmShow();} {if(delRowIndex!=-1)button1PerformClick();}}}usingusingSystemComponentModel;usingSystemData;usingSystemLinq;usingSystemText;namespace{publicpartialclass商:{SqlConnectionconn;SqlDataAdaptersda;DataSetds;public商{}privatevoid商 {SqlCommandcmd=newSqlCommand("SELECT*FROMpublisher",conn);sdaSelectCommand=cmd;ds=newDataSet();sdaFill(ds,dataGridView1Columns["pbsno"]HeaderText="商代號";dataGridView1Columns["pbsadd"]HeaderText="地址";dataGridView1Columns["pbsphone"]HeaderText="";dataGridView1Columns["pbspostcode"]HeaderText="";dataGridView1Columns["pbscontact"]HeaderText聯(lián)系人} {DataTabledt=dssdaUpdate(dt);,} { lvFrm=new管 } {lvFrmnew管理員登陸();lvFrmShow();} {if(delRowIndex!=-1)button1PerformClick();}}}usingusingSystemComponentModel;usingSystemData;usingSystemLinq;usingSystemText;usingSystemDataSql;namespace{publicpartialclass:{SqlConnectionconn;SqlDataAdaptersda;DataSetds;public{}privatevoid {SqlCommandcmd=newSqlCommand("SELECT*FROMbooks",conn);sdaSelectCommand=cmd;ds=newDataSet();sdaFill(ds,dataGridView1DataSource=dsTables[0];dataGridView1Columns["bno"]HeaderText="編號";dataGridView1Columns["tno"]HeaderText類別號";dataGridView1Columns["page"]HeaderText="頁數(shù)";dataGridView1Columns["price"]HeaderText單價dataGridView1Columns["ty"]HeaderText="數(shù)量";dataGridView1Columns["pbsno"]HeaderText="代號";dataGridView1Columns["edition"]HeaderText="版次";dataGridView1Columns["first_author"]HeaderText="第一作者";dataGridView1Columns["description"]HeaderText="內(nèi)容簡介";} {DataTabledt=dssdaUpdate(dt);,} { lvFrm=new管理 lvFrmShow();} {lvFrmnew管理員登陸();lvFrmShow();} {if(delRowIndex!=-1)button1PerformClick();}}}usingusingSystemComponentModel;usingSystemData;usingSystemLinq;usingSystemText;usingSystemDataSql;namespace{publicpartialclass類別:{SqlConnectionconn;SqlDataAdaptersda;DataSetds;public類別{} {SqlCommandcmd=newSqlCommand("SELECT*FROMType",conn);sdaSelectCommand=cmd;ds=newDataSet();sdaFill(ds,dataGridView1Columns["tno"]HeaderText="類別編號";} { if(ds{{}{,"}DataTabledt=ds sdaUpdate(dt);,}privatevoid {}privatevoid {//textBox1Text=dataGridView1SelectedCells[0]Value ",} {} { lvFrm=new管理 lvFrmShow();} {lvFrmnew管理員登陸();lvFrmShow();} {if(delRowIndex!=-1)button1PerformClick();}}}usingusingSystemComponentModel;usingSystemData;usingSystemLinq;usingSystemText;usingSystemDataSql;namespace{publicpartialclass{SqlConnectionconn;SqlDataAdaptersda;DataSetds;public訂單管理{}privatevoid訂單管理 {comboBox1ItemsAdd("貨到付款");SqlCommandcmd=newSqlCommand("SELECT*FROMborder",conn);sdaSelectCommand=cmd;ds=newDataSet();sdaFill(ds,dataGridView1DataSource=dsTables[0];dataGridView1Columns["bno"]HeaderText="編號";dataGridView1Columns["ty"]HeaderText="數(shù)量";dataGridView1Columns["price"]HeaderText="總價";dataGridView1Columns["CstatusHeaderText訂單狀態(tài)";} {DataTabledt=dssdaUpdate(dt);,} { lvFrm=new管理 lvFrmShow();} {lvFrmnew管理員登陸();lvFrmShow();}SqlCommandcmd; {conn1Open();cmdConnection=conn1;cmdCommandText="updatebookssetty=ty+"+dataGridView1SelectedCells[3]Value+"wherebno="+dataGridView1SelectedCells[2]Value;cmdExecuteNonQuery();cmdCommandText="deletefrombsendwhereOno="+dataGridView1SelectedCells[0]Value;cmdCommandType=CommandTypeText;conn1Close();if(delRowIndex!=-1)//button1} {} {SqlCommandcmd=newSqlCommand("SELECT*FROMborderwherepaytype="+"'"+comboBox1Text+"'",conn);sda=newSqlDataAdapter();ds=newDataSet();sdaFill(ds,dataGridView1DataSource=dsTables[0];dataGridView1

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論