Пример #1
0
        public Progress SaveProgress(Progress progress, int userId)
        {
            var progressId       = progress.PlanningWizardProgressID;
            var existingProgress = _planningRepository.FindBy <Progress>(p => p.UserID == userId && p.PlanningWizardProgressID == progressId).FirstOrDefault();

            if (existingProgress == null)
            {
                throw new Exception("Planning progress does not exist");
            }

            UpdateActionItems(progress, existingProgress);

            existingProgress.ModifyDate    = progress.ModifyDate;
            existingProgress.ModifyDateUtc = progress.ModifyDateUtc;
            existingProgress.ModifyUserID  = progress.ModifyUserID;

            existingProgress.PercentComplete = progress.PercentComplete;
            existingProgress.CurrentPlanningWizardPhaseID = progress.CurrentPlanningWizardPhaseID;
            existingProgress.ProgressXml = progress.Phases.ToXml();

            _planningRepository.Update(existingProgress);
            _planningRepository.Save();

            return(existingProgress);
        }
 public PlanningEntity Update(int idPlanning, PlanningEntity planning, int adminId)
 {
     return(_repository.Update(idPlanning, planning, adminId));
 }
Пример #3
0
 public Planning Update(Planning planning)
 {
     return(_planningRepository.Update(planning));
 }