Esempio n. 1
0
        /// <summary>
        /// Constructor for active keys list
        /// </summary>
        /// <param name="id"></param>
        /// <param name="guid"></param>
        /// <param name="started"></param>
        /// <param name="finished"></param>
        /// <param name="blocked"></param>
        public Key(int id, string guid, DateTime?started, DateTime?finished, bool blocked)
        {
            DomainException.When(!(id < 1), "Id is required!");
            DomainException.When(!string.IsNullOrEmpty(guid), "Guid is required!");

            this.Id          = id;
            this.Guid        = guid;
            this.Started     = started;
            this.Finished    = finished;
            this.BlockResult = blocked;
        }
Esempio n. 2
0
        public User(string name, string email, string password, bool?admin)
        {
            DomainException.When(!string.IsNullOrEmpty(name), "Name is required!");
            DomainException.When(!string.IsNullOrEmpty(email), "Email is required!");
            DomainException.When(!string.IsNullOrEmpty(password), "Password is required!");
            DomainException.When(!(password.Length < 6), "Password minimum 6 chars!");

            this.Name     = name;
            this.Email    = email;
            this.Password = password;
        }
Esempio n. 3
0
        public Key(string email, int sentBy, int consultant, bool blockRestult)
        {
            DomainException.When(!string.IsNullOrEmpty(email), "Email is required!");
            DomainException.When(!(sentBy < 1), "SentBy is required!");
            DomainException.When(!(consultant < 1), "Consultant is required!");

            this.Email       = email;
            this.SentBy      = sentBy;
            this.Consultant  = consultant;
            this.BlockResult = blockRestult;
        }
Esempio n. 4
0
            /// <summary>
            /// Use this Constructor for a message without attachments
            /// </summary>
            public Message(string name, string email, EmailMessageModels.Content content, int sentBy)
            {
                DomainException.When(!string.IsNullOrEmpty(name), "Name is required!");
                DomainException.When(!string.IsNullOrEmpty(email), "Email is required!");
                DomainException.When(!(sentBy < 1), "SentBy is required!");

                this.Name    = name;
                this.Email   = email;
                this.SentBy  = sentBy;
                this.Content = content;
            }
Esempio n. 5
0
        public Question(
            string guid,
            bool active,
            string active_created,
            string active_createdBy,
            int category,
            string title_PT,
            string text_PT,
            string title_ENG,
            string text_ENG,
            string created,
            string createdBy
            )
        {
            DomainException.When(!string.IsNullOrEmpty(guid), "Guid is required!");

            DomainException.When(!string.IsNullOrEmpty(active_createdBy), "Active_CreatedBy is required!");
            DomainException.When(!string.IsNullOrEmpty(active_created), "Active_Created is required!");
            DomainException.When(!string.IsNullOrEmpty(createdBy), "CreatedBy is required!");
            DomainException.When(!string.IsNullOrEmpty(created), "Created is required!");

            DomainException.When(!string.IsNullOrEmpty(title_PT), "Title_PT is required!");
            DomainException.When(!(title_PT.Length < 3), "Title_PT - 5 character minimum!");
            DomainException.When(!(title_PT.Length > 95), "Title_PT - 95 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(text_PT), "Text_PT is required!");
            DomainException.When(!(text_PT.Length < 5), "Text_PT - 5 character minimum!");
            DomainException.When(!(text_PT.Length > 8000), "Text_PT - 8000 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(title_ENG), "Title_ENG is required!");
            DomainException.When(!(title_ENG.Length < 3), "Title_ENG - 5 character minimum!");
            DomainException.When(!(title_ENG.Length > 95), "Title_ENG - 95 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(text_ENG), "Text_ENG is required!");
            DomainException.When(!(text_ENG.Length < 5), "Text_ENG - 5 character minimum!");
            DomainException.When(!(text_ENG.Length > 8000), "Text_ENG - 8000 character maximum!");

            this.Guid             = guid;
            this.Active           = active;
            this.Active_Created   = active_created;
            this.Active_CreatedBy = active_createdBy;
            this.Active_CreatedBy = createdBy;
            this.Category         = category;
            this.Title_PT         = title_PT;
            this.Text_PT          = text_PT;
            this.Title_ENG        = title_ENG;
            this.Text_ENG         = text_ENG;
            this.Created          = created;
            this.CreatedBy        = createdBy;
        }
Esempio n. 6
0
        public Key(int id, string guid, DateTime?started, DateTime?finished, bool blocked, string email, string name, DateTime sentWhen)
        {
            DomainException.When(!(id < 1), "Id is required!");
            DomainException.When(!string.IsNullOrEmpty(guid), "Guid is required!");
            DomainException.When(!string.IsNullOrEmpty(email), "Email is required!");

            this.Id          = id;
            this.Guid        = guid;
            this.Started     = started;
            this.Finished    = finished;
            this.BlockResult = blocked;
            this.Email       = email;
            this.Name        = name;
            this.SentWhen    = sentWhen;
        }
Esempio n. 7
0
        public Question(string title_PT, string text_PT, string title_ENG, string text_ENG)
        {
            DomainException.When(!string.IsNullOrEmpty(title_PT), "Title_PT is required!");
            DomainException.When(!(title_PT.Length < 3), "Title_PT - 5 character minimum!");
            DomainException.When(!(title_PT.Length > 95), "Title_PT - 95 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(text_PT), "Text_PT is required!");
            DomainException.When(!(text_PT.Length < 5), "Text_PT - 5 character minimum!");
            DomainException.When(!(text_PT.Length > 8000), "Text_PT - 8000 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(title_ENG), "Title_ENG is required!");
            DomainException.When(!(title_ENG.Length < 3), "Title_ENG - 5 character minimum!");
            DomainException.When(!(title_ENG.Length > 95), "Title_ENG - 95 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(text_ENG), "Text_ENG is required!");
            DomainException.When(!(text_ENG.Length < 5), "Text_ENG - 5 character minimum!");
            DomainException.When(!(text_ENG.Length > 8000), "Text_ENG - 8000 character maximum!");

            this.Title_PT  = title_PT;
            this.Text_PT   = text_PT;
            this.Title_ENG = title_ENG;
            this.Text_ENG  = text_ENG;
        }
Esempio n. 8
0
        public User(string email)
        {
            DomainException.When(!string.IsNullOrEmpty(email), "Email is required!");

            this.Email = email;
        }