1、公司证件管理

上传人:艾力 文档编号:32705852 上传时间:2018-02-12 格式:DOC 页数:10 大小:65.50KB
返回 下载 相关 举报
1、公司证件管理_第1页
第1页 / 共10页
1、公司证件管理_第2页
第2页 / 共10页
1、公司证件管理_第3页
第3页 / 共10页
1、公司证件管理_第4页
第4页 / 共10页
1、公司证件管理_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《1、公司证件管理》由会员分享,可在线阅读,更多相关《1、公司证件管理(10页珍藏版)》请在金锄头文库上搜索。

1、1、公司证件管理:/文件名:CertificateForm.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Diagnostics;namespace MyOfficepublic partial class CertificateForm : Formpublic CertificateForm()

2、InitializeComponent();private void 公司证件管理BindingNavigatorSaveItem_Click(object sender, EventArgs e)this.Validate();this.公司证件管理BindingSource.EndEdit();this.公司证件管理TableAdapter.Update(this.myOfficeDataSet.公司证件管理);private void CertificateForm_Load(object sender, EventArgs e)/ TODO: 这行代码将数据加载到表“myOfficeD

3、ataSet.公司证件管理”中。您可以根据需要移动或移除它。this.公司证件管理TableAdapter.Fill(this.myOfficeDataSet.公司证件管理);private void 选择文件Button_Click(object sender, EventArgs e)OpenFileDialog MyDlg = new OpenFileDialog();if (MyDlg.ShowDialog() = DialogResult.OK)this.存放路径TextBox.Text = MyDlg.FileName; private void 显示文件Button_Click(

4、object sender, EventArgs e)Process.Start(this.存放路径TextBox.Text); private void 查询ToolStripButton_Click(object sender, EventArgs e)trythis.公司证件管理TableAdapter.FillBy(this.myOfficeDataSet.公司证件管理, new System.Nullable(System.DateTime)(System.Convert.ChangeType(开始日期ToolStripTextBox.Text, typeof(System.Date

5、Time), new System.Nullable(System.DateTime)(System.Convert.ChangeType(结束日期ToolStripTextBox.Text, typeof(System.DateTime);catch (System.Exception ex)System.Windows.Forms.MessageBox.Show(ex.Message);2、往来信函报表:/文件名:LetterForm.csusing System;using System.Collections.Generic;using System.ComponentModel;us

6、ing System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Diagnostics ;namespace MyOfficepublic partial class LetterForm : Formpublic LetterForm() InitializeComponent();private void LetterForm_Load(object sender, EventArgs e)/ TODO: 这行代码将数据加载到表“myOfficeDataSet.往来

7、信函管理”中。您可以根据需要移动或移除它。this.往来信函管理TableAdapter.Fill(this.myOfficeDataSet.往来信函管理);private void 往来信函管理BindingNavigatorSaveItem_Click(object sender, EventArgs e)this.Validate();this.往来信函管理BindingSource.EndEdit();this.往来信函管理TableAdapter.Update(this.myOfficeDataSet.往来信函管理);private void 选择文件Button_Click(obj

8、ect sender, EventArgs e)OpenFileDialog MyDlg = new OpenFileDialog();if (MyDlg.ShowDialog() = DialogResult.OK)this.存放路径TextBox.Text = MyDlg.FileName;private void 显示文件Button_Click(object sender, EventArgs e)Process.Start(this.存放路径TextBox.Text);private void 查询ToolStripButton_Click(object sender, EventA

9、rgs e)trythis.往来信函管理TableAdapter.FillBy(this.myOfficeDataSet.往来信函管理, new System.Nullable(System.DateTime)(System.Convert.ChangeType(开始日期ToolStripTextBox.Text, typeof(System.DateTime), new System.Nullable(System.DateTime)(System.Convert.ChangeType(结束日期ToolStripTextBox.Text, typeof(System.DateTime); c

10、atch (System.Exception ex)System.Windows.Forms.MessageBox.Show(ex.Message);3、登陆using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace MyOfficepublic partial cl

11、ass LoginForm : Formpublic LoginForm()InitializeComponent();/记录用户登录次数private int MyTryCount = 0;private void 登录系统Button_Click(object sender, EventArgs e)/从app.config文件中读取数据库连接字符串信息String MySQLConnectionString = global:MyOffice.Properties.Settings.Default.MyOfficeConnectionString;string MySQL = Selec

12、t COUNT(*) From 操作权限设置 Where 用户名称=用户名称 AND 用户密码=用户密码;SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);MyConnection.Open(); SqlCommand MyCommand = new SqlCommand(MySQL, MyConnection);MyCommand.Parameters.Clear();SqlParameter MySqlNameParameter = new SqlParameter();MySqlNameParame

13、ter.ParameterName = 用户名称;MySqlNameParameter.Value = this.用户名称TextBox.Text;MyCommand.Parameters.Add(MySqlNameParameter);SqlParameter MySqlPWParameter = new SqlParameter();MySqlPWParameter.ParameterName = 用户密码;MySqlPWParameter.Value = this.用户密码TextBox.Text;MyCommand.Parameters.Add(MySqlPWParameter);in

14、t MyCount = (int)MyCommand.ExecuteScalar();if (MyCount = 1)this.Close();elsethis.MyTryCount += 1;if (this.MyTryCount != 3)int MyDoCount = 3 - this.MyTryCount;MessageBox.Show(用户密码或用户名称有错,还有 + MyDoCount + 次机会!, 信息提示, MessageBoxButtons.OK, MessageBoxIcon.Information);this.用户密码TextBox.Text = ;this.用户名称T

15、extBox.Text = ; else退出系统Button_Click(null, null);if (MyConnection.State = ConnectionState.Open)MyConnection.Close();private void 退出系统Button_Click(object sender, EventArgs e)MainForm MyDlg = (MainForm)this.Owner;MyDlg.Close();4、操作权限using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace MyOfficepublic partial class OperatorForm : Formpublic OperatorForm()InitializeComponent();private void 操作权限设置BindingNavigatorSaveItem_Click(object sender, EventArgs e)this.Validate();this.操

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号