Exemple #1
0
        /// <summary>
        /// Instanciate New User from [dr]
        /// </summary>
        /// <param name="pconstring">as data source connection string</param>
        /// <param name="dr">as data.datarow</param>
        internal User(string pconstring, System.Data.DataRow dr)
        {
            try
            {
                if (dr["UID"] != System.DBNull.Value) { _uid = new Guid(dr["UID"].ToString()); }
                if (dr["APPID"] != System.DBNull.Value) { _appid = new Guid(dr["APPID"].ToString()); }
                if (dr["UserName"] != System.DBNull.Value) { _username = (String)dr["UserName"]; }
                if (dr["UserIsAnonymous"] != System.DBNull.Value) { _isAnonymous = Convert.ToBoolean(dr["UserIsAnonymous"]); }
                if (dr["UserLastActivityDate"] != System.DBNull.Value) { _lastActivityDate = (DateTime)dr["UserLastActivityDate"]; }
                if (dr["UserTimestamp"] != System.DBNull.Value) { _timestamp = (DateTime)dr["UserTimestamp"]; }

                _demographics = new UserDemographics(dr);
                //load membership information for the current application
                _membership = new MembershipUser(pconstring, _uid, _appid);
                //load role for user
                _role = Role.getUserRoleForApplication(pconstring, _uid, _appid);
            }
            catch (Exception ex)
            {
                _LastError = ex;
                throw ex;
            }
        }
Exemple #2
0
 /// <summary>
 /// Set MyBase to String.Empty
 /// </summary>
 private void SetBase()
 {
     _username = String.Empty;
     _demographics = new UserDemographics();
 }