void FillActionUserGroup(AuditActionDto actionCode, ActionUserGroup actionUserGroup) { actionUserGroup.From = actionCode.NotificationFromEmail; actionUserGroup.ToEmails = actionCode.NotificationEmails; actionUserGroup.Subject = actionCode.NotificationSubject; actionUserGroup.Message = actionCode.NotificationMessage; }
void AddOrUpdateActionUserGroups(AuditActionDto actionCode, List <ActionUserGroup> actionUserGroups) { try { if (actionCode.SendNotification) { var actionUserGroup = AuditUnitOfWork.ActionUserGroupRepository.GetFirst(a => a.Audit_ActionCode == actionCode.ActionCode); if (actionUserGroup != null) { FillActionUserGroup(actionCode, actionUserGroup); AuditUnitOfWork.ActionUserGroupRepository.Update(actionUserGroup); } else { actionUserGroup = new ActionUserGroup(); actionUserGroup.Audit_ActionCode = actionCode.ActionCode; FillActionUserGroup(actionCode, actionUserGroup); actionUserGroups.Add(actionUserGroup); } } } catch (Exception ex) { ErrorLoger.Log(ex); } }
void AddOrUpdateActions(AuditActionDto actionCode, List <Persistance.Models.Action> actions) { try { var action = AuditUnitOfWork.ActionRepository.GetFirst(a => a.Code == actionCode.ActionCode); if (action != null) { action.SendNotification = actionCode.SendNotification; AuditUnitOfWork.ActionRepository.Update(action); } else { action = new Persistance.Models.Action() { Code = actionCode.ActionCode, SendNotification = actionCode.SendNotification }; actions.Add(action); } } catch (Exception ex) { ErrorLoger.Log(ex); } }