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表 字段信息
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: smalldatetime;
/// 数据长度: 4;
/// 是否允许为空: Y;
/// 默认值: ;
/// 描述: 考评标准制定时间;
///
public const string cEvaluationCreateTime = "EvaluationCreateTime";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: varchar;
/// 数据长度: -1;
/// 是否允许为空: Y;
/// 默认值: ;
/// 描述: 考评说明;
///
public const string cEvaluationDesc = "EvaluationDesc";
///
/// 为关键字段: Y --- PrimaryKey;
/// 自动增长: Y;
/// 数据类型: int;
/// 数据长度: 4;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: EvaluationID;
///
public const string cEvaluationID = "EvaluationID";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: nvarchar;
/// 数据长度: 100;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: 考评标准名;
///
public const string cEvaluationName = "EvaluationName";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: nvarchar;
/// 数据长度: 300;
/// 是否允许为空: Y;
/// 默认值: ;
/// 描述: 考评标准发布组织;
///
public const string cEvaluationOrg = "EvaluationOrg";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: nchar;
/// 数据长度: 2;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: 考评类型(M 市场类,S 摊贩类);
///
public const string cEvaluationType = "EvaluationType";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: nchar;
/// 数据长度: 2;
/// 是否允许为空: N;
/// 默认值: (N'N');
/// 描述: IsLock;
///
public const string cIsLock = "IsLock";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: nchar;
/// 数据长度: 2;
/// 是否允许为空: Y;
/// 默认值: ;
/// 描述: 是否正在使用中;
///
public const string cIsUser = "IsUser";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: smalldatetime;
/// 数据长度: 4;
/// 是否允许为空: N;
/// 默认值: (getdate());
/// 描述: TimeCreated;
///
public const string cTimeCreated = "TimeCreated";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: smalldatetime;
/// 数据长度: 4;
/// 是否允许为空: N;
/// 默认值: (getdate());
/// 描述: TimeLastMod;
///
public const string cTimeLastMod = "TimeLastMod";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: varchar;
/// 数据长度: 30;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: UserIDLastMod;
///
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
}