Beispiel #1
0
        public static User Build(ITypeReader reader)
        {
            User user = new User();

            user.UserId             = reader.GetGuid("UserId");
            user.AcceptedLatestTOS  = reader.GetBool("AcceptedLatestTOS");
            user.LastTOSVersion     = reader.GetInt("LastTOSVersion");
            user.PasswordExpiration = reader.GetDate("PasswordExpiration");
            user.FirstTimeUser      = reader.GetBool("NewUser");
            user.DisplayName        = reader.GetString("DisplayName");
            user.FirstName          = reader.GetString("FirstName");
            user.MiddleName         = reader.GetString("MiddleName");
            user.LastName           = reader.GetString("LastName");
            user.Phone = reader.GetString("Phone");
            user.Ext   = reader.GetString("Ext");
            user.SessionTimeoutInterval = reader.GetInt("SessionTimeout");
            user.PasswordQuestion       = reader.GetString("PasswordQuestion");
            user.PasswordAnswer         = reader.GetString("PasswordAnswer");
            user.AdminUserId            = reader.GetGuid("AdministratorUserId");
            user.AdminUserName          = reader.GetString("AdminUserName");
            user.UserType   = (UserTypes)reader.GetInt("UserTypeId");
            user.UserTypeId = reader.GetInt("UserTypeId");
            user.FailedPasswordAttemptCount       = reader.GetInt("FailedPasswordAttemptCount");
            user.FailedPasswordAnswerAttemptCount = reader.GetInt("FailedPasswordAnswerAttemptCount");
            user.Status       = reader.GetString("Status");
            user.StatusTypeId = reader.GetInt("StatusTypeId");
            return(user);
        }
Beispiel #2
0
        public static User BuildLightweight(ITypeReader reader)
        {
            User user = new User();

            user.UserId        = reader.GetGuid("UserId");
            user.UserName      = reader.GetString("UserName");
            user.DisplayName   = reader.GetString("DisplayName");
            user.CreateDate    = reader.GetDate("CreateDate").Value;
            user.Status        = reader.GetString("Status");
            user.StatusTypeId  = reader.GetInt("StatusTypeId");
            user.UserType      = (UserTypes)reader.GetInt("UserTypeId");
            user.UserTypeId    = reader.GetInt("UserTypeId");
            user.LastLoginDate = reader.GetDate("LastLoginDate");
            user.Email         = reader.GetString("Email");
            user.IsNewUser     = reader.GetBool("IsNewUser");

            return(user);
        }
Beispiel #3
0
        public static Group Build(ITypeReader reader)
        {
            Group group = new Group();

            group.GroupId    = reader.GetInt(Columns.GROUPID);
            group.Name       = reader.GetString(Columns.NAME);
            group.EnableAll  = reader.GetBool(Columns.ENABLEALL);
            group.CreateDate = reader.GetDate(Columns.CREATEDATE);

            return(group);
        }
Beispiel #4
0
        public DateTime?SaveSession(Guid userId, string sessionId, int sessionTimeOut, bool removeSession)
        {
            DateTime?expiration = null;

            using (ITypeReader reader = QueryReader(null, _dbConnName, StoredProcedure.SaveUserSession, userId, sessionId, sessionTimeOut, removeSession))
            {
                while (reader.Read())
                {
                    expiration = reader.GetDate("ExpirationDate");
                }
            }
            return(expiration);
        }
Beispiel #5
0
        public static Measure Build(ITypeReader reader)
        {
            Measure measure = new Measure();

            measure.MeasureId   = reader.GetInt(Columns.MEASUREIDCOLUMN);
            measure.Name        = reader.GetString(Columns.MEASURENAMECOLUMN);
            measure.Numerator   = reader.GetInt(Columns.NUMERATORCOLUMN);
            measure.Denominator = reader.GetInt(Columns.DENOMINATORCOLUMN);
            measure.Excluded    = reader.GetInt(Columns.EXCLUDEDCOLUMN);
            measure.LastDate    = reader.GetDate(Columns.LASTDATE);
            measure.LastValue   = reader.GetString(Columns.LASTVALUE);

            double percentage = ((double)measure.Numerator / (double)measure.Denominator) * (double)100;

            measure.Percentage = String.Format("{0:0 %}", percentage.ToString());

            return(measure);
        }