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表 字段信息 /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: int; /// 数据长度: 4; /// 是否允许为空: N; /// 默认值: (0); /// 描述: 是否锁定; /// public const string cIsLock = "IsLock"; /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: int; /// 数据长度: 4; /// 是否允许为空: N; /// 默认值: (0); /// 描述: 是否使用; /// public const string cIsUse = "IsUse"; /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: varchar; /// 数据长度: 40; /// 是否允许为空: N; /// 默认值: ; /// 描述: 标准名称; /// public const string cNames = "Names"; /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: numeric; /// 数据长度: 5; /// 是否允许为空: N; /// 默认值: ; /// 描述: 超标限值; /// public const string cOvertopValue = "OvertopValue"; /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: numeric; /// 数据长度: 5; /// 是否允许为空: N; /// 默认值: ; /// 描述: 合格限值; /// public const string cRegularValue = "RegularValue"; /// /// 为关键字段: Y --- PrimaryKey; /// 自动增长: Y; /// 数据类型: int; /// 数据长度: 4; /// 是否允许为空: N; /// 默认值: ; /// 描述: 编号; /// 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 }