//---------------------------------------------------------------------------
#include <vcl.h>
#include"math.h"
#pragma hdrstop
#include <stdio.h>
#include "main.h"
#include "data.h"
#include "name_gl.h"
#include "jinhuo_gl.h"
#include "lingshou.h"
#include "kucen.h"
#include "xiaoshou.h"
#include "passwd.h"
#include "check.h"
#include "xiaopiao.h"
#include "qingli.h"
#include "xiaoshoumx.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tfm_main *fm_main;
//-----------------------------------------------------
int danjuhao,row;;
//---------------------------------------------------------------------------
__fastcall Tfm_main::Tfm_main(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::bt_nameClick(TObject *Sender)
{
fm_name_gl->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::bt_jinhuoClick(TObject *Sender)
{
fm_jinhuo_gl->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::FormShow(TObject *Sender)
{
//计算单据号
dm_data->ds_guest->Close();
dm_data->ds_guest->CommandText="select top 1 * from xiaoshou order by danjuhao desc";
dm_data->ds_guest->Open();
if(dm_data->ds_guest->RecordCount<1 && (shuliang->Focused()==true || shoujia->Focused()==true || dazhe->Focused()==true))
danjuhao=1;
else
danjuhao=dm_data->ds_guest->FieldByName("danjuhao")->AsInteger+1;
dm_data->ds_guest->Close();
row=0;
lb->RowCount=1;
lb->ColCount=8;
lb->ColWidths[3]=30;
lb->ColWidths[7]=150;
lb->Cells[0][0]="序号";
lb->Cells[1][0]="货号";
lb->Cells[2][0]="货名";
lb->Cells[3][0]="数量";
lb->Cells[4][0]="定价";
lb->Cells[5][0]="优惠价";
lb->Cells[6][0]="金额";
lb->Cells[7][0]="时间";
danjuhaos->Text=danjuhao;
shuliang_hj->Text="0";
jine_hj->Text="0";
xianfu->Text="0";
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::codeKeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
PostMessage(Handle,WM_KEYDOWN,VK_TAB,0);
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::shuliangKeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
PostMessage(Handle,WM_KEYDOWN,VK_TAB,0);
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::shoujiaKeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
PostMessage(Handle,WM_KEYDOWN,VK_TAB,0);
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::dazheKeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
PostMessage(Handle,WM_KEYDOWN,VK_TAB,0);
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::codeExit(TObject *Sender)
{
dm_data->ds_guest->Close();
dm_data->ds_guest->CommandText="select jinhuo.*,name.name from jinhuo,name where jinhuo.code='"+code->Text+"' and name.code=jinhuo.code order by id desc";
dm_data->ds_guest->Open();
if(dm_data->ds_guest->RecordCount<1 && (shuliang->Focused()==true || shoujia->Focused()==true || dazhe->Focused()==true || chuhuo->Focused()==true))
{
Application->MessageBoxA("该货物可能没有进货,请重新输入","提示",MB_OK);
code->SetFocus();
}
else
{
int sn=0;
shoujia->Text=dm_data->ds_guest->FieldByName("shoujia")->AsString;
dingjia->Text=shoujia->Text;
name->Text=dm_data->ds_guest->FieldByName("name")->AsString;
shuliang->Text="1";
while(!dm_data->ds_guest->Eof)
{
sn=sn+dm_data->ds_guest->FieldByName("shuliang")->AsInteger;
dm_data->ds_guest->Next();
}
shuliang0->Text=IntToStr(sn);
}
dm_data->ds_guest->Close();
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::shoujiaChange(TObject *Sender)
{
float shoujian,dazhen,shoujia0n;
if((shoujia->Text.Trim()!="") && (dazhe->Text.Trim()!=""))
{
shoujian=StrToFloat(shoujia->Text);
dazhen=StrToFloat(dazhe->Text);
shoujia0n=shoujian*dazhen/10;
shoujia0->Text=FormatFloat("0.00",shoujia0n);
}
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::shoujiaxgClick(TObject *Sender)
{
if(shoujiaxg->Checked==true)
shoujia->Enabled=true;
else
shoujia->Enabled=false;
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::dazhexgClick(TObject *Sender)
{
if(dazhexg->Checked==true)
dazhe->Enabled=true;
else
dazhe->Enabled=false;
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::chuhuoClick(TObject *Sender)
{
dm_data->ds_guest->Close();
dm_data->ds_guest->CommandText="select jinhuo.*,name.name from jinhuo,name where jinhuo.code='"+code->Text+"' and name.code=jinhuo.code order by id desc";
dm_data->ds_guest->Open();
if(dm_data->ds_guest->RecordCount<1)
{
Application->MessageBoxA("该货物可能没有进货,请重新输入","提示",MB_OK);
code->SetFocus();
dm_data->ds_guest->Close();
return;
}
row=row+1;
lb->RowCount=row+1;
lb->Cells[0][row]=row;
lb->Cells[1][row]=code->Text;
lb->Cells[2][row]=name->Text;
lb->Cells[3][row]=shuliang->Text;
lb->Cells[4][row]=FormatFloat("0.00",StrToFloat(dingjia->Text));
lb->Cells[5][row]=shoujia0->Text;
lb->Cells[6][row]=FormatFloat("0.00",StrToFloat(shoujia0->Text)*StrToInt(shuliang->Text));
lb->Cells[7][row]=Now();
shuliang_hj->Text=StrToInt(shuliang_hj->Text)+StrToInt(shuliang->Text);
jine_hj->Text=FormatFloat("0.00",StrToFloat(jine_hj->Text)+StrToFloat(lb->Cells[6][row]));
code->SetFocus();
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::xianfuKeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
PostMessage(Handle,WM_KEYDOWN,VK_TAB,0);
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::xianfuExit(TObject *Sender)
{
zhaoling->Text=FloatToStr(StrToFloat(xianfu->Text)-StrToFloat(jine_hj->Text));
}
//---------------------------------------------------------------------------
void __fastcall Tfm_main::jiezhangClick(TObject *Sender)
{
AnsiString price;
TDateTime dd;
//
if(row<1)
{
Application->MessageBoxA("没有货物可供结帐,请输入货物代码","提示",MB_OK);
code->SetFocus();
return;
}
//打印
if(dy->Checked==true)
{
FILE *fp;
AnsiString str="";
if((fp=fopen("Lpt1","wb"))==NULL)
{
Application->MessageBoxA("打印机出错","警告",MB_OK);
return;
}
if(huiyuan->Checked==true)
price="会员价";
else
price="定价";
dm_data->ds_guest->Close();
dm_data->ds_guest->CommandText="select * from code where id>=20000 and id<30000 order by id";
dm_data->ds_guest->Open();
dm_data->ds_guest->First();
str=str.cat_sprintf("%s\n",dm_data->ds_guest->FieldByName("content")->AsString);
str=str.cat_sprintf("流水号: %d\n",danjuhao);
str=str.cat_sprintf("时 间: %s
没有合适的资源?快使用搜索试试~ 我知道了~
小型超市管理系统 vc
共74个文件
cpp:18个
h:17个
ddp:17个
4星 · 超过85%的资源 需积分: 10 201 下载量 146 浏览量
2009-01-04
08:28:14
上传
评论 2
收藏 754KB RAR 举报
温馨提示
小型超市管理系统 希望合作愉快 vc语言 的
资源推荐
资源详情
资源评论
收起资源包目录
VC写的超市管理系统.rar (74个子文件)
dy.ddp 51B
xiaoshou.h 1KB
main.cpp 13KB
check.cpp 1KB
main.h 3KB
jinhuo_gl.ddp 51B
newname.cpp 2KB
xiaopiao.h 1KB
xiaoshou_hj.dfm 328B
qingli.cpp 2KB
xiaoshou.dfm 4KB
xiaoshou_hj.h 757B
kucen.ddp 51B
check.dfm 1KB
xiaopiao.dfm 4KB
csgl.cpp 2KB
xiaoshoumx.ddp 51B
data.h 2KB
qingli.h 1KB
xiaoshou_hj.ddp 51B
newname.h 1KB
xiaopiao.ddp 51B
csgl.bpr 6KB
jinhuo_gl.cpp 5KB
qr_xiaoshoumx.cpp 809B
data.cpp 543B
passwd.cpp 2KB
lingshou.ddp 51B
main.ddp 51B
dy.dfm 15KB
jinhuo_gl.h 2KB
qr_xiaoshoumx.h 2KB
qr_xiaoshoumx.dfm 14KB
sys.h 1KB
data.dfm 6KB
name_gl.ddp 51B
jinhuo_gl.dfm 7KB
csgl.mdb 1.22MB
sys.cpp 2KB
qingli.dfm 2KB
lingshou.h 2KB
xiaoshoumx.dfm 21KB
sys.dfm 3KB
csgl.res 876B
check.ddp 51B
newname.dfm 3KB
qingli.ddp 51B
passwd.ddp 51B
xiaoshou_hj.cpp 524B
sys.ddp 51B
xiaoshou.ddp 51B
data.ddp 51B
qr_xiaoshoumx.ddp 51B
name_gl.dfm 7KB
main.dfm 15KB
passwd.dfm 3KB
name_gl.cpp 4KB
newname.ddp 51B
xiaoshoumx.h 2KB
xiaoshou.cpp 3KB
name_gl.h 2KB
passwd.h 1KB
kucen.h 1KB
csgl.exe 1.47MB
lingshou.cpp 5KB
dy.cpp 1KB
xiaoshoumx.cpp 2KB
xiaopiao.cpp 3KB
www.pudn.com.txt 218B
check.h 1KB
kucen.cpp 4KB
dy.h 2KB
kucen.dfm 2KB
lingshou.dfm 5KB
共 74 条
- 1
资源评论
- 瀚海一小鱼儿2014-03-11软件应该不错 界面有些简单 不够好 再多些软件说明会更好的
- cherries04760102013-10-03数据库是ACCESS,软件不错~
- throb_gdm2012-07-19唉,界面设计不是很好啊。
- queliunian022012-09-09软件还好,但是我不会输入数据。。。好囧哦。。。
- jiabiao_xue2012-01-08很好的软件 就是数据库用的是ACCESS
h15004694589
- 粉丝: 0
- 资源: 26
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Win64OpenSSL-3-3-0.exe
- 课高分程设计-基于C++实现的民航飞行与地图简易管理系统-南京航空航天大学
- 航天器遥测数据故障检测系统python源码+文档说明+数据库(课程设计)
- 北京航空航天大学操作系统课设+ppt+实验报告
- 基于Vue+Echarts实现风力发电机中传感器的数据展示监控可视化系统+源代码+文档说明(高分课程设计)
- 基于单片机的风力发电机转速控制源码
- 基于C++实现的风力发电气动平衡监测系统+源代码+测量数据(高分课程设计)
- 毕业设计- 基于STM32F103C8T6 单片机,物联网技术的太阳能发电装置+源代码+文档说明+架构图+界面截图
- 基于 LSTM(长短期记忆)(即改进的循环神经网络)预测风力发电厂中风力涡轮机产生的功率+源代码+文档说明
- 基于stm32f103+空心杯电机+oled按键+运动算法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功