企业客户信息管理系统代码.docx
《企业客户信息管理系统代码.docx》由会员分享,可在线阅读,更多相关《企业客户信息管理系统代码.docx(108页珍藏版)》请在冰豆网上搜索。
企业客户信息管理系统代码
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Windows.Forms;
namespaceCompanyPersonnelManagementSystem
{
staticclassProgram
{
[STAThread]
staticvoidMain()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Loginlo=newLogin();
lo.ShowDialog();
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(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.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
{
privateOleDbConnectioncon;
privateOleDbDataReadertbread;
//introw=0;
publicFormView()
{
InitializeComponent();
}
privatevoidFormView_Load(objectsender,EventArgse)
{
getCon();
listViewViewAll.Items.Clear();
try
{
while(tbread.Read())
{
ListViewItemlvi=newListViewItem(tbread.GetValue
(1).ToString());
lvi.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
{
MessageBox.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=newOleDbCommand(sql,con);
con.Open();
tbread=cmd.ExecuteReader();
returntbread;
}
catch
{
MessageBox.Show(MessageBoxButtons.OK);
returnnull;
}
}
}
FormMain:
Form
{
FormMain()
{
InitializeComponent();
.Hide();
FormLoginfl=FormLogin();
fl.ShowDialog();
}
FormMain_Load(sender,EventArgse)
{
labelWelcom.Text=+ClassAdminName.adminName;
}
buttonViewAll_Click(sender,EventArgse)
{
FormViewfv=FormView();
fv.MdiParent=;
fv.Show();
}
buttonSearch_Click(sender,EventArgse)
{
FormSearchfs=FormSearch();
fs.MdiParent=;
fs.Show();
}
buttonAdd_Click(sender,EventArgse)
{
FormAddfa=FormAdd();
fa.MdiParent=;
fa.Show();
}
buttonUpdate_Click(sender,EventArgse)
{
FormUpdatefu=FormUpdate();
fu.MdiParent=;
fu.Show();
}
buttonExit_Click(sender,EventArgse)
{
Application.Exit();
}
buttonDelete_Click(sender,EventArgse)
{
FormDeletefd=FormDelete();
fd.MdiParent=;
fd.Show();
}
button1_Click(sender,EventArgse)
{
AboutBox1aboutbox=AboutBox1();
aboutbox.ShowDialog();
}
button2_Click(sender,EventArgse)
{
System.Diagnostics.Process.Start("notepad.exe");
}
button3_Click(sender,EventArgse)
{
Form1form1=Form1();
form1.ShowDialog();
}
}
partialclassFormSearch
{
///
///Requireddesignervariable.
///
privateSystem.ComponentModel.IContainercomponents=null;
///
///Cleanupanyresourcesbeingused.
///
///trueifmanagedresourcesshouldbedisposed;otherwise,false.
protectedoverridevoidDispose(booldisposing)
{
if(disposing&&(components!
=null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#regionWindowsFormDesignergeneratedcode
///
///RequiredmethodforDesignersupport-donotmodify
///thecontentsofthismethodwiththecodeeditor.
///
privatevoidInitializeComponent()
{
this.groupBoxSearch=newSystem.Windows.Forms.GroupBox();
this.buttonClear=newSystem.Windows.Forms.Button();
this.buttonSearch=newSystem.Windows.Forms.Button();
this.textBoxSearch=newSystem.Windows.Forms.TextBox();
this.radioButtonNumberSearch=newSystem.Windows.Forms.RadioButton();
this.radioButtonNameSearch=newSystem.Windows.Forms.RadioButton();
this.listViewView=newSystem.Windows.Forms.ListView();
this.columnHeader1=newSystem.Windows.Forms.ColumnHeader();
this.columnHeader2=newSystem.Windows.Forms.ColumnHeader();
this.columnHeader3=newSystem.Windows.Forms.ColumnHeader();
this.columnHeader4=newSystem.Windows.Forms.ColumnHeader();
this.columnHeader5=newSystem.Windows.Forms.ColumnHeader();
this.columnHeader6=newSystem.Windows.Forms.ColumnHeader();
this.groupBoxSearch.SuspendLayout();
this.SuspendLayout();
//groupBoxSearch
this.groupBoxSearch.Controls.Add(this.buttonClear);
this.groupBoxSearch.Controls.Add(this.buttonSearch);
this.groupBoxSearch.Controls.Add(this.textBoxSearch);
this.groupBoxSearch.Controls.Add(this.radioButtonNumberSearch);
this.groupBoxSearch.Controls.Add(this.radioButtonNameSearch);
this.groupBoxSearch.Dock=System.Windows.Forms.DockStyle.Top;
this.groupBoxSearch.Location=newSystem.Drawing.Point(0,0);
this.groupBoxSearch.Name="groupBoxSearch";
this.groupBoxSearch.Size=newSystem.Drawing.Size(531,107);
this.groupBoxSearch.TabIndex=1;
this.groupBoxSearch.TabStop=false;
this.groupBoxSearch.Text=;
this.groupBoxSearch.Enter+=newSystem.EventHandler(this.groupBoxSearch_Enter);
//buttonClear
this.buttonClear.Location=newSystem.Drawing.Point(402,58);
this.buttonClear.Name="buttonClear";
this.buttonClear.Size=newSystem.Drawing.Size(75,23);
this.buttonClear.TabIndex=4;
this.buttonClear.Text=;
this.buttonClear.UseVisualStyleBackColor=true;
this.buttonClear.Click+=newSystem.EventHandler(this.buttonClear_Click);
//buttonSearch
this.buttonSearch.Location=newSystem.Drawing.Point(402,30);
this.buttonSearch.Name="buttonSearch";
this.buttonSearch.Size=newSystem.Drawing.Size(75,23);
this.buttonSearch.TabIndex=3;
this.buttonSearch.Text=;
this.buttonSearch.UseVisualStyleBackColor=true;
this.buttonSearch.Click+=newSystem.EventHandler(this.buttonSearch_Click);
//textBoxSearch
this.textBoxSearch.Location=newSystem.Drawing.Point(171,46);
this.textBoxSearch.Name="textBoxSearch";
this.textBoxSearch.Size=newSystem.Drawing.Size(195,21);
this.textBoxSearch.TabIndex=2;
//radioButtonNumberSearch
this.radioButtonNumberSearch.AutoSize=true;
this.radioButtonNumberSearch.Location=newSystem.Drawing.Point(47,65);
this.radioButtonNumberSearch.Name="radioButtonNumberSearch";
this.radioButtonNumberSearch.Size=newSystem.Drawing.Size(107,16);
this.radioButtonNumberSearch.TabIndex=1;
this.radioButtonNumberSearch.TabStop=true;
this.radioButtonNumberSearch.Text=;
this.radioButtonNumberSearch.UseVisualStyleBackColor=true;
//radioButtonNameSearch
this.radioButtonNameSearch.AutoSize=true;
this.radioButtonNameSearch.Location=newSystem.Drawing.Point(47,30);
this.radioButtonNameSearch.Name="radioButtonNameSearch";
this.radioButtonNameSearch.Size=newSystem.Drawing.Size(107,16);
this.radioButtonNameSearch.TabIndex=0;
this.radioButtonNameSearch.TabStop=true;
this.radioButtonNameSearch.Text=;
this.radioButtonNameSearch.UseVisualStyleBackColor=true;
//listViewView
this.listViewView.Columns.AddRange(newSystem.Windows.Forms.ColumnHeader[]{
this.columnHeader1,
this.columnHeader2,
this.columnHeader3,
this.columnHeader4,
this.columnHeader5,
this.columnHeader6});
this.listViewView.Dock=System.Windows.Forms.DockStyle.Bottom;
this.listViewView.FullRowSelect=true;
this.listViewView.GridLines=true;
this.listViewView.Location=newSystem.Drawing.Point(0,108);
this.listViewView.Name="listViewView";
this.listViewView.Size=newSystem.Drawing.Size(531,132);
this.listViewView.TabIndex=0;
this.listViewView.UseCompatibleStateImageBehavior=false;
this.listViewView.View=System.Windows.Forms.View.Details;
//columnHeader1
this.columnHeader1.Text=;
this.columnHeader1.Width=70;
//columnHeader2
this.columnHeader2.Text=;
this.columnHeader2.Width=72;
//columnHeader3
this.columnHeader3.Text=;
this.columnHeader3.Width=88;
//columnHeader4
this.columnHeader4.Text=;
this.columnHeader4.Width=134;
//columnHeader5
this.columnHeader5.Text=;
this.columnHeader5.Width=81;
//columnHeader6
this.columnHeader6.Text=;
this.columnHeader6.Width=76;
//FormSearch
this.AutoScaleDimensions=newSystem.Drawing.SizeF(6F,12F);
this.AutoScaleMode=System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize=newSystem.Drawing.Size(531,240);
this.Controls.Add(this.listViewView);
this.Controls.Add(this.groupBoxSearch);
this.Name="FormSearch";
this.Text=;
this.Load+=newSystem.EventHandler(this.FormSearch_Load);
this.groupBoxSearch.ResumeLayout(false);
this.groupBoxSearch.PerformLayout();
this.ResumeLayout(false);
}
#endregion
privateSystem.Windows.Forms.GroupBoxgroupBoxSearch;
privateSystem.Windows.Forms.ButtonbuttonClear;
privateSystem.Windows.Forms.ButtonbuttonSearch;
privateSystem.Windows.Forms.TextBoxtextBoxSearch;
privateSystem.Windows.Forms.RadioButtonradioButtonNumbe