using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using SysBaseLibs;
using System.Web.Script.Serialization;
namespace SysDataLibs.TableClass
{
#region CreditRating
public class CreditRating_info : ITableInfo
{
#region CreditRating表 字段信息
///
/// 为关键字段: Y --- PrimaryKey;
/// 自动增长: N;
/// 数据类型: int;
/// 数据长度: 4;
/// 是否允许为空: N;
/// 默认值: ;
/// 描述: 编号;
///
public const string cCreditID = "CreditID";
///
/// 为关键字段: N ;
/// 自动增长: N;
/// 数据类型: varchar;
/// 数据长度: 50;
/// 是否允许为空: Y;
/// 默认值: ;
/// 描述: 名称;
///
public const string cName = "Name";
#endregion
public CreditRating_info(){}
public CreditRating_info(DataRow poRow)
{
CreateTableInfo(poRow);
}
public void CreateTableInfo(DataRow poRow)
{
_CreditID=UtilStr.StrFromObj(poRow[cCreditID]);
_Name=UtilStr.StrFromObj(poRow[cName]);
}
public CreditRating_info( string pcCreditID, DBConnSql poDBConn)
{
if ( pcCreditID.Trim().Length > 0 && poDBConn != null)
{
string lcSql = "select * from " + Tn.CreditRating + " where CreditID='"+pcCreditID+"'";
rsQuery loQuery = poDBConn.OpenQuery(lcSql);
if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
{
loQuery.MoveFirst();
CreateTableInfo(loQuery.CurrentRow);
}
}
}
private string _CreditID="";
public string CreditID
{
get { return _CreditID; }
set { _CreditID = value; }
}
private string _Name="";
public string Name
{
get { return _Name; }
set { _Name = value; }
}
[ScriptIgnore]
public rsXmlNode DataXMLNode
{
get
{
rsXmlNode loMainNode = new rsXmlNode("CreditRatingRecord", "");
rsXmlNode loNode =null;
loNode = new rsXmlNode(cCreditID, CreditID);
loMainNode.AddChild(loNode);
loNode = new rsXmlNode(cName, Name);
loMainNode.AddChild(loNode);
return loMainNode ;
}
}
public string InsertSql()
{
return " insert into "+Tn.CreditRating+" "+
" ("+cCreditID+","+cName+") "+
" values ("+_CreditID+",'"+_Name+"') " ;
}
public string UpdateSql()
{
return " update "+Tn.CreditRating+" "+
" set "+cName+"='"+_Name+"' "+
" where "+cCreditID+"="+_CreditID+"" ;
}
public string DeleteSql()
{
return "Delete "+Tn.CreditRating+" where "+cCreditID+"="+_CreditID+"" ;
}
}
#endregion
#region
public class CreditRating_Qry : rsQuery
{
public Int64 CreditID
{
get { return GetInt(CreditRating_info.cCreditID); }
// set { SetField(CreditRating_info.cCreditID, value); }
}
public String Name
{
get { return GetString(CreditRating_info.cName); }
// set { SetField(CreditRating_info.cName, value); }
}
}
#endregion
}