public void DeleteMessagesForUser(string userId) { var messages = (from m in _messageRepository.GetAll() where m.ReceivingUserId == userId || m.SendingUserId == userId select m).ToList(); foreach (var m in messages) { foreach (var mr in m.MessageRecipients.ToList()) { _messageRecipientRepository.DeleteOnSubmit(mr); } _messageRepository.DeleteOnSubmit(m); } var messageRecipients = (from m in _messageRecipientRepository.GetAll() where m.UserId == userId select m).ToList(); foreach (var m in messageRecipients) { _messageRecipientRepository.DeleteOnSubmit(m); } }
public void DeleteCalendarItemType(CalendarItemType type) { if (type != null) { _calendarItemTypeRepository.DeleteOnSubmit(type); } }
public void DeleteRoleUsers(List <PersonnelRoleUser> users) { foreach (var user in users) { _personnelRoleUsersRepository.DeleteOnSubmit(user); } }
public void DeleteType(int typeId) { var type = GetTypeById(typeId); var inventories = _inventoryRepository.GetAll().Where(x => x.TypeId == typeId); _inventoryRepository.DeleteAll(inventories); _inventoryTypesRepository.DeleteOnSubmit(type); }
public void DeleteInvite(int inviteId) { var invite = GetInviteById(inviteId); if (invite != null) { _invitesRepository.DeleteOnSubmit(invite); } }
public void DeleteUnitType(int unitTypeId) { var type = GetUnitTypeById(unitTypeId); if (type != null) { _unitTypesRepository.DeleteOnSubmit(type); } }
public void DeleteCalendarAttendeeById(int calendarAttendeeId) { var item = GetCalendarAttendeeById(calendarAttendeeId); if (item != null) { _calendarItemAttendeeRepository.DeleteOnSubmit(item); } }
public void DeletePOIType(int poiTypeId) { var type = _poiTypesRepository.GetAll().FirstOrDefault(x => x.PoiTypeId == poiTypeId); if (type != null) { _poiTypesRepository.DeleteOnSubmit(type); } }
public void DeleteCallLog(int callLogId) { var log = GetCallLogById(callLogId); if (log != null) { _callLogsRepository.DeleteOnSubmit(log); } }
public void RemoveUserFromAllLists(string userId) { var members = _distributionListMemberRepository.GetAll().Where(x => x.UserId == userId).ToList(); foreach (var member in members) { _distributionListMemberRepository.DeleteOnSubmit(member); } }
public void DeleteShiftGroupsByGroupId(int departmentGroupId) { var groups = _shiftGroupsRepository.GetAll().Where(x => x.DepartmentGroupId == departmentGroupId).ToList(); foreach (var group in groups) { _shiftGroupsRepository.DeleteOnSubmit(group); } }
public void DeleteAuditLogById(int auditLogId) { var auditLog = GetAuditLogById(auditLogId); if (auditLog != null) { _auditLogsRepository.DeleteOnSubmit(auditLog); } }
public void DeleteLog(int logId) { var log = GetWorkLogById(logId); if (log != null) { _logsRepository.DeleteOnSubmit(log); } }
public void DeleteCertificationTypeById(int certificationTypeId) { var type = GetCertificationTypeById(certificationTypeId); if (type != null) { _departmentCertificationTypeRepository.DeleteOnSubmit(type); } }
public void DeleteUnit(int unitId) { var unit = _unitsRepository.GetAll().FirstOrDefault(x => x.UnitId == unitId); if (unit != null) { var states = _unitStatesRepository.GetAll().Where(x => x.UnitId == unitId); if (states != null && states.Any()) { _unitStatesRepository.DeleteAll(states); } _unitsRepository.DeleteOnSubmit(unit); _eventAggregator.SendMessage <DepartmentSettingsUpdateEvent>(new DepartmentSettingsUpdateEvent() { DepartmentId = unit.DepartmentId }); } }
public void DeleteFollow(DepartmentProfileUserFollow follow) { _departmentProfileUserFollowRepository.DeleteOnSubmit(follow); }
public void DeleteDistributionListsById(int distributionListId) { var list = GetDistributionListById(distributionListId); _distributionListRepository.DeleteOnSubmit(list); }
public void DeleteProtocol(int id) { var procotol = GetProcotolById(id); _dispatchProtocolRepository.DeleteOnSubmit(procotol); }
public void DeleteShiftSignup(ShiftSignup signup) { _shiftSignupRepository.DeleteOnSubmit(signup); }
public void DeleteShift(Shift shift) { _shiftsRepository.DeleteOnSubmit(shift); }
public void DeleteCertification(PersonnelCertification certification) { _personnelCertificationRepository.DeleteOnSubmit(certification); }
public void DeleteRoleById(int roleId) { var role = GetRoleById(roleId); _personnelRolesRepository.DeleteOnSubmit(role); }
public void DeleteDocument(Document document) { _documentRepository.DeleteOnSubmit(document); }
public void DeleteCallQuickTemplate(int id) { var template = GetCallQuickTemplateById(id); _callQuickTemplateRepository.DeleteOnSubmit(template); }
public void Delete(Note note) { _notesRepository.DeleteOnSubmit(note); }
public void DeleteFile(File file) { _fileRepository.DeleteOnSubmit(file); }