重庆邮电大学理学院信息与计算科学专业集中实践报告题目:人事管理系统指导老师:李永红系别:数学系专业:信息与计算科学班级:11021401学号:2014213022姓名:唐敬源学号:姓名:徐思齐成绩:2017年6月28日人事客户管理系统实验报告一.系统需求分析随着信息化时代的快速发展,企业人事管理变得十分繁杂,大量的客户资料信息的堆积让他公司的经营变得不畅,人事管理系统的出现让越来越多的企业享受到了福利,因为其方便快捷易于维护的特点,极大地提高了企业人事管理的办事效率,第一时间掌握人事信心,客户信息让公司的管理经营尽在掌控之中。二.系统模块设计登录界面用户管理系统客户管理添加客户添加服务添加投诉更改密码关于软件退出系统数据库设计模块:Datatable:ManagercustomeraddcompliantaddserviceClientAddclientaboutmanager表:实验使用软件为:VSstdio2010c#语言MicrosoftSQLsever2008数据库语言Windows7XP环境三.实验内容及其结果1.登录模块的设计代码:namespaceCRM_System{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}privatevoidForm1_Load(objectsender,EventArgse){}privatevoidbtnExit_Click(objectsender,EventArgse){Application.Exit();}privatevoidbtnLogin_Click(objectsender,EventArgse){if(tbUser.Text.Trim().Length==0)//判断是否输入用户名{MessageBox.Show(请输入用户名!);tbUser.Focus();return;}if(tbPwd.Text.Trim().Length==0){MessageBox.Show(请输入密码!);tbPwd.Focus();return;}//创建commom对象commoncom=newcommon();//创建database对象databasedb=newdatabase();//统计所输入的用户名和密码在对应数据表中个数的查询语句intt=0;stringsql=selectcount(*)frommanagerwhereusername'+tbUser.Text.Trim()+'andPwd='+com.md5(tbPwd.Text.Trim())+';//将对应表中数据条数放在变量t当中t=db.runSqlInt(sql);if(t0){this.Hide();mainfmain=newmain();fmain.User=tbUser.Text.Trim();fmain.Show();}else{MessageBox.Show(用户名或者密码错误!!);}}}}2.主登录模块代码为:namespace管理系统_客户管理系统{publicpartialclassmain:Form{publicmain(){InitializeComponent();}privatestringuser;publicstringUser{get{returnuser;}set{user=value;}}privatevoidmain_Load(objectsender,EventArgse){}privatevoidmain_FormClosing(objectsender,FormClosingEventArgse){DialogResultresult=MessageBox.Show(你确认退出系统,退出m对话框,MessageBoxButtons.YesNo);if(result==DialogResult.Yes){this.Dispose();}else{e.Cancel=true;}}privatevoidlklblExit_LinkClicked(objectsender,LinkLabelLinkClickedEventArgse){DialogResultresult=MessageBox.Show(你确认退出系统,退出m对话框,MessageBoxButtons.YesNo);if(result==DialogResult.Yes){this.Dispose();}}privatevoid退出系统ToolStripMenuItem_Click(objectsender,EventArgse){DialogResultresult=MessageBox.Show(你确认退出系统,退出m对话框,MessageBoxButtons.YesNo);if(result==DialogResult.Yes){this.Dispose();}}privatevoidlklblAddClient_LinkClicked(objectsender,LinkLabelLinkClickedEventArgse){AddClientac=newAddClient();ac.Show();}privatevoidlklblComplaint_LinkClicked(objectsender,LinkLabelLinkClickedEventArgse){AddComplaintacom=newAddComplaint();acom.Show();}privatevoidlklblAddSevice_LinkClicked(objectsender,LinkLabelLinkClickedEventArgse){AddServiceaser=newAddService();aser.Show();}privatevoid添加客户ToolStripMenuItem_Click(objectsender,EventArgse){AddClientac=newAddClient();ac.Show();}privatevoid客户管理ToolStripMenuItem1_Click(objectsender,EventArgse){Clientcli=newClient();cli.Show();}privatevoid添加服务ToolStripMenuItem_Click(objectsender,EventArgse){AddServiceaser=newAddService();aser.Show();}privatevoid添加投诉ToolStripMenuItem_Click(objectsender,EventArgse){AddComplaintacom=newAddComplaint();acom.Show();}privatevoid更改密码ToolStripMenuItem_Click(objectsender,EventArgse){Aboutab=newAbout();ab.Show();}}}3.客户管理修改数据:删除数据:添加数据:代码为:namespace管理系统_客户管理系统{publicpartialclassClient:Form{publicClient(){InitializeComponent();}privatevoidtoolStrip1_ItemClicked(objectsender,ToolStripItemClickedEventArgse){if(e.ClickedItem.Name==tslblAdd){modclient();}if(e.ClickedItem.Name==tslblModify){modclient();}if(e.ClickedItem.Name==tslblDelete){DialogResultstatus=MessageBox.Show(你确定删除所选的行吗?,确认对话框,MessageBoxButtons.YesNo);if(status==DialogResult.Yes){modclient();}}}commoncom=newcommon();databasedb=newdatabase();privatevoidshowCustomer(){com.bindDGV(dataGridView1,select*fromcustomerorderbyiddesc);}privatevoidClient_Load(objectsender,EventArgse){//显示客户的方法showCustomer();}//添加客户privatevoidshowForm(intt){AddClientac=newAddClient();ac.ID=t;DialogResultresult=ac.ShowDialog();if(result==DialogResult.OK){showCustomer();}}//修改客户privatevoidmodclient(){if(dataGridView1.RowCount0){if(dataGridView1.SelectedRows.Count==1){stringvalue=dataGridView1.SelectedRows[0].Cells[0].Value.ToString();if(value!=null&&value!=string.Empty){showForm(int.Parse(value));}else{MessageBox.Show(所选择行不存在数据);}}else{MessageBox.Show(请选择一行要修改的数据);}}else{MessageBox.Show(目前没有任何数据);}}}}添加客户管理:代码:namespace管理系统_客户管理系统{publicpartialclassAddClient:Form{publicAddClient(){InitializeComponent();}commoncom=newcommon();databasedb=newdatabase();privatevoidAddClient_Load(objectsender,EventArgse){try{com.bindComboBox(cbbnation,Selectid,nationfromnationorderbyidesc);//绑定名族if(ID!=0){cbbgender.SelectedIndex=0;cbbsource.SelectedIndex=0;cbbcon.SelectedIndex=0;cbbculture.SelectedIndex=0;cbbcon.SelectedIndex=0;cbbearing.SelectedIndex=0;cbbmarriage.SelectedIndex=0;Level.SelectedIndex=0;Text=客户修改资料;btnAdd.Text=修改;showClient(ID);}}catch(Exceptionex){MessageBox.Show(ex.Message.ToString());}}privatevoidshowClient(intt){SqlDataReaderdr;db.runSql(select*fromcustomerwhereid+t,outdr);if(dr.Read()){tbname.Text=dr[username].ToString();com.CbbIndexByText(cbbnation,dr[nation].ToString());dtpBirthday.Value=DateTime.Parse(dr[Birthday].ToString());com.CbbIndexByText(cbbgender,dr[gender].ToSt