123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data;
- using SysBaseLibs;
- using System.Web.Script.Serialization;
- using System.Web.UI.HtmlControls;
- namespace SysDataLibs.TableClass
- {
- #region LawRule
- public class LawRule_info : ITableInfo
- {
- #region LawRule表 字段信息
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: text;
- /// 数据长度: 16;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 内容;
- /// </summary>
- public const string cContent = "Content";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: varchar;
- /// 数据长度: 200;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 下载地址;
- /// </summary>
- public const string cDownUrl = "DownUrl";
- /// <summary>
- /// 为关键字段: Y --- PrimaryKey;
- /// 自动增长: Y;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 编号;
- /// </summary>
- public const string cLawRuleId = "LawRuleId";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 400;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 法规名称;
- /// </summary>
- public const string cLawRuleName = "LawRuleName";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 法规类型;
- /// </summary>
- public const string cLawRuleTypeId = "LawRuleTypeId";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: smalldatetime;
- /// 数据长度: 4;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 发布日期;
- /// </summary>
- public const string cpromulgateDate = "promulgateDate";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 200;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 发布者;
- /// </summary>
- public const string cpromulgator = "promulgator";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: smalldatetime;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 更新时间;
- /// </summary>
- public const string cUpdateTime = "UpdateTime";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: varchar;
- /// 数据长度: 20;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 用户编号;
- /// </summary>
- public const string cUserId = "UserId";
- #endregion
- public LawRule_info() { }
- public LawRule_info(DataRow poRow)
- {
- CreateTableInfo(poRow);
- }
- public void CreateTableInfo(DataRow poRow)
- {
- _Content = UtilStr.StrFromObj(poRow[cContent]);
- _DownUrl = UtilStr.StrFromObj(poRow[cDownUrl]);
- _LawRuleId = UtilStr.StrFromObj(poRow[cLawRuleId]);
- _LawRuleName = UtilStr.StrFromObj(poRow[cLawRuleName]);
- _LawRuleTypeId = UtilStr.StrFromObj(poRow[cLawRuleTypeId]);
- _promulgateDate = UtilStr.StrFromObj(poRow[cpromulgateDate]);
- _promulgator = UtilStr.StrFromObj(poRow[cpromulgator]);
- _UpdateTime = UtilStr.StrFromObj(poRow[cUpdateTime]);
- _UserId = UtilStr.StrFromObj(poRow[cUserId]);
- }
- public LawRule_info(string pcLawRuleId, DBConnSql poDBConn)
- {
- if (pcLawRuleId.Trim().Length > 0 && poDBConn != null)
- {
- string lcSql = "select * from " + Tn.LawRule + " where LawRuleId='" + pcLawRuleId + "'";
- rsQuery loQuery = poDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
- {
- loQuery.MoveFirst();
- CreateTableInfo(loQuery.CurrentRow);
- }
- }
- }
- private string _Content = "";
- public string Content
- {
- get { return _Content; }
- set { _Content = value; }
- }
- private string _DownUrl = "";
- public string DownUrl
- {
- get { return _DownUrl; }
- set { _DownUrl = value; }
- }
- private string _LawRuleId = "";
- public string LawRuleId
- {
- get { return _LawRuleId; }
- set { _LawRuleId = value; }
- }
- private string _LawRuleName = "";
- public string LawRuleName
- {
- get { return _LawRuleName; }
- set { _LawRuleName = value; }
- }
- private string _LawRuleTypeId = "";
- public string LawRuleTypeId
- {
- get { return _LawRuleTypeId; }
- set { _LawRuleTypeId = value; }
- }
- private string _promulgateDate = "";
- public string promulgateDate
- {
- get { return _promulgateDate; }
- set { _promulgateDate = value; }
- }
- private string _promulgator = "";
- public string promulgator
- {
- get { return _promulgator; }
- set { _promulgator = value; }
- }
- private string _UpdateTime = "";
- public string UpdateTime
- {
- get { return _UpdateTime; }
- set { _UpdateTime = value; }
- }
- private string _UserId = "";
- public string UserId
- {
- get { return _UserId; }
- set { _UserId = value; }
- }
- [ScriptIgnore]
- public rsXmlNode DataXMLNode
- {
- get
- {
- rsXmlNode loMainNode = new rsXmlNode("LawRuleRecord", "");
- rsXmlNode loNode = null;
- loNode = new rsXmlNode(cContent, Content);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cDownUrl, DownUrl);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cLawRuleId, LawRuleId);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cLawRuleName, LawRuleName);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cLawRuleTypeId, LawRuleTypeId);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cpromulgateDate, promulgateDate);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cpromulgator, promulgator);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cUpdateTime, UpdateTime);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cUserId, UserId);
- loMainNode.AddChild(loNode);
- return loMainNode;
- }
- }
- public string InsertSql()
- {
- return " insert into " + Tn.LawRule + " " +
- " (" + cContent + "," + cDownUrl + "," + cLawRuleName + "," + cLawRuleTypeId + "," + cpromulgateDate + "," + cpromulgator + "," + cUpdateTime + "," + cUserId + ") " +
- " values ('" + _Content + "','" + _DownUrl + "','" + _LawRuleName + "'," + _LawRuleTypeId + ",'" + _promulgateDate + "','" + _promulgator + "','" + _UpdateTime + "','" + _UserId + "') ";
- }
- public string UpdateSql()
- {
- return " update " + Tn.LawRule + " " +
- " set " + cContent + "='" + _Content + "'," + cDownUrl + "='" + _DownUrl + "'," + cLawRuleName + "='" + _LawRuleName + "'," + cLawRuleTypeId + "=" + _LawRuleTypeId + "," + cpromulgateDate + "='" + _promulgateDate + "'," + cpromulgator + "='" + _promulgator + "'," + cUpdateTime + "='" + _UpdateTime + "'," + cUserId + "='" + _UserId + "' " +
- " where " + cLawRuleId + "=" + _LawRuleId + "";
- }
- public string DeleteSql()
- {
- return "Delete " + Tn.LawRule + " where " + cLawRuleId + "=" + _LawRuleId + "";
- }
- public static void PrintLawRuleInfo(HtmlTable poTable, string pcType, UserSession poSession, string pcCurId)
- {
- if (poTable != null && pcType.Trim().Length > 0 && poSession != null && poSession.DBConn != null)
- {
- string lcSql = "select Top 50 * from LawRule where LawRuleTypeId='" + pcType + "'";
- rsQuery loQuery = poSession.DBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount > 0)
- {
- loQuery.SortBy("UpdateTime", false);
- loQuery.MoveFirst();
- for (int i = 0; i < loQuery.RecCount; i++)
- {
- string lcColor = "#C6DBFF";
- bool lbIsCurLine = pcCurId == loQuery.GetString("LawRuleId");
- if (lbIsCurLine)
- lcColor = "#8CAAE7";
- HtmlTableRow loRow = new HtmlTableRow();
- HtmlTableCell loCell = new HtmlTableCell();
- loCell.Attributes.Add("bgcolor", lcColor);
- loCell.InnerText = (i + 1) + "";
- loRow.Cells.Add(loCell);
- loCell = new HtmlTableCell();
- string lcTitle = loQuery.GetString("LawRuleName");
- if (lcTitle.Length < 60)
- {
- lcTitle += UtilStr.Replicate(" ", 60 - lcTitle.Length);
- }
- if (lbIsCurLine)
- {
- loCell.InnerHtml = string.Format("<div id='row{0}'>{1}</div>\n", loQuery.GetString("LawRuleId"), lcTitle);
- }
- else
- {
- loCell.InnerHtml = string.Format("<div style='CURSOR:hand' onclick=\"javascript:ShowContextById({0})\" id='row{0}'>{1}</div>\n", loQuery.GetString("LawRuleId"), lcTitle);
- }
- loCell.Attributes.Add("bgcolor", lcColor);
- loRow.Cells.Add(loCell);
- loCell = new HtmlTableCell();
- loCell.InnerText = loQuery.GetString("promulgator");
- loCell.Attributes.Add("bgcolor", lcColor);
- loRow.Cells.Add(loCell);
- loCell = new HtmlTableCell();
- loCell.InnerHtml = string.Format("{0:d}", loQuery.GetDateTime("promulgateDate"));
- loCell.Attributes.Add("bgcolor", lcColor);
- loRow.Cells.Add(loCell);
- poTable.Rows.Add(loRow);
- loCell = new HtmlTableCell();
- string lcDownUrl = loQuery.GetString("DownUrl");
- if (lcDownUrl.Trim().Length > 0)
- {
- string ext = lcDownUrl.Substring(lcDownUrl.LastIndexOf(".") + 1, lcDownUrl.Length - lcDownUrl.LastIndexOf(".") - 1);
- ext = UtilStr.UAndT(ext);
- string lcImg = "RICON100.GIF";
- if (ext == "DOC"||ext=="DOCS"||ext == "DOCX")
- {
- lcImg = "ICON-WORD.GIF";
- }
- else if (ext == "XLS"||ext=="XLSX")
- {
- lcImg = "ICON-EXCEL.GIF";
- }
- else if (ext == "TXT")
- {
- lcImg = "ftv2doc_3.gif";
- }
- lcDownUrl = "../" + SysDataLibs.AppEnv.SysSetObj.GetString("UPLOADPATH") + "/" + SysDataLibs.AppEnv.SysSetObj.GetString("LawRuleDown") + "/" + lcDownUrl; //SysBaseLibs.AppConfig.ReadString("DownLoadPath") + lcDownUrl;
- loCell.InnerHtml = string.Format(" <a href =\"{0}\"> <IMG style=\"CURSOR: hand\" title=\"下载\" src=\"../Images/{1}\"></a>", lcDownUrl, lcImg);
- }
- else
- {
- loCell.InnerHtml = "没有附件";
- }
- loCell.Attributes.Add("bgcolor", lcColor);
- loCell.Attributes.Add("align", "center");
- loRow.Cells.Add(loCell);
- poTable.Rows.Add(loRow);
- if (lbIsCurLine)
- {
- loRow = new HtmlTableRow();
- loCell = new HtmlTableCell();
- loCell.Attributes.Add("bgcolor", lcColor);
- loCell.Attributes.Add("colspan", "5");
- loCell.InnerHtml = loQuery.GetString("Content");
- loCell.Attributes.Add("bgcolor", "#FFFBF7");
- loRow.Cells.Add(loCell);
- poTable.Rows.Add(loRow);
- }
- loQuery.MoveNext();
- }
- }
- }
- }
- }
- #endregion
- #region
- public class LawRule_Qry : rsQuery
- {
- public String Content
- {
- get { return GetString(LawRule_info.cContent); }
- // set { SetField(LawRule_info.cContent, value); }
- }
-
- public String DownUrl
- {
- get { return GetString(LawRule_info.cDownUrl); }
- // set { SetField(LawRule_info.cDownUrl, value); }
- }
-
- public Int64 LawRuleId
- {
- get { return GetInt(LawRule_info.cLawRuleId); }
- // set { SetField(LawRule_info.cLawRuleId, value); }
- }
-
- public String LawRuleName
- {
- get { return GetString(LawRule_info.cLawRuleName); }
- // set { SetField(LawRule_info.cLawRuleName, value); }
- }
-
- public Int64 LawRuleTypeId
- {
- get { return GetInt(LawRule_info.cLawRuleTypeId); }
- // set { SetField(LawRule_info.cLawRuleTypeId, value); }
- }
-
- public DateTime promulgateDate
- {
- get { return GetDateTime(LawRule_info.cpromulgateDate); }
- // set { SetField(LawRule_info.cpromulgateDate, value); }
- }
-
- public String promulgator
- {
- get { return GetString(LawRule_info.cpromulgator); }
- // set { SetField(LawRule_info.cpromulgator, value); }
- }
-
- public DateTime UpdateTime
- {
- get { return GetDateTime(LawRule_info.cUpdateTime); }
- // set { SetField(LawRule_info.cUpdateTime, value); }
- }
-
- public String UserId
- {
- get { return GetString(LawRule_info.cUserId); }
- // set { SetField(LawRule_info.cUserId, value); }
- }
-
- }
- #endregion
- }
|