123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data;
- using SysBaseLibs;
- using System.Web.Script.Serialization;
- namespace SysDataLibs.TableClass
- {
- #region Evaluation
- public class Evaluation_info : ITableInfo
- {
- #region Evaluation表 字段信息
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: smalldatetime;
- /// 数据长度: 4;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 考评标准制定时间;
- /// </summary>
- public const string cEvaluationCreateTime = "EvaluationCreateTime";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: varchar;
- /// 数据长度: -1;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 考评说明;
- /// </summary>
- public const string cEvaluationDesc = "EvaluationDesc";
- /// <summary>
- /// 为关键字段: Y --- PrimaryKey;
- /// 自动增长: Y;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: EvaluationID;
- /// </summary>
- public const string cEvaluationID = "EvaluationID";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 100;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 考评标准名;
- /// </summary>
- public const string cEvaluationName = "EvaluationName";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 300;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 考评标准发布组织;
- /// </summary>
- public const string cEvaluationOrg = "EvaluationOrg";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 考评类型(M 市场类,S 摊贩类);
- /// </summary>
- public const string cEvaluationType = "EvaluationType";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: N;
- /// 默认值: (N'N');
- /// 描述: IsLock;
- /// </summary>
- public const string cIsLock = "IsLock";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 是否正在使用中;
- /// </summary>
- public const string cIsUser = "IsUser";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: smalldatetime;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: (getdate());
- /// 描述: TimeCreated;
- /// </summary>
- public const string cTimeCreated = "TimeCreated";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: smalldatetime;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: (getdate());
- /// 描述: TimeLastMod;
- /// </summary>
- public const string cTimeLastMod = "TimeLastMod";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: varchar;
- /// 数据长度: 30;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: UserIDLastMod;
- /// </summary>
- public const string cUserIDLastMod = "UserIDLastMod";
- #endregion
- public Evaluation_info() { }
- public Evaluation_info(DataRow poRow)
- {
- CreateTableInfo(poRow);
- }
- public void CreateTableInfo(DataRow poRow)
- {
- _EvaluationCreateTime = UtilStr.StrFromObj(poRow[cEvaluationCreateTime]);
- _EvaluationDesc = UtilStr.StrFromObj(poRow[cEvaluationDesc]);
- _EvaluationID = UtilStr.StrFromObj(poRow[cEvaluationID]);
- _EvaluationName = UtilStr.StrFromObj(poRow[cEvaluationName]);
- _EvaluationOrg = UtilStr.StrFromObj(poRow[cEvaluationOrg]);
- _EvaluationType = UtilStr.StrFromObj(poRow[cEvaluationType]);
- _IsLock = UtilStr.StrFromObj(poRow[cIsLock]);
- _IsUser = UtilStr.StrFromObj(poRow[cIsUser]);
- _TimeCreated = UtilStr.StrFromObj(poRow[cTimeCreated]);
- _TimeLastMod = UtilStr.StrFromObj(poRow[cTimeLastMod]);
- _UserIDLastMod = UtilStr.StrFromObj(poRow[cUserIDLastMod]);
- }
- public Evaluation_info(string pcEvaluationID, DBConnSql poDBConn)
- {
- if (pcEvaluationID.Trim().Length > 0 && poDBConn != null)
- {
- string lcSql = "select * from " + Tn.Evaluation + " where EvaluationID='" + pcEvaluationID + "'";
- rsQuery loQuery = poDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
- {
- loQuery.MoveFirst();
- CreateTableInfo(loQuery.CurrentRow);
- }
- }
- }
- public Evaluation_info(string pcType, bool IsUser, DBConnSql poDBConn)
- {
- string lcSql = "select * from " + Tn.Evaluation + " where " + Evaluation_info.cIsUser + "='" + (IsUser ? "Y" : "N") + "' and " + Evaluation_info.cEvaluationType + "='" + pcType + "' and " + Evaluation_info.cIsLock + "='N' ";
- rsQuery loQuery = poDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount > 0)
- {
- loQuery.MoveFirst();
- CreateTableInfo(loQuery.CurrentRow);
- }
- }
- private string _EvaluationCreateTime = "";
- public string EvaluationCreateTime
- {
- get { return _EvaluationCreateTime; }
- set { _EvaluationCreateTime = value; }
- }
- private string _EvaluationDesc = "";
- public string EvaluationDesc
- {
- get { return _EvaluationDesc; }
- set { _EvaluationDesc = value; }
- }
- private string _EvaluationID = "";
- public string EvaluationID
- {
- get { return _EvaluationID; }
- set { _EvaluationID = value; }
- }
- private string _EvaluationName = "";
- public string EvaluationName
- {
- get { return _EvaluationName; }
- set { _EvaluationName = value; }
- }
- private string _EvaluationOrg = "";
- public string EvaluationOrg
- {
- get { return _EvaluationOrg; }
- set { _EvaluationOrg = value; }
- }
- private string _EvaluationType = "";
- public string EvaluationType
- {
- get { return _EvaluationType; }
- set { _EvaluationType = value; }
- }
- private string _IsLock = "";
- public string IsLock
- {
- get { return _IsLock; }
- set { _IsLock = value; }
- }
- private string _IsUser = "";
- public string IsUser
- {
- get { return _IsUser; }
- set { _IsUser = value; }
- }
- private string _TimeCreated = "";
- public string TimeCreated
- {
- get { return _TimeCreated; }
- set { _TimeCreated = value; }
- }
- private string _TimeLastMod = "";
- public string TimeLastMod
- {
- get { return _TimeLastMod; }
- set { _TimeLastMod = value; }
- }
- private string _UserIDLastMod = "";
- public string UserIDLastMod
- {
- get { return _UserIDLastMod; }
- set { _UserIDLastMod = value; }
- }
- EvaluationItem_Qry _CurEvaluationItems;
- public EvaluationItem_Qry CurEvaluationItems
- {
- get
- {
- if (!(_CurEvaluationItems != null && _CurEvaluationItems.IsOpened))
- {
- UserSession loSession = WebLibs.CheckLogin();
- _CurEvaluationItems = new EvaluationItem_Qry();
- _CurEvaluationItems.Open("select * from " + Tn.EvaluationItem + " where " + EvaluationItem_info.cEvaluationID + "='" + this.EvaluationID + "' and " + cIsLock + "='N' order by ItemIndex ", loSession.DBConn);
- }
- return _CurEvaluationItems;
- }
- }
- [ScriptIgnore]
- public rsXmlNode DataXMLNode
- {
- get
- {
- rsXmlNode loMainNode = new rsXmlNode("EvaluationRecord", "");
- rsXmlNode loNode = null;
- loNode = new rsXmlNode(cEvaluationCreateTime, EvaluationCreateTime);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cEvaluationDesc, EvaluationDesc);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cEvaluationID, EvaluationID);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cEvaluationName, EvaluationName);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cEvaluationOrg, EvaluationOrg);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cEvaluationType, EvaluationType);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cIsLock, IsLock);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cIsUser, IsUser);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cTimeCreated, TimeCreated);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cTimeLastMod, TimeLastMod);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cUserIDLastMod, UserIDLastMod);
- loMainNode.AddChild(loNode);
- return loMainNode;
- }
- }
- public string InsertSql()
- {
- return " insert into " + Tn.Evaluation + " " +
- " (" + cEvaluationCreateTime + "," + cEvaluationDesc + "," + cEvaluationName + "," + cEvaluationOrg + "," + cEvaluationType + "," + cIsLock + "," + cIsUser + "," + cTimeCreated + "," + cTimeLastMod + "," + cUserIDLastMod + ") " +
- " values ('" + _EvaluationCreateTime + "','" + _EvaluationDesc + "','" + _EvaluationName + "','" + _EvaluationOrg + "','" + _EvaluationType + "','" + _IsLock + "','" + _IsUser + "','" + _TimeCreated + "','" + _TimeLastMod + "','" + _UserIDLastMod + "') ";
- }
- public string UpdateSql()
- {
- return " update " + Tn.Evaluation + " " +
- " set " + cEvaluationCreateTime + "='" + _EvaluationCreateTime + "'," + cEvaluationDesc + "='" + _EvaluationDesc + "'," + cEvaluationName + "='" + _EvaluationName + "'," + cEvaluationOrg + "='" + _EvaluationOrg + "'," + cEvaluationType + "='" + _EvaluationType + "'," + cIsLock + "='" + _IsLock + "'," + cIsUser + "='" + _IsUser + "'," + cTimeCreated + "='" + _TimeCreated + "'," + cTimeLastMod + "='" + _TimeLastMod + "'," + cUserIDLastMod + "='" + _UserIDLastMod + "' " +
- " where " + cEvaluationID + "=" + _EvaluationID + "";
- }
- public string DeleteSql()
- {
- return "Delete " + Tn.Evaluation + " where " + cEvaluationID + "=" + _EvaluationID + "";
- }
- public static bool update(string pcDeleteLine, string pcType ,DBConnSql poDBCon )
- {
- string lcSql = "update " + Tn.Evaluation + " set " + cIsLock + " ='" + pcType + "' where " + cEvaluationID + " in(" + pcDeleteLine + ")";
- if (!poDBCon.ExcuteSqlTran(lcSql))
- {
- JSComm.ShowMessage("操作失败!");
- }
- return true;
- }
-
- }
- #endregion
- #region
- public class Evaluation_Qry : rsQuery
- {
- public DateTime EvaluationCreateTime
- {
- get { return GetDateTime(Evaluation_info.cEvaluationCreateTime); }
- // set { SetField(Evaluation_info.cEvaluationCreateTime, value); }
- }
- public String EvaluationDesc
- {
- get { return GetString(Evaluation_info.cEvaluationDesc); }
- // set { SetField(Evaluation_info.cEvaluationDesc, value); }
- }
- public Int64 EvaluationID
- {
- get { return GetInt(Evaluation_info.cEvaluationID); }
- // set { SetField(Evaluation_info.cEvaluationID, value); }
- }
- public String EvaluationName
- {
- get { return GetString(Evaluation_info.cEvaluationName); }
- // set { SetField(Evaluation_info.cEvaluationName, value); }
- }
- public String EvaluationOrg
- {
- get { return GetString(Evaluation_info.cEvaluationOrg); }
- // set { SetField(Evaluation_info.cEvaluationOrg, value); }
- }
- public Boolean EvaluationType
- {
- get { return GetBool(Evaluation_info.cEvaluationType); }
- // set { SetField(Evaluation_info.cEvaluationType, value); }
- }
- public Boolean IsLock
- {
- get { return GetBool(Evaluation_info.cIsLock); }
- // set { SetField(Evaluation_info.cIsLock, value); }
- }
- public Boolean IsUser
- {
- get { return GetBool(Evaluation_info.cIsUser); }
- // set { SetField(Evaluation_info.cIsUser, value); }
- }
- public DateTime TimeCreated
- {
- get { return GetDateTime(Evaluation_info.cTimeCreated); }
- // set { SetField(Evaluation_info.cTimeCreated, value); }
- }
- public DateTime TimeLastMod
- {
- get { return GetDateTime(Evaluation_info.cTimeLastMod); }
- // set { SetField(Evaluation_info.cTimeLastMod, value); }
- }
- public String UserIDLastMod
- {
- get { return GetString(Evaluation_info.cUserIDLastMod); }
- // set { SetField(Evaluation_info.cUserIDLastMod, value); }
- }
- }
- #endregion
- }
|