📄 frmemployees.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Drawing.Printing;
using HouseDA;
using HouseBE;
using HouseBS;
namespace frmLogin
{
/// <summary>
/// frmEmployees 的摘要说明。
/// </summary>
public class frmEmployees : System.Windows.Forms.Form
{
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.StatusBar statusBar1;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.ToolBarButton toolBarButton2;
private System.Windows.Forms.ToolBarButton toolBarButton3;
private System.Windows.Forms.ToolBarButton toolBarButton5;
private System.Windows.Forms.ToolBarButton toolBarButton6;
private System.Windows.Forms.DataGrid dataGrid1;
private DevComponents.DotNetBar.LabelX labelX1;
private DevComponents.DotNetBar.Controls.TextBoxX textBoxX1;
private DevComponents.DotNetBar.LabelX labelX2;
private DevComponents.DotNetBar.LabelX labelX3;
private DevComponents.DotNetBar.Controls.ComboBoxEx comboBoxEx1;
private DevComponents.DotNetBar.LabelX labelX4;
private DevComponents.DotNetBar.Controls.TextBoxX textBoxX3;
private DevComponents.DotNetBar.LabelX labelX5;
private DevComponents.DotNetBar.Controls.ComboBoxEx comboBoxEx2;
private DevComponents.DotNetBar.LabelX labelX6;
private DevComponents.DotNetBar.Controls.TextBoxX textBoxX4;
private DevComponents.DotNetBar.LabelX labelX7;
private DevComponents.DotNetBar.Controls.TextBoxX textBoxX5;
private System.ComponentModel.IContainer components;
//用户字段
private SqlConnection con;
private SqlDataAdapter da;
private DataSet ds=null;
//private SqlCommand cmd;
//private SqlDataReader sr;
private DevComponents.Editors.ComboItem cboMan;
private DevComponents.Editors.ComboItem cboWomen;
private System.Windows.Forms.ToolTip toolTip1;
private ConDA conDA;
private DevComponents.Editors.ComboItem comboItem6;
private DevComponents.Editors.ComboItem comboItem7;
private DevComponents.Editors.ComboItem comboItem8;
private DevComponents.Editors.ComboItem comboItem9;
private DevComponents.Editors.ComboItem comboItem10;
private DevComponents.DotNetBar.Controls.ComboBoxEx comboBoxEx3;
private DevComponents.Editors.ComboItem comboItem1;
private DevComponents.Editors.ComboItem comboItem2;
private DevComponents.Editors.ComboItem comboItem3;
private DevComponents.Editors.ComboItem comboItem4;
private DevComponents.Editors.ComboItem comboItem5;
private int EID=0;//员工ID
private string BranchID="";
private HouseBE.Employee EmployeeBE;
private System.Drawing.Printing.PrintDocument printDocument1;
private System.Windows.Forms.PrintPreviewDialog printPreviewDialog1;
private System.Windows.Forms.PageSetupDialog pageSetupDialog1;
private HouseBS.EmployeeBS EmployeeBS;
public frmEmployees()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.conDA=new ConDA();
this.con=this.conDA._con;
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmEmployees));
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton6 = new System.Windows.Forms.ToolBarButton();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.panel1 = new System.Windows.Forms.Panel();
this.comboBoxEx3 = new DevComponents.DotNetBar.Controls.ComboBoxEx();
this.comboItem1 = new DevComponents.Editors.ComboItem();
this.comboItem2 = new DevComponents.Editors.ComboItem();
this.comboItem3 = new DevComponents.Editors.ComboItem();
this.comboItem4 = new DevComponents.Editors.ComboItem();
this.comboItem5 = new DevComponents.Editors.ComboItem();
this.textBoxX5 = new DevComponents.DotNetBar.Controls.TextBoxX();
this.labelX7 = new DevComponents.DotNetBar.LabelX();
this.textBoxX4 = new DevComponents.DotNetBar.Controls.TextBoxX();
this.labelX6 = new DevComponents.DotNetBar.LabelX();
this.comboBoxEx2 = new DevComponents.DotNetBar.Controls.ComboBoxEx();
this.comboItem6 = new DevComponents.Editors.ComboItem();
this.comboItem7 = new DevComponents.Editors.ComboItem();
this.comboItem8 = new DevComponents.Editors.ComboItem();
this.comboItem9 = new DevComponents.Editors.ComboItem();
this.comboItem10 = new DevComponents.Editors.ComboItem();
this.labelX5 = new DevComponents.DotNetBar.LabelX();
this.textBoxX3 = new DevComponents.DotNetBar.Controls.TextBoxX();
this.labelX4 = new DevComponents.DotNetBar.LabelX();
this.comboBoxEx1 = new DevComponents.DotNetBar.Controls.ComboBoxEx();
this.cboMan = new DevComponents.Editors.ComboItem();
this.cboWomen = new DevComponents.Editors.ComboItem();
this.labelX3 = new DevComponents.DotNetBar.LabelX();
this.labelX2 = new DevComponents.DotNetBar.LabelX();
this.textBoxX1 = new DevComponents.DotNetBar.Controls.TextBoxX();
this.labelX1 = new DevComponents.DotNetBar.LabelX();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.statusBar1 = new System.Windows.Forms.StatusBar();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.printDocument1 = new System.Drawing.Printing.PrintDocument();
this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
this.pageSetupDialog1 = new System.Windows.Forms.PageSetupDialog();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton2,
this.toolBarButton3,
this.toolBarButton5,
this.toolBarButton6});
this.toolBar1.ButtonSize = new System.Drawing.Size(70, 50);
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.imageList1;
this.toolBar1.Location = new System.Drawing.Point(0, 0);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(616, 56);
this.toolBar1.TabIndex = 0;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// toolBarButton1
//
this.toolBarButton1.ImageIndex = 0;
this.toolBarButton1.Text = "添加 ";
this.toolBarButton1.ToolTipText = "添加";
//
// toolBarButton2
//
this.toolBarButton2.ImageIndex = 1;
this.toolBarButton2.Text = "保存";
this.toolBarButton2.ToolTipText = "保存";
//
// toolBarButton3
//
this.toolBarButton3.ImageIndex = 3;
this.toolBarButton3.Text = "编辑";
this.toolBarButton3.ToolTipText = "编辑";
//
// toolBarButton5
//
this.toolBarButton5.ImageIndex = 4;
this.toolBarButton5.Text = "打印";
this.toolBarButton5.ToolTipText = "打印";
//
// toolBarButton6
//
this.toolBarButton6.ImageIndex = 5;
this.toolBarButton6.Text = "退出";
this.toolBarButton6.ToolTipText = "退出";
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(28, 25);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel1.Controls.Add(this.comboBoxEx3);
this.panel1.Controls.Add(this.textBoxX5);
this.panel1.Controls.Add(this.labelX7);
this.panel1.Controls.Add(this.textBoxX4);
this.panel1.Controls.Add(this.labelX6);
this.panel1.Controls.Add(this.comboBoxEx2);
this.panel1.Controls.Add(this.labelX5);
this.panel1.Controls.Add(this.textBoxX3);
this.panel1.Controls.Add(this.labelX4);
this.panel1.Controls.Add(this.comboBoxEx1);
this.panel1.Controls.Add(this.labelX3);
this.panel1.Controls.Add(this.labelX2);
this.panel1.Controls.Add(this.textBoxX1);
this.panel1.Controls.Add(this.labelX1);
this.panel1.Controls.Add(this.dataGrid1);
this.panel1.Controls.Add(this.statusBar1);
this.panel1.Location = new System.Drawing.Point(0, 56);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(616, 360);
this.panel1.TabIndex = 1;
//
// comboBoxEx3
//
this.comboBoxEx3.DisplayMember = "Text";
this.comboBoxEx3.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.comboBoxEx3.Items.AddRange(new object[] {
this.comboItem1,
this.comboItem2,
this.comboItem3,
this.comboItem4,
this.comboItem5});
this.comboBoxEx3.Location = new System.Drawing.Point(264, 48);
this.comboBoxEx3.Name = "comboBoxEx3";
this.comboBoxEx3.Size = new System.Drawing.Size(80, 22);
this.comboBoxEx3.TabIndex = 16;
//
// comboItem1
//
this.comboItem1.Text = "销售部";
//
// comboItem2
//
this.comboItem2.Text = "策划部";
//
// comboItem3
//
this.comboItem3.Text = "广告部";
//
// comboItem4
//
this.comboItem4.Text = "经理部";
//
// comboItem5
//
this.comboItem5.Text = "其他";
//
// textBoxX5
//
this.textBoxX5.AutoSize = false;
//
// textBoxX5.Border
//
this.textBoxX5.Border.Class = "TextBoxBorder";
this.textBoxX5.Location = new System.Drawing.Point(400, 8);
this.textBoxX5.Name = "textBoxX5";
this.textBoxX5.Size = new System.Drawing.Size(56, 21);
this.textBoxX5.TabIndex = 15;
//
// labelX7
//
this.labelX7.Location = new System.Drawing.Point(352, 8);
this.labelX7.Name = "labelX7";
this.labelX7.Size = new System.Drawing.Size(75, 23);
this.labelX7.TabIndex = 14;
this.labelX7.Text = "年龄:";
//
// textBoxX4
//
this.textBoxX4.AutoSize = false;
//
// textBoxX4.Border
//
this.textBoxX4.Border.Class = "TextBoxBorder";
this.textBoxX4.Location = new System.Drawing.Point(80, 48);
this.textBoxX4.Name = "textBoxX4";
this.textBoxX4.Size = new System.Drawing.Size(104, 21);
this.textBoxX4.TabIndex = 13;
//
// labelX6
//
this.labelX6.Location = new System.Drawing.Point(200, 8);
this.labelX6.Name = "labelX6";
this.labelX6.Size = new System.Drawing.Size(64, 23);
this.labelX6.TabIndex = 12;
this.labelX6.Text = "性别:";
//
// comboBoxEx2
//
this.comboBoxEx2.DisplayMember = "Text";
this.comboBoxEx2.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.comboBoxEx2.Items.AddRange(new object[] {
this.comboItem6,
this.comboItem7,
this.comboItem8,
this.comboItem9,
this.comboItem10});
this.comboBoxEx2.Location = new System.Drawing.Point(512, 8);
this.comboBoxEx2.Name = "comboBoxEx2";
this.comboBoxEx2.Size = new System.Drawing.Size(88, 22);
this.comboBoxEx2.TabIndex = 11;
//
// comboItem6
//
this.comboItem6.Text = "高中";
//
// comboItem7
//
this.comboItem7.Text = "本科";
//
// comboItem8
//
this.comboItem8.Text = "大专";
//
// comboItem9
//
this.comboItem9.Text = "中专";
//
// comboItem10
//
this.comboItem10.Text = "其他";
//
// labelX5
//
this.labelX5.Location = new System.Drawing.Point(464, 8);
this.labelX5.Name = "labelX5";
this.labelX5.Size = new System.Drawing.Size(56, 23);
this.labelX5.TabIndex = 10;
this.labelX5.Text = "学历:";
//
// textBoxX3
//
this.textBoxX3.AutoSize = false;
//
// textBoxX3.Border
//
this.textBoxX3.Border.Class = "TextBoxBorder";
this.textBoxX3.Location = new System.Drawing.Point(400, 48);
this.textBoxX3.Name = "textBoxX3";
this.textBoxX3.Size = new System.Drawing.Size(200, 21);
this.textBoxX3.TabIndex = 9;
//
// labelX4
//
this.labelX4.Location = new System.Drawing.Point(352, 48);
this.labelX4.Name = "labelX4";
this.labelX4.Size = new System.Drawing.Size(56, 23);
this.labelX4.TabIndex = 8;
this.labelX4.Text = "备注:";
//
// comboBoxEx1
//
this.comboBoxEx1.DisplayMember = "Text";
this.comboBoxEx1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.comboBoxEx1.Items.AddRange(new object[] {
this.cboMan,
this.cboWomen});
this.comboBoxEx1.Location = new System.Drawing.Point(264, 8);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -