public void DeleteVendContactContext(sp_VendContact_DM vendcontact) { using (VolTeerEntities context = new VolTeerEntities()) { var VendContacttoRemove = (from n in context.tblVendContacts where n.ContactID == vendcontact.ContactID & n.VendorID == vendcontact.VendorID select n).FirstOrDefault(); context.tblVendContacts.Remove(VendContacttoRemove); context.SaveChanges(); } }
public void DeleteContactContext(sp_VendContact_DM _caContact) { System.Web.Caching.Cache cache = HttpRuntime.Cache; sp_VendContact_DM cacheContact; cacheContact = (sp_VendContact_DM)cache[_caContact.ContactID.ToString()]; if (cacheContact != null) { cache.Remove(_caContact.ContactID.ToString()); } BLL.DeleteContactContext(_caContact); }
public void InsertVendContactContext(sp_VendContact_DM vendcontact) { using (VolTeerEntities context = new VolTeerEntities()) { var NewVendContact = new tblVendContact { VendorID = vendcontact.VendorID, ContactID = vendcontact.ContactID, PrimaryContact = vendcontact.PrimaryContact }; context.tblVendContacts.Add(NewVendContact); context.SaveChanges(); } }
public void UpdateContactContext(sp_VendContact_DM _caContact) { System.Web.Caching.Cache cache = HttpRuntime.Cache; sp_VendContact_DM cacheContact; cacheContact = (sp_VendContact_DM)cache[_caContact.ContactID.ToString()]; if (cacheContact != null) { cache.Remove(_caContact.ContactID.ToString()); } cache.Insert(_caContact.ContactID.ToString(), _caContact, null, DateTime.Now.AddSeconds(60), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.High, null); BLL.UpdateContactContext(_caContact); }
/// <summary> /// ListContacts - There's a good chance the same record may be requested often. Cache the contact object... /// /// </summary> /// <param name="Contacts"></param> /// <returns></returns> public sp_VendContact_DM ListContacts(int? VendContact) { sp_VendContact_DM cRating = new sp_VendContact_DM(); //Cache cache = HttpRuntime.Cache; System.Web.Caching.Cache cache = HttpRuntime.Cache; sp_VendContact_DM cacheRating; cacheContact = (sp_VendContact_DM)cache[VendContact.ToString()]; if (cacheContact == null) { caContact = BLL.ListContacts(VendContact); cache.Insert(caContact.ContactID.ToString(), caContact, null, DateTime.Now.AddSeconds(60), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.High, null); } else { caContact = cacheContact; } return caContact; }
public void InsertContactContext(sp_VendContact_DM _caContact) { BLL.InsertContactContext(_caContact); System.Web.Caching.Cache cache = HttpRuntime.Cache; cache.Insert(_caContact.ContactID.ToString(), _caContact, null, DateTime.Now.AddSeconds(60), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.High, null); }
public void UpdateVendContactContext(sp_VendContact_DM vendcontact) { DAL.UpdateVendContactContext(vendcontact); }
public void InsertVendContactContext(sp_VendContact_DM vendcontact) { DAL.InsertVendContactContext(vendcontact); }
public void DeleteVendContactContext(sp_VendContact_DM vendcontact) { DAL.DeleteVendContactContext(vendcontact); }
public void UpdateVendContactContext(sp_VendContact_DM vendcontact) { using (VolTeerEntities context = new VolTeerEntities()) { var ExistingVendContact = context.tblVendContacts.Find(vendcontact.VendorID, vendcontact.ContactID); if (ExistingVendContact != null) { ExistingVendContact.PrimaryContact = vendcontact.PrimaryContact; context.SaveChanges(); } } }