vb销售系统代码.pdf
vb 销售系统代码PrivateSub c1_Click()Open"d:lgzdingdan"&t1.Text&".dat"For InputAs#1Do While Not EOF(1)'显示理化标准Line Input#1,a$b$=b$+a$+Chr(13)+Chr(10)Loopt2.Text=bClose#1End SubPrivateSub ck_Click()tjcp.Enabled=Falsesccp.Enabled=FalseFrame1.Visible=TrueFrame5.Visible=TrueFrame3.Visible=Truet2.Visible=FalseList1.ClearList1.Visible=TrueFrame4.Visible=FalseList1.Top=Frame4.TopList1.Width=Frame4.WidthList1.Height=Frame4.HeightList1.Left=Frame4.LeftCommand6.Visible=Falsejl.FileName="d:lgzdanjia"Frame2.Visible=FalseFor i=0 To Val(jl.ListCount-1)List1.AddItemLeft(jl.List(i),Val(Len(jl.List(i)-4)Next iEnd SubPrivateSub Command1_Click()If MsgBox("检 查 信 息 无 误",vbYesNo,"确 认 订 单")=vbYes Then'确认订单ddh=InputBox$("请输入顾客订单序列号","顾客订金收据编号!")'输入订单号If Text4=""Then Text4=InputBox$(Label4.Caption,"客户信息缺失!")If Text5=""Then Text5=InputBox$(Label5.Caption,"客户信息缺失!")If Text3=""Then Text3=InputBox$(Label3.Caption,"客户信息缺失!")If Text6=""Then Text6=InputBox$(Label7.Caption,"客户信息缺失!")If Text7=""Then Text7=InputBox$(Label6.Caption,"客户信息缺失!")If Text8=""Then Text8=InputBox$(Label10.Caption,"客户信息缺失!")If Check1.Value=1 Thenhuyuan="会员优惠"ddlj="d:lgzdingdan"&ddh&".dat"'订单文件路径Open ddljFor AppendAs#1'打开订单文件Print#1,Label4.Caption,Text4,Label5.Caption,Text5,Label3.Caption,Text3Print#1,Label7.Caption,Text6,Label6,Text7Print#1,Label10.Caption,Text8,Label11.Caption,Text9,huiyuan,Label12.Caption,Label13.CaptionPrint#1,Now()Close#1'完成订单文件cjjg=Val(Label13.Caption)zdlj="d:lgzlsz.jzwj"'流水账路径Open zdljFor AppendAs#3Print#3,"订单号码:"ddhPrint#3,"姓 名:"Text4.Text,"实 际 收 帐:"Label13.Caption,"交易时间:"Str(Now()Print#3,Close#3Text1=""Text2=""Text3=""Text4=""Text5=""Text6=""Text7=""Text8=""Text9=""'清空数据Command1.Enabled=FalseCommand2.Enabled=FalseCommand3.Enabled=FalseCommand5.Enabled=FalseCommand4.Enabled=FalseMsgBox"交易记录","完成交易"End IfEnd SubPrivateSub Command2_Click()Do UntilVal(Text6.Text)>0Text6.Text=InputBox("请输入产品数量","需要的数量不正确")LoopText9.Text=Str(Val(Text10.Text)*Val(Text6.Text)'安装费乘以数量Text8=Str(Val(Text2)*Val(Text6)'材料单价乘以数量If Check1.Value=1 And Check2.Value=1 ThenText9.Text="0元"Label13.Caption=Str(Val(Text8)*0.95)&"元"'会员自装End IfIfCheck1.Value=1AndCheck2.Value=0ThenLabel13.Caption=Str(Val(Text8.Text)*0.95+Val(Text9)*0.95)&"元"'会员包装If Check1.Value=0 And Check2.Value=1 ThenText9.Text="0元"Label13.Caption=Text8.Text&"元"'非会员自装End IfIfCheck1.Value=0AndCheck2.Value=0ThenLabel13.Caption=Str(Val(Text8)+Val(Text9)&"元"'非会员包装Command1.Enabled=TrueEnd SubPrivateSub Command3_Click()'图片调整背面Picture1.Picture=LoadPicture("d:lgztupian"&Text3.Text&"(1).jpg")End SubPrivateSub Command4_Click()'图像正面Picture1.Picture=LoadPicture("d:lgztupian"&Text3.Text&".jpg")End SubPrivateSub Command5_Click()Picture1.Picture=LoadPicture("d:lgztupian"&Text3.Text&"(2).jpg")'图像侧面End SubPrivateSub Command6_Click()If Len(Text3.Text)>0 Thenlhbz="d:lgzlhbz"&Text3.Text&".dat"Open lhbzFor InputAs#1Do While Not EOF(1)'显示理化标准Line Input#1,a$b$=b$+a$+Chr(13)+Chr(10)LoopText1.Text=bClose#1Picture1.Picture=LoadPicture("d:lgztupian"&Text3.Text&".jpg")djlj="d:lgzdanjia"&Text3.Text&".dat"Open djljFor InputAs#1Line Input#1,jgText2.Text=jgClose#1'显示单价azlj="d:lgzanzhuangfei"&Text3.Text&".dat"Open azlj For InputAs#1Line Input#1,azText10.Text=azClose#1Command2.Enabled=TrueCommand3.Enabled=TrueCommand4.Enabled=TrueCommand5.Enabled=TrueElseText3.FontStrikethru=TrueText3.Text="输入编码"End IfEnd SubPrivateSub ddcx_Click()List1.Visible=Falsetjcp.Enabled=Falsesccp.Enabled=Falset2.Text=""Frame1.Visible=FalseFrame2.Visible=FalseFrame3.Visible=FalseFrame4.Visible=FalseFrame5.Visible=FalseCommand6.Visible=FalseLabel12.Visible=Falsec1.Caption="订单查询"c1.Top=480c1.Height=400c1.Width=900c1.Visible=Truet1.Top=480t1.Height=400t1.Width=2400t1.Text=""t1.Visible=Truel1.Caption="用户编码:"l1.Top=480l1.Height=400l1.AutoSize=Truel1.Visible=Truet2.Height=6000t2.Width=8000t2.Top=1500t2.Visible=TrueEnd SubPrivateSub Form_Load()Label12.ForeColor=RGB(225,0,0)Label9.Caption=Str(Now()End SubPrivateSub Option3_Click()End SubPrivateSub jl_Click()Print jl.ListCountEnd SubPrivateSub jlcx_Click()List1.Visible=Falsetjcp.Enabled=Falsesccp.Enabled=FalseFrame1.Visible=FalseFrame2.Visible=FalseFrame3.Visible=FalseFrame4.Visible=FalseFrame5.Visible=FalseCommand6.Visible=FalseLabel12.Visible=Falset2.Height=6000t2.Width=8000t2.Top=1500t1.Visible=Falsec1.Visible=Falsel1.Visible=Falset2.Visible=TrueOpen"d:lgzlsz.jzwj"For InputAs#1Do While Not EOF(1)'显示理化标准Line Input#1,a$b$=b$+a$+Chr(13)+Chr(10)Loopt2.Text=bClose#1End SubPrivateSub List1_DblClick()Picture1.Picture=LoadPicture("d:lgztupian"&List1&".jpg")djlj="d:lgzdanjia"&List1&".dat"Open djljFor InputAs#1Line Input#1,jgText2.Text=jgClose#1'显示单价lhbz="d:lgzlhbz"&List1&".dat"Open lhbzFor InputAs#1Do While Not EOF(1)'显示理化标准Line Input#1,a$b$=b$+a$+Chr(13)+Chr(10)LoopText1.Text=bClose#1azlj="d:lgzanzhuangfei"&List1&".dat"Open azlj For InputAs#1Line Input#1,a$Text10=aClose#1End SubPrivateSub sccp_Click()List1.Visible=FalseIf MsgBox("是否准备删除",vbYesNo,"确定删除产品")=vbYes Thenbm=InputBox("产品编码","删除产品")Kill"d:lgzdanjia"&bm&".dat"'删除单价文件Kill"d:lgzlhbz"&bm&".dat"'删除理化指标文件Kill"d:lgztupian"&bm&"(1).jpg"Kill"d:lgztupian"&bm&"(2).jpg"Kill"d:lgztupian"&bm&".jpg"'删除相关图片文件Kill"d:lgzanzhuangfei"&bm&".dat"MsgBox"删除成功","删除产品提示"ck.Enabled=FalseElseEnd IfEnd SubPrivateSub Text3_Change()Text3.FontStrikethru=FalseEnd SubPrivateSub Text6_Change()If Val(Text6.Text)<0 Then Text6.Text="请输入数量"End SubPrivateSub tjcp_Click()List1.Visible=FalseIf MsgBox("是否准备添加",vbYesNo,"确定添加产品")=vbYes ThenFrame1.Visible=TrueFrame2.Visible=TrueFrame3.Visible=TrueFrame4.Visible=TrueFrame5.Visible=TrueCommand6.Visible=TrueLabel12.Visible=Truet2.Visible=Falset1.Visible=Falsec1.Visible=Falsel1.Visible=Falsebm=InputBox("输入编码","添加产品编码")djlj="d:lgzdanjia"&bm&".dat"Open djljFor OutputAs#1jg=InputBox("输入价格","增加产品价格")Print#1,jgClose#1'价格文件添加确认azlj="d:lgzanzhuangfei"&bm&".dat"Open azlj For OutputAs#1az=InputBox("输 入 单 位 产 品 安 装 费 用","增 加 产 品 安 装 费")Print#1,azClose#1lhbz="d:lgzlhbz"&bm&".dat"Open lhbzFor OutputAs#2cj=InputBox("输入厂家","增加产品厂家")'理化标准添加模块Print#2,"厂家:"cjlx=InputBox("输入产品类型","增加产品类型")Print#2,"产品类型:"lxDo Untilqt="ok"qt=InputBox("输入 ok 完成添加","增加其他项目")Print#2,qtLoopClose#2CommonDialog1.Action=1If Len(CommonDialog1.FileName)>2 ThenFileCopyCommonDialog1.FileName,"d:lgztupian"&bm&".jpg"ElseFileCopy"d:lgzshili.jpg","d:lgztupian"&bm&".jpg"End IfCommonDialog2.Action=1If Len(CommonDialog2.FileName)>2 ThenFileCopyCommonDialog2.FileName,"d:lgztupian"&bm&"(1).jpg"ElseFileCopy"d:lgzshili.jpg","d:lgztupian"&bm&"(1).jpg"End IfCommonDialog3.Action=1If Len(CommonDialog3.FileName)>2 ThenFileCopyCommonDialog3.FileName,"d:lgztupian"&bm&"(2).jpg"ElseFileCopy"d:lgzshili.jpg","d:lgztupian"&bm&"(2).jpg"End IfMsgBox"添加成功","添加产品"ck.Enabled=FalseElseEnd IfEnd SubPrivateSub zjm_Click()List1.Visible=Falsetjcp.Enabled=Truesccp.Enabled=TrueFrame1.Visible=TrueFrame2.Visible=TrueFrame3.Visible=TrueFrame4.Visible=TrueFrame5.Visible=TrueCommand6.Visible=TrueLabel12.Visible=Truet2.Visible=Falset1.Visible=Falsec1.Visible=Falsel1.Visible=FalseEnd Sub