/// <summary>
 ///
 /// </summary>
 /// <param name="contactRelationId"></param>
 /// <param name="data"></param>
 /// <returns></returns>
 public async Task <ContactRelation?> UpdateContactRelationAsync(int contactRelationId, ContactRelation data)
 => await _api.PostAsync <ContactRelation>("2.0/contact_relation/" + contactRelationId, data);
 public PostalContact(string postalAddress,
                      string label,
                      ContactRelation relation)
   : base(label, relation) {
   this.postalAddress = postalAddress;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public async Task <ContactRelation?> CreateContactRelationAsync(ContactRelation data)
 => await _api.PostAsync <ContactRelation>("2.0/contact_relation", data);
 public IMContact(string imAddress,
                  string protocol,
                  string label,
                  ContactRelation relation)
   : base(label, relation) {
   this.imAddress = imAddress;
   this.protocol = protocol;
 }
 public PhoneContact(string phoneNumber,
                     string label,
                     ContactRelation relation)
   : base(label, relation) {
   this.phoneNumber = phoneNumber;
 }
 public EmailContact(string emailAddress,
                     string label,
                     ContactRelation relation,
                     bool isPrimary)
   : base(label, relation) {
   this.emailAddress = emailAddress;
   this.isPrimary = isPrimary;
 }
 public ContactElement(string label,
                       ContactRelation relation) {
   this.label = label;
   this.relation = relation;
 }
 static string GetRelationURI(ContactRelation contactRelation) {
   switch (contactRelation) {
     case ContactRelation.Home:
       return "http://schemas.google.com/g/2005#home";
     case ContactRelation.Mobile:
       return "http://schemas.google.com/g/2005#mobile";
     case ContactRelation.Pager:
       return "http://schemas.google.com/g/2005#pager";
     case ContactRelation.Work:
       return "http://schemas.google.com/g/2005#work";
     case ContactRelation.HomeFax:
       return "http://schemas.google.com/g/2005#home_fax";
     case ContactRelation.WorkFax:
       return "http://schemas.google.com/g/2005#work_fax";
     case ContactRelation.Other:
       return "http://schemas.google.com/g/2005#other";
     case ContactRelation.Label:
     default:
       Debug.Fail("Should not be called for this");
       return string.Empty;
   }
 }
 static string GetNotesEmailTemplate(ContactRelation contactRelation) {
   switch (contactRelation) {
     case ContactRelation.Home:
       return Resources.HomeEmailTemplateText;
     case ContactRelation.Mobile:
       return Resources.OtherEmailTemplateText;
     case ContactRelation.Pager:
       return Resources.OtherEmailTemplateText;
     case ContactRelation.Work:
       return Resources.WorkEmailTemplateText;
     case ContactRelation.HomeFax:
       return Resources.OtherEmailTemplateText;
     case ContactRelation.WorkFax:
       return Resources.OtherEmailTemplateText;
     case ContactRelation.Other:
       return Resources.OtherEmailTemplateText;
     case ContactRelation.Label:
       return Resources.LabelEmailTemplateText;
     default:
       Debug.Fail("Should not be called for this");
       return string.Empty;
   }
 }
Example #10
0
        /// <summary>
        /// Marks invalid/valid feilds by calling their Mark(In)Valid functions
        /// returns true if all fields contain valid data, false otherwise.
        /// </summary>
        /// <returns></returns>
        private bool ValidateFields()
        {
            bool allValid = true;

            if (FirstName.TextField.Text == FirstName.Hint)
            {
                FirstName.MarkInvalid();
                allValid = false;
            }
            else
            {
                FirstName.MarkValid();
            }

            if (LastName.TextField.Text == LastName.Hint)
            {
                LastName.MarkInvalid();
                allValid = false;
            }
            else
            {
                LastName.MarkValid();
            }

            if (!IsHealthcareIDValid() || HealthID.TextField.Text == HealthID.Hint)
            {
                HealthID.MarkInvalid();
                allValid = false;
            }
            else
            {
                HealthID.MarkValid();
            }

            if (!Birthdate.DateSelected.HasValue)
            {
                Birthdate.InputText.MarkInvalid();
                allValid = false;
            }
            else
            {
                Birthdate.InputText.MarkValid();
            }

            if (Address.TextField.Text == Address.Hint)
            {
                Address.MarkInvalid();
                allValid = false;
            }
            else
            {
                Address.MarkValid();
            }

            if (City.TextField.Text == City.Hint)
            {
                City.MarkInvalid();
                allValid = false;
            }
            else
            {
                City.MarkValid();
            }

            if (!IsPostalCodeValid())
            {
                PostalCode.MarkInvalid();
                allValid = false;
            }
            else
            {
                PostalCode.MarkValid();
            }

            if (!IsPhoneNumberValid(HomePhone))
            {
                HomePhone.MarkInvalid();
                allValid = false;
            }
            else
            {
                HomePhone.MarkValid();
            }

            //Optional Business Phone, if it is filled in, ensure it is at least a 10 digit number
            if (BusinessPhone.TextField.Text != BusinessPhone.Hint && BusinessPhone.TextField.Text.Length < 14)
            {
                BusinessPhone.MarkInvalid();
                allValid = false;
            }
            else
            {
                BusinessPhone.MarkValid();
            }

            //Optional Cell Phone, if it is filled in, ensure it is at least a 10 digit number
            if (CellPhone.TextField.Text != CellPhone.Hint && CellPhone.TextField.Text.Length < 14)
            {
                CellPhone.MarkInvalid();
                allValid = false;
            }
            else
            {
                CellPhone.MarkValid();
            }

            if (ContactName.TextField.Text == ContactName.Hint)
            {
                ContactName.MarkInvalid();
                allValid = false;
            }
            else
            {
                ContactName.MarkValid();
            }

            if (ContactRelation.TextField.Text == ContactRelation.Hint)
            {
                ContactRelation.MarkInvalid();
                allValid = false;
            }
            else
            {
                ContactRelation.MarkValid();
            }

            if (!IsPhoneNumberValid(ContactPhone))
            {
                ContactPhone.MarkInvalid();
                allValid = false;
            }
            else
            {
                ContactPhone.MarkValid();
            }

            return(allValid);
        }