public override void ProcessStarted(Guid documentId, EXP_Activities activity) { var document = _context.EXP_ExpertiseStageDosage.FirstOrDefault(e => e.Id == documentId); document.FinalDocStatusId = DictionaryHelper.GetDicIdByCode(Dictionary.EXP_DocumentStatus.DicCode, Dictionary.EXP_DocumentStatus.StatusOnAgreement); var documentType = DictionaryHelper.GetDicItemById(activity.DocumentTypeId); var task = activity.EXP_Tasks.FirstOrDefault(); var agreementTaskType = DictionaryHelper.GetDicItemById(task.TypeId); var taskTypeName = agreementTaskType.Code == Dictionary.ExpTaskType.Agreement ? "на согласование" : "для утверждения"; _context.SaveChanges(); var notificationText = string.Format("К вам поступил \"{0}\" {1}", documentType.Name, taskTypeName); var notificationManager = new NotificationManager(); notificationManager.SendNotification(notificationText, ObjectType.PrimaryFinalDoc, documentId, task.ExecutorId); }