Пример #1
0
        public void Entity_Equals_BeTrue()
        {
            //Arrange
            var       id         = Guid.NewGuid();
            Telephone telephone  = new Telephone(id, "212", "5513394", "home");
            Telephone telephone2 = new Telephone(id, "212", "5513394", "home");

            //Act
            var isEqual = telephone.Equals(telephone2);


            //Assert
            isEqual.Should().BeTrue();
        }
        public string GetFormattedDetails()
        {
            List <string> details = new List <string>();

            if (Institution != "")
            {
                details.Add(Institution);
            }
            if (StreetName != "")
            {
                details.Add(StreetName + (StreetNumber != "" ? Characters.FIXED_SPACE + StreetNumber : "") + (Box != "" ? Characters.FIXED_SPACE + Box : ""));
            }
            if (PostalCode != "")
            {
                details.Add(PostalCode + (Town != "" ? Characters.FIXED_SPACE + Town : ""));
            }
            if (Telephone != "" && Telephone.Equals(Fax))
            {
                if (Telephone != "")
                {
                    details.Add("T/F" + Characters.FIXED_SPACE + Telephone.Replace("-", Characters.NOBREAK_HYPHEN));
                }
            }
            else
            {
                if (Telephone != "")
                {
                    details.Add("T" + Characters.FIXED_SPACE + Telephone.Replace("-", Characters.NOBREAK_HYPHEN));
                }
                if (Fax != "")
                {
                    details.Add("F" + Characters.FIXED_SPACE + Fax.Replace("-", Characters.NOBREAK_HYPHEN));
                }
            }
            if (Cellphone != "")
            {
                details.Add("G" + Characters.FIXED_SPACE + Cellphone.Replace("-", Characters.NOBREAK_HYPHEN));
            }
            if (Email != "")
            {
                details.Add(Email);
            }

            return(string.Join(Characters.FIXED_SPACE + Characters.NOBREAK_HYPHEN + " ", details.ToArray()));
        }
Пример #3
0
        /// <summary>
        /// Returns true if Incident instances are equal
        /// </summary>
        /// <param name="other">Instance of Incident to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Incident other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Incidentid == other.Incidentid ||
                     Incidentid != null &&
                     Incidentid.Equals(other.Incidentid)
                     ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     Position == other.Position ||
                     Position != null &&
                     Position.Equals(other.Position)
                 ) &&
                 (
                     Prio == other.Prio ||
                     Prio != null &&
                     Prio.Equals(other.Prio)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     Probability == other.Probability ||
                     Probability != null &&
                     Probability.Equals(other.Probability)
                 ) &&
                 (
                     Interventionplan == other.Interventionplan ||
                     Interventionplan != null &&
                     Interventionplan.Equals(other.Interventionplan)
                 ) &&
                 (
                     Incidenttime == other.Incidenttime ||
                     Incidenttime != null &&
                     Incidenttime.Equals(other.Incidenttime)
                 ) &&
                 (
                     Wbid == other.Wbid ||
                     Wbid != null &&
                     Wbid.Equals(other.Wbid)
                 ) &&
                 (
                     Telephone == other.Telephone ||
                     Telephone != null &&
                     Telephone.Equals(other.Telephone)
                 ) &&
                 (
                     AdditionalMedia == other.AdditionalMedia ||
                     AdditionalMedia != null &&
                     AdditionalMedia.Equals(other.AdditionalMedia)
                 ) &&
                 (
                     MediaType == other.MediaType ||
                     MediaType != null &&
                     MediaType.Equals(other.MediaType)
                 ) &&
                 (
                     Area == other.Area ||
                     Area != null &&
                     MediaType.Equals(other.Area)
                 ));
        }
Пример #4
0
 private async Task RegisterUserAsync()
 {
     if (Nid == null || Nid.Equals(""))
     {
         UserTittle = "Ingrese Nid";
         _textBoxNid.Focus(FocusState.Programmatic);
     }
     else
     {
         if (Name == null || Name.Equals(""))
         {
             UserTittle = "Ingrese el nombre";
             _textBoxName.Focus(FocusState.Programmatic);
         }
         else
         {
             if (LastName == null || LastName.Equals(""))
             {
                 UserTittle = "Ingrese el apellido";
                 _textBoxLastName.Focus(FocusState.Programmatic);
             }
             else
             {
                 if (Telephone == null || Telephone.Equals(""))
                 {
                     UserTittle = "Ingrese el Numero de telefono";
                     _textBoxTelephone.Focus(FocusState.Programmatic);
                 }
                 else
                 {
                     if (Email == null || Email.Equals(""))
                     {
                         UserTittle = "Ingrese el email";
                         _textBoxEmail.Focus(FocusState.Programmatic);
                     }
                     else
                     {
                         if (TextBoxEvent.IsValidEmail(Email))
                         {
                             if (Password == null || Password.Equals(""))
                             {
                                 UserTittle = "Ingrese la contrseña";
                                 _textBoxPass.Focus(FocusState.Programmatic);
                             }
                             else
                             {
                                 if (User == null || User.Equals(""))
                                 {
                                     UserTittle = "Ingrese el usuario";
                                     _textBoxUser.Focus(FocusState.Programmatic);
                                 }
                                 else
                                 {
                                     if (SelectedRole == null || SelectedRole.Equals(""))
                                     {
                                         UserTittle = "Seleccione un rol";
                                     }
                                     else
                                     {
                                         await SaveDataAsync();
                                     }
                                 }
                             }
                         }
                         else
                         {
                             UserTittle = "el Email no es valido";
                             _textBoxEmail.Focus(FocusState.Programmatic);
                         }
                     }
                 }
             }
         }
     }
 }