public void ContactScheduleDelete(int contactScheduleId) { string UserId = BHIP.Model.Helper.Security.GetLoggedInUserID(); var query = (from contact in ContextPerRequest.CurrentData.ContactSchedules where contact.ContactScheduleID == contactScheduleId select contact).FirstOrDefault(); if (query != null) { ContactScheduleHoldViewModel hold = new ContactScheduleHoldViewModel { ContactEmail = query.ContactEmail, ContactFirstName = query.ContactFirstName, ContactLastName = query.ContactLastName, ContactPhone = query.ContactPhone, ContactPhoneExt = query.ContactPhoneExt, ContactTitle = query.ContactTitle, MemberCoverageID = query.MemberCoverageID, ContactScheduleID = query.ContactScheduleID, EditType = "Delete", ScheduleStatusID = 2, MemberID = BHIP.Model.Helper.MemberInformation.GetMemberID(query.MemberCoverageID), UserID = UserId }; ContextPerRequest.CurrentData.ContactSchedules.Remove(query); ContextPerRequest.CurrentData.SaveChanges(); } }
public void ContactScheduleHoldSave(ContactScheduleHoldViewModel model) { var query = (from contact in ContextPerRequest.CurrentData.ContactScheduleHolds where contact.ContactScheduleHoldID == model.ContactScheduleHoldID select contact).FirstOrDefault(); query.ContactEmail = model.ContactEmail; query.ContactFirstName = model.ContactFirstName; query.ContactLastName = model.ContactLastName; query.ContactPhone = model.ContactPhone; query.ContactPhoneExt = model.ContactPhoneExt; query.ContactTitle = model.ContactTitle; ContextPerRequest.CurrentData.SaveChanges(); }