word完美格式
else {
MassageBox(“库存中没有此种商品”,”提示”); return; }
/*Count*/
m_Count.GetWindowText(Count); gcount=atoi(Count) /*Acount*/
account=gcount*price; pay+=acount;
/*StubNumber=SaleID*/ /*Date*/
int year,month,day; CString date;
CTime t=CTime::GetCurrentTime(); year=t.GetYear; month=t.GetMonth(); day=t.GetDay();
Date.Format(“%d%d%d”,year,month,day);
/*************************************************************/ Acount. Format(“%f”,acount);
精心整理 学习帮手
word完美格式
m_SRList.InsetItem(100,””);
m_SRList.InsetItemText(row,0,GoodsID); m_SRList.InsetItem Text(row,1,Count); m_SRList.InsetItem Text(row,2,Acount); row++;
/***********************销售记录插入*************************/
sql.Format(“insert into Sale values(“%s%s%f%d%f%s%s”)”,SaleID,GoodsID,price,gcount,account,SturbNumber,Date;)
/************************************************************/ try {
dm.ConnectDataBase();
Record->Open(_variant_t(“Sale”),_
variant_t((IDispatch*)DataConn,true),adOpenKeyset,adLockOptimistic,adCmdTable);
}
catch(_com_error& e) {
this->MessageBox(e.ErrorMessage(),”出错提示”); }
/***********************日盘存记录修改***********************/
精心整理 学习帮手
word完美格式
CString temp1=””,temp2=””; Recordl->raw_Close();
sql.Format(“select*from DayStorage where GoodsID=%s”,GoodsID); Recordl->Open((_variant_t)sql,DataConn.GetInterfacePtr(),adOpenKeyset,adLockOptimistic,adCmdText);
if(Recordl->RecordCount>0) {
temp1
(TCHAR*)(_dstr_t)Recordl->GetFields()->GetItem((long)2)->Value;
temp2
(TCHAR*)(_dstr_t)Recordl->GetFields()->GetItem((long)2)->Value;
int addcount = atoi(temp1);
float addacount = (float)atof(temp2); addcount+=gcount; addacount+=account; sql.Format(“update DayStorage
GoodsCount=%d,GoodsAcount=%f
GoodsID=%s”,addcount,addacount,GoodsID);
try {
dm.ExecSQL(sql);
}
精心整理 学习帮手
=
= set where
word完美格式
catch(_com_error &e) {
this->MessageBox(e.ErrorMessage(),”出错提示”);
} } else {
sql.Foemat(“inset
into
DayStorage values(%s,%f,%d,%f,%s)”,GoodsID,price,gcount,acount,Date);
try {
dm.ExecSQL(sql);
}
catch(_com_error &e) {
this->MessageBox(e.ErrorMessage(),”出错提示”);
} }
/*********************月盘存记录修改***************************/ Recordl->raw_Close();
sql.Format(“select*from MonthStorage where GoodsID=%s”,GoodsID); Recordl->Open((_variant_t)sql,DataConn.GetInterfacePtr(),adOpenKeyset
精心整理 学习帮手
word完美格式
,adLockOptimistic,adCmdText);
if(Recordl->RecordCount>0) {
temp1
(TCHAR*)(_bstr_t)Recordl->GetFields()->GetItem((long)2)->Value;
temp2
(TCHAR*)(_bstr_t)Recordl->GetFields()->GetItem((long)3)->Value;
int addcount = atoi(temp1);
float addacount = (float)atof(temp2); addcount+=gcount; addacount+=account; sql.Format(“update MonthStorage
GoodsCount=%d,GoodsAcount=%f
GoodsID=%s”,addcount,addacount,GoodsID);
try {
dm.ExecSQL(sql);
}
catch(_com_error &e) {
this->MessageBox(e.ErrorMessage(),”出错提示”);
}
精心整理 学习帮手
=
= set where