123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data;
- using SysBaseLibs;
- using System.Web.Script.Serialization;
- namespace SysDataLibs.TableClass
- {
- #region Standard
- public class Standard_info : ITableInfo
- {
- #region Standard表 字段信息
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: (0);
- /// 描述: 是否锁定;
- /// </summary>
- public const string cIsLock = "IsLock";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: (0);
- /// 描述: 是否使用;
- /// </summary>
- public const string cIsUse = "IsUse";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: varchar;
- /// 数据长度: 40;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 标准名称;
- /// </summary>
- public const string cNames = "Names";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: numeric;
- /// 数据长度: 5;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 超标限值;
- /// </summary>
- public const string cOvertopValue = "OvertopValue";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: numeric;
- /// 数据长度: 5;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 合格限值;
- /// </summary>
- public const string cRegularValue = "RegularValue";
- /// <summary>
- /// 为关键字段: Y --- PrimaryKey;
- /// 自动增长: Y;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 编号;
- /// </summary>
- public const string cStandardID = "StandardID";
- #endregion
- public Standard_info() { }
- public Standard_info(DataRow poRow)
- {
- CreateTableInfo(poRow);
- }
- public void CreateTableInfo(DataRow poRow)
- {
- _IsLock = UtilStr.StrFromObj(poRow[cIsLock]);
- _IsUse = UtilStr.StrFromObj(poRow[cIsUse]);
- _Names = UtilStr.StrFromObj(poRow[cNames]);
- _OvertopValue = UtilStr.StrFromObj(poRow[cOvertopValue]);
- _RegularValue = UtilStr.StrFromObj(poRow[cRegularValue]);
- _StandardID = UtilStr.StrFromObj(poRow[cStandardID]);
- }
- public Standard_info(string pcStandardID, DBConnSql poDBConn)
- {
- if (pcStandardID.Trim().Length > 0 && poDBConn != null)
- {
- string lcSql = "select * from " + Tn.Standard + " where StandardID='" + pcStandardID + "'";
- rsQuery loQuery = poDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
- {
- loQuery.MoveFirst();
- CreateTableInfo(loQuery.CurrentRow);
- }
- }
- }
- private string _IsLock = "";
- public string IsLock
- {
- get
- {
- return _IsLock;
- }
- set { _IsLock = value; }
- }
- private string _IsUse = "";
- public string IsUse
- {
- get { return _IsUse; }
- set { _IsUse = value; }
- }
- private string _Names = "";
- public string Names
- {
- get { return _Names; }
- set { _Names = value; }
- }
- private string _OvertopValue = "";
- public string OvertopValue
- {
- get { return _OvertopValue; }
- set { _OvertopValue = value; }
- }
- private string _RegularValue = "";
- public string RegularValue
- {
- get { return _RegularValue; }
- set { _RegularValue = value; }
- }
- private string _StandardID = "";
- public string StandardID
- {
- get { return _StandardID; }
- set { _StandardID = value; }
- }
- [ScriptIgnore]
- public rsXmlNode DataXMLNode
- {
- get
- {
- rsXmlNode loMainNode = new rsXmlNode("StandardRecord", "");
- rsXmlNode loNode = null;
- loNode = new rsXmlNode(cIsLock, IsLock);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cIsUse, IsUse);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cNames, Names);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cOvertopValue, OvertopValue);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cRegularValue, RegularValue);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cStandardID, StandardID);
- loMainNode.AddChild(loNode);
- return loMainNode;
- }
- }
- public string InsertSql()
- {
- return " insert into " + Tn.Standard + " " +
- " (" + cIsLock + "," + cIsUse + "," + cNames + "," + cOvertopValue + "," + cRegularValue + ") " +
- " values (" + _IsLock + "," + _IsUse + ",'" + _Names + "','" + _OvertopValue + "','" + _RegularValue + "') ";
- }
- public string UpdateSql()
- {
- return " update " + Tn.Standard + " " +
- " set " + cIsLock + "=" + _IsLock + "," + cIsUse + "=" + _IsUse + "," + cNames + "='" + _Names + "'," + cOvertopValue + "='" + _OvertopValue + "'," + cRegularValue + "='" + _RegularValue + "' " +
- " where " + cStandardID + "=" + _StandardID + "";
- }
- public string DeleteSql()
- {
- return "Delete " + Tn.Standard + " where " + cStandardID + "=" + _StandardID + "";
- }
- }
- #endregion
- #region
- public class Standard_Qry : rsQuery
- {
- public Int64 IsLock
- {
- get { return GetInt(Standard_info.cIsLock); }
- // set { SetField(Standard_info.cIsLock, value); }
- }
- public Int64 IsUse
- {
- get { return GetInt(Standard_info.cIsUse); }
- // set { SetField(Standard_info.cIsUse, value); }
- }
- public String Names
- {
- get { return GetString(Standard_info.cNames); }
- // set { SetField(Standard_info.cNames, value); }
- }
- public Decimal OvertopValue
- {
- get { return GetDecimal(Standard_info.cOvertopValue); }
- // set { SetField(Standard_info.cOvertopValue, value); }
- }
- public Decimal RegularValue
- {
- get { return GetDecimal(Standard_info.cRegularValue); }
- // set { SetField(Standard_info.cRegularValue, value); }
- }
- public Int64 StandardID
- {
- get { return GetInt(Standard_info.cStandardID); }
- // set { SetField(Standard_info.cStandardID, value); }
- }
- }
- #endregion
- }
|