using System; using System.Collections.Generic; using System.Text; using System.Data; using SysBaseLibs; using System.Web.Script.Serialization; namespace SysDataLibs.TableClass { #region Sys_Groups public class Sys_Groups_info : ITableInfo { #region Sys_Groups表 字段信息 /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: datetime; /// 数据长度: 8; /// 是否允许为空: Y; /// 默认值: ; /// 描述: 创建时间; /// public const string cCreateDate = "CreateDate"; /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: varchar; /// 数据长度: 20; /// 是否允许为空: Y; /// 默认值: ; /// 描述: 创建用户; /// public const string cCreateUser = "CreateUser"; /// /// 为关键字段: Y --- PrimaryKey; /// 自动增长: N; /// 数据类型: varchar; /// 数据长度: 10; /// 是否允许为空: N; /// 默认值: ; /// 描述: 组编号; /// public const string cGroupID = "GroupID"; /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: nchar; /// 数据长度: 2; /// 是否允许为空: N; /// 默认值: ; /// 描述: 是否锁定; /// public const string cIsLock = "IsLock"; /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: int; /// 数据长度: 4; /// 是否允许为空: N; /// 默认值: ; /// 描述: 是否系统; /// public const string cIsSystem = "IsSystem"; /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: varchar; /// 数据长度: 30; /// 是否允许为空: N; /// 默认值: ; /// 描述: 用户组名称; /// public const string cNames = "Names"; /// /// 为关键字段: N ; /// 自动增长: N; /// 数据类型: varchar; /// 数据长度: 200; /// 是否允许为空: Y; /// 默认值: ; /// 描述: 备注; /// public const string cRemark = "Remark"; #endregion public Sys_Groups_info() { } public Sys_Groups_info(DataRow poRow) { CreateTableInfo(poRow); } public void CreateTableInfo(DataRow poRow) { _CreateDate = UtilStr.StrFromObj(poRow[cCreateDate]); _CreateUser = UtilStr.StrFromObj(poRow[cCreateUser]); _GroupID = UtilStr.StrFromObj(poRow[cGroupID]); _IsLock = UtilStr.StrFromObj(poRow[cIsLock]); _IsSystem = UtilStr.StrFromObj(poRow[cIsSystem]); _Names = UtilStr.StrFromObj(poRow[cNames]); _Remark = UtilStr.StrFromObj(poRow[cRemark]); } public Sys_Groups_info(string pcGroupID, DBConnSql poDBConn) { if (pcGroupID.Trim().Length > 0 && poDBConn != null) { string lcSql = "select * from " + Tn.Sys_Groups + " where GroupID='" + pcGroupID + "'"; rsQuery loQuery = poDBConn.OpenQuery(lcSql); if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1) { loQuery.MoveFirst(); CreateTableInfo(loQuery.CurrentRow); } } } private string _CreateDate = ""; public string CreateDate { get { return _CreateDate; } set { _CreateDate = value; } } private string _CreateUser = ""; public string CreateUser { get { return _CreateUser; } set { _CreateUser = value; } } private string _GroupID = ""; public string GroupID { get { return _GroupID; } set { _GroupID = value; } } private string _IsLock = ""; public string IsLock { get { return _IsLock; } set { _IsLock = value; } } private string _IsSystem = ""; public string IsSystem { get { return _IsSystem; } set { _IsSystem = value; } } private string _Names = ""; public string Names { get { return _Names; } set { _Names = value; } } private string _Remark = ""; public string Remark { get { return _Remark; } set { _Remark = value; } } [ScriptIgnore] public rsXmlNode DataXMLNode { get { rsXmlNode loMainNode = new rsXmlNode("Sys_GroupsRecord", ""); rsXmlNode loNode = null; loNode = new rsXmlNode(cCreateDate, CreateDate); loMainNode.AddChild(loNode); loNode = new rsXmlNode(cCreateUser, CreateUser); loMainNode.AddChild(loNode); loNode = new rsXmlNode(cGroupID, GroupID); loMainNode.AddChild(loNode); loNode = new rsXmlNode(cIsLock, IsLock); loMainNode.AddChild(loNode); loNode = new rsXmlNode(cIsSystem, IsSystem); loMainNode.AddChild(loNode); loNode = new rsXmlNode(cNames, Names); loMainNode.AddChild(loNode); loNode = new rsXmlNode(cRemark, Remark); loMainNode.AddChild(loNode); return loMainNode; } } public string InsertSql() { return " insert into " + Tn.Sys_Groups + " " + " (" + cCreateDate + "," + cCreateUser + "," + cGroupID + "," + cIsLock + "," + cIsSystem + "," + cNames + "," + cRemark + ") " + " values ('" + _CreateDate + "','" + _CreateUser + "','" + _GroupID + "','" + _IsLock + "'," + _IsSystem + ",'" + _Names + "','" + _Remark + "') "; } public string UpdateSql() { return " update " + Tn.Sys_Groups + " " + " set " + cCreateDate + "='" + _CreateDate + "'," + cCreateUser + "='" + _CreateUser + "'," + cIsLock + "='" + _IsLock + "'," + cIsSystem + "=" + _IsSystem + "," + cNames + "='" + _Names + "'," + cRemark + "='" + _Remark + "' " + " where " + cGroupID + "='" + _GroupID + "'"; } public string DeleteSql() { return "Delete " + Tn.Sys_Groups + " where " + cGroupID + "='" + _GroupID + "'"; } public bool lockGroup(DBConnSql poDBConn) { bool lbRetVal = false; string lcSql = " update " + Tn.Sys_Groups + " set IsLock='" + _IsLock + "' where GroupID='" + _GroupID + "'"; lbRetVal = poDBConn.ExcuteSqlTran(lcSql); return lbRetVal; } public static rsQuery GetAllGroups(string pcLock, DBConnSql poConn) { string lcSql = "select * from " + Tn.Sys_Groups + " where " + Sys_Groups_info.cIsLock + "='" + pcLock + "' order by " + Sys_Groups_info.cGroupID + " desc "; return poConn.OpenQuery(lcSql); } } #endregion #region public class Sys_Groups_Qry : rsQuery { public DateTime CreateDate { get { return GetDateTime(Sys_Groups_info.cCreateDate); } // set { SetField(Sys_Groups_info.cCreateDate, value); } } public String CreateUser { get { return GetString(Sys_Groups_info.cCreateUser); } // set { SetField(Sys_Groups_info.cCreateUser, value); } } public String GroupID { get { return GetString(Sys_Groups_info.cGroupID); } // set { SetField(Sys_Groups_info.cGroupID, value); } } public Boolean IsLock { get { return GetBool(Sys_Groups_info.cIsLock); } // set { SetField(Sys_Groups_info.cIsLock, value); } } public Int64 IsSystem { get { return GetInt(Sys_Groups_info.cIsSystem); } // set { SetField(Sys_Groups_info.cIsSystem, value); } } public String Names { get { return GetString(Sys_Groups_info.cNames); } // set { SetField(Sys_Groups_info.cNames, value); } } public String Remark { get { return GetString(Sys_Groups_info.cRemark); } // set { SetField(Sys_Groups_info.cRemark, value); } } } #endregion }