77范文网 - 专业文章范例文档资料分享平台

大学生个人理财管理系统(6)

来源:网络收集 时间:2018-11-26 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

void CNCUView::OnLogout() {

//退出按钮 int i=MessageBox(\您确定要退出么?\提示消息\ if (i==IDOK) { AfxGetMainWnd()->SendMessage(WM_CLOSE); return; } }

void CNCUView::OnFileSave() { // TODO: Add your command handler code here OnFile(); }

void CNCUView::OnFileOpen() {

//重新连接数据源 if(m_database.IsOpen()) m_database.Close(); m_database.Open(_T(\ m_recordSet.Close(); m_recordSet.m_pDatabase=&m_database; }

void CNCUView::OnFileSaveAs() {

//恢复数据库文件

CString filter,strSQL; CString path;

filter=\数据库文件(*.mdb)|*.mdb||\ CFileDialog

file(true,NULL,NULL,OFN_OVERWRITEPROMPT,filter,this); int i=file.DoModal(); if (i==IDOK) { path=file.GetPathName(); m_database.Close(); CopyFile(path,cPath,FALSE); OpenDB(); }

MessageBox(\成功恢复数据库文件!\}

return;

26

void CNCUView::OnDataBackup() { // TODO: Add your command handler code here

if(AfxMessageBox(\确定要备份数据库?\ { return; } CTime time=time.GetCurrentTime(); int iYear=time.GetYear(); int iMonth=time.GetMonth(); int iDay=time.GetDay(); CString sFileName; sFileName.Format(\ if(CopyFile(cPath,\

AfxMessageBox(\数据库已成功备份到当前databack中!\else

AfxMessageBox(\数据库备份失败!\}

void CNCUView::OnHlp() { // TODO: Add your control notification handler code here ShellExecute(NULL,\WMAXIMIZED);}

void CNCUView::OnBack() { // TODO: Add your control notification handler code here DestoryTab(); m_pic=(CStatic*)GetDlgItem(IDC_STATIC); m_pic->ModifyStyle(NULL,WS_VISIBLE); this->RedrawWindow(); }

Login.cpp

//用户登录界面

void CLogin::OnOK() { // TODO: Add extra validation here CString username,password; m_name.GetWindowText(username);

//////判断用户名是否为空//////////// if(username.IsEmpty()) {

27

MessageBox(\用户名不能为空!\错误\ m_name.SetFocus(); return; }

//////判断密码是否为空///////////// m_password.GetWindowText(password); if(password.IsEmpty()) { MessageBox(\密码不能为空!\错误\ m_password.SetFocus(); return; } OpenDB(); CString strSQL;

/////////////判断有无用户//////// strSQL.Format(\ m_recordSet.Open(CRecordset::forwardOnly,strSQL); if(m_recordSet.GetRecordCount()==0) { MessageBox(\现在系统里和还没有用户,来注册一个吧~~\提示\ m_recordSet.Close(); m_name.SetWindowText(\

m_password.SetWindowText(\清空密码文本框 m_name.SetFocus(); OnNew(); return; }

m_recordSet.Close();

////////验证用户名和密码////// strSQL.Format(\Password='%s'\ m_recordSet.Open(CRecordset::forwardOnly,strSQL);

if(m_recordSet.GetRecordCount()==0)//如果找不到记录 {

MessageBox(\用户名或密码错误,请重新输入\错误\提示密码错误 m_password.SetWindowText(\清空密码文本框 m_password.SetFocus();//设置用户名文本框为当前的焦点 m_recordSet.Close();

28

}

else//如果找到记录 {

m_recordSet.GetFieldValue(\则将用户ID值赋给theUser m_recordSet.Close(); CDialog::OnOK(); } }

New.cpp

//用户注册页面

void CNew::OnOK() { // TODO: Add extra validation here CString

aver,limit,balance,password,username,intype,outtype,temp; m_username.GetWindowText(username); if(username.GetLength()<3) { MessageBox(\用户名太短,至少要多于3个字节。\错误\ m_username.SetFocus(); return; }

////////////////检测用户名是否重复////// OpenDB(); CRecordset rs; rs.m_pDatabase=&m_database; CString strSQL; strSQL.Format(\Name='%s'\

rs.Open(CRecordset::forwardOnly,strSQL); if (rs.GetRecordCount()!=0) {

MessageBox(\貌似你的用户名已经有人用啦,那就换一个吧 -_-\错误\ m_username.SetWindowText(\ m_username.SetFocus(); rs.Close(); return; } rs.Close();

29

/////////////////////////////////////// m_password.GetWindowText(password); if(password.GetLength()<6) {

MessageBox(\为了您的安全,请将密码设为6位以上。\错误\ m_password.SetFocus(); return; }

///////判断密码长度///////////// m_balance.GetWindowText(balance); if(balance.IsEmpty()) {

MessageBox(\为了使系统能够正常工作,请填写帐户初始余额。\提示\ m_balance.SetFocus(); return; } m_aver.GetWindowText(aver); m_limit.GetWindowText(limit); CStringArray ary;

//////////提取InType的所有ID值以便插入新建用户的数据表中//////// strSQL.Format(\ rs.Open(CRecordset::forwardOnly,strSQL); for(int i=0;i/////////////提取OutType的所有ID值//////// strSQL.Format(\ rs.Open(CRecordset::forwardOnly,strSQL); ary.RemoveAll(); for(i=0;i

30

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库大学生个人理财管理系统(6)在线全文阅读。

大学生个人理财管理系统(6).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/310256.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: