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

📄 servicerecord.cs

📁 汽车销售公司ERP进销存系统 汽车销售公司ERP进销存系统
💻 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 System.Data.OleDb;
namespace CallCenter.BusinessInterfaces.MainForms
{
	/// <summary>
	/// ServiceRecord 的摘要说明。
	/// </summary>
	public class ServiceRecord : System.Windows.Forms.Form
	{
		private System.Windows.Forms.DataGrid dgSeviceNote;
		private WebMIS.GoldFilter.GridDataFilter gridDataFilter1;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public ServiceRecord()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}
		public ServiceRecord(int id)
		{
			try
			{
				InitializeComponent();
				getDataBind(id);
				
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}

		private void getDataBind(int id)
		{	
			this.dgSeviceNote.CaptionBackColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			this.dgSeviceNote.BackgroundColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			
			SPServiceNoteBLL spbll=new SPServiceNoteBLL();
			DataSet ds=new DataSet();
			ds=spbll.getSPServiceNoteBySId_DataSet(id,"spnote");
			this.dgSeviceNote.DataSource=ds.Tables["spnote"].DefaultView;

		
			
		
			this.dgSeviceNote.TableStyles.Clear();
			DataGridTableStyle ts = new DataGridTableStyle();
			ts.MappingName = ds.Tables["spnote"].TableName;

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

	
			DataGridColumnStyle gs1 = new DataGridTextBoxColumn();
			gs1.MappingName = "cname";
			gs1.HeaderText = "客户名称";
			gs1.NullText = "";
			gs1.Width=100;
			gs1.ReadOnly=true;
			gs1.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs1);

			DataGridColumnStyle gs2 = new DataGridTextBoxColumn();
			gs2.MappingName = "scontent";
			gs2.HeaderText = "服务内容";
			gs2.NullText = "";
			gs2.Width=400;
			gs2.ReadOnly=true;
			gs2.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs2);

			DataGridColumnStyle gst2 = new DataGridTextBoxColumn();
			gst2.MappingName = "sdate";
			gst2.HeaderText = "服务时间";
			gst2.NullText = "";
			gst2.Width=100;
			gst2.ReadOnly=true;
			gst2.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gst2);

			DataGridColumnStyle gs3 = new DataGridTextBoxColumn();
			gs3.MappingName = "ccomment";
			gs3.HeaderText = "描述";
			gs3.NullText = "";
			gs3.Width=400;
			gs3.ReadOnly=true;
			gs3.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs3);

			DataGridColumnStyle gs4 = new DataGridTextBoxColumn();
			gs4.MappingName = "gshow";
			gs4.HeaderText = "满意度";
			gs4.NullText = "";
			gs4.Width=100;
			gs4.ReadOnly=true;
			gs4.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs4);

			this.dgSeviceNote.TableStyles.Add(ts);
		
			//如果指定了DataGridTableStyle,则gridDataFilter1会加载它的标题
			this.gridDataFilter1.DataGridTableStyle = this.dgSeviceNote.TableStyles[0];
			

			if (this.dgSeviceNote.DataSource != null)
			{
				this.gridDataFilter1.Enabled = true;
			}
			else
			{
				this.gridDataFilter1.Enabled = false;
			}


			this.gridDataFilter1.DataSource=this.dgSeviceNote.DataSource;
			this.gridDataFilter1.Begin();
		}
		/// <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.dgSeviceNote = new System.Windows.Forms.DataGrid();
			this.gridDataFilter1 = new WebMIS.GoldFilter.GridDataFilter();
			((System.ComponentModel.ISupportInitialize)(this.dgSeviceNote)).BeginInit();
			this.SuspendLayout();
			// 
			// dgSeviceNote
			// 
			this.dgSeviceNote.AlternatingBackColor = System.Drawing.Color.GhostWhite;
			this.dgSeviceNote.BackColor = System.Drawing.Color.GhostWhite;
			this.dgSeviceNote.BackgroundColor = System.Drawing.Color.Lavender;
			this.dgSeviceNote.CaptionBackColor = System.Drawing.Color.FromArgb(((System.Byte)(90)), ((System.Byte)(180)), ((System.Byte)(232)));
			this.dgSeviceNote.CaptionForeColor = System.Drawing.Color.White;
			this.dgSeviceNote.CaptionText = "服务记录列表";
			this.dgSeviceNote.DataMember = "";
			this.dgSeviceNote.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dgSeviceNote.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dgSeviceNote.Location = new System.Drawing.Point(0, 0);
			this.dgSeviceNote.Name = "dgSeviceNote";
			this.dgSeviceNote.ReadOnly = true;
			this.dgSeviceNote.Size = new System.Drawing.Size(520, 349);
			this.dgSeviceNote.TabIndex = 0;
			this.dgSeviceNote.CurrentCellChanged += new System.EventHandler(this.dgSeviceNote_CurrentCellChanged);
			// 
			// gridDataFilter1
			// 
			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(520, 32);
			this.gridDataFilter1.TabIndex = 1;
			// 
			// ServiceRecord
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(520, 381);
			this.Controls.Add(this.dgSeviceNote);
			this.Controls.Add(this.gridDataFilter1);
			this.Name = "ServiceRecord";
			this.Text = "服务记录";
			((System.ComponentModel.ISupportInitialize)(this.dgSeviceNote)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void dgSeviceNote_CurrentCellChanged(object sender, System.EventArgs e)
		{
			this.dgSeviceNote.Select(this.dgSeviceNote.CurrentCell.RowNumber);
		}
	}
}

⌨️ 快捷键说明

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