private void LoadMaritalStatuses()
 {
     Type _enumType = typeof (MaritalStatas);
     FieldInfo[] infos;
     infos = _enumType.GetFields(BindingFlags.Public | BindingFlags.Static);
     MaritalStatusList.Clear();
     foreach (FieldInfo fi in infos)
         MaritalStatusList.Add((MaritalStatas) Enum.Parse(_enumType, fi.Name, true));
     SelectedMaritalStatus = MaritalStatusList.FirstOrDefault(n => n == Contact.MStatus);
 }
Example #2
0
        protected Guid AddContact(Guid cCId, string contactPerson, string telephone, string fax, string mobile, string address1, string address2, string locality, string postalCode, string city, int classification, MaritalStatas maritalStatus, Guid contactType, int contactOwner,string email)
        {

            Contact contact = new Contact(Guid.NewGuid())
            {
                ContactOwnerMasterId = cCId,
                Firstname = contactPerson,
                BusinessPhone = telephone,
                Fax = fax,
                MobilePhone = mobile,
                PhysicalAddress = address1,
                PostalAddress = address2,
                Company = locality,
                Email = email,
                City = city,
                ContactClassification = ContactClassification.PrimaryContact,
                ContactOwnerType = ContactOwnerType.Distributor,
                 MStatus=MaritalStatas.Single,
                 ContactType=_contactTypeRepository.GetById(contactType)
            };
            contact._SetStatus(EntityStatus.Active);
            return _contactRepository.Save(contact);

        }
 public void Setup(Contact contact)
 {
     Contact = contact.Clone<Contact>();
     LoadContactTypes();
     LoadMaritalStatuses();
     if (Contact.ContactType != null)
     {
         SelectedContactType = ContactTypesList.FirstOrDefault(n => n.Id == Contact.ContactType.Id);
         SelectedMaritalStatus = Contact.MStatus;
     }
 }