Ejemplo n.º 1
0
        public override User GetUserbyCode(string UserCode)
        {
            //TODO:实现通过用户Code获取用户信息
            string sql = "SELECT Objectid,Code,Name,QQ,Email,Password FROM SYS_User  WHERE Code = @userCode";

            System.Data.Common.DbCommand dbCommand = database.GetSqlStringCommand(sql);
            database.AddInParameter(dbCommand, "@userCode", DbType.String, UserCode);

            User currentuser = null;

            using (IDataReader reder = database.ExecuteReader(sql))
            {
                if (reder.Read())
                {
                    currentuser = UserMapping.CreateUserMapping().MappUser(reder);
                }
            }

            return(currentuser);
        }
Ejemplo n.º 2
0
        public static UserMapping CreateUserMapping()
        {
            UserMapping _usermapping = new UserMapping();

            return(_usermapping);
        }