Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
UserNewSet.cpp
Package: MIS.rar [view]
Upload User: fjjkzmm
Upload Date: 2013-01-22
Package Size: 820k
Code Size: 3k
Category:
ADO-ODBC
Development Platform:
Visual C++
- // UserNewSet.cpp : implementation file
- //
- #include "stdafx.h"
- #include "库存管理.h"
- #include "UserNewSet.h"
- #include "Typer.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CUserNewSet dialog
- CUserNewSet::CUserNewSet(CWnd* pParent /*=NULL*/)
- : CDialog(CUserNewSet::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CUserNewSet)
- m_type = _T("");
- //}}AFX_DATA_INIT
- }
- void CUserNewSet::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CUserNewSet)
- DDX_Control(pDX, IDC_NewUser, m_button1);
- DDX_Control(pDX, IDC_LIST1, m_list);
- DDX_Text(pDX, IDC_EDIT1, m_type);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CUserNewSet, CDialog)
- //{{AFX_MSG_MAP(CUserNewSet)
- ON_BN_CLICKED(IDC_Canle, OnCanle)
- ON_BN_CLICKED(IDC_NewUser, OnNewUser)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CUserNewSet message handlers
- void CUserNewSet::OnCanle()
- {
- // TODO: Add your control notification handler code here
- CDialog::OnCancel();
- }
- void CUserNewSet::list()
- {
- m_list.InsertColumn(0,"货品类型",LVCFMT_LEFT,220);
- m_list.SetExtendedStyle(LVS_EX_FLATSB
- |LVS_EX_FULLROWSELECT
- |LVS_EX_HEADERDRAGDROP
- |LVS_EX_ONECLICKACTIVATE
- |LVS_EX_GRIDLINES);
- }
- BOOL CUserNewSet::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- list();
- number();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CUserNewSet::number()
- {
- UpdateData();
- CTyper set;
- CString str;
- int count=0;
- str.Format("select * from typer");
- set.Open(AFX_DB_USE_DEFAULT_TYPE,str);
- if(set.GetRecordCount()>0)
- {
- m_list.DeleteAllItems();
- CString tempstr;
- while(!set.IsEOF())
- {
- tempstr.Format("%s",set.m_type);
- m_list.InsertItem(count,tempstr);
- count++;
- set.MoveNext();
- }
- str.Format("%d",count);
- UpdateData(false);
- set.Close();
- }
- else
- {
- MessageBox("库中无记录!","提示");
- return;
- }
- }
- void CUserNewSet::OnNewUser()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- CTyper set;
- CString sql;
- CString str;
- m_button1.GetWindowText(str);
- if(str=="新增类型")
- {
- GetDlgItem(IDC_EDIT1)->EnableWindow(true);
- m_button1.SetWindowText("保存");
- UpdateData();
- return;
- }
- else
- {
- if(set.IsOpen())
- {
- set.Close();
- return;
- }
- else
- {
- set.Open();
- set.AddNew();
- set.m_type = m_type;
- set.Update();
- m_button1.SetWindowText("新增类型");
- m_type="";
- set.Close();
- UpdateData(false);
- MessageBox("类型添加成功!","提示");
- number();
- }
- }
- }