partial void DeleteT_AllowedContact(T_AllowedContact instance);
 partial void InsertT_AllowedContact(T_AllowedContact instance);
 partial void UpdateT_AllowedContact(T_AllowedContact instance);
Esempio n. 4
0
		private T_AllowedContact SaveContactPreferences(ContactPreferences contact, int id)
		{
			using (var dc = new EngageCCTDataClassesDataContext())
			{
				T_AllowedContact tContact = dc.T_AllowedContacts.SingleOrDefault(c => c.LeadID == id);
				if (tContact == null)
				{
					tContact = new T_AllowedContact();
					tContact.LeadID = id;
					dc.T_AllowedContacts.InsertOnSubmit(tContact);
				}
				tContact.acBusinessPhone = contact.IsAllowBusinessPhone;
				tContact.acCellPhone = contact.IsAllowMobilePhone;
				tContact.acEmail = contact.IsAllowEmail;
				tContact.acFax = contact.IsAllowFax;
				tContact.acHomePhone = contact.IsAllowHomePhone;
				tContact.acSkypeName = contact.IsAllowSkype;
				tContact.acPreferredContact = contact.PreferredContact;
				dc.SubmitChanges();
				return tContact;
			}
		}