⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 workmanage.cs

📁 c#编写的汽车销售公司erp进销存系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
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 DevExpress.XtraEditors.PanelControl panel2;
		private DevExpress.XtraEditors.PanelControl panel1;
		private System.ComponentModel.IContainer components=null;
		private System.Windows.Forms.CheckBox checkBox1;
		private DevExpress.XtraEditors.SimpleButton btSave;
		private DevExpress.XtraEditors.SimpleButton btDelete;
		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 DevExpress.XtraEditors.PanelControl();
			this.checkBox1 = new System.Windows.Forms.CheckBox();
			this.panel1 = new DevExpress.XtraEditors.PanelControl();
			this.btDelete = new DevExpress.XtraEditors.SimpleButton();
			this.btSave = new DevExpress.XtraEditors.SimpleButton();
			((System.ComponentModel.ISupportInitialize)(this.dgWorker)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.panel2)).BeginInit();
			this.panel2.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.panel1)).BeginInit();
			this.panel1.SuspendLayout();
			this.SuspendLayout();
			// 
			// dgWorker
			// 
			this.dgWorker.AlternatingBackColor = System.Drawing.Color.GhostWhite;
			this.dgWorker.BackColor = System.Drawing.Color.GhostWhite;
			this.dgWorker.BackgroundColor = System.Drawing.Color.Lavender;
			this.dgWorker.CaptionBackColor = System.Drawing.Color.FromArgb(((System.Byte)(90)), ((System.Byte)(180)), ((System.Byte)(232)));
			this.dgWorker.CaptionForeColor = System.Drawing.Color.Black;
			this.dgWorker.CaptionText = "工单信息列表";
			this.dgWorker.DataMember = "";
			this.dgWorker.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dgWorker.ForeColor = System.Drawing.Color.MidnightBlue;
			this.dgWorker.GridLineColor = System.Drawing.Color.RoyalBlue;
			this.dgWorker.HeaderBackColor = System.Drawing.Color.DeepSkyBlue;
			this.dgWorker.HeaderForeColor = System.Drawing.Color.LavenderBlush;
			this.dgWorker.LinkColor = System.Drawing.Color.Teal;
			this.dgWorker.Location = new System.Drawing.Point(2, 2);
			this.dgWorker.Name = "dgWorker";
			this.dgWorker.ParentRowsBackColor = System.Drawing.Color.LavenderBlush;
			this.dgWorker.ParentRowsForeColor = System.Drawing.Color.MidnightBlue;
			this.dgWorker.SelectionBackColor = System.Drawing.Color.Teal;
			this.dgWorker.SelectionForeColor = System.Drawing.Color.PaleGreen;
			this.dgWorker.Size = new System.Drawing.Size(636, 345);
			this.dgWorker.TabIndex = 1;
			this.dgWorker.CurrentCellChanged += new System.EventHandler(this.dgWorker_CurrentCellChanged);
			// 
			// gridDataFilter1
			// 
			this.gridDataFilter1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(141)), ((System.Byte)(193)), ((System.Byte)(230)));
			this.gridDataFilter1.checkbox = null;
			this.gridDataFilter1.Dock = System.Windows.Forms.DockStyle.Bottom;
			this.gridDataFilter1.Location = new System.Drawing.Point(2, 347);
			this.gridDataFilter1.Name = "gridDataFilter1";
			this.gridDataFilter1.Size = new System.Drawing.Size(636, 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.Color.FromArgb(((System.Byte)(90)), ((System.Byte)(180)), ((System.Byte)(232)));
			this.checkBox1.Font = new System.Drawing.Font("宋体", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.checkBox1.ForeColor = System.Drawing.SystemColors.ActiveCaption;
			this.checkBox1.Location = new System.Drawing.Point(96, 6);
			this.checkBox1.Name = "checkBox1";
			this.checkBox1.Size = new System.Drawing.Size(56, 16);
			this.checkBox1.TabIndex = 15;
			this.checkBox1.Text = "全选";
			this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
			// 
			// panel1
			// 
			this.panel1.Appearance.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(141)), ((System.Byte)(193)), ((System.Byte)(230)));
			this.panel1.Appearance.Options.UseBackColor = true;
			this.panel1.Controls.Add(this.btDelete);
			this.panel1.Controls.Add(this.btSave);
			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;
			// 
			// btDelete
			// 
			this.btDelete.Location = new System.Drawing.Point(88, 8);
			this.btDelete.Name = "btDelete";
			this.btDelete.TabIndex = 21;
			this.btDelete.Text = "删除";
			this.btDelete.Click += new System.EventHandler(this.button1_Click);
			// 
			// btSave
			// 
			this.btSave.Location = new System.Drawing.Point(8, 8);
			this.btSave.Name = "btSave";
			this.btSave.TabIndex = 20;
			this.btSave.Text = "修改";
			this.btSave.Click += new System.EventHandler(this.btSave_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();
			((System.ComponentModel.ISupportInitialize)(this.panel2)).EndInit();
			this.panel2.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.panel1)).EndInit();
			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()
		{	
			this.dgWorker.CaptionBackColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			this.dgWorker.BackgroundColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			this.checkBox1.BackColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			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;

			ts.GridLineColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			ts.HeaderBackColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);

			DataGridColumnStyle gsc = new DataGridBoolColumn();
			gsc.MappingName = "check";
			gsc.HeaderText = "选择";
			gsc.Width=40;
			gsc.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gsc);

			DataGridColumnStyle gs0 = new DataGridTextBoxColumn();
			gs0.MappingName = "id";
			gs0.HeaderText = "工单编号";
			gs0.NullText = "";
			gs0.Width=80;
			gs0.Alignment = HorizontalAlignment.Left;
			gs0.ReadOnly=true;
			
			ts.GridColumnStyles.Add(gs0);

			DataGridColumnStyle gs1 = new DataGridTextBoxColumn();
			gs1.MappingName = "cid";
			gs1.HeaderText = "客户编号";
			gs1.NullText = "";
			gs1.Width=0;
			gs1.ReadOnly=true;
			ts.GridColumnStyles.Add(gs1);

			DataGridColumnStyle gs10 = new DataGridTextBoxColumn();
			gs10.MappingName = "cname";
			gs10.HeaderText = "客户姓名";
			gs10.NullText = "";
			gs10.Width=100;
			gs10.ReadOnly=true;
			gs10.Alignment = HorizontalAlignment.Left;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -