예제 #1
0
 public Contact(Int32?id, Core.Database.Contact contact)
 {
     this.Id = id;
     if (contact != null)
     {
         this.Name = contact.LastName + ", " + contact.FirstName;
         if (contact.AgencyNameId.HasValue)
         {
             this.Company = contact.Agency.NameCompany;
         }
     }
 }
예제 #2
0
        public String GetName(Core.Database.Contact contact)
        {
            String result = "";

            if (!String.IsNullOrEmpty(contact.Salutation))
            {
                result += contact.Salutation + " ";
            }
            if (!String.IsNullOrEmpty(contact.MiddleName))
            {
                result += contact.FirstName + " " + contact.MiddleName + " " + contact.LastName;
            }
            else
            {
                result += contact.FirstName + " " + contact.LastName;
            }
            return(result);
        }
예제 #3
0
        public String GetContactSityStateZip(Core.Database.Contact contact)
        {
            String result = String.Empty;

            if (!String.IsNullOrEmpty(contact.City))
            {
                result += ", " + contact.City;
            }
            if (!String.IsNullOrEmpty(contact.State))
            {
                result += ", " + contact.State;
            }
            if (!String.IsNullOrEmpty(contact.Zip))
            {
                result += " " + contact.Zip;
            }
            return(result);
        }
예제 #4
0
        public String GetAddress(Core.Database.Contact contact)
        {
            String result = contact.Address1;

            if (!String.IsNullOrEmpty(contact.Address2))
            {
                result += ", " + contact.Address2;
            }
            if (!String.IsNullOrEmpty(contact.City))
            {
                result += ", " + contact.City;
            }
            if (!String.IsNullOrEmpty(contact.State))
            {
                result += ", " + contact.State;
            }
            if (!String.IsNullOrEmpty(contact.Zip))
            {
                result += " " + contact.Zip;
            }
            return(result);
        }