Esempio n. 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="readerId"></param>
 /// <param name="bookId"></param>
 /// <param name="status"></param>
 /// <param name="comment"></param>
 public BookHistory(int readerId, string bookId, RegistrationStatus status, string comment)
 {
     BookId   = bookId;
     ReaderId = readerId;
     Status   = status;
     Remark   = comment;
 }
Esempio n. 2
0
        /// <summary>
        /// Occurs when data is received from the engine controller after sending this command.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EngineController_DataReceived(object sender, ChessCommandReceivedEventArgs e)
        {
            var data = e.Data;

            if (ResponseIsNotNullOrEmpty(data))
            {
                if (data.StartsWith(ID))
                {
                    ParseIdName(data);
                    ParseIdAuthor(data);
                }
                else if (data.StartsWith(OPTION))
                {
                    ParseOption(data);
                }
                else if (data.StartsWith(UCIOK))
                {
                    CommandResponseReceived = true;
                }
                else if (data.StartsWith("copyprotection"))
                {
                    CopyProtectionInfo = data;
                }
                else if (data.StartsWith("registration"))
                {
                    RegistrationInfo = GetRegistrationStatus(data);
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the status of the specified registration account.
        /// </summary>
        /// <param name="userId">Internal identifier of the user.</param>
        /// <returns>Status of the specified registration account.</returns>
        public RegistrationStatus GetStatus(int userId)
        {
            RegistrationStatus status = RegistrationStatus.Inactive;

            SqlParameter[] parameters = SQLHelper.GetCachedParameters("SQL_GET_USER_STATUS");

            if (parameters == null)
            {
                parameters = new SqlParameter[] {
                    new SqlParameter("@UserId", SqlDbType.Int)
                };

                SQLHelper.CacheParameters("SQL_GET_USER_STATUS", parameters);
            }

            parameters[0].Value = userId;

            using (SqlDataReader reader = SQLHelper.ExecuteReader(SQLHelper.CONNECTION_STRING,
                                                                  CommandType.Text, SQLHelper.GetSQLStatement(MODULE_NAME, "SQL_GET_STATUS"),
                                                                  parameters))
            {
                if (reader.Read())
                {
                    status = (RegistrationStatus)reader.GetInt32(0);
                }
            }

            return(status);
        }
Esempio n. 4
0
        public void UpdateRegistrationStatus(long userId, RegistrationStatus registrationStatus)
        {
            var user = _userRepository.Get(userId);

            user.RegistrationStatus = registrationStatus;

            _userRepository.Update(user);
        }
Esempio n. 5
0
 public RegistrationStatus FormData(RegistrationStatus info)
 {
     info.Id     = this.Id;
     info.UserId = this.UserId;
     info.SubordinateActivitiesID = this.SubordinateActivitiesID;
     info.RegistrationName        = this.RegistrationName;
     info.RegistrationDate        = this.RegistrationDate;
     info.RegistrationTel         = this.RegistrationTel;
     return(info);
 }
Esempio n. 6
0
 public RegistrationStatusModel ToModel(RegistrationStatus info)
 {
     this.Id     = info.Id;
     this.UserId = info.UserId;
     this.SubordinateActivitiesID = info.SubordinateActivitiesID;
     this.RegistrationName        = info.RegistrationName;
     this.RegistrationDate        = info.RegistrationDate;
     this.RegistrationTel         = info.RegistrationTel;
     return(this);
 }
Esempio n. 7
0
        public RegistrationStatus ToInfo()
        {
            RegistrationStatus info = new RegistrationStatus();

            info.UserId = this.UserId;
            info.SubordinateActivitiesID = this.SubordinateActivitiesID;
            info.RegistrationName        = this.RegistrationName;
            info.RegistrationDate        = this.RegistrationDate;
            info.RegistrationTel         = this.RegistrationTel;
            return(info);
        }
        /// <summary>
        /// Create a new OCPP boot notification response.
        /// </summary>
        /// <param name="Request">The related boot notification request.</param>
        /// <param name="Status">The registration status.</param>
        /// <param name="CurrentTime">The current time at the central system.</param>
        /// <param name="Interval">When the registration status is 'accepted', the interval defines the heartbeat interval in seconds. In all other cases, the value of the interval field indicates the minimum wait time before sending a next BootNotification request.</param>
        public BootNotificationResponse(CP.BootNotificationRequest Request,
                                        RegistrationStatus Status,
                                        DateTime CurrentTime,
                                        TimeSpan Interval)

            : base(Request, Result.OK())

        {
            this.Status      = Status;
            this.CurrentTime = CurrentTime;
            this.Interval    = Interval;
        }
Esempio n. 9
0
        public void ParseConfigurationWorks_CantEnableWithoutCode()
        {
            var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[]
            {
                new KeyValuePair <string, string>("Registration:Enabled", "true"),
            }
                                                                                 ).Build();

            var service = new RegistrationStatus(configuration, logger);

            Assert.False(service.RegistrationEnabled);
        }
Esempio n. 10
0
        public void ParseConfigurationWorks_EnabledDifferentCapitals()
        {
            var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[]
            {
                new KeyValuePair <string, string>("Registration:Enabled", "True"),
                new KeyValuePair <string, string>("Registration:RegistrationCode", Code)
            }
                                                                                 ).Build();

            var service = new RegistrationStatus(configuration, logger);

            Assert.True(service.RegistrationEnabled);
        }
Esempio n. 11
0
        public UserDto RegisterNewUser(RegistrationRequest registrationRequest, out RegistrationStatus registrationStatus)
        {
            registrationStatus = ValidateRegistration(registrationRequest);

            if (registrationStatus != RegistrationStatus.SUCCESS)
            {
                return(null);
            }

            HashedPasswordData hashedPassword = PasswordHashComputer.CreateHashedPassword(registrationRequest.Password);
            User user = CreateUser(registrationRequest, hashedPassword);

            return(Mapper.Map <UserDto>(user));
        }
Esempio n. 12
0
 public User(
     int id,
     string fName,
     string lName,
     string email,
     DateTime registerDate,
     RegistrationStatus status)
 {
     _id           = id;
     _fName        = fName;
     _lName        = lName;
     _email        = email;
     _registerDate = registerDate;
     _status       = status;
 }
Esempio n. 13
0
        public List <RegistrationStatus> GetRegistrationStatuses()
        {
            var reader   = Reader.GetTableReader(CoordinatorRequest.Statuses());
            var statuses = new List <RegistrationStatus>();

            while (reader.Read())
            {
                var status = new RegistrationStatus(
                    reader["RegistrationStatusId"].ToString(),
                    reader["RegistrationStatus"].ToString()
                    );
                statuses.Add(status);
            }
            return(statuses);
        }
Esempio n. 14
0
            public void CacheInvalidInspectorType(Type type, RegistrationStatus status)
            {
                if (s_StatusPerType.TryGetValue(type, out var s))
                {
                    status |= s;
                }
                s_StatusPerType[type] = status;

                var data = s_UnregisteredTypesPerStatus;

                if (!data.TryGetValue(status, out var list))
                {
                    data[status] = list = new List <Type>();
                }
                list.Add(type);
            }
 public void EnterPersonalInfoStatus(RegistrationStatus status)
 {
     UIUtil.DefaultProvider.SelectWithText(
         UIUtil.DefaultProvider.GetAttribute("//*[text()='Status:']", "for", LocateBy.XPath),
         StringEnum.GetStringValue(status),
         LocateBy.Id);
 }
 private static string ErrorCodeToString(RegistrationStatus createStatus)
 {
     switch (createStatus)
     {
         case RegistrationStatus.Fail:
             return "Registartion fail.Please contact administrator...";
         default:
             return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
     }
 }