📄 workmanage.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using CallCenter.BusinessLayer;
using CallCenter.DALFactory;
using CallCenter.IDAL;
using CallCenter.Modules;
using CallCenter.OracleDAL;
using System.Data;
using CallCenter.BusinessInterfaces.BaseForms;
namespace CallCenter.BusinessInterfaces.MainForms
{
/// <summary>
/// WorkManage 的摘要说明。
/// </summary>
public class WorkManage : System.Windows.Forms.UserControl
{
private System.Windows.Forms.DataGrid dgWorker;
private WebMIS.GoldFilter.GridDataFilter gridDataFilter1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btDelete;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btSave;
private System.ComponentModel.IContainer components=null;
private System.Windows.Forms.CheckBox checkBox1;
private DataSet dsworker=null;
public WorkManage()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// 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.dgWorker = new System.Windows.Forms.DataGrid();
this.gridDataFilter1 = new WebMIS.GoldFilter.GridDataFilter();
this.panel2 = new System.Windows.Forms.Panel();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.panel1 = new System.Windows.Forms.Panel();
this.btSave = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btDelete = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgWorker)).BeginInit();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// dgWorker
//
this.dgWorker.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dgWorker.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dgWorker.CaptionText = "工单信息列表";
this.dgWorker.DataMember = "";
this.dgWorker.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgWorker.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgWorker.Location = new System.Drawing.Point(0, 0);
this.dgWorker.Name = "dgWorker";
this.dgWorker.Size = new System.Drawing.Size(640, 349);
this.dgWorker.TabIndex = 1;
this.dgWorker.CurrentCellChanged += new System.EventHandler(this.dgWorker_CurrentCellChanged);
//
// gridDataFilter1
//
this.gridDataFilter1.BackColor = System.Drawing.SystemColors.Menu;
this.gridDataFilter1.checkbox = null;
this.gridDataFilter1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.gridDataFilter1.Location = new System.Drawing.Point(0, 349);
this.gridDataFilter1.Name = "gridDataFilter1";
this.gridDataFilter1.Size = new System.Drawing.Size(640, 32);
this.gridDataFilter1.TabIndex = 14;
//
// panel2
//
this.panel2.Controls.Add(this.checkBox1);
this.panel2.Controls.Add(this.dgWorker);
this.panel2.Controls.Add(this.gridDataFilter1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 40);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(640, 381);
this.panel2.TabIndex = 15;
//
// checkBox1
//
this.checkBox1.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.checkBox1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.checkBox1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.checkBox1.Location = new System.Drawing.Point(96, 0);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(56, 21);
this.checkBox1.TabIndex = 15;
this.checkBox1.Text = "全选";
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// panel1
//
this.panel1.BackColor = System.Drawing.SystemColors.Menu;
this.panel1.Controls.Add(this.btSave);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.btDelete);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(640, 40);
this.panel1.TabIndex = 17;
//
// btSave
//
this.btSave.BackColor = System.Drawing.SystemColors.Menu;
this.btSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btSave.Font = new System.Drawing.Font("宋体", 9F);
this.btSave.Location = new System.Drawing.Point(8, 8);
this.btSave.Name = "btSave";
this.btSave.Size = new System.Drawing.Size(75, 24);
this.btSave.TabIndex = 19;
this.btSave.Text = "修改";
this.btSave.Click += new System.EventHandler(this.btSave_Click);
//
// button1
//
this.button1.BackColor = System.Drawing.SystemColors.Menu;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("宋体", 9F);
this.button1.Location = new System.Drawing.Point(176, 8);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 24);
this.button1.TabIndex = 18;
this.button1.Text = "退出";
this.button1.Click += new System.EventHandler(this.button1_Click_1);
//
// btDelete
//
this.btDelete.BackColor = System.Drawing.SystemColors.Menu;
this.btDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btDelete.Font = new System.Drawing.Font("宋体", 9F);
this.btDelete.ImageIndex = 0;
this.btDelete.Location = new System.Drawing.Point(96, 8);
this.btDelete.Name = "btDelete";
this.btDelete.Size = new System.Drawing.Size(75, 24);
this.btDelete.TabIndex = 17;
this.btDelete.Text = "删除";
this.btDelete.Click += new System.EventHandler(this.button1_Click);
//
// WorkManage
//
this.AutoScroll = true;
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.Name = "WorkManage";
this.Size = new System.Drawing.Size(640, 421);
this.Load += new System.EventHandler(this.WorkManage_Load);
((System.ComponentModel.ISupportInitialize)(this.dgWorker)).EndInit();
this.panel2.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void WorkManage_Load(object sender, System.EventArgs e)
{
getDataBind();
this.gridDataFilter1.checkbox=this.checkBox1;
}
private void getDataBind()
{
dsworker=new DataSet();
WorkBillBLL wbll=new WorkBillBLL();
WorkBillInfo winfo=new WorkBillInfo();
dsworker=wbll.queryWorkBill_DataSet(winfo,"worker");
System.Type myDataType;
myDataType = System.Type.GetType("System.Boolean");
System.Data.DataColumn myColumn = new System.Data.DataColumn("check");
// Set various properties.
myColumn.AutoIncrement = false;
myColumn.ReadOnly = false;
myColumn.ColumnMapping = System.Data.MappingType.Attribute;
myColumn.Caption = "check";
myColumn.DefaultValue = "false";
myColumn.DataType = myDataType;
dsworker.Tables["worker"].Columns.Add(myColumn);
DataView dv=new DataView();
dv=dsworker.Tables["worker"].DefaultView;
dv.AllowNew=false;
this.dgWorker.DataSource=dv;//dsworker.Tables["worker"].DefaultView;
this.dgWorker.TableStyles.Clear();
DataGridTableStyle ts = new DataGridTableStyle();
ts.MappingName = dsworker.Tables["worker"].TableName;
DataGridColumnStyle gsc = new DataGridBoolColumn();
gsc.MappingName = "check";
gsc.HeaderText = "选择";
gsc.Width=40;
ts.GridColumnStyles.Add(gsc);
DataGridColumnStyle gs0 = new DataGridTextBoxColumn();
gs0.MappingName = "id";
gs0.HeaderText = "工单编号";
gs0.NullText = "";
gs0.Width=80;
gs0.Alignment = HorizontalAlignment.Right;
gs0.ReadOnly=true;
ts.GridColumnStyles.Add(gs0);
DataGridColumnStyle gs1 = new DataGridTextBoxColumn();
gs1.MappingName = "cid";
gs1.HeaderText = "客户编号";
gs1.NullText = "";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -