예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,Description,ResponsibleOrganization,Deadline,Status,Comment,Done,MeetingId,Subject")] ToDo toDo, bool sendNotification)
        {
            if (ModelState.IsValid)
            {
                toDo.OrganizationNumber = HttpContext.Session.GetString("OrganizationNumber");

                Notification notification = GetNotificationInfo(sendNotification);

                try {
                    await _meetingService.CreateToDo(toDo, notification);
                }
                catch (Exception ex) { Log.Error(ex.Message); }
                return(RedirectToAction(nameof(Index), new { meetingId = toDo.MeetingId, status = toDo.Status }));
            }
            return(View(toDo));
        }