Пример #1
0
 public Person FindPerson(Person person)
 {
     if (String.IsNullOrEmpty(person.Email))
     {
         throw new CodeCampAuthorizationException("Email is missing");
     }
     return this.CodeCampDataService.FindPersonByEmail(person);
 }
        private bool CheckIfCodeCampPersonExists(string emailAddress)
        {
            this.Person = CodeCampDataService.FindPersonByEmail(emailAddress);

            if (this.Person != null)
            {
                return true;
            }

            return false;
        }
Пример #3
0
        private static bool ValidatePerson(Person person)
        {
            if (!String.IsNullOrEmpty(person.Email))
            {
                throw new CodeCampAuthorizationException("Email is null or empty");
            }

            if(!String.IsNullOrEmpty(person.Name))
            {
                throw new CodeCampAuthorizationException("Name is null or empty");
            }

            if(!String.IsNullOrEmpty(person.PasswordHash))
            {
                throw new CodeCampAuthorizationException("PasswordHash is null or empty");
            }
            
            return true;
        }
Пример #4
0
        public void ResetAttendeePassword(Person person)
        {

            base.ResetPeoplePassword(person);
        }
Пример #5
0
 public Person FindPersonByEmail(Person person)
 {
     return base.GetPersonByEmail(person.Email);
 }
Пример #6
0
 public void AddPerson(Person person)
 {
     base.InsertPerson(person);
 }
Пример #7
0
 public void AddPerson(Person person)
 {
     if (!ValidatePerson(person))
     this.CodeCampDataService.AddPerson(person);    
 }
Пример #8
0
 /// <summary>
 /// Deprecated Method for adding a new object to the People EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPeople(Person person)
 {
     base.AddObject("People", person);
 }
Пример #9
0
 /// <summary>
 /// Create a new Person object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="firstName">Initial value of the FirstName property.</param>
 /// <param name="lastName">Initial value of the LastName property.</param>
 /// <param name="email">Initial value of the Email property.</param>
 /// <param name="passwordHash">Initial value of the PasswordHash property.</param>
 public static Person CreatePerson(global::System.Int32 id, global::System.String firstName, global::System.String lastName, global::System.String email, global::System.String passwordHash)
 {
     Person person = new Person();
     person.Id = id;
     person.FirstName = firstName;
     person.LastName = lastName;
     person.Email = email;
     person.PasswordHash = passwordHash;
     return person;
 }