using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using SysBaseLibs;
using System.Web.Script.Serialization;
namespace SysDataLibs.TableClass
{
#region EvaluationItem
public class EvaluationItem_info : ITableInfo
{
#region EvaluationItem表 字段信息
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: int;
/// 数据长度: 4;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: EvaluationID;
///
public const string cEvaluationID = "EvaluationID";
///
/// 为关键字段: Y --- PrimaryKey;
/// 自动增长: Y;
/// 数据类型: int;
/// 数据长度: 4;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: EvaluationItemID;
///
public const string cEvaluationItemID = "EvaluationItemID";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: nvarchar;
/// 数据长度: -1;
/// 是否允许为空: Y;
/// 默认值: ;
/// 描述: EvaluationNorm;
///
public const string cEvaluationNorm = "EvaluationNorm";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: nchar;
/// 数据长度: 2;
/// 是否允许为空: N;
/// 默认值: (N'N');
/// 描述: IsLock;
///
public const string cIsLock = "IsLock";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: varchar;
/// 数据长度: -1;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: ItemContent;
///
public const string cItemContent = "ItemContent";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: smallint;
/// 数据长度: 2;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: ItemIndex;
///
public const string cItemIndex = "ItemIndex";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: smallint;
/// 数据长度: 2;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: Score;
///
public const string cScore = "Score";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: smalldatetime;
/// 数据长度: 4;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: TimeCreated;
///
public const string cTimeCreated = "TimeCreated";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: smalldatetime;
/// 数据长度: 4;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: TimeLastMod;
///
public const string cTimeLastMod = "TimeLastMod";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: varchar;
/// 数据长度: 30;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: UserIDLastMod;
///
public const string cUserIDLastMod = "UserIDLastMod";
#endregion
public EvaluationItem_info() { }
public EvaluationItem_info(DataRow poRow)
{
CreateTableInfo(poRow);
}
public void CreateTableInfo(DataRow poRow)
{
_EvaluationID = UtilStr.StrFromObj(poRow[cEvaluationID]);
_EvaluationItemID = UtilStr.StrFromObj(poRow[cEvaluationItemID]);
_EvaluationNorm = UtilStr.StrFromObj(poRow[cEvaluationNorm]);
_IsLock = UtilStr.StrFromObj(poRow[cIsLock]);
_ItemContent = UtilStr.StrFromObj(poRow[cItemContent]);
_ItemIndex = UtilStr.StrFromObj(poRow[cItemIndex]);
_Score = UtilStr.StrFromObj(poRow[cScore]);
_TimeCreated = UtilStr.StrFromObj(poRow[cTimeCreated]);
_TimeLastMod = UtilStr.StrFromObj(poRow[cTimeLastMod]);
_UserIDLastMod = UtilStr.StrFromObj(poRow[cUserIDLastMod]);
}
public EvaluationItem_info(string pcEvaluationItemID, DBConnSql poDBConn)
{
if (pcEvaluationItemID.Trim().Length > 0 && poDBConn != null)
{
string lcSql = "select * from " + Tn.EvaluationItem + " where EvaluationItemID='" + pcEvaluationItemID + "'";
rsQuery loQuery = poDBConn.OpenQuery(lcSql);
if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
{
loQuery.MoveFirst();
CreateTableInfo(loQuery.CurrentRow);
}
}
}
private string _EvaluationID = "";
public string EvaluationID
{
get { return _EvaluationID; }
set { _EvaluationID = value; }
}
private string _EvaluationItemID = "";
public string EvaluationItemID
{
get { return _EvaluationItemID; }
set { _EvaluationItemID = value; }
}
private string _EvaluationNorm = "";
public string EvaluationNorm
{
get { return _EvaluationNorm; }
set { _EvaluationNorm = value; }
}
private string _IsLock = "";
public string IsLock
{
get { return _IsLock; }
set { _IsLock = value; }
}
private string _ItemContent = "";
public string ItemContent
{
get { return _ItemContent; }
set { _ItemContent = value; }
}
private string _ItemIndex = "";
public string ItemIndex
{
get { return _ItemIndex; }
set { _ItemIndex = value; }
}
private string _Score = "";
public string Score
{
get { return _Score; }
set { _Score = 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; }
}
[ScriptIgnore]
public rsXmlNode DataXMLNode
{
get
{
rsXmlNode loMainNode = new rsXmlNode("EvaluationItemRecord", "");
rsXmlNode loNode = null;
loNode = new rsXmlNode(cEvaluationID, EvaluationID);
loMainNode.AddChild(loNode);
loNode = new rsXmlNode(cEvaluationItemID, EvaluationItemID);
loMainNode.AddChild(loNode);
loNode = new rsXmlNode(cEvaluationNorm, EvaluationNorm);
loMainNode.AddChild(loNode);
loNode = new rsXmlNode(cIsLock, IsLock);
loMainNode.AddChild(loNode);
loNode = new rsXmlNode(cItemContent, ItemContent);
loMainNode.AddChild(loNode);
loNode = new rsXmlNode(cItemIndex, ItemIndex);
loMainNode.AddChild(loNode);
loNode = new rsXmlNode(cScore, Score);
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.EvaluationItem + " " +
" (" + cEvaluationID + "," + cEvaluationNorm + "," + cIsLock + "," + cItemContent + "," + cItemIndex + "," + cScore + "," + cTimeCreated + "," + cTimeLastMod + "," + cUserIDLastMod + ") " +
" values (" + _EvaluationID + ",'" + _EvaluationNorm + "','" + _IsLock + "','" + _ItemContent + "','" + _ItemIndex + "','" + _Score + "','" + _TimeCreated + "','" + _TimeLastMod + "','" + _UserIDLastMod + "') ";
}
public string UpdateSql()
{
return " update " + Tn.EvaluationItem + " " +
" set " + cEvaluationID + "=" + _EvaluationID + "," + cEvaluationNorm + "='" + _EvaluationNorm + "'," + cIsLock + "='" + _IsLock + "'," + cItemContent + "='" + _ItemContent + "'," + cItemIndex + "='" + _ItemIndex + "'," + cScore + "='" + _Score + "'," + cTimeCreated + "='" + _TimeCreated + "'," + cTimeLastMod + "='" + _TimeLastMod + "'," + cUserIDLastMod + "='" + _UserIDLastMod + "' " +
" where " + cEvaluationItemID + "=" + _EvaluationItemID + "";
}
public string DeleteSql()
{
return "Delete " + Tn.EvaluationItem + " where " + cEvaluationItemID + "=" + _EvaluationItemID + "";
}
public static bool update(string pcDeleteLine, string pcType, DBConnSql poDBCon)
{
string lcSql = "update " + Tn.EvaluationItem + " set " + cIsLock + " ='" + pcType + "' where " + cEvaluationItemID + " in(" + pcDeleteLine + ")";
if (!poDBCon.ExcuteSqlTran(lcSql))
{
JSComm.ShowMessage("操作失败!");
}
return true;
}
}
#endregion
#region
public class EvaluationItem_Qry : rsQuery
{
public Int64 EvaluationID
{
get { return GetInt(EvaluationItem_info.cEvaluationID); }
// set { SetField(EvaluationItem_info.cEvaluationID, value); }
}
public Int64 EvaluationItemID
{
get { return GetInt(EvaluationItem_info.cEvaluationItemID); }
// set { SetField(EvaluationItem_info.cEvaluationItemID, value); }
}
public String EvaluationNorm
{
get { return GetString(EvaluationItem_info.cEvaluationNorm); }
// set { SetField(EvaluationItem_info.cEvaluationNorm, value); }
}
public Boolean IsLock
{
get { return GetBool(EvaluationItem_info.cIsLock); }
// set { SetField(EvaluationItem_info.cIsLock, value); }
}
public String ItemContent
{
get { return GetString(EvaluationItem_info.cItemContent); }
// set { SetField(EvaluationItem_info.cItemContent, value); }
}
public Int64 ItemIndex
{
get { return GetInt(EvaluationItem_info.cItemIndex); }
// set { SetField(EvaluationItem_info.cItemIndex, value); }
}
public Int64 Score
{
get { return GetInt(EvaluationItem_info.cScore); }
// set { SetField(EvaluationItem_info.cScore, value); }
}
public DateTime TimeCreated
{
get { return GetDateTime(EvaluationItem_info.cTimeCreated); }
// set { SetField(EvaluationItem_info.cTimeCreated, value); }
}
public DateTime TimeLastMod
{
get { return GetDateTime(EvaluationItem_info.cTimeLastMod); }
// set { SetField(EvaluationItem_info.cTimeLastMod, value); }
}
public String UserIDLastMod
{
get { return GetString(EvaluationItem_info.cUserIDLastMod); }
// set { SetField(EvaluationItem_info.cUserIDLastMod, value); }
}
}
#endregion
}