欢迎来到天天文库
浏览记录
ID:56788644
大小:318.50 KB
页数:60页
时间:2020-07-11
《企业客户信息管理系统-代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Windows.Forms;namespaceCompanyPersonnelManagementSystem{staticclassProgram{[STAThread]staticvoidMain(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Loginlo=newLogin();lo.Sh
2、owDialog();if(lo.DialogResult==DialogResult.OK){Form{//privateboolres=false;OleDbConnectioncon;OleDbDataReadertbread;FormLogin(){InitializeComponent();}buttonClose_Click(sender,EventArgse){Application.Exit();}buttonOk_Click(sender,EventArgse){getCon();{tbread.Read();pw=tbread.GetValue(
3、0).ToString();(pw==textBoxPW.Text){ClassAdminName.adminName=textBoxName.Text;.Close();}MessageBox.Show(MessageBoxButtons.OK);}{MessageBox.Show(MessageBoxButtons.OK);}con.Close();}OleDbDataReadergetCon(){{ConStr="Provider=Microsoft.Jet.OLEDB.4.0;Datasource=Provider=Microsoft.Jet.OLEDB.4
4、.0;DataSource=dbJJCRM.mdb";con=OleDbConnection(ConStr);sql="selectadminPasswordfromtbAdminwhereadminName='"+textBoxName.Text+"'";OleDbCommandcmd=OleDbCommand(sql,con);con.Open();tbread=cmd.ExecuteReader();tbread;}{MessageBox.Show(MessageBoxButtons.OK);}}}publicpartialclassFormView:Form
5、{privateOleDbConnectioncon;privateOleDbDataReadertbread;//introw=0;publicFormView(){InitializeComponent();}privatevoidFormView_Load(objectsender,EventArgse){getCon();listViewViewAll.Items.Clear();try{while(tbread.Read()){ListViewItemlvi=newListViewItem(tbread.GetValue(1).ToString());lv
6、i.SubItems.Add(tbread.GetValue(2).ToString());lvi.SubItems.Add(tbread.GetValue(3).ToString());lvi.SubItems.Add(tbread.GetValue(4).ToString());lvi.SubItems.Add(tbread.GetValue(5).ToString());lvi.SubItems.Add(tbread.GetValue(6).ToString());listViewViewAll.Items.Add(lvi);}}catch{MessageBo
7、x.Show(MessageBoxButtons.OK);}con.Close();}publicOleDbDataReadergetCon(){try{stringConStr="Provider=Microsoft.Jet.OLEDB.4.0;Datasource=Provider=Microsoft.Jet.OLEDB.4.0;DataSource=dbJJCRM.mdb";con=newOleDbConnection(ConStr);stringsql="select*fromtbUserInfo";OleDbCommandcmd=newOleDbCom
此文档下载收益归作者所有