public void ContactScheduleAdd(ContactScheduleViewModel model) { ContactSchedule contact = new ContactSchedule { ContactEmail = model.ContactEmail, ContactFirstName = model.ContactFirstName, ContactLastName = model.ContactLastName, ContactPhone = model.ContactPhone, ContactPhoneExt = model.ContactPhoneExt, ContactTitle = model.ContactTitle, MemberCoverageID = model.MemberCoverageID }; ContextPerRequest.CurrentData.ContactSchedules.Add(contact); ContextPerRequest.CurrentData.SaveChanges(); }
public void ContactScheduleEdit(ContactScheduleViewModel model) { string UserId = BHIP.Model.Helper.Security.GetLoggedInUserID(); var query = (from contact in ContextPerRequest.CurrentData.ContactSchedules where contact.ContactScheduleID == model.ContactScheduleID select contact).FirstOrDefault <ContactSchedule>(); if (query != null) { query.ContactEmail = model.ContactEmail; query.ContactFirstName = model.ContactFirstName; query.ContactLastName = model.ContactLastName; query.ContactPhone = model.ContactPhone; query.ContactPhoneExt = model.ContactPhoneExt; query.ContactTitle = model.ContactTitle; query.MemberCoverageID = model.MemberCoverageID; ContextPerRequest.CurrentData.SaveChanges(); } }
public void ContactScheduleEdit(ContactScheduleViewModel model) { string UserId = BHIP.Model.Helper.Security.GetLoggedInUserID(); ContactScheduleHold hold = new ContactScheduleHold { ContactEmail = model.ContactEmail, ContactFirstName = model.ContactFirstName, ContactLastName = model.ContactLastName, ContactPhone = model.ContactPhone, ContactPhoneExt = model.ContactPhoneExt, ContactTitle = model.ContactTitle, ContactScheduleID = model.ContactScheduleID, EditType = "Edit", MemberCoverageID = model.MemberCoverageID, ScheduleStatusID = 2, UserID = UserId }; ContextPerRequest.CurrentData.ContactScheduleHolds.Add(hold); ContextPerRequest.CurrentData.SaveChanges(); }