123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data;
- using SysBaseLibs;
- using System.Web.Script.Serialization;
- namespace SysDataLibs.TableClass
- {
- #region PlatRegDsn
- public class PlatRegDsn_info : ITableInfo
- {
- #region PlatRegDsn表 字段信息
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 100;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: Description;
- /// </summary>
- public const string cDescription = "Description";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: varchar;
- /// 数据长度: 50;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: PlatDsName;
- /// </summary>
- public const string cPlatDsName = "PlatDsName";
- /// <summary>
- /// 为关键字段: Y --- PrimaryKey;
- /// 自动增长: N;
- /// 数据类型: varchar;
- /// 数据长度: 50;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: TableId;
- /// </summary>
- public const string cTableId = "TableId";
- #endregion
- public PlatRegDsn_info(){}
-
- public PlatRegDsn_info(DataRow poRow)
- {
- CreateTableInfo(poRow);
- }
-
- public void CreateTableInfo(DataRow poRow)
- {
- _Description=UtilStr.StrFromObj(poRow[cDescription]);
- _PlatDsName=UtilStr.StrFromObj(poRow[cPlatDsName]);
- _TableId=UtilStr.StrFromObj(poRow[cTableId]);
- }
-
- public PlatRegDsn_info( string pcTableId, DBConnSql poDBConn)
- {
- if ( pcTableId.Trim().Length > 0 && poDBConn != null)
- {
- string lcSql = "select * from " + Tn.PlatRegDsn + " where TableId='"+pcTableId+"'";
- rsQuery loQuery = poDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
- {
- loQuery.MoveFirst();
- CreateTableInfo(loQuery.CurrentRow);
- }
- }
- }
- private string _Description="";
- public string Description
- {
- get { return _Description; }
- set { _Description = value; }
- }
-
- private string _PlatDsName="";
- public string PlatDsName
- {
- get { return _PlatDsName; }
- set { _PlatDsName = value; }
- }
-
- private string _TableId="";
- public string TableId
- {
- get { return _TableId; }
- set { _TableId = value; }
- }
-
- [ScriptIgnore]
- public rsXmlNode DataXMLNode
- {
- get
- {
- rsXmlNode loMainNode = new rsXmlNode("PlatRegDsnRecord", "");
- rsXmlNode loNode =null;
- loNode = new rsXmlNode(cDescription, Description);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cPlatDsName, PlatDsName);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cTableId, TableId);
- loMainNode.AddChild(loNode);
- return loMainNode ;
- }
- }
- public string InsertSql()
- {
- return " insert into "+Tn.PlatRegDsn+" "+
- " ("+cDescription+","+cPlatDsName+","+cTableId+") "+
- " values ('"+_Description+"','"+_PlatDsName+"','"+_TableId+"') " ;
- }
-
- public string UpdateSql()
- {
- return " update "+Tn.PlatRegDsn+" "+
- " set "+cDescription+"='"+_Description+"',"+cPlatDsName+"='"+_PlatDsName+"' "+
- " where "+cTableId+"='"+_TableId+"'" ;
- }
-
- public string DeleteSql()
- {
- return "Delete "+Tn.PlatRegDsn+" where "+cTableId+"='"+_TableId+"'" ;
- }
- }
- #endregion
- #region
- public class PlatRegDsn_Qry : rsQuery
- {
- public String Description
- {
- get { return GetString(PlatRegDsn_info.cDescription); }
- // set { SetField(PlatRegDsn_info.cDescription, value); }
- }
-
- public String PlatDsName
- {
- get { return GetString(PlatRegDsn_info.cPlatDsName); }
- // set { SetField(PlatRegDsn_info.cPlatDsName, value); }
- }
-
- public String TableId
- {
- get { return GetString(PlatRegDsn_info.cTableId); }
- // set { SetField(PlatRegDsn_info.cTableId, value); }
- }
-
- }
- #endregion
- }
|