Пример #1
0
        public async Task <IActionResult> Audit(AuditInvestigationViewModel model)
        {
            if (ModelState.IsValid)
            {
                var investigation = await _investigationManager.FindByIdAsync(model.Id);

                if (investigation == null)
                {
                    return(NotFound(model.Id));
                }
                await _investigationManager.AuditAsync(investigation, model.IsQualified, model.QualifiedRemark);

                Notifier.Success($"你已成功审核了“{investigation.Name}”的意向调查记录!");

                //通知其处理人
                //var notification = new NotifyEntry()
                //{
                //    Content = $"我刚刚将你的一份关于“{investigation.Name}”的意向调查标记为{(model.IsQualified ? "合格" : "不合格")},<a href=\"/Investigation/View/{investigation.Id}\">查看意向调查</a>"
                //};
                //notification.Receivers.Add(investigation.CreatedBy);
                //await Notifier.NotifyAsync(notification);

                return(RedirectToAction(nameof(List)));
            }
            return(View(model));
        }