MessageData.cs
上传用户:autodoor
上传日期:2022-08-04
资源大小:9973k
文件大小:4k
- using System;
- using System.Data;
- using System.Data.SqlClient;
- namespace qminoa.Common.Data
- {
- /// <summary>
- /// MessageData 的摘要说明。
- /// </summary>
- public class MessageData :DataSet
- {
- //
- // 内存中信息数据表字段常量,该表来自实际数据表MsgCont,MsgAdd表示了一条信息的详细信息
- // 没有实际的物理表与之对应。
- //
- /// <value>用于数据表名的常量 </value>
- public const string MESSAGE_TABLE ="messages";
-
- //---------------------------------------------------------------------
- //以下指明字段常量
- /// <value>指明信息ID号。</value>
- public const string MESSAGEID_FIELD ="MessageID";
- /// <value>指明信息发出的时间。</value>
- public const string MESSAGESENDTIME_FIELD = "SendDate";
- /// <value>指明此信息被浏览的最新时间。</value>
- public const string MESSAGESEETIME_FIELD = "SeeData";
- /// <value>指明发件人ID号。</value>
- public const string MESSAGEPERSON_FIELD ="MsgPerson";
- /// <value>指明收件人。</value>
- public const string SENDTO_FIELD = "SendTo";
- /// <value>指明密送人。</value>
- public const string SECRETTO_FIELD = "SecretTo";
- /// <value>指明附件。</value>
- public const string ACCESSORY_FIELD = "Accessory";
- /// <value>指明附件编号。</value>
- public const string ACCESSORYID_FIELD = "AccessoryID";
- /// <value>指明信息标题。</value>
- public const string TITLE_FIELD = "Title";
- /// <value>指明信息级别。</value>
- public const string Level_FIELD = "SendLevel";
- /// <value>指明信息内容。</value>
- public const string CONTENT_FIELD = "Content";
- /// <value>指明此信息被浏览的次数 </value>
- public const string WATCHTIMES_FIELD = "Times";
- /// <value>指明此信息现在的状态</value>
- public const string STATUS_FIELD = "Status";
- /// <value>指明该条信息的具体接收人</value>
- public const string RESIVE_FIELD = "ResivePerson";
- /// <value> 指明该信息具体接收人ID</value>
- public const string RESIVEID_FIELD = "ResivePersonID";
- /// <value> 指明该信息是否为重要信息 </value>
- public const string IMPORTANT_FIELD = "Important";
- /// <value> 指明该条信息的阅读代号</value>
- public const string REID_FIELD = "reID";
- public MessageData()
- {
- BuildTable();
- }
- //---------------------------------------------------------------
- //方法:构造内存中的数据表
- //数据表名:message
- //---------------------------------------------------------------
- public void BuildTable()
- {
- DataTable table = new DataTable(MESSAGE_TABLE);
- DataColumnCollection columns = table.Columns;
-
- //开始往数据表中添加列
- columns.Add(MESSAGEID_FIELD,typeof(System.Int32));
- columns.Add(MESSAGESENDTIME_FIELD,typeof(System.DateTime));
- columns.Add(MESSAGESEETIME_FIELD,typeof(System.DateTime));
- columns.Add(MESSAGEPERSON_FIELD,typeof(System.String));
- columns.Add(SENDTO_FIELD,typeof(System.String));
- columns.Add(SECRETTO_FIELD,typeof(System.String));
- columns.Add(ACCESSORY_FIELD,typeof(System.String));
- columns.Add(ACCESSORYID_FIELD,typeof(System.String));
- columns.Add(TITLE_FIELD,typeof(System.String));
- columns.Add(Level_FIELD,typeof(System.Int16));
- columns.Add(CONTENT_FIELD,typeof(System.String));
- columns.Add(WATCHTIMES_FIELD,typeof(System.Int16));
- columns.Add(STATUS_FIELD,typeof(System.Int32));
- columns.Add(RESIVE_FIELD,typeof(System.String));
- columns.Add(REID_FIELD,typeof(System.Int32));
- columns.Add(RESIVEID_FIELD,typeof(System.Int32));
- columns.Add(IMPORTANT_FIELD,typeof(System.Boolean));
- //添加列结束
- this.Tables.Add(table);
- }
- }
- }