Beispiel #1
0
 public string GetUserNick(int id)
 {
     tb_UserEntity ue = new tb_UserEntity();
     ue.id = id;
     try
     {
         ue.Retrieve();
     }
     catch (PlException plex)
     {
         //获取失败了,主键有误
     }
     if (ue.IsPersistent)
     {
         return ue.nick;
     }
     else
     {
         return "";
     }
 }
Beispiel #2
0
 /// <summary>根据主键获取一个实体</summary>
 public static tb_UserEntity RetrieveAtb_UserEntity(int id)
 {
     tb_UserEntity obj=new tb_UserEntity();
     obj.id=id;
     obj.Retrieve();
     if (obj.IsPersistent)
     {
         return obj;
     }
     else
     {
         return null;
     }
 }