Ejemplo n.º 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);
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 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 );
 }
Ejemplo n.º 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 );
                }
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
 }