ooknum = booknum+ %f where barcode = '%s' and counter = '%s'",f_number,c_barcode,c_counter);
m_pRs->raw_Close();
m_pRs->Open((_variant_t)sql,m_pCon.GetInterfacePtr(),adOpenKeyset,adLockOptimistic,adCmdText);
}
MessageBox("操作成功,票号为: "+c_id);
CancelOperate();
}
catch(...)
{
MessageBox("操作失败");
}
}
float CDlgSaleBack2::CalculateMoney()
{
int row = m_list.GetItemCount();
CString str;
float money = 0.0;
for (int i = 0 ;i < row;i++)
{
str = m_list.GetItemText(i,6);
money+= atof(str);
}
return money;
}
void CDlgSaleBack2::CancelOperate()
{
m_list.DeleteAllItems();
m_author.SetWindowText("");
m_barcode.SetWindowText("");
m_bookrebate.SetWindowText("1.0");
m_bookname.SetWindowText("");
m_booknum.SetWindowText("");
m_counter.SetCurSel(-1);
m_customer.SetWindowText("无记名");
CTime date = CTime::GetCurrentTime();
m_date.SetTime(&date);
m_factmoney.SetWindowText("");
m_operator.SetWindowText(user);
m_paymoney.SetWindowText("");
m_rebate.SetWindowText("1.0");
m_sellprice.SetWindowText("");
m_summoney.SetWindowText("");
}
void CDlgSaleBack2::DeleteListData()
{
int m = m_list.GetItemCount();
if ( m >0)
{
int row = m_list.GetSelectionMark();
if (row != -1)
{
if (MessageBox("确实要删除当前行数据吗?","提示",MB_YESNO)==IDYES)
{
for (int i = row+1;i<m_list.GetItemCount();i++)
{
for(int c = 0; c<7 ;c++)
{
m_list.SetItemText(i-1,c,m_list.GetItemText(i,c));
}
}
m_list.DeleteItem(m_list.GetItemCount()-1);
//统计
float money = CalculateMoney();
CString temp;
temp.Format("%f",money);
m_summoney.SetWindowText(temp);
}
}
}
}
bool CDlgSaleBack2::HeaderInfoIsNull()
{
CString str,c_totalmoney,c_rebate,c_paymoney,c_factmoney;
int index;
m_customer.GetWindowText(str);
index = m_counter.GetCur
上一篇:
DlgRoleinfo.cpp
下一篇:
多年来只想说一句,我不怪你