Пример #1
0
        /// <summary>
        /// Adds the problem.
        /// </summary>
        /// <param name="problem">The problem.</param>
        /// <returns>A VisitProblem.</returns>
        public virtual VisitProblem AddProblem(Problem problem)
        {
            var visitProblem = new VisitProblem(this, problem);

            _problems.Add(visitProblem);

            NotifyItemAdded(() => Problems, visitProblem);

            return(visitProblem);
        }
Пример #2
0
        /// <summary>
        /// Associates the problems.
        /// </summary>
        /// <param name="problems">The problems.</param>
        public virtual void AssociateProblems(IEnumerable <Problem> problems)
        {
            foreach (var problem in problems)
            {
                var prob = problem;

                var visitProblem = _problems.SingleOrDefault(p => p.Problem.Key == prob.Key);

                if (visitProblem == null)
                {
                    var newVisitProblem = new VisitProblem(this, problem);
                    _problems.Add(newVisitProblem);

                    NotifyItemAdded(() => Problems, newVisitProblem);
                }
            }
        }
Пример #3
0
 /// <summary>
 /// Deletes the problem.
 /// </summary>
 /// <param name="problem">The problem.</param>
 public virtual void DeleteProblem( VisitProblem problem )
 {
     _problems.Delete(problem);
     NotifyItemRemoved ( () => Problems, problem );
 }
Пример #4
0
        /// <summary>
        /// Associates the problems.
        /// </summary>
        /// <param name="problems">The problems.</param>
        public virtual void AssociateProblems( IEnumerable<Problem> problems )
        {
            foreach ( var problem in problems )
            {
                var prob = problem;

                var visitProblem = _problems.SingleOrDefault ( p => p.Problem.Key == prob.Key );

                if ( visitProblem == null )
                {
                    var newVisitProblem = new VisitProblem ( this, problem );
                    _problems.Add ( newVisitProblem );

                    NotifyItemAdded ( () => Problems, newVisitProblem );
                }
            }
        }
Пример #5
0
        /// <summary>
        /// Adds the problem.
        /// </summary>
        /// <param name="problem">The problem.</param>
        /// <returns>A VisitProblem.</returns>
        public virtual VisitProblem AddProblem( Problem problem )
        {
            var visitProblem = new VisitProblem ( this, problem );
            _problems.Add ( visitProblem );

            NotifyItemAdded ( () => Problems, visitProblem );

            return visitProblem;
        }
Пример #6
0
 /// <summary>
 /// Deletes the problem.
 /// </summary>
 /// <param name="problem">The problem.</param>
 public virtual void DeleteProblem(VisitProblem problem)
 {
     _problems.Delete(problem);
     NotifyItemRemoved(() => Problems, problem);
 }