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

📄 document.cs

📁 很不错的公文流转系统
💻 CS
📖 第 1 页 / 共 3 页
字号:
using System; 
using System.Collections;
using OI.Modules;

namespace OI.Data
{
	//设计人:吴高发     日期:20030109
	//v1.0     修改日期:20030109
	/// <summary>
	/// 枚举类:Documents
	/// 集合元素类:Document
	/// </summary>
	/// <example>
	/// <code>
	/// Documents oFileList=new Documents()
	/// foreach(Documents.Document in oFileList)
	/// {
	/// }
	/// </code>
	/// <code>
	/// Documents.Document  oFileList=new
	/// </code>
	/// </example> 
	public class Documents :OI.Data.DbObject,IEnumerable
	{
		public enum SearchDeleteSignType{All,Delete,NotDelete};
		public enum SearchStapleSignType{All,Staple,NotStaple};
		public enum SearchCompleteSignType{All,Complete,NotComplete};
		private int nCurrentRecordNum;
		private string cSearchKey;
		//出错信息;
		private SearchDeleteSignType cDeleteSign=SearchDeleteSignType.All ;//删除标志
		private SearchStapleSignType stapleSign=SearchStapleSignType.All;
		private int cStreamID=0;//所用流id
		private int cUserID=0;//创建人id
		private SearchCompleteSignType cCompleteSign=SearchCompleteSignType.All ;//是否完成
		private string cCurrentStepName="";//在流中当前节点名
		private int cCurrentStepID=0;//在流中当前节点id
		private string cTopicWord="";//主题词
		private string cSendDepartment="";//发文单位
		private string cDraftDepartment="";//拟稿单位
		private string cCopySendComp="";//抄送单位
		private string cMainSendComp="";//主送单位
		private string cTitle="";
		private string cDocumentNumber="";
		private string cDocumentHead="";
		private int cExigenceDegreeID=0;//紧急程度id
		private int cDocumentTypeID=0;
		private int cSecretGreadID=0;
		private int cDocumentID=0;

		private SearchDeleteSignType  searchDeleteSign=SearchDeleteSignType.NotDelete;

		public SearchDeleteSignType SearchDeleteSign
		{
			get
			{
				return searchDeleteSign;
			}
			set
			{
				this.searchDeleteSign=value;
			}
		}
		public Documents():base()
		{
		}
		public Documents(string newConnectionString):base(newConnectionString)
		{
		}
		//属性接口
		
		/// <summary>
		/// 设置过滤条件:删除标识
		/// </summary>
		public SearchDeleteSignType DeleteSign
		{
			get
			{
				return cDeleteSign;
			}
			set
			{
				cDeleteSign=value;
			}
		}
		/// <summary>
		/// 设置过滤条件:归档标识
		/// </summary>
		public SearchStapleSignType StapleSign
		{
			get
			{
				return stapleSign;
			}
			set
			{
				stapleSign=value;
			}
		}
		/// <summary>
		/// 设置过滤条件:流程ID
		/// </summary>
		public int StreamID
		{
			get
			{
				return cStreamID;
			}
			set
			{
				cStreamID=value;;
			}
		}
		/// <summary>
		/// 设置过滤条件:用户ID
		/// </summary>
		public int UserID
		{
			get
			{
				return cUserID;
			}
			set
			{
				cUserID=value;
			}
		}
		/// <summary>
		/// 设置过滤条件:流程结束标识,0为进行中,1为完成
		/// </summary>
		public SearchCompleteSignType CompleteSign
		{
			get
			{
				return cCompleteSign;
			}
			set
			{
				cCompleteSign=value;
			}
		}
		/// <summary>
		/// 设置过滤条件:当前节点名称
		/// </summary>
		public string CurrentStepName
		{
			get
			{
				return cCurrentStepName;
			}
			set
			{
				cCurrentStepName=OI.Modules.String.GenSafeChars(value);
			}
		}
		/// <summary>
		/// 设置过滤条件:当前节点ID
		/// </summary>
		public int CurrentStepID
		{
			get
			{
				return cCurrentStepID;
			}
			set
			{
				cCurrentStepID=value;
			}
		}
		/// <summary>
		/// 设置过滤条件:主题词
		/// </summary>
		public string TopicWord
		{
			get
			{
				return cTopicWord;
			}
			set
			{
				cTopicWord=OI.Modules.String.GenSafeChars(value);;
			}
		}
		/// <summary>
		/// 设置过滤条件:发文单位
		/// </summary>
		public string SendDepartment
		{
			get
			{
				return cSendDepartment;
			}
			set
			{
				cSendDepartment=OI.Modules.String.GenSafeChars(value);;
			}
		}
		/// <summary>
		/// 设置过滤条件:拟稿单位
		/// </summary>
		public string DraftDepartment
		{
			get
			{
				return cDraftDepartment;
			}
			set
			{
				cDraftDepartment=OI.Modules.String.GenSafeChars(value);;
			}
		}
		/// <summary>
		/// 设置过滤条件:抄送单位
		/// </summary>
		public string CopySendComp
		{
			get
			{
				return cCopySendComp;
			}
			set
			{
				cCopySendComp=OI.Modules.String.GenSafeChars(value);;
			}
		}
		/// <summary>
		/// 设置过滤条件:主送单位
		/// </summary>
		public string MainSendComp
		{
			get
			{
				return cMainSendComp;
			}
			set
			{
				cMainSendComp=OI.Modules.String.GenSafeChars(value);;
			}
		}
		/// <summary>
		/// 设置过滤条件:标题
		/// </summary>
		public string Title
		{
			get
			{
				return cTitle;
			}
			set
			{
				cTitle=OI.Modules.String.GenSafeChars(value);;
			}
		}
		/// <summary>
		/// 设置过滤条件:文号
		/// </summary>
		public string DocumentNumber
		{
			get
			{
				return cDocumentNumber;
			}
			set
			{
				cDocumentNumber=OI.Modules .String .GenSafeChars (value);
			}
		}
		/// <summary>
		/// 设置过滤条件:文头
		/// </summary>
		public string DocumentHead
		{
			get
			{
				return cDocumentHead;
			}
			set
			{
				cDocumentHead=OI.Modules.String.GenSafeChars(value);;
			}
		}
		/// <summary>
		/// 设置过滤条件:紧急程度
		/// </summary>
		public int ExigenceDegreeID
		{
			get
			{
				return cExigenceDegreeID;
			}
			set
			{
				cExigenceDegreeID=value;
			}
		}
		/// <summary>
		/// 设置过滤条件:公文类别
		/// </summary>
		public int DocumentTypeID
		{
			get
			{
				return cDocumentTypeID;
			}
			set
			{
				cDocumentTypeID=value;
			}
		}
		/// <summary>
		/// 设置过滤条件:秘密等级
		/// </summary>
		public int SecretGreadID
		{
			get
			{
				return cSecretGreadID;
			}
			set
			{
				cSecretGreadID=value;
			}
		}
		/// <summary>
		/// 设置过滤条件:文档ID
		/// </summary>
		public int DocumentID
		{
			get
			{
				return cDocumentID;
			}
			set
			{
				cDocumentID=value;
			}
		}
		System.Data.DataSet oDataSet;
		/// <summary>
		/// 当前的记录
		/// </summary>
		public int CurrentRecordNum
		{
			get
			{
				return nCurrentRecordNum;
			}
			set
			{
				nCurrentRecordNum=value;
			}
		}
       
		
       
		/// <summary>
		/// 组织查询条件
		/// </summary>
		/// <returns>查询字符串</returns>
		private string GenSqlFilter()
		{
			string cSql="";
			switch(this.cDeleteSign)
			{
				case Documents.SearchDeleteSignType .All :
					break;
				case Documents.SearchDeleteSignType .NotDelete :
					if(cSql!="")
						cSql=cSql+" and DeleteSign ='0' " ;
					else
						cSql=cSql+" where DeleteSign ='0'" ;
					break;
				case Documents.SearchDeleteSignType .Delete :
					if(cSql!="")
						cSql=cSql+" and DeleteSign ='1' " ;
					else
						cSql=cSql+" where DeleteSign ='1'" ;
					break;
			}
			switch(this.stapleSign)
			{
				case Documents.SearchStapleSignType.All:
					break;
				case Documents.SearchStapleSignType .NotStaple :
					if(cSql!="")
						cSql=cSql+" and StapleSign ='0' " ;
					else
						cSql=cSql+" where StapleSign ='0' " ;
					break;
				case Documents.SearchStapleSignType .Staple :
					if(cSql!="")
						cSql=cSql+" and StapleSign ='1'" ;
					else
						cSql=cSql+" where StapleSign ='1'" ;
					break;
			}
			if(this.cStreamID!=0)
			{
				if(cSql!="")
					cSql=cSql+" and StreamID ='"+this.cStreamID+"' " ;
				else
					cSql=cSql+" where StreamID ='"+this.cStreamID+"' " ;
			}
			if(this.cUserID!=0)
			{
				if(cSql!="")
					cSql=cSql+" and UserID ='"+this.cUserID+"' " ;
				else
					cSql=cSql+" where UserID ='"+this.cUserID+"' " ;
			}
			switch(this.cCompleteSign)
			{
				case SearchCompleteSignType.All :
					break;
				case SearchCompleteSignType.Complete :
					if(cSql!="")
						cSql=cSql+" and CompleteSign ='1'" ;
					else
						cSql=cSql+" where CompleteSign ='1'" ;
					break;
				case SearchCompleteSignType.NotComplete :
					if(cSql!="")
						cSql=cSql+" and CompleteSign ='0'" ;
					else
						cSql=cSql+" where CompleteSign ='0'" ;
					break;
			}
			if(this.cCurrentStepName!="")
			{
				if(cSql!="")
					cSql=cSql+" and CurrentStepName ='"+this.cCurrentStepName+"' " ;
				else
					cSql=cSql+" where CurrentStepName ='"+this.cCurrentStepName+"' " ;
			}
			if(this.cCurrentStepID!=0)
			{
				if(cSql!="")
					cSql=cSql+" and CurrentStepID ='"+this.cCurrentStepID+"' " ;
				else
					cSql=cSql+" where CurrentStepID ='"+this.cCurrentStepID+"' " ;
			}
			if(this.cTopicWord!="")
			{
				if(cSql!="")
					cSql=cSql+" and TopicWord ='"+this.cTopicWord+"' " ;
				else
					cSql=cSql+" where TopicWord ='"+this.cTopicWord+"' " ;
			}
			if(this.cSendDepartment!="")
			{
				if(cSql!="")
					cSql=cSql+" and SendDepartment ='"+this.cSendDepartment+"' " ;
				else
					cSql=cSql+" where SendDepartment ='"+this.cSendDepartment+"' " ;
			}
			if(this.cDraftDepartment!="")
			{
				if(cSql!="")
					cSql=cSql+" and DraftDepartment ='"+this.cDraftDepartment+"' " ;
				else
					cSql=cSql+" where DraftDepartment ='"+this.cDraftDepartment+"' " ;
			}
			if(this.cCopySendComp!="")
			{
				if(cSql!="")
					cSql=cSql+" and CopySendComp ='"+this.cCopySendComp+"' " ;
				else
					cSql=cSql+" where CopySendComp ='"+this.cCopySendComp+"' " ;
			}
			if(this.cMainSendComp!="")
			{
				if(cSql!="")
					cSql=cSql+" and MainSendComp ='"+this.cMainSendComp+"' " ;
				else
					cSql=cSql+" where MainSendComp ='"+this.cMainSendComp+"' " ;
			}
			if(this.cTitle!="")
			{
				if(cSql!="")
					cSql=cSql+" and Title ='"+this.cTitle+"' " ;
				else
					cSql=cSql+" where Title ='"+this.cTitle+"' " ;
			}
			if(this.cDocumentNumber!="")
			{
				if(cSql!="")
					cSql=cSql+" and DocumentNumber ='"+this.cDocumentNumber+"' " ;
				else
					cSql=cSql+" where DocumentNumber ='"+this.cDocumentNumber+"' " ;
			}
			if(this.cDocumentHead!="")
			{
				if(cSql!="")
					cSql=cSql+" and DocumentHead ='"+this.cDocumentHead+"' " ;
				else
					cSql=cSql+" where DocumentHead ='"+this.cDocumentHead+"' " ;
			}
			if(this.cExigenceDegreeID!=0)
			{
				if(cSql!="")
					cSql=cSql+" and ExigenceDegreeID ='"+this.cExigenceDegreeID+"' " ;
				else
					cSql=cSql+" where ExigenceDegreeID ='"+this.cExigenceDegreeID+"' " ;
			}
			if(this.cDocumentTypeID!=0)
			{
				if(cSql!="")
					cSql=cSql+" and DocumentTypeID ='"+this.cDocumentTypeID+"' " ;
				else
					cSql=cSql+" where DocumentTypeID ='"+this.cDocumentTypeID+"' " ;
			}
			if(this.cSecretGreadID!=0)
			{
				if(cSql!="")
					cSql=cSql+" and SecretGreadID ='"+this.cSecretGreadID+"' " ;
				else
					cSql=cSql+" where SecretGreadID ='"+this.cSecretGreadID+"' " ;
			}
			if(this.cDocumentID!=0)
			{
				if(cSql!="")
					cSql=cSql+" and DocumentID ='"+this.cDocumentID+"' " ;
				else
					cSql=cSql+" where DocumentID ='"+this.cDocumentID+"' " ;
			}
		
			
			if(cSearchKey!=null&&cSearchKey!="")  
			{
				if(cSql!="")
					cSql=cSql+" And ( DocumentHead  like '%"+cSearchKey+"%' or DocumentNumber  like '%"+cSearchKey+"%' or Title  like '%"+cSearchKey+"%' or MainSendComp  like '%"+cSearchKey+"%' or CopySendComp  like '%"+cSearchKey+"%' or DraftDepartment  like '%"+cSearchKey+"%' or SendDepartment  like '%"+cSearchKey+"%' or TopicWord  like '%"+cSearchKey+"%')";
				else
					cSql=cSql+" Where ( DocumentHead  like '%"+cSearchKey+"%' or DocumentNumber  like '%"+cSearchKey+"%' or Title  like '%"+cSearchKey+"%' or MainSendComp  like '%"+cSearchKey+"%' or CopySendComp  like '%"+cSearchKey+"%' or DraftDepartment  like '%"+cSearchKey+"%' or SendDepartment  like '%"+cSearchKey+"%' or TopicWord  like '%"+cSearchKey+"%')";
			}
			return cSql;

⌨️ 快捷键说明

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