예제 #1
0
        /// <summary>
        /// Public constructor with required data
        /// </summary>
        /// <param name="email">Email associated with the authenticator.</param>
        /// <param name="password">User&apos;s password hash</param>
        /// <param name="timestamp">Creation timestamp</param>
        /// <param name="user">Authenticator associated with the user</param>
        public Authenticator(string email, string password, DateTime timestamp, global::BackendModel.User user)
        {
            if (string.IsNullOrEmpty(email))
            {
                throw new ArgumentNullException(nameof(email));
            }
            this.Email = email;

            if (string.IsNullOrEmpty(password))
            {
                throw new ArgumentNullException(nameof(password));
            }
            this.Password = password;

            this.Timestamp = timestamp;

            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            this.User          = user;
            user.Authenticator = this;

            Init();
        }
        /// <summary>
        /// Public constructor with required data
        /// </summary>
        /// <param name="timestamp">Creation timestamp</param>
        /// <param name="user"></param>
        public UserSession(DateTime timestamp, global::BackendModel.User user)
        {
            this.Timestamp = timestamp;

            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            this.User = user;


            Init();
        }
        /// <summary>
        /// Public constructor with required data
        /// </summary>
        /// <param name="message">The message within a feedback</param>
        /// <param name="timestamp">Creation timestamp</param>
        /// <param name="user"></param>
        public Feedback(string message, DateTime timestamp, global::BackendModel.User user)
        {
            if (string.IsNullOrEmpty(message))
            {
                throw new ArgumentNullException(nameof(message));
            }
            this.Message = message;

            this.Timestamp = timestamp;

            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            this.User = user;


            Init();
        }
예제 #4
0
 /// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="email">Email associated with the authenticator.</param>
 /// <param name="password">User&apos;s password hash</param>
 /// <param name="timestamp">Creation timestamp</param>
 /// <param name="user">Authenticator associated with the user</param>
 public static Authenticator Create(string email, string password, DateTime timestamp, global::BackendModel.User user)
 {
     return(new Authenticator(email, password, timestamp, user));
 }
예제 #5
0
 /// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="timestamp">Creation timestamp</param>
 /// <param name="challenge"></param>
 /// <param name="_user0"></param>
 public static PrevChallenge Create(DateTime timestamp, global::BackendModel.Challenge challenge, global::BackendModel.User _user0)
 {
     return(new PrevChallenge(timestamp, challenge, _user0));
 }
예제 #6
0
        /// <summary>
        /// Public constructor with required data
        /// </summary>
        /// <param name="timestamp">Creation timestamp</param>
        /// <param name="challenge"></param>
        /// <param name="_user0"></param>
        public PrevChallenge(DateTime timestamp, global::BackendModel.Challenge challenge, global::BackendModel.User _user0)
        {
            this.Timestamp = timestamp;

            if (challenge == null)
            {
                throw new ArgumentNullException(nameof(challenge));
            }
            this.Challenge = challenge;

            if (_user0 == null)
            {
                throw new ArgumentNullException(nameof(_user0));
            }
            _user0.PrevChallenges.Add(this);


            Init();
        }
 /// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="entrytype">Type of entry</param>
 /// <param name="entrydata">If applicable, semicolon separated list of strings/numbers relating to this entry (no spaces other than those required by the strings themselves).</param>
 /// <param name="timestamp">Time that this entry was created</param>
 /// <param name="_user0"></param>
 public static SessionLogEntry Create(global::BackendModel.SessionLogEntryType entrytype, string entrydata, DateTime timestamp, global::BackendModel.User _user0)
 {
     return(new SessionLogEntry(entrytype, entrydata, timestamp, _user0));
 }
        /// <summary>
        /// Public constructor with required data
        /// </summary>
        /// <param name="entrytype">Type of entry</param>
        /// <param name="entrydata">If applicable, semicolon separated list of strings/numbers relating to this entry (no spaces other than those required by the strings themselves).</param>
        /// <param name="timestamp">Time that this entry was created</param>
        /// <param name="_user0"></param>
        public SessionLogEntry(global::BackendModel.SessionLogEntryType entrytype, string entrydata, DateTime timestamp, global::BackendModel.User _user0)
        {
            this.EntryType = entrytype;

            if (string.IsNullOrEmpty(entrydata))
            {
                throw new ArgumentNullException(nameof(entrydata));
            }
            this.EntryData = entrydata;

            this.Timestamp = timestamp;

            if (_user0 == null)
            {
                throw new ArgumentNullException(nameof(_user0));
            }
            _user0.SessonLogEntries.Add(this);

            Init();
        }
 /// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="timestamp">Creation timestamp</param>
 /// <param name="user"></param>
 public static UserSession Create(DateTime timestamp, global::BackendModel.User user)
 {
     return(new UserSession(timestamp, user));
 }
예제 #10
0
 /// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="imageurl">Url for this image</param>
 /// <param name="longlat">Suggested position</param>
 /// <param name="name">Name of this suggested challenge</param>
 /// <param name="desc">Description of the suggested challenge</param>
 /// <param name="timestamp">Creation timestamp</param>
 /// <param name="user">Suggestions associated with this user</param>
 public static Suggestion Create(byte[] imageurl, Point longlat, string name, string desc, DateTime timestamp, global::BackendModel.User user)
 {
     return(new Suggestion(imageurl, longlat, name, desc, timestamp, user));
 }
예제 #11
0
        /// <summary>
        /// Public constructor with required data
        /// </summary>
        /// <param name="imageurl">Url for this image</param>
        /// <param name="longlat">Suggested position</param>
        /// <param name="name">Name of this suggested challenge</param>
        /// <param name="desc">Description of the suggested challenge</param>
        /// <param name="timestamp">Creation timestamp</param>
        /// <param name="user">Suggestions associated with this user</param>
        public Suggestion(byte[] imageurl, Point longlat, string name, string desc, DateTime timestamp, global::BackendModel.User user)
        {
            this.ImageUrl = imageurl;

            this.LongLat = longlat;

            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name));
            }
            this.Name = name;

            if (string.IsNullOrEmpty(desc))
            {
                throw new ArgumentNullException(nameof(desc));
            }
            this.Desc = desc;

            this.Timestamp = timestamp;

            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            this.User = user;
            user.Suggestions.Add(this);

            Init();
        }
 /// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="message">The message within a feedback</param>
 /// <param name="timestamp">Creation timestamp</param>
 /// <param name="user"></param>
 public static Feedback Create(string message, DateTime timestamp, global::BackendModel.User user)
 {
     return(new Feedback(message, timestamp, user));
 }