DocData.cs
上传用户:autodoor
上传日期:2022-08-04
资源大小:9973k
文件大小:5k
- using System;
- using System.Data;
- namespace qminoa.Common.Data
- {
- /// <summary>
- /// DocData 的摘要说明。
- /// </summary>
- public class DocData:DataSet
- {
- protected const string DOCID="DocID";
- protected const string TITLE="Title";
- protected const string SUBTITLE="SubTitle";
- protected const string DOCCLASS="DocClass";
- protected const string CURLINK="CurLink";
- protected const string GOEDTIME="Days";
- protected const string CREATETIME="CreateTime";
- protected const string STATE="State";
- protected const string SEND_TABLE="SendedTableInfo";
- protected const string TEMPLATEID="TemplateID";
- protected const string RECORDID="RecordID";
- protected const string FILENAEM="FileName";
- protected const string FILETPE="FileType";
- protected const string FILEDATE="FileDate";
- protected const string FILEBODY="FileBody";
- protected const string FILEPATH="FilePath";
- protected const string USERNAME="UserName";
- protected const string DESCRIPT="Descript";
- public const string TEMPLATE_TABLE="TemplateTable";
- public const string DOCCLASS_TABLE = "docClass";
-
- public const string CLASSID_FIELD = "ClassID";
- public const string CLASSNAME_FIELD = "CLASSNAME";
- //公文表
- public const string DOC_TABLE = "doc";
-
- public const string DOCID_FIELD = "DocID";
- public const string EMPNAME_FIELD = "EName";
- public const string TITLE_FIELD = "Title";
- public const string SUBTITLE_FIELD = "SubTitle";
- public const string ROUTEID_FIELE = "RouteID";
- public const string SAVMONTHS_FIELD = "SavMonths";
- public const string CONTEXT_FIELD = "Context";
- public const string NOTE_FIELD = "Note";
- public const string STATUS_FIELD = "Status";
- public const string CONFDATE_FIELD = "ConfDate";
- public const string NEXTCONFNAME_FIELD = "NextConfName";
- public const string NEXTCONFID_FIELD = "NextConfID";
- public const string NEXTAGENTID_FIELD = "NextAgentID";
- public const string ATTFLAG_FIELD = "AttFlag";
- public const string SENDDATE_FIELD = "SendDate";
-
- //用于对新建表的列集和列的引用
- protected DataColumnCollection columns;
- protected DataColumn column;
- public DocData()
- {
- BuildDataTables();
- }
- protected void BuildDataTables()
- {
- //创建发送表
- DataTable table=new DataTable(SEND_TABLE);
- DataColumnCollection columns=table.Columns;
- column=columns.Add(DOCID,typeof(System.String ));
- column.AllowDBNull=false;
- column.AutoIncrement=true;
- columns.Add(TITLE,typeof(System.String)).AllowDBNull=false;
- columns.Add(SUBTITLE,typeof(System.String));
- columns.Add(DOCCLASS,typeof(System.String));
- columns.Add(CURLINK,typeof(System.String));
- columns.Add(GOEDTIME,typeof(System.String));
- columns.Add(CREATETIME,typeof(System.String));
- columns.Add(STATE,typeof(System.String));
- this.Tables.Add(table);
-
- //创建公文类别表
- DataTable docClassTable = new DataTable(DOCCLASS_TABLE);
- columns = docClassTable.Columns;
- column = columns.Add(CLASSID_FIELD,typeof(System.Int32));
- column.AllowDBNull = false;
- column.AutoIncrement = true;
- columns.Add(CLASSNAME_FIELD,typeof(System.String)).AllowDBNull = false;
- this.Tables.Add(docClassTable);
- //创建公文表
- DataTable docTable = new DataTable(DOC_TABLE);
- columns = docTable.Columns;
- column = columns.Add(DOCID_FIELD,typeof(System.Int32));
- column.AllowDBNull = false;
- column.AutoIncrement = true;
- columns.Add(EMPNAME_FIELD,typeof(System.String));
- columns.Add(TITLE_FIELD,typeof(System.String));
- columns.Add(SUBTITLE_FIELD,typeof(System.String));
- columns.Add(ROUTEID_FIELE,typeof(System.Int32));
- columns.Add(SAVMONTHS_FIELD,typeof(System.Int32));
- columns.Add(CONTEXT_FIELD,typeof(System.String));
- columns.Add(NOTE_FIELD,typeof(System.String));
- columns.Add(STATUS_FIELD,typeof(System.String));
- columns.Add(CONFDATE_FIELD,typeof(System.DateTime));
- columns.Add(NEXTCONFNAME_FIELD,typeof(System.String));
- columns.Add(NEXTCONFID_FIELD,typeof(System.Int32));
- columns.Add(NEXTAGENTID_FIELD,typeof(System.Int32));
- columns.Add(CLASSNAME_FIELD,typeof(System.String));
- columns.Add(ATTFLAG_FIELD,typeof(System.Boolean));
- columns.Add(SENDDATE_FIELD,typeof(System.DateTime));
- this.Tables.Add(docTable);
- //创建模板表
- DataTable Temtable=new DataTable(TEMPLATE_TABLE);
- columns=Temtable.Columns;
- column=columns.Add(TEMPLATEID,typeof(System.Int32 ));
- column.AllowDBNull=false;
- column.AutoIncrement=true;
- column.AutoIncrementSeed=1;
- column.AutoIncrementStep=1;
- columns.Add(RECORDID,typeof(System.String));
- columns.Add(FILENAEM,typeof(System.String));
- columns.Add(FILETPE,typeof(System.String));
- columns.Add(FILEDATE,typeof(System.String));
- columns.Add(FILEBODY,typeof(System.String));
- columns.Add(FILEPATH,typeof(System.String));
- columns.Add(USERNAME,typeof(System.String));
- columns.Add(DESCRIPT,typeof(System.String));
- this.Tables.Add(Temtable);
- }
-
- }
- }