示例#1
0
 /// <summary>
 /// 根据ID获取用户数据
 /// </summary>
 /// <param name="id"></param>
 /// <param name="db"></param>
 /// <returns></returns>
 internal static Tuple <bool, string, Model.Model.LC_User> GetUserVoFromId(long id, SuperDataBase.Model.DBSandbox db)
 {
     sql = makesql.MakeSelectSql(typeof(Model.Model.LC_User), "id=@id", new SqlParameter[] {
         new SqlParameter("@id", id)
     }, string.Empty, 1);
     ids = db.Read(sql);
     if (!ids.flag)
     {
         return(new Tuple <bool, string, Model.Model.LC_User>(false, ids.errormsg, null));
     }
     if (!ids.ReadIsOk())
     {
         return(new Tuple <bool, string, Model.Model.LC_User>(false, "没有任何数据!", null));
     }
     return(new Tuple <bool, string, Model.Model.LC_User>(true, string.Empty, ids.GetVOList <Model.Model.LC_User>()[0]));
 }
示例#2
0
 /// <summary>
 /// 根据OPENID获取用户数据
 /// </summary>
 /// <param name="openid"></param>
 /// <returns></returns>
 public static (bool, string, Model.Model.LC_User) GetUserVOFromOpenID(string openid, SuperDataBase.Model.DBSandbox db)
 {
     sql = makesql.MakeSelectSql(typeof(Model.Model.LC_User), "wx_openid=@wx_openid", new SqlParameter[] {
         new SqlParameter("@wx_openid", openid)
     });
     ids = db.Read(sql);
     if (!ids.flag)
     {
         return(false, ids.errormsg, null);
     }
     if (!ids.ReadIsOk())
     {
         return(false, "没有找到任何数据!", null);
     }
     return(true, string.Empty, ids.GetVOList <Model.Model.LC_User>()[0]);
 }