企业进销存管理系统主界面工具栏源代码
进销存主要代码

private void btnOK_Click(object sender, EventArgs e)
{
tb_EmpInfoMenthod tbEmp = new tb_EmpInfoMenthod();
if (txtID.Text == "")
}
private void menuEmployee_Click(object sender, EventArgs e)
{
//员工信息
frmEmpInfo empinfo = new frmEmpInfo();
{
Application.Exit();
}
}
}
员工基本信息窗体:
Using……
namespace CHEXC
{
public partial class frmEmpInfo : Form
{
public frmEmpInfo()
frmReole.Owner = this;
frmReole.ShowDialog();
}
private void frmMain_Load(object sender, EventArgs e)
{
private void menuDepotFind_Click(object sender, EventArgs e)
{
//库存查询 frmKcG源自odFind kcfrmFind = new frmKcGoodFind();
public static int intFalg = 0;//控件方法状态
int G_Int_status; //保存工具栏按钮操作状态
进销存主要代码

一下为主要代码:登录窗体:u sing……na mespa ce CH EXC{publi c par tialclass frmL ogin: For m { publ ic fr mLogi n() { Init ializ eComp onent(); } pri vatevoidbtnOK_Clic k(obj ect s ender, Eve ntArg s e) { tb_EmpIn foMen thodtbEmp = ne w tb_EmpIn foMen thod();if (t xtID.Text== ""){ Mes sageB ox.Sh ow("用户名不能为空!"); ret urn; } if (txtPw d.Tex t =="") {M essag eBox.Show("密码不能为空!"); re turn; } if(tbEm p.tb_EmpIn foFin d(txt ID.Te xt, t xtPwd.Text, 2)== 1) { frmM ain f rm =new f rmMai n(txt ID.Te xt); frm.Show();t his.H ide();} el se{ Me ssage Box.S how("登录失败!"); } } priv ate v oid b tnCan cel_C lick(objec t sen der,Event Argse) {Appli catio n.Exi t(); } pr ivate void frmL ogin_FormC losin g(obj ect s ender, For mClos ingEv entAr gs e){ Ap plica tion.Exit(); } priv ate v oid t xtID_TextC hange d(obj ect s ender, Eve ntArg s e) { } pr ivate void txtP wd_Te xtCha nged(objec t sen der,Event Argse) { } priv ate v oid f rmLog in_Lo ad(ob jectsende r, Ev entAr gs e){}}}主窗体:u sing……na mespa ce CH EXC{publi c par tialclass frmM ain : Form{publi c frm Main(){I nitia lizeC ompon ent();}publi c frm Main(strin g str Name){ In itial izeCo mpone nt(); Se ndNam eValu e = s trNam e; } publ ic st ringSendN ameVa lue; pr ivate void menu Goods In_Cl ick(o bject send er, E ventA rgs e) {//进贷信息 fr mJhGo odsIn fo jh GOOD= new frmJ hGood sInfo(); jhGO OD.Ow ner = this;j hGOOD.Show Dialo g(); } pr ivate void menu Emplo yee_C lick(objec t sen der,Event Argse) {//员工信息f rmEmp Infoempin fo =new f rmEmp Info();empin fo.Ow ner = this;e mpinf o.Sho wDial og();}p rivat e voi d men uComp any_C lick(objec t sen der,Event Argse) {//供应商信息frmCo mpany InfofrmCo mp =new f rmCom panyI nfo();f rmCom p.Own er =this; fr mComp.Show Dialo g(); } pr ivate void menu Find_Click(obje ct se nder, Even tArgs e) { //商品信息查查询 fr mFind Goodfindg ood = newfrmFi ndGoo d(); fin dgood.Owne r = t his; fin dgood.Show Dialo g(); } pr ivate void menu Depot Alarm_Clic k(obj ect s ender, Eve ntArg s e) { //库存警报 frmK cGood s kcG ood = newfrmKc Goods(); kcGo od.Ow ner = this;k cGood.Show Dialo g(); } pr ivate void menu Depot Find_Click(obje ct se nder, Even tArgs e) { //库存查询frmKc GoodF ind k cfrmF ind = newfrmKc GoodF ind();k cfrmF ind.O wner= thi s;kcfrm Find.ShowD ialog(); } pri vatevoidmenuS ellGo ods_C lick(objec t sen der,Event Argse) {//商品销售信息 frmS ellGo ods f rmSel l = n ew fr mSell Goods(); frmS ell.O wner= thi s;frmSe ll.Sh owDia log();}priva te vo id me nuSel lFind_Clic k(obj ect s ender, Eve ntArg s e) { //退货信息 frmT hGood sInfo frmT h = n ew fr mThGo odsIn fo(); fr mTh.O wner= thi s;frmTh.Show Dialo g(); } pr ivate void数据备份HTool Strip MenuI tem_C lick(objec t sen der,Event Argse) {//数据备份f rmDat aBack frmB ack = newfrmDa taBac k(); frm Back.Owner = th is; frmB ack.S howDi alog(); } priv ate v oid 数据还原IT oolSt ripMe nuIte m_Cli ck(ob jectsende r, Ev entAr gs e){ //数据还源 frm DataR eolefrmRe ole = newfrmDa taReo le(); fr mReol e.Own er =this; fr mReol e.Sho wDial og();}p rivat e voi d frm Main_Load(objec t sen der,Event Argse) {timer2.Ena bled= tru e;this.statu sUser.Text = "系统操作员:" +Se ndNam eValu e; } priv ate v oid t imer2_Tick(obje ct se nder, Even tArgs e) { this.stat usTim e.Tex t = "当前时间:" + D ateTi me.No w.ToS tring(); } pri vatevoidfrmMa in_Fo rmClo sing(objec t sen der,FormC losin gEven tArgs e) { Appl icati on.Ex it();}}}员工基本信息窗体:U sing……nam espac e CHE XC{p ublic part ial c lassfrmEm pInfo : Fo rm { pub lic f rmEmp Info(){I nitia lizeC ompon ent();}tb_Em pInfo EmpC lass= new tb_E mpInf o(); tb_EmpI nfoMe nthod tbMe nthod = ne w tb_EmpIn foMen thod(); publ ic st aticint i ntFal g = 0;//控件方法状态 in t G_I nt_st atus; //保存工具栏按钮操作状态p ublic intgetPa n() { intintFa lg1 = 0; if (intFa lg != 3) {i f (tx tEmpN ame.T ext == "") {M essag eBox.Show("员工姓名不能为空!", "提示");txtEm pName.Focu s();retur n int Falg1; } if (txtEm pLogi nName.Text == ""){ Mess ageBo x.Sho w("登录名称不能为空!","提示"); ret urn i ntFal g1;} if (int Falg!= 2) {i f (tx tEmpL oginP wd.Te xt == ""){ Mess ageBo x.Sho w("登录密码不能为空!","提示"); retu rn in tFalg1; } }i f (in tFalg == 2) {EmpCl ass.i ntEmp Id =this.dataG ridVi ew1[0,thi s.dat aGrid View1.Curr entCe ll.Ro wInde x].Va lue.T oStri ng(); }else { Em pClas s.int EmpId = tb Menth od.tb_EmpI nfoID();}} el se{ if (txt EmpNa me.Te xt == "") { Me ssage Box.S how("请在下面选择要删除的记录","提示"); ret urn i ntFal g1;} el se{ EmpC lass.intEm pId = this.data GridV iew1[0,th is.da taGri dView1.Cur rentC ell.R owInd ex].V alue.ToStr ing(); Emp Class.intE mpId= thi s.dat aGrid View1[0, t his.d ataGr idVie w1.Cu rrent Cell.RowIn dex].Value.ToSt ring(); } } Emp Class.strE mpNam e = t xtEmp Name.Text; Em pClas s.str EmpLo ginNa me =txtEm pLogi nName.Text;E mpCla ss.st rEmpL oginP wd =txtEm pLogi nPwd.Text; Em pClas s.int EmpSe x = c omboB ox2.T ext; Emp Class.daEm pBirt hday= daE mpBir thday.Valu e;EmpCl ass.s trEmp Dept= cmb EmpDe pt.Te xt; EmpC lass.strEm pPost = cm bEmpP ost.T ext; Emp Class.strE mpPho ne =txtEm pPhon e.Tex t;EmpCl ass.s trEmp Phone M = t xtEmp Phone M.Tex t;EmpCl ass.s trEmp Addre ss =txtEm pAddr ess.T ext; if(intFa lg!=3){ Em pClas s.int EmpFa lg =0;}else { Emp Class.intE mpFal g = 1;} in tFalg1 = 1;r eturn intF alg1;}/// <s ummar y> ///控制控件状态/// </summ ary> pr ivate void Cont rolSt atus(){t his.t oolSa ve.En abled = !t his.t oolSa ve.En abled;t his.t oolAd d.Ena bled= !th is.to olAdd.Enab led; thi s.too lCanc el.En abled = !t his.t oolCa ncel.Enabl ed; this.tool Amend.Enab led = !thi s.too lAmen d.Ena bled; th is.to olDel ete.E nable d = !this.toolD elete.Enab led; } /// <su mmary>/// 将控件恢复到原始状态 /// </s ummar y> priv ate v oid C learC ontro ls() { txt EmpAd dress.Text = "";t xtEmp Login Name.Text= ""; tx tEmpL oginP wd.Te xt =""; txtE mpNam e.Tex t = "";txtEm pPhon e.Tex t = "";txtEm pPhon eM.Te xt =""; cmbE mpDep t.Sel ected Index = 0; cm bEmpP ost.S elect edInd ex =0;combo Box2.Selec tedIn dex = 0; this.daEm pBirt hday.Value = Da teTim e.Now;}priva te vo id fr mEmpI nfo_L oad(o bject send er, E ventA rgs e) {t bMent hod.t b_Emp InfoF ind("",5,d ataGr idVie w1); } pr ivate void tool Add_C lick(objec t sen der,Event Argse) {Clear Contr ols();//清空控件内容 Con trolS tatus();//控件控年状态i ntFal g = 1;//添加标}priva te vo id to olAme nd_Cl ick(o bject send er, E ventA rgs e){C ontro lStat us(); in tFalg = 2;//修改标记}priva te vo id to olref esh_C lick(objec t sen der,Event Argse) {Clear Contr ols();//刷新 Co ntrol Statu s(); } //查询 priv ate v oid t xtOK_Click(obje ct se nder, Even tArgs e) { stri ng P_Str_s elect condi tion= thi s.cbx Condi tion.Text; //I tems[this.cbxCo nditi on.Se lecte dInde x].To Strin g(); if(P_St r_sel ectco nditi on == null){ Mes sageB ox.Sh ow("请选择查询条件!"); ret urn; } if (this.txtKe yWord.Text == ""){ Me ssage Box.S how("输入查询条件!"); ret urn; } swit ch (P_Str_selec tcond ition){ cas e "员工姓名":tbMen thod.tb_Em pInfo Find(txtKe yWord.Text,1,da taGri dView1); b reak; cas e "员工性别":tbMen thod.tb_Em pInfo Find(txtKe yWord.Text, 2,dataG ridVi ew1); brea k;c ase "所属部门": tbM entho d.tb_EmpIn foFin d(txt KeyWo rd.Te xt, 3, dat aGrid View1); br eak; case "员工职位":t bMent hod.t b_Emp InfoF ind(t xtKey Word.Text, 4, d ataGr idVie w1);break; de fault: bre ak; } } priv ate v oid t oolCa ncel_Click(obje ct se nder, Even tArgs e) { Clea rCont rols();}priva te vo id to olSav e_Cli ck(ob jectsende r, Ev entAr gs e){ if (get Pan() == 1){ if(intF alg == 1) { if (tbM entho d.tb_EmpIn foFin d(txt EmpLo ginNa me.Te xt,"",1) == 1){ Mess ageBo x.Sho w("登录名称已被占用!!"); txtE mpLog inNam e.Tex t = ""; txt EmpLo ginNa me.Fo cus(); retu rn;} if(tbMe nthod.tb_E mpInf oAdd(EmpCl ass)== 1) { Mes sageB ox.Sh ow("添加成功"); intF alg = 0; tb Menth od.tb_EmpI nfoFi nd("", 5,dataG ridVi ew1);Clear Contr ols(); Cont rolSt atus(); }else{ Mess ageBo x.Sho w("添加成失败"); intF alg = 0; //tbMen thod.tb_Em pInfo Find("2",d ataGr idVie w1);C learC ontro ls();Contr olSta tus(); }} if (int Falg== 2) {i f (tb Menth od.tb_EmpI nfoUp date(EmpCl ass)==1){Messa geBox.Show("修改成功");i ntFal g = 0; tbMe nthod.tb_E mpInf oFind("",5, da taGri dView1); Cl earCo ntrol s();C ontro lStat us(); } el se {M essag eBox.Show("修改成失败"); //tb Menth od.tb_EmpI nfoFi nd("2",dat aGrid View1); Cle arCon trols(); Co ntrol Statu s();} } if (intFa lg == 3){ if(tbMe nthod.tb_E mpInf oDele te(Em pClas s) == 1){Messa geBox.Show("删除成功");i ntFal g = 0; tbMe nthod.tb_E mpInf oFind("",5, da taGri dView1); Cl earCo ntrol s();C ontro lStat us(); } el se {M essag eBox.Show("删除失败"); in tFalg = 0;Clear Contr ols(); Cont rolSt atus(); } }}//en d}priva te vo id Fi llCon trols() {try {S qlDat aRead er sq ldr = tbMe nthod.tb_E mpInf oFind(this.data GridV iew1[0, th is.da taGri dView1.Cur rentC ell.R owInd ex].V alue.ToStr ing(),1); sqld r.Rea d(); if (sqldr.HasR ows) { tx tEmpL oginN ame.T ext = sqld r[2].ToStr ing(); txt EmpNa me.Te xt =sqldr[1].T oStri ng(); comb oBox2.Text =sql dr[4].ToSt ring(); da EmpBi rthda y.Val ue =Conve rt.To DateT ime(s qldr[5].To Strin g()); cmbE mpDep t.Tex t =sq ldr[6].ToS tring();c mbEmp Post.Text= sql dr[7].ToSt ring(); tx tEmpP hone.Text= sql dr[8].ToSt ring(); tx tEmpP honeM.Text = sq ldr[9].ToS tring();t xtEmp Addre ss.Te xt =sqldr[10].ToStr ing(); } } catc h(Exc eptio n ee){ Mes sageB ox.Sh ow(ee.ToSt ring()); } } priv ate v oid d ataGr idVie w1_Ce llCli ck(ob jectsende r,Da taGri dView CellE ventA rgs e){i f (in tFalg == 2 || i ntFal g ==3){ Fi llCon trols(); } }priva te vo id to olExi t_Cli ck(ob jectsende r, Ev entAr gs e){ th is.Cl ose();}priva te vo id to olDel ete_C lick(objec t sen der,Event Argse) {Contr olSta tus();//控件控年状态 int Falg= 3;//删除标记}p rivat e voi d too lStri p1_It emCli cked(objec t sen der,ToolS tripI temCl icked Event Argse) { } priv ate v oid t xtEmp Addre ss_Te xtCha nged(objec t sen der,Event Argse) { } }}供应商信息窗体:names paceCHEXC{ pub lic p artia l cla ss fr mComp anyIn fo :Form{p ublic frmC ompan yInfo() {Initi alize Compo nent(); } publ ic fr mComp anyIn fo(in t int Resul t) {Initi alize Compo nent();intRe turn= int Resul t; } publ ic st aticint i ntRet urn = 0; tb_Compa ny Co mpany = ne w tb_Compa ny();t b_Com panyM entho d Com panyM entho d = n ew tb_Comp anyMe nthod(); tb_JhGoo dsInf oMent hod j hgood = ne w tb_JhGoo dsInf oMent hod();publi c sta tic i nt in tFalg =0; pr ivate void Cont rolSt atus(){t his.t oolSa ve.En abled = !t his.t oolSa ve.En abled;t his.t oolAd d.Ena bled= !th is.to olAdd.Enab led; thi s.too lCanc el.En abled = !t his.t oolCa ncel.Enabl ed; this.tool Amend.Enab led = !thi s.too lAmen d.Ena bled; th is.to olref esh.E nable d = !this.toolr efesh.Enab led; } /// <su mmary>/// 将控件恢复到原始状态 /// </s ummar y> priv ate v oid C learC ontro ls() { txt Compa nyDir ector.Text = "";t xtCom panyA ddres s.Tex t = "";txtCo mpany Fax.T ext = ""; txt Compa nyNam e.Tex t = "";txtCo mpany Phone.Text = "";t xtCom panyR emark.Text = ""; } ///控制控件状态 ///</sum mary>p ublic intGetCo unt(){ in t int Reslu lt =0;if (i ntFal g ==1 ||intFa lg == 2) {i f (tx tComp anyNa me.Te xt == "") { Me ssage Box.S how("供应商名称不能为空!", "提示");retur n int Reslu lt;} if (txt Compa nyPho ne.Te xt == "") { Me ssage Box.S how("联系电话不能为空!", "提示");r eturn intR eslul t;} if(txtC ompan yDire ctor.Text== "") {Messa geBox.Show("地址不能为空!", "提示");r eturn intR eslul t;} if(intF alg != 2) { Co mpany.intC ompan yID = Comp anyMe nthod.tb_C ustom erID();} els e {Compa ny.in tComp anyID = th is.da taGri dView1[0,this.dataG ridVi ew1.C urren tCell.RowI ndex].Valu e.ToS tring();} Co mpany.intE mpFal g = 0; Co mpany.strC ompan yAddr ess = txtC ompan yAddr ess.T ext; Comp any.s trCom panyD irect or =txtCo mpany Direc tor.T ext; Comp any.s trCom panyF ax =txtCo mpany Fax.T ext; Comp any.s trCom panyN ame = txtC ompan yName.Text; Co mpany.strC ompan yPhon e = t xtCom panyP hone.Text; Com pany.strCo mpany Remar k = t xtCom panyR emark.Text; Co mpany.daRe DateT ime = Date Time.Now; } if (intFa lg == 3) {i f (tx tComp anyNa me.Te xt == "") { Me ssage Box.S how("供应商名称不能为空!请选择要删除的的记录", "提示");retur n int Reslu lt;} Co mpany.intE mpFal g =1; Com pany.intCo mpany ID =this.dataG ridVi ew1[0,thi s.dat aGrid View1.Curr entCe ll.Ro wInde x].Va lue.T oStri ng(); } int Reslu lt=1; re turnintRe slult; } priv ate v oid f rmCom panyI nfo_L oad(o bject send er, E ventA rgs e){C ompan yMent hod.t b_Com panyF ind("", 3, data GridV iew1);}priva te vo id tx tAddr ess_T extCh anged(obje ct se nder, Even tArgs e) { } pri vatevoidtoolE xit_C lick(objec t sen der,Event Argse) {this.Close(); } pri vatevoidtoolS ave_C lick(objec t sen der,Event Argse) {if (G etCou nt()== 1) { if (intFa lg == 1){ if(Comp anyMe nthod.tb_C ompan yMent hodAd d(Com pany) == 1) { if (int Retur n ==1) { frm GonYi ngSha ng fr mCop= (frm GonYi ngSha ng)th is.Ow ner; jh good.fillt Prod(frmCo p.tre eView1,frm Cop.i mageL ist1);Clear Contr ols();Contr olSta tus();intFa lg =0; this.Clos e(); }M essag eBox.Show("添加成功"); in tFalg = 0;Compa nyMen thod.tb_Co mpany Find("", 3, dat aGrid View1); Cle arCon trols(); Co ntrol Statu s();} els e { Me ssage Box.S how("添加失败"); int Falg= 0;C ompan yMent hod.t b_Com panyF ind("", 3, data GridV iew1); Clea rCont rols(); Con trolS tatus();} }if (i ntFal g ==2){ if (Compa nyMen thod.tb_Co mpany Menth odUpD ate(C ompan y) == 1) {Messa geBox.Show("修改成功");i ntFal g = 0; Comp anyMe nthod.tb_C ompan yFind("",3, da taGri dView1); Cl earCo ntrol s();C ontro lStat us(); } el se {M essag eBox.Show("修改失败"); in tFalg = 0;Compa nyMen thod.tb_Co mpany Find("", 3, dat aGrid View1); Cle arCon trols(); Co ntrol Statu s();} } if (intFa lg ==3){ if (Compa nyMen thod.tb_Co mpany Menth odDel ete(C ompan y) == 1) {Messa geBox.Show("删除成功");i ntFal g = 0; Comp anyMe nthod.tb_C ompan yFind("",3, da taGri dView1); Cl earCo ntrol s();C ontro lStat us(); } el se {M essag eBox.Show("删除失败"); in tFalg = 0;Compa nyMen thod.tb_Co mpany Find("", 3, dat aGrid View1); Cle arCon trols(); Co ntrol Statu s();} } }//}p rivat e voi d Fil lCont rols(){t ry{ Sq lData Reade r sql dr =Compa nyMen thod.tb_Co mpany Find(this.dataG ridVi ew1[0,thi s.dat aGrid View1.Curr entCe ll.Ro wInde x].Va lue.T oStri ng()); sq ldr.R ead(); if (sql dr.Ha sRows) {txtCo mpany Name.Text= sql dr[1].ToSt ring(); tx tComp anyDi recto r.Tex t = s qldr[2].To Strin g();txtCo mpany Phone.Text = sq ldr[3].ToS tring();t xtCom panyF ax.Te xt =sqldr[4].T oStri ng(); txtC ompan yAddr ess.T ext = sqld r[5].ToStr ing(); txt Compa nyRem ark.T ext = sqld r[6].ToStr ing(); } } catc h (Ex cepti on ee){ Mes sageB ox.Sh ow(ee.ToSt ring()); } } pri vatevoidtoolC ancel_Clic k(obj ect s ender, Eve ntArg s e) { Clea rCont rols();C ontro lStat us(); in tFalg = 0;}p rivat e voi d too lAdd_Click(obje ct se nder, Even tArgs e) { Cont rolSt atus();Clear Contr ols();i ntFal g = 1;//添加标记 } priv ate v oid t oolAm end_C lick(objec t sen der,Event Argse) {Contr olSta tus();C learC ontro ls(); in tFalg = 2;//修改加标记 } priv ate v oid t oolDe lete_Click(obje ct se nder, Even tArgs e) { } pri vatevoidtxtOK_Clic k(obj ect s ender, Eve ntArg s e) { str ing P_Str_cmdtx t = S tring.Empt y;strin g P_S tr_se lectc ondit ion = this.cbxC ondit ion.T ext; if(P_St r_sel ectco nditi on == null){ Mes sageB ox.Sh ow("请选择查询条件!"); ret urn; } if (this.txtKe yWord.Text == ""){ Me ssage Box.S how("输入查询条件!"); ret urn; } swit ch (P_Str_selec tcond ition){ cas e "供应商名称": Comp anyMe nthod.tb_C ompan yFind(txtK eyWor d.Tex t,1,d ataGr idVie w1);break; ca se "负责人姓名": Com panyM entho d.tb_Compa nyFin d(txt KeyWo rd.Te xt, 2, dat aGrid View1); br eak; defa ult:break;}}p rivat e voi d dat aGrid View1_Cell Click(obje ct se nder, Data GridV iewCe llEve ntArg s e) { if(intF alg == 2 || int Falg== 3) { Fill Contr ols();}}p rivat e voi d too lrefe sh_Cl ick(o bject send er, E ventA rgs e){C ontro lStat us(); in tFalg = 3;//修改加标记 } }}商品进货窗体:n amesp ace C HEXC{ publ ic pa rtial clas s frm JhGoo dsInf o : F orm { pu blicfrmJh Goods Info(){I nitia lizeC ompon ent();}publi c frm JhGoo dsInf o(int intC do) { Init ializ eComp onent(); } tb_JhGoo dsInf o jhG ood=n ew tb_JhGo odsIn fo();t b_JhG oodsI nfoMe nthod jhMe nthod=newtb_Jh Goods InfoM entho d(); pu blicstati c int intF alg = 0; pri vatevoidContr olSta tus(){ th is.to olSav e.Ena bled= !th is.to olSav e.Ena bled; th is.to olAdd.Enab led = !thi s.too lAdd.Enabl ed; this.tool Cance l.Ena bled= !th is.to olCan cel.E nable d;this.toolA mend.Enabl ed =!this.tool Amend.Enab led; thi s.tol lDele te.En abled = !t his.t ollDe lete.Enabl ed; } pub lic v oid C learC ontor l() { txtG oodsN um.Te xt =""; txtG oodsR emark.Text = "";t xtGoo dsSel lPric e.Tex t = "";txtJh CompN ame.T ext = ""; txt Goods NoPri ce.Te xt =""; txtG oodsN eedPr ice.T ext = ""; txt Goods Name.Text= ""; tx tGood sJhPr ice.T ext = ""; txt Goods ID.Te xt =""; txtE mpId.Text= ""; cm bDepo tName.Text = "";}publi c int getI ntCou nt() { int intR eslut = 0; if (int Falg== 1) { if (txtGo odsID.Text == ""){ Mess ageBo x.Sho w("商品编号不能为空!"); retu rn in tResl ut;} if (txt Goods Name.Text== "") {Messa geBox.Show("商品名称不能为空!");retur n int Reslu t;} if(txtJ hComp Name.Text== "") {Messa geBox.Show("供应商名称不能为空!"); retu rn in tResl ut;} if (txt EmpId.Text == ""){ Mess ageBo x.Sho w("进货人姓名不能为空!"); ret urn i ntRes lut; }i f (tx tGood sNum.Text== "") {Messa geBox.Show("数量不能为空!"); re turnintRe slut; }if (t xtGoo dsNam e.Tex t ==""){ Mes sageB ox.Sh ow("进货单价不能为空!"); ret urn i ntRes lut; }}i f (in tFalg == 2){ if(txtG oodsI D.Tex t ==""){ Mes sageB ox.Sh ow("商品编号不能为空!,选择要修改记录","提示");retur n int Reslu t;} } if(intF alg == 3) {if (t xtGoo dsID.Text== "") {Messa geBox.Show("商品编号不能为空!,选择要删除记录", "提示"); r eturn intR eslut; } } jhGo od.st rGood sID = txtG oodsI D.Tex t;jhGoo d.str EmpId = tx tEmpI d.Tex t;jhGoo d.str JhCom pName = tx tGood sName.Text;j hGood.strD epotN ame = cmbD epotN ame.T ext; jhG ood.s trGoo dsNum = Co nvert.ToIn t32(t xtGoo dsNum.Text);jhGoo d.str Goods Name= txt Goods Name.Text; jh Good.strGo odsUn it =cmbGo odsUn it.Te xt; jhGo od.de Goods JhPri ce =txtGo odsJh Price.Text;j hGood.deGo odsNe edPri ce =txtGo odsNe edPri ce.Te xt; jhGo od.de Goods NoPri ce =txtGo odsNo Price.Text;j hGood.deGo odsSe llPri ce =txtGo odsSe llPri ce.Te xt; jhGo od.st rGood sRema rk =txtGo odsRe mark.Text; jh Good.DaGoo dTime = da teTim ePick er1.V alue; if (int Falg!= 3) { jhGo od.Fa lg =0;}e lse {j hGood.Falg = 1; } int Reslu t = 1;r eturn intR eslut;}priva te vo id fr mJhGo odsIn fo_Lo ad(ob jectsende r, Ev entAr gs e){ jh Menth od.tb_JhGo odsIn foFin d("", 5, d ataGr idVie w1);。
新华书店进销存管理系统部分程序源代码

附录2新华书店进销存管理系统部分程序源代码1 、主程序MAIN.PRG 程序代码毕业设计PUBLIC nkfgl,nxsgl,ncggl,nkcgl,nxtglSTORE .f. TO nkfgl,nxsgl,ncggl,nkcgl,nxtglPUBLIC nname,ndepartmentSTORE "" TO nname,ndepartmentDo Form loginfRead EventsDo Form mainRead EventsQuit2 、主表单MAIN.SCX 代码2.1 表单Init 过程程序代码do mmenu.mpr with this,.T. bel2.caption = nname bel4.caption = ndepartment3 、系统登入表单LOGINF.SCX 代码3.1 表单登入按钮Click 事件程序代码SELECT user GO TOP *检查用户名和密码是否输入If empty(thisform.text1.value) thenbel3.caption = " 请输入用户名"returnelseif empty(thisform.text2.value) then bel3.caption =" 请输入密码" returnendifendif* 操作USER 表,查询满足条件记录locate for name = alltrim(thisform.text1.value) if !found()bel3.caption=" 用户不存在" returnelseif user.password != alltrim(thisform.text2.value) thenbel3.caption=" 密码错误" return endifendifnname = ndepartment = user.department nkfgl = user.kfgl nxsgl = user.xsgl ncggl = user.cggl nkcgl = user.kcgl nxtgl = user.xtgl thisform.release clear events4 、系统管理表单XTGLF.SCX 代码4.1 表单Init 过程程序代码4.2 表单自定义过程 DIS_RECORD 程序代PUBLIC newcommand STORE .f. TO newcommand ifreccount("user") = 0 thisform.text1.value = "" thisform.text2.value = "" bo1.value = "" thisform.check1.value = 0 thisform.check2.value = 0 thisform.check3.value = 0 thisform.check4.value=thisform.check5.value = 0 else thisform.text1.value = 程序代thisform.text1.enabled = .f. thisform.text2.enabled = .f. thisform.text3.enabled = .f. bo1.enabled = .f. thisform.check1.enabled = .f. thisform.check2.enabled = .f. thisform.check3.enabled = .f. thisform.check4.enabled = .f. thisform.check5.enabled = .f. bel5.visible = .f. thisform.text3.visible = .f. mand10.enabled = .f. mand11.enabled = .f. thisform.dis_recordthisform.dis_reccommand thisform.text2.value = user.password bo1.value = user.department if user.kfgl thenthisform.check1.value = 1 elsethisform.check1.value = 0 endif if user.xsgl then thisform.check2.value = 1 elsethisform.check2.value = 0 endif if user.cggl then thisform.check3.value = 1 elsethisform.check3.value = 0 endif if user.kcgl then thisform.check4.value = 1 elsethisform.check4.value = 0 endif if user.xtgl then thisform.check5.value = 1 else thisform.check5.value = 0 endif endifthisform.refresh4.3表单自定义过程 DIS_RECCOMMAND private nstore 0 to nn = reccount("user") if n=1 .or. n=0 then mand1.enabled = .f.mand2.enabled = .f.mand3.enabled = .f.mand4.enabled = .f.elseif recno("user")=1 then mand1.enabled = .f.mand2.enabled = .f. mand3.enabled = .t.mand4.enabled = .t. elseif recno("user")=n thenmand1.enabled = .t.mand2.enabled = .t.mand3.enabled = .f. mand4.enabled = .f. elsemand1.enabled = .t.mand2.enabled = .t.mand3.enabled = .t. mand4.enabled = .t.endifendifendifthisform.refresh4.4 表单保存按钮Click 事件程序代码if empty(thisform.text1.value) then=messagebox(" 请输入用户名",0+48+0," 出错") thisform.text1.setfocus thisform.refreshreturnendifif empty(thisform.text2.value) then=messagebox(" 请输入密码",0+48+0," 出错") thisform.text2.setfocus thisform.refreshreturn endifif .not.(alltrim(thisform.text2.value) == alltrim(thisform.text3.value)) then =messagebox(" 密码重复错误,请重新输入",0+48+0," 出错")thisform.text2.value = ""thisform.text3.value = ""thisform.text2.setfocusthisform.refreshreturnendifif empty(bo1.value) then=messagebox(" 请选择所属部门",0+48+0," 出错")bo1.setfocusthisform.refreshreturnendifif thisform.check1.value=0.and.thisform.check2.value=0.and.thisform.check3.value=0.and.thisform.check4.value=0.and.thisform.check5.value=0 then=messagebox(" 至少选择一个用户权限",0+48+0," 出错")thisform.check1.setfocusthisform.refreshreturnendifif thisform.check1.value=1.and.thisform.check2.value=1.and.thisform.check3.value=1.and.thisform.check4.value=1.and.thisform.ch eck5.value=1 thenmesbox=messagebox(" 此用户将具有全部权限, 请确认",4+48+0," 警告")if mesbox=7 thenthisform.check1.setfocusthisform.refreshreturnendifendif *用户权限处理PRIVATE nname,npassword,ndepartment,nkf,nxs,ncg,nkc,nxt nname =alltrim(thisform.text1.value)npassword = alltrim(thisform.text2.value)ndepartment = alltrim(bo1.value)if thisform.check1.value = 1 thennkf = .t.elsenkf = .f.endif&& if thisform.check2.value = 1 thennxs = .t.elsenxs = .f.endifif thisform.check3.value = 1 thenncg = .t.elsencg = .f.endifif thisform.check4.value = 1 thennkc = .t.elsenkc = .f.endifif thisform.check5.value = 1 thennxt = .t.elsenxt = .f.endif*判断是新记录保存还是修改记录If newcommand thennewcommand = .t. 是新记录保存locate for =alltrim(thisform.text1.value)into valuespassword=if found() then =messagebox(" 用户已经存在 ",0+48+0," 出错 ")thisform.text1.setfocus thisform.refresh return endif* 数据表 user 保存记录 insertuser(name,password,department,kfgl,xsgl,cggl,kcgl,xtgl) (nname,npassword,ndepartment,nkf,nxs,ncg,nkc,nxt) =messagebox(" 保存完毕 ",0+48+0," 提示 ") elseupdate user setnpassword,department=ndepartment,kfgl=nkf,xsgl=nxs,cggl=ncg, kcgl=nkc,xtgl=nxt where name= nname=messagebox(" 修改完成 ",0+48+0," 提示 ") endif*表单初始化 thisform.text1.enabled = .f. thisform.text2.enabled = .f. thisform.text3.enabled = .f. bo1.enabled = .f. thisform.check1.enabled = .f. thisform.check2.enabled = .f. thisform.check3.enabled = .f. thisform.check4.enabled = .f. thisform.check5.enabled = .f.mand1.enabled = .t. mand2.enabled = .t. mand3.enabled = .t. mand4.enabled = .t. mand5.enabled = .t. mand6.enabled = .t. mand7.enabled = .t. mand8.enabled = .t. mand9.enabled = .t. mand10.enabled =.f. mand11.enabled =.f. mand12.enabled = .t. bel5.visible = .f. thisform.text3.visible = .f. thisform.dis_reccommand thisform.dis_record newcommand = .f. thisform.refreshwindow4.5表单浏览按钮 Click 事件程序代码DEFINE WINDOW browsewin FROM 1,1 TO 30,80 noFLOAT CLOSEnominimize nogrow nozoom systembrow fields name,department,kfgl,xsgl,cggl,kcgl browsewin noappend nomodify nodeleterelease window browsewin5、 图书管理表单 TSGL.SCX 代码5.1自定义过程 AUTO_BOOKID 程序代码select book set order to bookid go bottomprivate autoid1,autoid2,autoid3,autoid4autoid1 = alltrim(str(val(substr(alltrim(book.bookid),2,6))+1,6,0)) autoid2 = len(autoid1) if autoid2 != 6 thenfor n = autoid2 to 5autoid1 = "0" + autoid1 endforendif autoid4 = "B" + alltrim(autoid1) thisform.text1.value = autoid45.2新建按钮 Click 事件程序代码thisform.text2.enabled = .t. thisform.text3.enabled = .t. thisform.text4.enabled = .t. thisform.text5.enabled = .t. thisform.text6.enabled = .t. bo1.enabled = .t. thisform.text7.enabled = .t. thisform.text8.enabled = .t. mand1.enabled = .f. mand2.enabled = .f. mand3.enabled = .f. mand4.enabled = .f. mand5.enabled = .f. mand6.enabled = .f. mand7.enabled=.f.mand8.enabled=.f.mand9.enabled = .f. mand10.enabled =.t. mand11.enabled =.t. mand12.enabled = .t.thisform.text2.value = ""thisform.text3.value = ""thisform.text4.value = "" thisform.text5.value = "" thisform.text6.value = "" bo1.value = "" thisform.text7.value = 0thisform.text8.value = 0thisform.auto_bookidthisform.text2.setfocusthisform.newcommand = .t.thisform.refresh5.3 删除按钮Click 事件程序代码if reccount("book")=1 then =messagebox(" 只有一条记录,不能删除",0+16+0,"出错")return elsenbookid = alltrim(thisform.text1.value)nbookname = alltrim(thisform.text2.value)mesbox=messagebox(" 是否删除"+nbookid+" 号图书",4+48+0," 警告") if mesbox=7 thenreturnelseuse book EXCLUSIVEdelete from book where bookid=nbookid pack=messagebox(nbookid+" 图书已经删除",0+48+0," 提示") endif endif thisform.dis_recordthisform.dis_reccommand thisform.grid1.recordsource = "book" thisform.refresh 5.4 保存按钮Click 事件程序代码if empty(thisform.text2.value)=messagebox(" 请输入书名",0+48+0," 出错") thisform.text2.setfocus thisform.refreshreturn endif if empty(thisform.text3.value)=messagebox(" 请输入书号",0+48+0," 出错") thisform.text3.setfocus thisform.refreshreturn endif if empty(thisform.text4.value)=messagebox(" 请输入出版社",0+48+0," 出错") thisform.text4.setfocus thisform.refreshreturn endif if empty(thisform.text5.value)=messagebox(" 请输入作者信息",0+48+0," 出错")thisform.text5.setfocusthisform.refreshreturn endif if empty(bo1.value)=messagebox(" 请选择图书类型",0+48+0," 出错")bo1.setfocusthisform.refreshreturn endif if thisform.text7.value = 0=messagebox(" 请输入价格",0+48+0," 出错") bo1.setfocus thisform.refreshthenbook values setwherereturn endifPRIVATE nbookid,nbookname,nbookno,nbookphouse,nbookwriter,nbookc d,nbookclass,nbookprice,nbookdiscountnbookid = alltrim(thisform.text1.value) nbookname = alltrim(thisform.text2.value) nbookno = alltrim(thisform.text3.value) nbookphouse = alltrim(thisform.text4.value) nbookwriter = alltrim(thisform.text5.value) nbookcd = alltrim(thisform.text6.value) nbookclass = alltrim(bo1.value) nbookprice = thisform.text7.value nbookdiscount = thisform.text8.value*判断是新记录保存还是修改记录 If thisform.newcommand && newcommand = .t. 是新记录保存* 数据表 book 保存记录 insert into(bookid,bookname,bookno,bookphouse,bookwriter,bookcd,bookcl ass,bookprice,bookdiscount)(nbookid,nbookname,nbookno,nbookphouse,nbookwriter,nbookc d,nbookclass,nbookprice,nbookdiscount)=messagebox(" 保存完毕 ",0+48+0," 提示 ") else update bookbookname=nbookname,bookno=nbookno,bookphouse=nbookpho use,bookwriter=nbookwriter,bookcd=nbookcd,bookclass=nbookcl ass,bookprice=nbookprice,bookdiscount=nbookdiscount bookid=nbookid=messagebox(" 修改完成 ",0+48+0," 提示 ") endifnoFLOATfieldsnoappend *表单初始化 thisform.text2.enabled = .f. thisform.text3.enabled = .f.thisform.text4.enabled = .f. thisform.text5.enabled = .f. thisform.text6.enabled = .f. bo1.enabled = .f. thisform.text7.enabled = .f. thisform.text8.enabled = .f.mand5.enabled = .t. mand6.enabled = .t. mand7.enabled = .t. mand8.enabled =.t. mand9.enabled=.t.mand10.enabled=.f.mand11.enabled =.f. mand12.enabled = .t. thisform.dis_recordthisform.dis_reccommand thisform.newcommand = .f. thisform.refresh5.5浏览按钮 Click 事件程序代码DEFINE WINDOW browsewin FROM 1,1 TO 30,160 CLOSE nominimize nogrow nozoom system browbookid,bookname,bookno,bookphouse,bookwriter,bookcd,bookclass,bookprice,bookdiscount window browsewin nomodify nodelete release window browsewin6、 会员输入表单 KFGL_HYSR.SCX 程序代码 6.1自定义过程 AUTO_VIPID 程序代码select vipset order to vipid go bottomprivate autoid1,autoid2,autoid3,autoid4autoid1 = alltrim(str(val(substr(alltrim(vip.vipid),2,6))+1,6,0)) autoid2 = len(autoid1) if autoid2 != 6 thenfor n = autoid2 to 5 autoid1 = "0" + autoid1 endforendif autoid4 = "V" + alltrim(autoid1) thisform.text1.value = autoid46.2 保存按钮Click 事件程序代码*输入数据校验if empty(thisform.text2.value)=messagebox(" 请输入会员姓名",0+16+0," 出错") thisform.text2.setfocus returnendifif thisform.optiongroup1.value = 0=messagebox(" 请选择会员性别",0+16+0," 出错")thisform.optiongroup1.option1.setfocusreturnelse private nvipsex store "" to nvipsex if thisform.optiongroup1.value = 1vipvaluesstore " 男 " to nvipsex elsestor " 女 " to nvipsex endif endifif empty(thisform.text4.value)=messagebox(" 请输入会员联系地址 ",0+16+0," 出错 ") thisform.text4.setfocus return endifif empty(thisform.text5.value)=messagebox(" 请输入会员联系电话 ",0+16+0," 出错 ") thisform.text5.setfocus return endifif empty(thisform.text6.value)=messagebox(" 请输入邮政编码 ",0+16+0," 出错 ") thisform.text6.setfocus return endif *保存数据private nvipid,nvipname,nvipadd,nvipphone,nvipcode nvipid =alltrim(thisform.text1.value) nvipname = alltrim(thisform.text2.value) nvipadd = alltrim(thisform.text4.value) nvipphone = alltrim(thisform.text5.value) nvipcode = alltrim(thisform.text6.value) insert into(vipid,vipname,vipsex,vipadd,vipphone,vipcode,vipsum,vipdiscou nt) (nvipid,nvipname,nvipsex,nvipadd,nvipphone,nvipcode,0,0)=messagebox(" 保存成功 ",0+48+0," 提示 ") nmesbox=messagebox(" 是否打印会员卡? ",4+32+0," 会员卡打印 ") if nmesbox = 6会员编号 "select vip.vipid,vip.vipname,vip.vipsex,vip.vipadd,vip.vipphone,vip.vipco de from vip where vip.vipid = nvipid into cursor vipcardselect vipcardreport form vipcard.frx to print use in vipcard endifthisform.auto_vipid mand2.click6.3清除按钮 Click 事件程序代码thisform.text2.value = "" thisform.optiongroup1.value = 0 thisform.text4.value = "" thisform.text5.value = "" thisform.text6.value = "" thisform.text1.setfocus thisform.refresh7、 会员查询表单 KFGL_HYCX.SCX 程序代码7.1表单自定义过程 DIS_GRID 程序代码thisform.grid1.readonly = .t.thisform.grid1.columncount = 8 thisform.grid1.column1.header1.caption = " thisform.grid1.column1.width = 80 thisform.grid1.column1.movable = .f. thisform.grid1.column1.resizable = .f.会员姓名" thisform.grid1.column2.header1.caption = " thisform.grid1.column2.width = 80 thisform.grid1.column2.movable = .f.thisform.grid1.column2.resizable = .f.thisform.grid1.column3.header1.caption = "thisform.grid1.column3.width = 80 thisform.grid1.column3.movable = .f. thisform.grid1.column3.resizable = .f. thisform.grid1.column4.header1.caption = " thisform.grid1.column4.width = 250 thisform.grid1.column4.movable = .f. thisform.grid1.column4.resizable = .f. thisform.grid1.column5.header1.caption = " thisform.grid1.column5.width = 80 thisform.grid1.column5.movable = .f. thisform.grid1.column5.resizable = .f. 会员性别"联系地址"联系电话"thisform.grid1.column6.header1.caption = " thisform.grid1.column6.width = 80 thisform.grid1.column6.movable = .f. thisform.grid1.column6.resizable = .f. thisform.grid1.column7.header1.caption = " thisform.grid1.column7.width = 80 thisform.grid1.column7.movable = .f. thisform.grid1.column7.resizable = .f. 邮政编码"累计购书金额"thisform.grid1.column8.header1.caption = " thisform.grid1.column8.width = 80 thisform.grid1.column8.movable = .f. thisform.grid1.column8.resizable = .f. 会员优惠折扣"thisform.refreshcursor.or.7.2表单 Init 过程程序代码thisform.dis_grid public ncombo1,ncombo2,ntext1,chsql,cxsql store "" to ncombo1,ncombo2,ntext1,chsql,cxsqlthisform.optiongroup1.value = 0 thisform.optiongroup1.enabled = .f. thisform.grid1.recordsource = Null selectvip.vipid,vip.vipname,vip.vipsex,vip.vipadd,vip.vipphone,vip.vipco de,vip.vipsum,vip.vipdiscount from vip into hycx_temptable order by vip.vipidthisform.grid1.recordsource = "hycx_temptable" thisform.dis_grid thisform.refresh7.3表单添加条件按钮 Click 事件程序代码if empty(bo1.value) empty(bo2.value) .or. empty(thisform.text1.value) =messagebox(" 请输入条件 ",0+48+0," 出错 ") bo1.setfocusreturn endifif thisform.optiongroup1.value = 1 chsql = " AND " endifif thisform.optiongroup1.value = 2 chsql = " OR " endifchsql = chsql + ncombo1 + ncombo2 + ntext1 thisform.edit1.value = thisform.edit1.value + chsql if .not.empty(thisform.edit1.value)thisform.optiongroup1.value = 1thisform.optiongroup1.enabled = .t. endif bo1.value = "" bo2.value = "" thisform.text1.value = "" chsql = ""bo1.setfocus thisform.refresh7.4 表单条件查询按钮Click 事件程序代码if empty(thisform.edit1.value) =messagebox(" 请输入查询条件",0+16+0," 出错") mand1.setfocusthisform.refreshreturnendifcxsql = alltrim(thisform.edit1.value)thisform.grid1.recordsource = Nullselectvip.vipid,vip.vipname,vip.vipsex,vip.vipadd,vip.vipphone,vip.vipco de,vip.vipsum,vip.vipdiscount from vip where &cxsql into cursor hycx_temptable order by vip.vipid thisform.grid1.recordsource = "hycx_temptable"thisform.optiongroup1.value = 0 thisform.optiongroup1.enabled = .f. bo1.value = "" bo2.value = ""thisform.text1.value = "" thisform.edit1.value = "" store "" to ncombo1,ncombo2,ntext1,chsql,cxsqlthisform.refresh8 、会员修改表单KFGL_HYXG.SCX 程序代码8.1 表单Init 过程程序代码LPARAMETERS nPar1select vip set order to vipid locate for vip.vipid = nPar1thisform.text1.value = vip.vipid thisform.text2.value = vip.vipname if vip.vipsex = " 男"thisform.optiongroup1.value = 1 elsethisform.optiongroup1.value = 2 endif thisform.text4.value =vip.vipaddthisform.text5.value = vip.vipphonethisform.text6.value = vip.vipcode thisform.refresh*输入数据校验if empty(thisform.text2.value)=messagebox(" 请输入会员姓名",0+48+0," 出错")thisform.text2.setfocusreturnendifif thisform.optiongroup1.value = 0 =messagebox(" 请选择会员性别",0+48+0,"出错") thisform.optiongroup1.option1.setfocus returnelse private nvipsex store "" to nvipsex if thisform.optiongroup1.value = 1store " 男" to nvipsex elsestor " 女" to nvipsexendifendifif empty(thisform.text4.value) =messagebox(" 请输入会员联系地址",0+48+0," 出错") thisform.text4.setfocus returnendifif empty(thisform.text5.value) =messagebox(" 请输入会员联系电话",0+48+0," 出错") thisform.text5.setfocus returnendifif empty(thisform.text6.value) =messagebox(" 请输入邮政编码",0+48+0," 出错") thisform.text6.setfocus returnendif*修改数据private nvipid,nvipname,nvipadd,nvipphone,nvipcode nvipid =alltrim(thisform.text1.value) nvipname = alltrim(thisform.text2.value) nvipadd =alltrim(thisform.text4.value) nvipphone = alltrim(thisform.text5.value) nvipcode =alltrim(thisform.text6.value)update vip set vip.vipname = nvipname, vip.vipsex = nvipsex, vip.vipadd = nvipadd,vip.vipphone = nvipphone, vip.vipcode = nvipcode where vip.vipid = nvipid=messagebox(" 修改已完成",0+48+0," 提示")thisform.release8.3 删除按钮Click 事件程序代码nvipid = alltrim(thisform.text1.value)mesbox=messagebox(" 是否删除" + nvipid + " 号会员",4+48+0," 警告") if mesbox=7 thenreturnelseuse vip EXCLUSIVEdelete from vip where vip.vipid = nvipidpack=messagebox(" 会员" + nvipid + " 已经删除",0+48+0," 提示") endif thisform.release9 、会员卡打印表单KFGL_HYDY.SCX 程序代码9.1 打印按钮Click 事件程序代码if empty(thisform.text1.value)=messagebox(" 请输入会员编号",0+16+0," 出错") thisform.text1.setfocus returnelsenvipid = thisform.text1.valueendifnmesbox=messagebox(" 是否打印会员卡?",4+32+0," 会员卡打印") if nmesbox = 6select vip.vipid,vip.vipname,vip.vipsex,vip.vipadd,vip.vipphone,vip.vipco de from vip where vip.vipid = nvipid into cursor vipcardselect vipcardreport form vipcard.frx to printuse in vipcardendif9.2 输入框Text1 的Valid 事件程序代码this.value = alltrim(this.value) if .not.empty(this.value)select vipgo toplocate for vip.vipid = this.value if found()thisform.text2.value = vip.vipname thisform.text3.value = vip.vipsexthisform.text4.value = vip.vipaddthisform.text5.value = vip.vipphone thisform.text6.value = vip.vipcodeelse=messagebox(" 会员编号不存在",0+16+0," 出错") thisform.text1.value = ""thisform.text2.value = ""thisform.text3.value = ""thisform.text4.value = ""thisform.text5.value = ""thisform.text6.value = "" endif endif thisform.refresh10 、采购员管理表单KFGL_CGY.SCX 程序代码10.1 表单自定义过程AUTO_BUYERID 程序代码select buyerset order to buyeridgo bottomprivate autoid1,autoid2,autoid3,autoid4 autoid1alltrim(str(val(substr(alltrim(buyer.buyerid),4,2))+1,2,0)) autoid2 = len(autoid1) if autoid2 =1autoid1 = "0" + autoid1 endif autoid4 = "BUY" + alltrim(autoid1) thisform.text1.value = autoid410.2 表单表单保存按钮Click 程序代码privatenbuyerid,nbuyername,nbuyersex,nbuyerbirthday,nbuyeradd,nb uyerphoneif empty(thisform.text2.value)=messagebox(" 请输入采购员姓名",0+48+0," 出错")thisform.text2.setfocusthisform.refreshreturn endif if thisform.optiongroup1.value = 0 =messagebox(" 请选择采购员性别",0+48+0," 出错") thisform.optiongroup1.option1.setfocus thisform.refresh returnendifif thisform.text3.value = {} =messagebox(" 请输入出生年月",0+48+0," 出错") thisform.text3.setfocus thisform.refresh returnendifif empty(thisform.text4.value) then =messagebox(" 请输入家庭住址",0+48+0,"出错") thisform.text4.setfocus thisform.refresh returnendifif empty(thisform.text5.value) then =messagebox(" 请输入联系电话",0+48+0,"出错") thisform.text5.setfocus thisform.refresh returnendifnbuyerid = alltrim(thisform.text1.value) nbuyername = alltrim(thisform.text2.value) if thisform.optiongroup1.value = 1nbuyersex = " 男"elsenbuyersex = " 女"endifnbuyerbirthday = dtoc(thisform.text3.value)是新记录into values setnbuyeradd = alltrim(thisform.text4.value)nbuyerphone = alltrim(thisform.text5.value)*判断是新记录保存还是修改记录 If thisform.newcommand = .t. && newcommand = .t.存* 数据表 buyer 保存记录insertbuyer(buyerid,buyername,buyersex,buyerbirthday,buyeradd,buyerphone)(nbuyerid,nbuyername,nbuyersex,nbuyerbirthday,nbuyeradd,nbuyerphone)=messagebox(" 保存完毕 ",0+48+0," 提示 ")elseupdate buyerbuyername=nbuyername,buyersex=nbuyersex,buyerbirthday=nbuyerbirthday,buyeradd=nbuyeradd,buyerphone=nbuyerphone wherebuyerid=nbuyerid=messagebox(" 修改完成 ",0+48+0," 提示 ") endif*表单初始化thisform.text1.enabled = .f.thisform.text2.enabled = .f.thisform.optiongroup1.enabled = .f.thisform.text3.enabled = .f.thisform.text4.enabled = .f.thisform.text5.enabled = .f.mand1.enabled = .t.mand2.enabled = .t.mand3.enabled = .t.mand4.enabled = .t.mand5.enabled = .t.mand6.enabled = .t.mand7.enabled = .t.mand8.enabled = .t.mand9.enabled = .t.采购员 已经删mand10.enabled =.f. mand11.enabled =.f.mand12.enabled = .t. thisform.dis_record thisform.dis_reccommand thisform.newcommand = .f.thisform.refresh10.3 表单删除按钮 Click 程序代码if reccount("buyer")=1 then=messagebox(" 只有一条记录 ,不能删除 ",0+16+0," 出错") return elsenbuyerid = alltrim(thisform.text1.value) nbuyername =alltrim(thisform.text2.value) mesbox=messagebox(" 是 否 删 除"+nbuyerid+" 号 "+nbuyername,4+48+0," 警告 ")if mesbox=7 then returnelseuse buyer EXCLUSIVEdelete from buyer where buyer.buyerid=nbuyerid pack=messagebox(nbuyerid+" 号采购员 "+nbuyername+"",0+48+0," 提示 ")endif endif thisform.dis_recordthisform.dis_reccommand thisform.refreshnoFLOAT fields 10.4 表单浏览按钮 Click 程序代码DEFINE WINDOW browsewin FROM 1,1 TO 30,120 CLOSEnominimize nogrow nozoom system select buyerset order to buyeridbrowbuyerid,buyername,buyersex,buyerbirthday,buyeradd,buyerpho ne window browsewin noappend nomodify nodelete release window browsewin 10.5 表单自定义过程 DIS_RECORD 程序代码select buyer set order to buyeridif reccount("buyer") = 0 thisform.text1.value = "" thisform.text2.value = ""thisform.optiongroup1.value = 0 thisform.text3.value = {} thisform.text4.value = "" thisform.text5.value = ""elsethisform.text1.value = buyer.buyerid thisform.text2.value = buyer.buyername if buyer.buyersex = " 男 " thisform.optiongroup1.value = 1 elsethisform.optiongroup1.value = 2 endifthisform.text3.value = buyer.buyerbirthday thisform.text4.value =buyer.buyeradd thisform.text5.value = buyer.buyerphone endif.and.thisform.refresh11 、 采购员信息查找表单 KFGL_CGY_CZ.SCX 程序代码 11.1 表单查找按钮 Click 事件程序代码if thisform.optiongroup1.value = 1 empty(thisform.text1.value)=messagebox(" 请输入采购员编号 ",0+16+0," 出错 ")thisform.text1.setfocus return endif if thisform.optiongroup1.value = 2 empty(thisform.text2.value) =messagebox(" 请输入采购员姓名 ",0+16+0," 出错 ")thisform.text2.setfocusreturn endif if thisform.optiongroup1.value = 0=messagebox(" 请选择条件 ",0+16+0," 出错 ")thisform.optiongroup1.option1.setfocusreturn endifselect buyerset order to buyeridgo topif thisform.optiongroup1.value = 1locate for buyerid == alltrim(thisform.text1.value)if .not.found()=messagebox(" 没有附和条件记录 ",0+16+0," 出错 ")thisform.text1.setfocusreturnendif elselocate for buyername = alltrim(thisform.text2.value)if .not.found()=messagebox(" 没有附和条件记录 ",0+16+0," 出错 ")thisform.text2.setfocusreturnendifendifcggl_cgy.dis_recordcggl_cgy.dis_reccommand cggl_cgy.refresh thisform.release。
销售管理系统界面及代码(毕业设计)

1.创建网页表单
页面设计:利用网页表单将管理员输入的客户信息传递给目标网页。由目标网页验证后将管
理员输入的客户信息保存到数据库。页面首先创建网页表单并对表单控件进行设置。
代码如下所示。
<%'创建表单 form1,采用隐式传递,提交目标网页 AddCustomer.asp 并返回一个 action 值%>
'获取客户工作单位
memo = Trim(Request.Form("memo"))
'获取客户备注说明
'判断客户信息的合法性
If customer_id = "" Or name = "" Then '如果客户编号或客户名称为空,则提示’客户编号或客户名
称不能为空!’
Response.Write "<Script>alert('客户编号或客户名称不能为空!');</Script>"
customer_id%> name%> city%>
</td>
</tr>
<tr bgcolor="#FFFFFF"> <td align="right"><font color="ff0000">**</font>客户姓名:</td>
<td height="25"> <input type="text" name="name">
End If
企业进销存管理系统进货管理主菜单

package com.lzw;import java.awt.*;import java.awt.event.*;import java.beans.PropertyVetoException;import ng.reflect.Constructor;import .*;import java.util.*;import javax.swing.*;import javax.swing.event.*;import com.lzw.iframe.*;public class MenuBar extends JMenuBar {/*** (进货管理)菜单*/private JMenu jinhuo_Menu = null;/*** (进货单)菜单项,位于(进货管理)菜单内*/private JMenuItem jinhuoItem = null;/*** (进货退货)菜单项,位于(进货管理)菜单内 */private JMenuItem jinhuo_tuihuoItem = null;/*** (销售管理)菜单*/private JMenu xiaoshou_Menu = null;/*** (库存管理)菜单*/private JMenu kucun_Menu = null;/*** (信息查询)菜单*/private JMenu xinxi_chaxunMenu = null;/*** (基本资料)菜单*/private JMenu jiben_ziliaoMenu = null;/*** (系统维护)菜单*/private JMenu xitong_weihuMenu = null;/*** (窗口)菜单*/private JMenu chuang_kouMenu = null;/*** (帮助)菜单*/private JMenu bang_zhuMenu = null;/*** (关于)菜单项,位于(帮助)菜单内*/private JMenuItem guanyu_Item = null;/*** (联系技术支持)菜单项,位于(帮助)菜单内 */private JMenuItem bugItem = null;/*** (访问技术网站)菜单项,位于(帮助)菜单内 */private JMenuItem fangwen_wangzhanItem = null; /*** (销售单)菜单项,位于(销售管理)菜单内 */private JMenuItem xiaoshou_danItem = null;/*** (销售退货)菜单项,位于(销售管理)菜单内 */private JMenuItem xiaoshou_tuihuoItem = null;/*** (库存盘点)菜单项,位于(库存管理)菜单内 */private JMenuItem kucun_pandianItem = null;/*** (价格调整)菜单项,位于(库存管理)菜单内 */private JMenuItem jiage_tiaozhengItem = null;/*** (销售查询)菜单项,位于(信息查询)菜单内*/private JMenuItem xiaoshou_chaxunItem = null;/*** (商品查询)菜单项,位于(信息查询)菜单内*/private JMenuItem shangpin_chaxunItem = null;/*** (销售排行)菜单项,位于(信息查询)菜单内*/private JMenuItem xiaoshou_paihangItem = null;/*** (商品管理)菜单项,位于(基本资料)菜单内*/private JMenuItem shangpin_guanliItem = null;/*** (客户管理)菜单项,位于(基本资料)菜单内*/private JMenuItem kehu_guanliItem = null;/*** (供应商管理)菜单项,位于(基本资料)菜单内*/private JMenuItem gys_guanliItem = null;/*** (经手人设置)菜单项,位于(基本资料)菜单内*/private JMenuItem jsr_guanliItem = null;/*** (密码修改)菜单项,位于(系统维护)菜单内*/private JMenuItem mima_xiugaiItem = null;/*** (数据库备份与恢复)菜单项,位于(系统维护)菜单内 */private JMenuItem shuju_beifenItem = null;/*** (退出)菜单项,位于(系统维护)菜单内*/private JMenuItem exitItem = null;/*** (窗口平铺)菜单项,位于(窗口)菜单内*/private JMenuItem pingpuItem = null;/*** 容纳内部窗体的桌面面板*/private JDesktopPane desktopPanel = null;/*** 内部窗体的集合*/private Map<JMenuItem, JInternalFrame> iFrames = null; /*** 内部窗体的位置坐标*/private int nextFrameX, nextFrameY;/*** (全部关闭)菜单项,位于(窗口)菜单内*/private JMenuItem closeAllItem = null;/*** (全部最小化)菜单项,位于(窗口)菜单内*/private JMenuItem allIconItem = null;/*** (全部还原)菜单项,位于(窗口)菜单内*/private JMenuItem allResumeItem = null;/*** 状态栏的内部窗体提示标签*/private JLabel stateLabel = null;/*** 默认的构造方法**/private MenuBar() {}public MenuBar(JDesktopPane desktopPanel, JLabel label) {super();iFrames = new HashMap<JMenuItem, JInternalFrame>();this.desktopPanel = desktopPanel;this.stateLabel = label;initialize();}/*** 初始化菜单栏界面的方法**/private void initialize() {this.setSize(new Dimension(600, 24));add(getJinhuo_Menu());add(getXiaoshou_Menu());add(getKucun_Menu());add(getXinxi_chaxunMenu());add(getJiben_ziliaoMenu());add(getXitong_weihuMenu());add(getChuang_kouMenu());add(getBang_zhuMenu());}/*** 初始化进货管理菜单的方法** @return javax.swing.JMenu*/public JMenu getJinhuo_Menu() {if (jinhuo_Menu == null) {jinhuo_Menu = new JMenu();jinhuo_Menu.setText("进货管理(J)");jinhuo_Menu.setMnemonic(KeyEvent.VK_J);jinhuo_Menu.add(getJinhuoItem());jinhuo_Menu.add(getJinhuo_tuihuoItem());}return jinhuo_Menu;}/*** 初始化(进货单)菜单项的方法该方法定义菜单项打开进货单窗口,并使窗口处于被选择状态** @return javax.swing.JMenuItem*/public JMenuItem getJinhuoItem() {if (jinhuoItem == null) {jinhuoItem = new JMenuItem();jinhuoItem.setText("进货单");jinhuoItem.setIcon(new ImageIcon(getClass().getResource("/res/icon/jinhuodan.png")));jinhuoItem.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {createIFrame(jinhuoItem, JinHuoDan_IFrame.class);}});}return jinhuoItem;}/*** 初始化(进货退货)菜单项的方法,该方法定义菜单项打开(进货退货)窗体,并使窗体处于已选择状态。
C语言进销存管理系统源程序

參止头埒秦皇岛分校NorthEastern University At QinHuangDaoC语言课程设计综合性程序设计报告之源程序设计题目:电脑公司进销存管理系统专业:冶金工程学号:8090507姓名:刘欢成绩: ________________设计时间: 2010年11月03日二•开题说明1•问题概要该系统用于处理某电脑公司的设备买入,卖出,仓储等设备账目。
在买入设备时,记录设备的数量型号(如computer,keyboard和价钱,并在库房记录中添加设备,在卖出设备时从库房中减掉该设备,并根据卖出的数量型号和价钱得出每一笔买出的利润。
每个一段时间盘点库房和账目计算出利润等数据。
基本要求:有货物管理(设备的添加,删除,修改)有账目管理可以查询账目清单可以计算年度或月份或季度利润。
2•问题分析:先定义合适的结构体,存储物品信息。
在程序中建立一个文件用于存储,凡进行了进货操作的物品在文件中都有记录,进货时由于尚不知售货时间与售价、利润,故此三项(实际为四项,时间分为年、月两项)暂先赋值为零,待进行售货操作时再输入各数值,其中利润由系统自动计算得出并保存。
账目清单分为已售、仓储两部分,由此可看到所有购进、卖出的货物信息。
月利润查询可查得所输入年月的各类所售货物数量与利润。
功能模块四•源程序#i nclude <stdio.h>#i nclude <stdlib.h>#i nclude vconi o.h>#in clude <dos.h>#i nclude <stri ng.h>#define LEN sizeof(struct object)#defi ne FORMAT1 "\t%-8d%-11s%-9.2f%-6d%-4d\n"#defi ne DATA1 (p1+i)->nu m,(p1+i)->n ame,(p1+i)->i nprice,(p1+i)->i ny ear,(p1+i)->i nmonth#defi ne FORMAT2 "\t%-8d%-11s%-9.2f%-9.2f%-7.2f%-6d%-4d%-6d%-4d\n"#defi ne DATA2 (p1+i)->nu m,(p1+i)->n ame,(p1+i)->inprice,(p1+i)->outprice,(p1+i)->profit,(p1+i)- >iny ear,(p1+i)->inmonth,(p1+i)->outyear,(p1+i)->outm onthvoid in();void show();void modify();void sell();void menu();void mon thearn();struct object{int nu m,i ny ear,i nmon th,outyear,outmo nth;char n ame[10];float in price,outprice,profit;} obj[100];struct object *p1=obj;mai n(){int n;menu();while( n)switch( n){case 1: in( );break;case 2:sell();break;case 3:modify();break;case 4:show();break;case 5:m on thear n( );break;default:break;}getch();menu();sca nf("%d",&n);}}void menu ()// 菜单{system("cls");prin tf("\n\n\n\n\n\n");*************** 菜单************** \n");prin tf("\t\t 0.退出\n ”);printf("\t\t 1.进货操作\n");printf("\t\t 2.售货操作\n");prin tf("\t\t 3•修改信息\n");prin tf("\t\t 4.账目清单\n");prin tf("\t\t 5月利润查询\n");printf("\t\t********************************\n")・}void in() //进货操作{int i,m=0;char ch[2];FILE *p;if( (p=fope n( "data","a+"))==NULL){printf("打不开文件!\n"); //打开文件retur n;}while(!feof(p)){if(fread(&obj[m] ,L EN,1,p)==1)m++; //将数据读入内存}fclose(p);if(m==0)printf("无记录!\n");printf("请确认是否进货?( y/n)");sea nf("%s",ch);while(strcmp(ch,"y")==0||strcmp(ch,"y")==0){printf("请输入设备编号:");sca nf("%d", &obj[m]. nu m);for(i=0;i<m;i++)if((p1+i)->num==obj[m]. num){printf("此号已存在,按任意键继续!");getch();fclose(p);return;}printf("设备名称:");sca nf("%s",obj[m]. name);printf("进价:");sca nf("%f",&obj[m].i nprice);printf("进货年、月:");sea nf("%d%d",&obj[m].i nyear,&obj[m].i nmon th);obj[m].outprice=0;obj[m].outyear=0;(p1+m)->outm on th=0;fope n( "data","w"); //打开文件用以向磁盘导入数据for(i=0;i<=m;i++)fwrite(&obj[i],LEN,1,p);if(fwrite(&obj[m] ,L EN,1,p)!=1){printf("无法保存!");getch();}else{printf("%s 保存成功!\n",obj[m].name);m++;}printf("继续?( y/n)");sca nf("%s",ch);}fclose(p);printf("保存完毕!\n");printf("进价:");}void sell() //售货操作{FILE *p;int snu m,i,j,m=0;char ch[2];if((p二fope n("data","rb"))==NULL){prin tf("无法打开文件! \n"); retur n;}while(!feof(p))if(fread(&obj[m] ,L EN,1,p)==1) m++;fclose(p);if(m==0){printf("无记录! \n"); return;} sca nf("%d", &sn um);//打开文件//读入printf("请输入编号:");for(i=0;i<m;i++)if(snum==(p1+i)->num)break;if(i<m) // 判断1{printf("查得此物品,确认出售? ( y/n) ”);sca nf("%s",ch);if(strcmp(ch,"y")==O||strcmp(ch,"Y")==0) //判断2 {printf("请输入售价:");sca nf("%f",&(p1+i)->outprice);(p1+i)->profit=((p1+i)->outprice-(p1+i)->i nprice);printf("\n请输入售出年、月:");sca nf("%d%d",&(p1+i)->outyear,&(p1+i)->outmo nth);if((p=fope n("data","wb+"))==NULL){printf("打不开文件! \n ”);return;}for(j=0;j<m;j++)if(fwrite(&obj[j],LEN,1,p)!=1) printf("无法保存! \n”); getch();}printf("售货成功!"); fclose(p);retur n;}elsereturn; //判断2}elseprintf("无此物品!");return; 〃判断1}void modify() // 修改信息FILE *p;int i,j,m=O,s num;if((p二fope n( "data","rb"))==NULL) {printf("打不开文件!\n”);return;}while(!feof(p))if(fread(&obj[m] ,L EN,1,p)==1)m++;if(m==0){printf("无记录! \n");fclose(p);return;}printf("请输入欲修改信息的货物编号:");sca nf("%d",&sn um);for(i=0;i<m;i++)if(snum==(p1+i)->num)break;if(i<m){prin tf("找到此货物! \n");printf("\n 名称:”);sea nf("%s",(p1+i)-> name);printf("\n 进价:");sea nf("%f",&(p1+i)->i npriee);printf("\n 进货年、月:");sea nf("%d%d",&(p1+i)->i nyear,&(p1+i)->i nmon th); if((p=fope n("data","wb+"))==NULL){printf("打不开文件! \n");return;}for(j=0;j<m;j++)if(fwrite(&obj[j],LEN,1,p)!=1){printf("无法保存!");getch();}fclose(p);}else return;printf("无此货物!");printf("\t 编号 名称 进价进货时间\t\n"); void show() //账目清单 {FILE *p; int i,m=0;if((p 二fope n( "data","rb"))==NULL)printf("打不开!"); while(!feof(p))if(fread(&obj[m] ,L EN,1,p)==1)m++;fclose(p);printf("已售\n\t 编号 名称进价 售价 利润间出售时间\t\n");for(i=0;i<m;i++) {if((p1+i)->profit!=0)printf(FORMAT2,DA TA2);}printf("仓储 \n"); for(i=0;i<m;i++)进货时{if((p1+i)->profit==0)prin tf(F0RMAT1,DATA1);}} void mon thearn()〃月利润{FILE *p;int m=0,s=0,a=0,b=0,c=0,d=0,y,z;float sum1=0,sum2=0,sum3=0,sum4=0;if((p=fope n( "data","rb"))==NULL){printf("打不开文件! \n");retur n;} //打开文件while(!feof(p))if(fread(&obj[m] ,L EN,1,p)==1)m++;fclose(p); //将数据读入内存printf("请输入欲查询的年份、月份:");sea nf("%d%d", &y,& z);for(s=0;s<m;s++){if((strcmp(obj[s].name,"zhuji")==0)&&(y==obj[s].outyear)&&( z==obj[s].outm on th)) {a++;sum1+=obj[s].profit;}if((strcmp(obj[s]. name,"xianshiqi")==0)&&(y==obj[s].outyear)&&( z==obj[s].outm on th)){b++;sum2+=obj[s].profit;}if((strcmp(obj[s]. name,"jianpan ”)==0)&&(y==obj[s].outyear)&&( z==obj[s].outmo nth))c++;sum3+=obj[s].profit;if((strcmp(obj[s].name,"shubiao")==0)&&(y==obj[s].outyear)&&( z==obj[s].outmo nth)) {d++;sum4+=obj[s].profit;}}printf("本月共售出\n");printf("\t 主机%d 台,总利润%7.2f 元\n",a,sum1);printf("\t 显示器%d 台,总利润%7.2f 元\n",b,sum2);printf("\t 键盘%d 台,总利润%7.2f 元\n",c,sum3);printf("\t 鼠标%d 台,总利润%7.2f 元\n",d,sum4);。
进销存网站管理系统-代码
package org.liky.game.frame;import java.awt.Color;import java.awt.Font;import java.awt.Graphics;import java.awt.Toolkit;import java.awt.event.MouseEvent;import java.awt.event.MouseListener;import java.awt.image.BufferedImage;import java.io.File;import java.io.IOException;import javax.imageio.ImageIO;import javax.swing.JFrame;public class MyChessFrame extends JFrame implements MouseListener { public MyChessFrame() {this.setTitle;this.setSize(1000, 700);this.setResizable(false) ;this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);int width = Toolkit.getDefaultToolkit().getScreenSize().width;int height = Toolkit.getDefaultToolkit().getScreenSize().height;/*System.out.println;System.out.println;*/this.setLocation((width - 200)/2, (height-100)/2);this.addMouseListener(this);this.setVisible(true);}public void paint(Graphics g) {/*g.drawString;*//*g.drawOval(20, 40, 40, 40);*//*g.fillOval(20, 40, 40, 40);*//*g.drawLine(20, 40, 80, 40);*//* g.drawRect(20, 40, 40, 20);g.fillRect(80, 40, 40, 20);*/BufferedImage image = null;try {image = ImageIO.read(new File);} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}g.drawImage(image,0,0,this);g.drawOval(20, 40, 40, 40);g.setColor(Color.BLUE);g.fillRect(80, 40, 40, 20);g.setFont(new Font;g.drawString;}public void mouseClicked(MouseEvent arg0) {// TODO Auto-generated method stub}public void mouseEntered(MouseEvent arg0) {// TODO Auto-generated method stub}public void mouseExited(MouseEvent arg0) {// TODO Auto-generated method stub}public void mousePressed(MouseEvent arg0) {// TODO Auto-generated method stub}public void mouseReleased(MouseEvent arg0) {// TODO Auto-generated method stub}}package org.liky.game.test;import org.liky.game.frame.FiveChessFrame;public class Test {public static void main(String[] args) {/*MyChessFrame mf = new MyChessFrame();*///JOptionPane.showMessageDialog(mf,;/*int result = JOptionPane.showConfirmDialog;if (result == 0 ) {JOptionPane.showMessageDialog;}if (result == 1) {JOptionPane.showMessageDialog;}if (result == 2) {JOptionPane.showMessageDialog;}*//*String username = JOptionPane.showInputDialog;if (username != null) {System.out.println(username );JOptionPane.showMessageDialog"+username );} else {JOptionPane.showMessageDialog;}*/FiveChessFrame ff = new FiveChessFrame();}}package org.liky.game.frame;import java.awt.Color;import java.awt.Font;import java.awt.Graphics;import java.awt.Toolkit;import java.awt.event.MouseEvent;import java.awt.event.MouseListener;import java.awt.image.BufferedImage;import java.io.File;import java.io.IOException;import javax.imageio.ImageIO;import javax.swing.JFrame;import javax.swing.JOptionPane;public class FiveChessFrame extends JFrame implements MouseListener, Runnable {int width = Toolkit.getDefaultToolkit().getScreenSize().width;int height = Toolkit.getDefaultToolkit().getScreenSize().height;BufferedImage bgImage = null;int x = 0;int y = 0;int[][] allChess = new int[19][19];boolean isBlack = true;boolean canPlay = true;String message =;int maxTime = 0;Thread t = new Thread(this);int blackTime = 0;int whiteTime = 0;String blackMessage =;String whiteMessage =;public FiveChessFrame() {this.setTitle;this.setSize(500, 500);this.setLocation((width - 500) / 2, (height - 500) / 2);this.setResizable(false);this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.addMouseListener(this);this.setVisible(true);t.start();t.suspend();this.repaint();String imagePath = "" ;try {imagePath=System.getProperty("user.dir")+"/bin/image/background.jpg" ;bgImage = ImageIO.read(new File(imagePath.replaceAll("\\\\", "/")));} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}public void paint(Graphics g) {BufferedImage bi = new BufferedImage(500, 500,BufferedImage.TYPE_INT_RGB);Graphics g2 = bi.createGraphics();g2.setColor(Color.BLACK);g2.drawImage(bgImage, 1, 20, this);g2.setFont(new;g2.drawString;g2.setFont(new Font;g2.drawString;g2.drawString;for (int i = 0; i < 19; i++) {g2.drawLine(10, 70 + 20 * i, 370, 70 + 20 * i);g2.drawLine(10 + 20 * i, 70, 10 + 20 * i, 430);}g2.fillOval(68, 128, 4, 4);g2.fillOval(308, 128, 4, 4);g2.fillOval(308, 368, 4, 4);g2.fillOval(68, 368, 4, 4);g2.fillOval(308, 248, 4, 4);g2.fillOval(188, 128, 4, 4);g2.fillOval(68, 248, 4, 4);g2.fillOval(188, 368, 4, 4);g2.fillOval(188, 248, 4, 4);for (int i = 0; i < 19; i++) {for (int j = 0; j < 19; j++) {if (allChess[i][j] == 1) {int tempX = i * 20 + 10;int tempY = j * 20 + 70;g2.fillOval(tempX - 7, tempY - 7, 14, 14);}if (allChess[i][j] == 2) {int tempX = i * 20 + 10;int tempY = j * 20 + 70;g2.setColor(Color.WHITE);g2.fillOval(tempX - 7, tempY - 7, 14, 14);g2.setColor(Color.BLACK);g2.drawOval(tempX - 7, tempY - 7, 14, 14);}}}g.drawImage(bi, 0, 0, this);}public void mouseClicked(MouseEvent e) {// TODO Auto-generated method stub}public void mouseEntered(MouseEvent e) {// TODO Auto-generated method stub}public void mouseExited(MouseEvent e) {// TODO Auto-generated method stub}public void mousePressed(MouseEvent e) {// TODO Auto-generated method stub*System.out.println("X:"+e.getX());System.out.println("Y:"+e.getY());if (canPlay == true) {x = e.getX();y = e.getY();if (x >= 10 && x <= 370 && y >= 70 && y <= 430) {x = (x - 10) / 20;y = (y - 70) / 20;if (allChess[x][y] == 0) {if (isBlack == true) {allChess[x][y] = 1;isBlack = false;message =;} else {allChess[x][y] = 2;isBlack = true;message =;}boolean winFlag = this.checkWin();if (winFlag == true) {JOptionPane.showMessageDialog(this, "+ (allChess[x][y] == 1 ?canPlay = false;}} else {JOptionPane.showMessageDialog}this.repaint();}}/* System.out.println(e.getX() + " -- " + e.getY()); */if (e.getX() >= 400 && e.getX() <= 470 && e.getY() >= 70&& e.getY() <= 100) {int result = JOptionPane.showConfirmDialog(this,;if (result == 0) {for (int i = 0; i < 19; i++) {for (int j = 0; j < 19; j++) {allChess[i][j] = 0;}}message =;isBlack = true;blackTime = maxTime;whiteTime = maxTime;if (maxTime > 0) {blackMessage = maxTime / 3600 + ":"+ (maxTime / 60 - maxTime / 3600 * 60) + ":"+ (maxTime - maxTime / 60 * 60);whiteMessage = maxTime / 3600 + ":"+ (maxTime / 60 - maxTime / 3600 * 60) + ":"+ (maxTime - maxTime / 60 * 60);t.resume();} else {blackMessage =;whiteMessage =;}this.canPlay = true;this.repaint();}}if (e.getX() >= 400 && e.getX() <= 470 && e.getY() >= 120&& e.getY() <= 150) {String input = JOptionPanetry {maxTime = Integer.parseInt(input) * 60;if (maxTime < 0) {JOptionPane.showMessageDialog(this,;}if (maxTime == 0) {intresult=JOptionPane.showConfirmDialog(this,if (result == 0) {for (int i = 0; i < 19; i++) {for (int j = 0; j < 19; j++) {allChess[i][j] = 0;}}message =;isBlack = true;blackTime = maxTime;whiteTime = maxTime;package pm;public class SwitchTest {//>=90 A// 80~89 B// 70~79 C// 60~69 D// <60 Epublic static void main(String[] args) {int s=87;switch(s/10){case 10 :System.out.println("A");break;case 9 :System.out.println("A");break;case 8 :System.out.println("B");break;case 7 :System.out.println("c");break;case 6 :System.out.println("D");break;default :System.out.println("E");break;}}}package pm;public class SwitchTest{public static void main(String[] args){for(int i=1;i<=9;i++){for(int j=1;j<=i;j++){System.out.print(j+"*"+i+"="+(i*j)+"\t");}System.out.println();}}}package pm;import java.util.Scanner;public class SwitchTest {public static void main(String[] args) {Scanner sc=new Scanner(System.in);while (true) {System.out.println;String s = sc.next().trim();if ("c".equalsIgnoreCase(s)) {System.out.println;double db = sc.nextDouble();double db2 = (db * 9 / 5) + 32;System.out.println(" + db2 + "F");} else if ("f".equalsIgnoreCase(s)) {System.out.println;double db = sc.nextDouble();double db2 = (db - 32) * 5 / 9;System.out.println(+ Math.round(db2) + "C");}else if("exit".equalsIgnoreCase(s)){break;}}}}package pm;import java.util.Scanner;public class SwitchTest{public static void main(String[] args) {Scanner sc=new Scanner(System.in);boolean flag=true;while (flag) {System.out.println;String str = sc.nextLine().trim();if (str.endsWith("c") || str.endsWith("C")) {String st = str.substring(0, str.length() - 1);double db = Double.parseDouble(st);//[0,2)//2 double db=Double.valueOf(st).doubleValue();double db2 = (db * 9 / 5) + 32;System.out.println;} else if (str.endsWith("f") || str.endsWith("F")) {String st = str.substring(0, str.length() - 1);double db = Double.parseDouble(st);//[0,2)//2 double db=Double.valueOf(st).doubleValue();double db2 = (db - 32) * 5 / 9;System.out.println(+ Math.round(db2) + "C");}else if("exit".equalsIgnoreCase(str)){flag=false;}}}}package pm;public class SwitchTest {public static void main(String[] args) {int a=1,b=2,c=3,d=0;d=a>b?a:b;d=a>b?(a>c?a:c):(b>c?b:c);System.out.println;}}package one;import java.awt.BorderLayout;import java.awt.GridLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JPanel;import javax.swing.JTextField;public class Jsq implements ActionListener {private JFrame frame;private JButton[] bus;private JTextField jtx;private JButton bu;private char[] strs;private String d_one = "";private String operator;public static void main(String[] args) {new Jsq();}public Jsq() {frame = new JFrame;jtx = new JTextField(14);bus = new JButton[16];strs = "789/456*123-0.+=".toCharArray();for (int i = 0; i < 16; i++) {bus[i] = new JButton(strs[i] + "");bus[i].addActionListener(this);}bu = new JButton("C");bu.addActionListener(this);init();}/* GUI */public void init() {JPanel jp1 = new JPanel();jp1.add(jtx);jp1.add(bu);frame.add(jp1, BorderLayout.NORTH);JPanel jp2 = new JPanel();jp2.setLayout(new GridLayout(4, 4));for (int i = 0; i < 16; i++) {jp2.add(bus[i]);}frame.add(jp2, BorderLayout.CENTER);frame.pack();frame.setLocation(300, 400);frame.setVisible(true);frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);}public void actionPerformed(ActionEvent arg0) {String conn = arg0.getActionCommand();if ("C".equals(conn)) {d_one = "";operator = "";jtx.setText("");return;}if(".".equals(conn)){return;}if (("+-*/".indexOf(conn)) != -1) {if("".equals(d_one) && "".equals(jtx.getText())) return;d_one = jtx.getText();operator = conn;jtx.setText("");return;}if ("=".equals(conn)) {if("".equals(d_one) && "".equals(jtx.getText())) return;double db = 0;if ("+".equals(operator)) {db = Double.parseDouble(d_one)+ Double.parseDouble(jtx.getText());jtx.setText(db + "");}if ("-".equals(operator)) {db = Double.parseDouble(d_one)- Double.parseDouble(jtx.getText());jtx.setText(db + "");}if ("*".equals(operator)) {db = Double.parseDouble(d_one)* Double.parseDouble(jtx.getText());jtx.setText(db + "");}if ("/".equals(operator)) {db = Double.parseDouble(d_one)/ Double.parseDouble(jtx.getText());jtx.setText(db + "");}d_one = db + "";return;}jtx.setText(jtx.getText() + conn);}}package pm;public class SwitchTest{public static void main(String[] args){int n=5;for(int i=0;i<=n;i++){for(int j=0;j<n-i;j++){System.out.print(" ");}for(int k=0;k<2*i-1;k++){System.out.print("*");}System.out.println();}}}package pm;import java.util.Scanner;public class SwitchTest{public static void main(String[] args){String name=null;Scanner sca=new Scanner (System.in);char firstChar;do{System.out.println("please input your name");name=sca.nextLine();firstChar=name.charAt(0);}while(!(firstChar>='a' && firstChar<='z' ||firstChar>='A' && firstChar<='Z'));System.out.println("OK! your name is:"+name);}}package pm;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JPanel;public class SwitchTest {private JFrame frame;private JLabel jl1;private JLabel jl2;private JLabel jl3;/* */public static void main(String[] args) {new SwitchTest().getTime();}private void getTime(){long time=1*3600;long hour =0 ;long minute =0 ;long seconds=0;while(time>=0){hour=time/3600;minute=(time-hour*3600)/60;seconds=time-hour*3600-minute*60;jl1.setText(hour+"时");jl2.setText(minute+"分");jl3.setText(seconds+"秒");try {Thread.sleep(1000);} catch (InterruptedException e) {e.printStackTrace();}time--;}}/* GUI */public SwitchTest(){frame = new JFrame;jl1 = new JLabel();jl2 = new JLabel();jl3 = new JLabel();init();}/* */private void init(){JPanel jp=new JPanel();jp.add(jl1);jp.add(jl2);jp.add(jl3);frame.add(jp);frame.setVisible(true);frame.setLocation(300,400);frame.setSize(300, 200);frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);}}public class Sjx{public static void main(String[] args){int SIZE=19;for(int i=0;i<SIZE;i++){if(i<10){System.out.print(" "+i);}else{System.out.print(" "+(char)(i+'a'-10));}}System.out.println();// System.out.print(i<10?(char)(i+'0'):(char)(i+'a'-10));for(int i=0;i<SIZE;i++){if(i<10){System.out.print(i+" ");//}else{System.out.print((char)(i+'a'-10)+" ");}for(int j=0;j<SIZE;j++){System.out.print("*"+" ");}System.out.println();}}}package day04;public class ArrayTest {public static void main(String[] args){char[][] arr=new char[4][7];String s="";for(int i=0;i<arr.length;i++){for(int j=0;j<arr[i].length;j++){arr[i][j]=s.charAt(i*7+j);}}for(int i=0;i<arr[0].length;i++){for(int j=0;j<arr.length;j++){System.out.print(arr[arr.length-j-1][i]+" ");}System.out.println();}}}package day02;public class Fangk{public static void main(String[] args){for(int i=1000;i<=9999;i++){int q=i/1000;int b=i/100%10;int s=i/10%10;int g=i%10;if(q>b && s>g && q+g==b+s && b%2!=0){System.out.println("The Min Number is:"+i);break;}}loop1: for(int q=1;q<=9;q++){loop2: for(int b=0;b<=9;b++){if(b%2==0){continue loop2;}for(int s=0;s<=9;s++){for(int g=0;g<=9;g++){if(q>b && s>g && q+g==b+s){System.out.println("The Min Number is:"+(q*1000+b*100+s*10+g));break loop1;}}}}package day02;public class Fangk{public static void main(String[] args){int num=14;boolean flag=true;for(int i=2;i<=num/2;i++){if(num%i==0){flag=false;break;}}if(flag){System.out.println(num+" is a prime number!");}else{System.out.println(num+" is not a prime number!");}}}package day04;import java.util.Scanner;public class A1{public static void main(String[] args){int n;Scanner sca=new Scanner(System.in);System.out.println("please input a number:");n=sca.nextInt();if(isPrimeNumber(n)){System.out.println(n+"is a prime number!");}else{System.out.println(n+"is not a prime number!");}}public static boolean isPrimeNumber(int n){for(int i=2;i<=n/2;i++){if(n%i==0){return false;}}return true;}}package day02;public class Daoxu{public static void main(String[] args){int olddata=3758;int newdata=0;while(olddata!=0){for(int i=0;i<4;i++){newdata=newdata*10+olddata%10;olddata=olddata/10;}System.out.println("newdata="+newdata);}}}package day04;import java.util.Scanner;public class ArrayTest {public static void main(String[] args){int n;Scanner s=new Scanner(System.in);System.out.println("please input a number:");n=s.nextInt();for(int i=31;i>=0;i--){if((n&(1<<i))!=0){System.out.print("1");}else{System.out.print("0");}if((32-i)%8==0){System.out.print(" ");}}}}package day02;public class Fangk {public static void main(String[] args){int m=5,n=6;for(int i=0;i<n;i++){System.out.print("* ");}System.out.println();for(int i=0;i<m-2;i++){System.out.print("* ");for(int j=0;j<n-2;j++){System.out.print(" ");}System.out.print("*");System.out.println();}for(int i=0;i<n;i++){System.out.print("* ");}}}package day02;import java.util.Scanner;public class Csz {public static void main(String[] args) {Scanner s = new Scanner(System.in);int num = (int) (Math.random() * 1000);int m=0;for(int i=9;i>=0;i--){System.out.println("please input your number! ");m=s.nextInt();if(m>num){System.out.println("Too large!");}else if(m<num){System.out.println("Too small!");}else{System.out.println("You are right!");break;}if(i>0){System.out.println;}}if( m!=num){System.out.println;}}}17.HotelManagerpackage hotel;import java.util.Scanner;public class HotelManager {private static String[][] rooms;public static void main(String[] args) {rooms = new String[10][12];String comm;for (int i = 0; i < rooms.length; i++) {for (int j = 0; j < rooms[0].length; j++) {rooms[i][j] = "EMPTY";}}while (true) {System.out.println;Scanner sca = new Scanner(System.in);System.gc();comm = sca.next();if ("search".equalsIgnoreCase(comm)) {search();} else if ("in".equalsIgnoreCase(comm)) {int roomNo = sca.nextInt();String name = sca.next();in(roomNo, name);} else if ("out".equalsIgnoreCase(comm)) {int roomNo = sca.nextInt();out(roomNo);} else if ("exit".equalsIgnoreCase(comm)) {System.out.println;break;} else {System.out.println;}}}private static void out(int roomNo) {if("EMPTY".equals(rooms[(roomNo/100)-1][(roomNo%100)-1])){System.out.println;return;}rooms[(roomNo/100)-1][(roomNo%100)-1]="EMPTY";System.out.println;}private static void in(int roomNo, String name) {if(!"EMPTY".equals(rooms[(roomNo/100)-1][(roomNo%100)-1])){System.out.println;return;}rooms[(roomNo/100)-1][(roomNo%100)-1]=name;System.out.println;}private static void search() {for (int i = 0; i < rooms.length; i++) {for (int j = 0; j < rooms[0].length; j++) {if (j + 1 < 10) {System.out.print(i + 1 + "0" + (j + 1) + "");} else {System.out.print(i + 1 + "" + (j + 1) + " ");}}System.out.println();for (int j = 0; j < rooms[0].length; j++) {System.out.print(rooms[i][j] + " ");}System.out.println();}}}18.StudentManagerpackage day05.student_manager;import java.util.Scanner;public class StudentManager {static int[][] scores=new int[6][5];static String[]students={"zhangsan","lisi","wangwu","zhaoliu","qianqi","liuba"};static String[] courses={"corejava","jdbc","servlet","jsp","ejb"};public static void main(String[] args) {for(int i=0;i<scores.length;i++){for(int j=0;j<scores[i].length;j++){scores[i][j]=(int)(Math.random()*100);}}Scanner s=new Scanner(System.in);String comm;while(true){System.out.println;comm=s.next();if(comm.equals("AVG")){String para=s.next();avg(para);}else if(comm.equals("SORT")){String course=s.next();sort(course);}else if(comm.equals("GET")){String student=s.next();String course=s.next();get(student,course);}else if(comm.equals("EXIT")){break;}else{System.out.println;}}}//main() end!public static void avg(String para){int sIndex=-1;int cIndex=-1;for(int i=0;i<students.length;i++){if(students[i].equals(para)){sIndex=i;}}if(sIndex==-1){for(int i=0;i<courses.length;i++){if(courses[i].equals(para)){cIndex=i;}}}if(sIndex==-1 && cIndex==-1){System.out.println;return;}double avg=0.0;if(sIndex!=-1){for(int i=0;i<scores[sIndex].length;i++){avg+=scores[sIndex][i];}avg/=scores[sIndex].length;System.out.println(+para++avg);}else{for(int i=0;i<scores.length;i++){avg+=scores[i][cIndex];}avg/=scores.length;System.out.println(+para+ +avg);}}public static void sort(String course){int[] courseScore=new int[scores.length];if(course.equals("sum"))courseScorefor(int i=0;i<scores.length;i++){int studentSum=0;for(int j=0;j<scores[i].length;j++){studentSum+=scores[i][j];}courseScore[i]=studentSum;}}elseint cIndex=-1;for(int i=0;i<courses.length;i++)if(courses[i].equals(course)){cIndex=i;}}if(cIndex!=-1)// scores* courseScore!for(int i=0;i<scores.length;i++){courseScore[i]=scores[i][cIndex];}}else{System.out.println;return;}}String[] studentCopy=new String[students.length];System.arraycopy(students, 0, studentCopy, 0, students.length);for(int i=0;i<courseScore.length-1;i++){for(int j=i+1;j<courseScore.length;j++){if(courseScore[i]<courseScore[j]){int temp=courseScore[i];courseScore[i]=courseScore[j];courseScore[j]=temp;String stemp=studentCopy[i];studentCopy[i]=studentCopy[j];studentCopy[j]=stemp;}}}int order=1;System.out.println;for(int i=0;i<courseScore.length;i++){if(i!=0 && courseScore[i]==courseScore[i-1]){order--;}else{order=i+1;}System.out.print(order+"\t");System.out.print(studentCopy[i]+"\t");System.out.println(courseScore[i]);order++;}}public static void get(String student,String course){int sIndex=-1;int cIndex=-1;for(int i=0;i<students.length;i++){if(students[i].equals(student)){sIndex=i;}}if(sIndex==-1){System.out.println(+student);return;}if(course.equals("sum")){int studentSum=0;for(int j=0;j<scores[sIndex].length;j++){studentSum+=scores[sIndex][j];}System.out.println(student+studentSum);return;}for(int i=0;i<courses.length;i++){if(courses[i].equals(course)){cIndex=i;}}if(cIndex==-1){System.out.println(+course);return;}System.out.println(student+course+scores[sIndex][cIndex]);}}19.Fivepackage hotel;import java.util.Scanner;public class Five {private static String[][] five=new String[17][17];static{drawFive();}public static void main(String[] args) {while(true){System.out.println;Point p1=pleaseIn();if(!five[Integer.parseInt(p1.getX())][Integer.parseInt(p1.getY())].equal s("*")){System.out.println;}runPoint(p1,"white");gameover(p1);System.out.println;Point p2=pleaseIn();if(!five[Integer.parseInt(p2.getX())][Integer.parseInt(p2.getY())].equal s("*")){System.out.println;}runPoint(p2,"black");gameover(p2);}} private static void runPoint(Point p,String str){// px pyint x=Integer.parseInt(p.getX()),y=Integer.parseInt(p.getY());if(str.equals("white")){five[x][y]="@";}else{five[x][y]="O";}outFive();}private static Point pleaseIn(){Scanner sc=new Scanner(System.in);Point p=new Point(sc.next(),sc.next());String px=p.getX();String py=p.getY();// px pyint x=0,y=0;for(int i=1;i<five.length;i++){if(five[i][0].equals(px)){x=i;}if(five[0][i].equals(py)){y=i;}}return new Point(x+"",y+"");}* @param ppublic static void gameover(Point p) {int x=Integer.parseInt(p.getX()),y=Integer.parseInt(p.getY());int c1 = 0, c2 = 0, c3 = 0, c4 = 0;boolean l1 = true, l2 = true, l3 = true, l4 = true, l5 = true, l6 = true, l7 = true, l8 = true;for (int i = 1; i <5 ; i++) {if (y - i >= 1&& five[x][y - i].equals(five[x][y])&& l1) {c1++;} else {l1 = false;}if (y + i <= 16&& five[x][y + i].equals(five[x][y])&& l2) {c1++;} else {l2 = false;}if (x - i >= 1&& five[x - i][y].equals(five[x][y])&& l3) {c2++;} else {l3 = false;}if (x + i <= 16&& five[x + i][y].equals(five[x][y])&& l4) {c2++;} else {l4 = false;}if (x - i >= 1 && y - i >= 1&& five[x - i][y - i].equals(five[x][y])&& l5) {c3++;} else {l5 = false;}if (x + i <= 16 && y + i <= 16&& five[x + i][y + i].equals(five[x][y])&& l6) {c3++;} else {l6 = false;}if (x - i >= 1 && y + i <= 16&& five[x - i][y + i].equals(five[x][y])&& l7) {c4++;} else {l7 = false;}if (x + i <= 16 && y - i >= 1&& five[x + i][y - i].equals(five[x][y])&& l8) {c4++;} else {l8 = false;}}if (c1 >= 4 || c2 >= 4 || c3 >= 4 || c4 >= 4) {if (five[x][y].equals("1")) {System.out.println;System.exit(0);} else {System.out.println;System.exit(0);}}}。
销售管理系统相关代码
销售管理系统相关代码以下是一个简单的销售管理系统的代码示例:```pythonclass Product:def __init__(self, name, price, quantity): = nameself.price = priceself.quantity = quantitydef get_total_price(self):return self.price * self.quantityclass SalesManager:def __init__(self):self.products = []def add_product(self, product):self.products.append(product)def remove_product(self, product):self.products.remove(product)def calculate_total_revenue(self):total_revenue = 0for product in self.products:total_revenue += product.get_total_price() return total_revenue# 示例用法if __name__ == "__main__":manager = SalesManager()# 添加产品product1 = Product("iPhone", 999, 2)manager.add_product(product1)product2 = Product("iPad", 599, 3)manager.add_product(product2)# 计算总收入total_revenue = manager.calculate_total_revenue()print("总收入:", total_revenue)# 移除产品manager.remove_product(product1)# 重新计算总收入total_revenue = manager.calculate_total_revenue()print("调整后总收入:", total_revenue)```上述代码包括两个类:`Product`和`SalesManager`。
基于Java Swing 和MySQL的企业进销存管理系统(含源文件)
摘要随着信息化时代的到来,生活中各种信息趋向数字化、清晰化,应用于各行业的信息管理系统应运而生。
进销存管理系统是促进企业发展的重要组成部分,是商业企业经营管理中的核心环节,也是一个企业能否取得效益的关键,如果能够做到合理采购、及时销售、库存量最小、减少积压,那么企业就能够取得最佳效益。
在现代社会中,大多数企事业单位,特别是中小型企业,实现信息化管理是首要任务。
只有实现信息化管理,才能够提高工作效率和企业的管理水平。
市场经济快速多变,竞争激烈,企业采用进销存管理系统管理进货、库存、销售等诸多环节已成为趋势及必然。
本系统是一个基本的进销存管理系统,利用信息化手段把先进的企业管理方法引入企业的实践,为企业的管理改革提供切实易行的途径。
系统对企业中常见的采购、库存销售等商业活动以及相关的供应商和客户等基本信息进行管理。
本文以企业进销存管理系统的分析和设计为出发点,详细介绍了开发本系统的各个步骤:系统分析、系统设计、系统编码实现和系统测试。
在系统分析中先后用数据流图、系统的功能结构图分析了系统所需的各种数据和功能模块。
在系统设计和系统实现部分,详细的展现了系统的数据库设计与实现,以及系统的各个功能模块的所需的数据库表、表字段以及菜单的设计。
系统实现了强大的经销存管理,包括基本信息、采购、进货、销售和库存管理。
系统采用Java Swing技术,以MySQL作为后台数据库管理系,使用Eclipse 集成环境工具进行开发,界面简洁美观、性能满足要求、功能完善,经测试,本系统的设计是正确的。
关键词:信息化管理;进销存管理系统;Java Swing;Mysql;ABSTRACTWith the advent of the information age, living in a variety of information tends to digital, clear, information management systems used in various industries came into being. Inventory management system is an important part of the promotion of enterprise development is a core part of the management of commercial enterprises, is an enterprise the ability to obtain the key to effective, timely sales if you can do a reasonable purchase, minimum inventory levels, reduce the backlog. , then the business will be able to achieve the best efficiency. In modern society, the majority of enterprises, especially SMEs, to achieve information management is a priority. Only information management, to improve the efficiency and management level of enterprises. Market economy is rapidly changing, highly competitive, enterprise management of inventory management system to purchase, inventory, sales, and many other areas has become a trend and inevitable.This system is a basic inventory management systems, and use of information technology means the introduction of advanced management methods to the practice of the enterprise, to provide effective and easy way for enterprise management reform. Management system for enterprise purchasing, inventory, sales and other commercial activities, as well as suppliers and customers and other basic information.In this paper, the inventory management system analysis and design as a starting point, details the various steps of the development of the system: system analysis, system design, system coding and system testing. System analysis has used data flow diagrams, the functional block diagram of the system required by the system data and functional modules. In system design and system implementation part of the show in detail the system's database design and implementation, as well as the various functional modules of the system required database tables, table fields, and menu design. System to achieve a strong distribution inventory management, including basic information, procurement, purchasing, selling and inventory management.The system uses the Java Swing technology, MySQL as a backend database manager system, using the Eclipse integrated development of environmental tools, the interface is simple and beautiful performance to meet the requirements, fully functionalhas been tested the design of this system is correct.Keywords:information management; inventory management system; Java Swing; MySQL;目录第一章前言 (1)1.1 系统开发背景 (1)1.2 系统开发目的与意义 (1)1.3 企业进销存系统的发展现状 (2)第二章系统分析 (4)2.1 系统开发的目标 (4)2.2 可行性分析 (4)2.2.1 可行性研究的前提 (5)2.2.2 经济可行性 (5)2.2.3 技术可行性 (5)2.2.4 社会可行性 (6)2.2.5 操作可行性 (6)2.3 需求分析 (6)2.3.1 系统的功能需求 (6)2.3.2 数据字典设计 (7)2.3.3 系统的性能需求 (10)2.3.4 出错处理需求 (10)2.3.5 约束需求 (10)2.3.6 开发环境 (11)第三章总体设计 (12)3.1 系统功能结构设计 (12)3.2 数据库设计 (13)3.2.1 概念结构设计 (13)3.2.2 逻辑结构设计 (20)3.2.3 数据表设计 (21)第四章详细设计 (30)4.1界面设计 (30)4.1.1 界面概述 (30)4.1.2 主界面设计 (30)4.2 功能模块设计 (31)4.2.1 系统登录模块设计 (31)4.2.2 供应商基本信息管理模块设计 (32)4.2.3 入库信息查询模块设计 (33)4.2.4 用户管理模块设计 (34)4.2.5 经手人管理模块设计 (35)4.2.6 订购商品信息管理模块设计 (36)4.2.7 采购入库管理模块设计 (37)4.2.8 库存调拨模块设计 (38)4.2.9 销售退货管理模块设计 (38)4.2.10 其他模块设计 (39)第五章系统实现 (40)5.1 公共类设计 (40)5.1.1 SaveUserInfo公共类 (40)5.1.2 OnlyNumber公共类 (40)5.1.3 DaoConn公共类 (41)5.2软件实现 (41)5.2.1 用户登录模块 (41)5.2.2 供应商基本信息管理模块 (43)5.2.3 入库信息查询模块 (47)5.2.4 用户信息管理模块设计 (48)5.2.5 经手人管理模块设计 (53)5.2.6 订购商品信息管理模块 (55)5.2.7 采购入库管理模块 (57)5.2.8 销售出库管理模块 (59)5.3 开发常见问题与解决 (61)5.3.1 不显示系统登录窗体 (61)5.3.2运行程序时找不到数据库驱动 (61)5.3.3运行程序时用户名或密码不正确 (62)5.3.4运行程序时找不到数据库 (62)5.4 系统测试 (62)5.4.1测试目标 (62)5.4.2测试方法 (63)5.4.3测试方案 (63)5.4.4 测试用例 (63)5.4.5 测试运行 (67)5.4.6 测试结论 (72)总结 (73)附录A 系统使用说明书 (74)参考文献 (76)致谢 (77)第一章前言1.1 系统开发背景计算机技术作为现代科学技术的基础和核心,已经而且将继续对人类文明社会的进步与发展产生深刻影响。
产品进销存管理系统 代码
printf("输入此产品类所含产品的产品名称、总量、进货日期、销售数量、销售时间:\n");
scanf("%s %d %d,%d,%d %d %d,%d,%d",&(q->pname),&(q->totalquantity),&((q->goodsdate).year),&((q->goodsdate).month),&((q->goodsdate).day),&(q->salesquantity),&((q->salestime).year),&((q->salestime).month),&((q->salestime).day));
typedef struct date{
int year;
int month;
int day;
}date; //日期
typedef struct productlnode{
char pname[30]; //产品名称
int totalquantity; //产品总量
}
if(i<L.length){
for(p=L.kindelem[i].firstproduct;p!=NULL;p=p->nextproduct){
k=strcmp(p->pname,pname1);
if(k==0){
p->totalquantity=p->totalquantity+n;
plinklist p;