コード例 #1
0
        public ActionResult Edit(Project project, string ProjectManagers)
        {
            var oldProject  = db.Projects.AsNoTracking().FirstOrDefault(p => p.Id == project.Id);
            var oldUserList = project.Users.ToList();

            //projectVM.projectValue.IsArchive = false;
            db.Entry(project).State = EntityState.Modified;
            //var userIdList = $"{ProjectManagers},{DeveloperId},{SubmitterId}";
            projectHelper.UpdateProjectUserIds(ProjectManagers, project.Id);

            db.SaveChanges();
            var newProject = db.Projects.AsNoTracking().FirstOrDefault(p => p.Id == project.Id);

            historyHelper.ProjectHistoriesEdit(oldProject, newProject);
            notificationHelper.ProjectChangedNotification(newProject, oldProject, oldUserList);
            return(RedirectToAction("Index"));
        }