Exemple #1
0
 public Milestone(MilestoneEntity entity)
 {
     Id = entity.Id;
     Name = entity.Name;
     StartDate = entity.StartDate;
     EndDate = entity.EndDate;
     IsClosed = entity.IsClosed;
 }
Exemple #2
0
        public MilestoneEntity StartNewMilestone(MilestoneEntity newMilestone, MilestoneEntity oldMilestone)
        {
            _storage.MilestoneRepository.OpenConnection();

            oldMilestone.IsClosed = true;
            oldMilestone.EndDate = DateTime.Today;
            _storage.MilestoneRepository.Update(oldMilestone);
            var result = _storage.MilestoneRepository.Add(newMilestone);

            var saveChangesResult = _storage.MilestoneRepository.SaveChanges();
            _storage.MilestoneRepository.CloseConnection();

            return saveChangesResult
                        ? result
                        : null;
        }