第二层数据访问层,对底层的数据库访问作一些包装供业务层调用生成的代码如下:

代码中主要生成了针对每个数据库表的inf类了对这些表中的记录管理的基类Manager_Base类


None.gif using  System;
None.gif
using  System.Data;
None.gif
using  Keyss.Framework;
None.gif
None.gif
namespace  Keyss.Framework
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
ContractedSubBlock.gifExpandedSubBlockStart.gif
ArticleClassInf#region ArticleClassInf
InBlock.gif
public class ArticleClassInf
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
ContractedSubBlock.gifExpandedSubBlockStart.gif    
protected fields#region protected fields
InBlock.gif    
protected Guid _iD = Guid.Empty;
InBlock.gif    
protected Guid _parentID = Guid.Empty;
InBlock.gif    
protected string _name = String.Empty;
InBlock.gif    
protected string _description = String.Empty;
InBlock.gif    
protected int _orderBy;
InBlock.gif    
protected string _imgUrl = String.Empty;
InBlock.gif    
protected string _iconUrl = String.Empty;
ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif    
ContractedSubBlock.gifExpandedSubBlockStart.gif    
public properties#region public properties
InBlock.gif    
public Guid ID
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
get dot.gif{return _iD;}
ExpandedSubBlockStart.gifContractedSubBlock.gif        
set dot.gif{_iD = value;}
ExpandedSubBlockEnd.gif    }

InBlock.gif    
public Guid ParentID
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
get dot.gif{return _parentID;}
ExpandedSubBlockStart.gifContractedSubBlock.gif        
set dot.gif{_parentID = value;}
ExpandedSubBlockEnd.gif    }

InBlock.gif    
public string Name
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
get dot.gif{return _name;}
ExpandedSubBlockStart.gifContractedSubBlock.gif        
set dot.gif{_name = value;}
ExpandedSubBlockEnd.gif    }

InBlock.gif    
public string Description
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
get dot.gif{return _description;}
ExpandedSubBlockStart.gifContractedSubBlock.gif        
set dot.gif{_description = value;}
ExpandedSubBlockEnd.gif    }

InBlock.gif    
public int OrderBy
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
get dot.gif{return _orderBy;}
ExpandedSubBlockStart.gifContractedSubBlock.gif        
set dot.gif{_orderBy = value;}
ExpandedSubBlockEnd.gif    }

InBlock.gif    
public string ImgUrl
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
get dot.gif{return _imgUrl;}
ExpandedSubBlockStart.gifContractedSubBlock.gif        
set dot.gif{_imgUrl = value;}
ExpandedSubBlockEnd.gif    }

InBlock.gif    
public string IconUrl
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
get dot.gif{return _iconUrl;}
ExpandedSubBlockStart.gifContractedSubBlock.gif        
set dot.gif{_iconUrl = value;}
ExpandedSubBlockEnd.gif    }

ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif    
ContractedSubBlock.gifExpandedSubBlockStart.gif    
public methods#region public methods
InBlock.gif    
public virtual void Populate(System.Data.SqlClient.SqlDataReader reader)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
try
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            _iD 
= reader.GetGuid(0);
InBlock.gif            
if (!reader.IsDBNull(1))
InBlock.gif                _parentID 
= reader.GetGuid(1);
InBlock.gif            
else
InBlock.gif                _parentID 
= Guid.Empty;
InBlock.gif            _name 
= reader.GetString(2);
InBlock.gif            _description 
= reader.GetString(3);
InBlock.gif            _orderBy 
= reader.GetInt32(4);
InBlock.gif            _imgUrl 
= reader.GetString(5);
InBlock.gif            _iconUrl 
= reader.GetString(6);
ExpandedSubBlockEnd.gif        }

InBlock.gif        
catch
ExpandedSubBlockStart.gif
<