private void AddNewOutcome(object sender, RoutedEventArgs e)
 {
     ILR.DPOutcome dpo = _learnerDP.CreateOutcome();
     if (LearnerOutcomeItemsCV == null)
     {
         LearnerOutcomeItemsCV = CollectionViewSource.GetDefaultView(_learnerDP.DPOutcomeList);
         LearnerOutcomeItemsCV.CurrentChanged += LearnerOutcomeItemsCV_CurrentChanged;
     }
     else
     {
         LearnerOutcomeItemsCV = CollectionViewSource.GetDefaultView(_learnerDP.DPOutcomeList);
     }
     LearnerOutcomeItemsCV.MoveCurrentTo(dpo);
     foreach (ILR.DPOutcome xDp in LearnerOutcomeItemsCV)
     {
         xDp.IsSelected = false;
     }
     SetSubControl(LearnerOutcomeItemsCV.CurrentItem as ILR.DPOutcome);
     if (LearnerOutcomeItemsCV.CurrentItem != dpo)
     {
         if (!dpo.IsSelected)
         {
             dpo.IsSelected = true;
         }
     }
     ShowHidChildControls();
     LearnerOutcomeItemsCV.Refresh();
     OnPropertyChanged("CurrentItem");
     OnPropertyChanged("LearnerOutcomeItemsCV");
 }
        public DPOutcome CreateOutcome()
        {
            XmlNode   newNode     = Node.OwnerDocument.CreateElement("DPOutcome", NSMgr.LookupNamespace("ia"));
            DPOutcome newInstance = new DPOutcome(newNode, NSMgr);

            //XmlNode prevNode = DPOutcomeList.Last().Node;
            DPOutcomeList.Add(newInstance);
            //Node.InsertAfter(newNode, prevNode);
            Node.AppendChild(newNode);
            return(newInstance);
        }
 private void SetSubControl(ILR.DPOutcome outcome)
 {
     if (LearnerOutcomeItemsCV.CurrentItem != null)
     {
         OutcomeDetailControl.CurrentItem = outcome;
     }
     else
     {
         OutcomeDetailControl.CurrentItem = null;
     }
 }
        internal DPOutcome(DPOutcome MigrationDPOutcome, XmlNode Node, XmlNamespaceManager NSMgr)
        {
            this.Node  = Node;
            this.NSMgr = NSMgr;

            this.OutType      = MigrationDPOutcome.OutType;
            this.OutCode      = MigrationDPOutcome.OutCode;
            this.OutStartDate = MigrationDPOutcome.OutStartDate;
            this.OutEndDate   = MigrationDPOutcome.OutEndDate;
            this.OutCollDate  = MigrationDPOutcome.OutCollDate;
        }
Ejemplo n.º 5
0
        internal LearnerDestinationandProgression(XmlNode LearnerDestinationandProgressionNode, XmlNamespaceManager NSMgr)
        {
            this.Node  = LearnerDestinationandProgressionNode;
            this.NSMgr = NSMgr;

            XmlNodeList dpOutcomeNodes = LearnerDestinationandProgressionNode.SelectNodes("./ia:DPOutcome", NSMgr);

            foreach (XmlNode node in dpOutcomeNodes)
            {
                var dbOutcome = new DPOutcome(node, NSMgr);
                dbOutcome.OutcomeChanged += NewInstance_OutcomeChanged;
                DPOutcomeList.Add(dbOutcome);
            }
        }
Ejemplo n.º 6
0
        internal LearnerDestinationandProgression(LearnerDestinationandProgression MigrationLearnerDestinationandProgression, XmlNode Node, XmlNamespaceManager NSMgr)
        {
            this.Node  = Node;
            this.NSMgr = NSMgr;

            this.LearnRefNumber = MigrationLearnerDestinationandProgression.LearnRefNumber;
            this.ULN            = MigrationLearnerDestinationandProgression.ULN;

            foreach (DPOutcome migrationItem in MigrationLearnerDestinationandProgression.DPOutcomeList.Where(d => d.OutCollDate >= Message.CurrentYearStart))
            {
                XmlNode   newNode     = Node.OwnerDocument.CreateElement("DPOutcome", NSMgr.LookupNamespace("ia"));
                DPOutcome newInstance = new DPOutcome(migrationItem, newNode, NSMgr);
                DPOutcomeList.Add(newInstance);
                Node.AppendChild(newNode);
            }
        }
 private void RemoveOutcome(object sender, RoutedEventArgs e)
 {
     if (LearnerOutcomeItemsCV.CurrentItem != null)
     {
         ILR.DPOutcome ld2Remove = LearnerOutcomeItemsCV.CurrentItem as ILR.DPOutcome;
         if (ld2Remove != null)
         {
             _learnerDP.Delete(ld2Remove);
             if (!LearnerOutcomeItemsCV.IsEmpty)
             {
                 if (!LearnerOutcomeItemsCV.MoveCurrentToPrevious())
                 {
                     LearnerOutcomeItemsCV.MoveCurrentToFirst();
                     LearnerOutcomeItemsCV.Refresh();
                     OnPropertyChanged("LearnerOutcomeItemsCV");
                 }
                 if ((LearnerOutcomeItemsCV.CurrentItem != null) && (LearnerOutcomeItemsCV.CurrentItem != ld2Remove))
                 {
                     ILR.DPOutcome lr = LearnerOutcomeItemsCV.CurrentItem as ILR.DPOutcome;
                     foreach (ILR.DPOutcome xDp in LearnerOutcomeItemsCV)
                     {
                         xDp.IsSelected = false;
                     }
                     lr.IsSelected = true;
                 }
                 else
                 {
                     LearnerOutcomeItemsCV.MoveCurrentToNext();
                     if (LearnerOutcomeItemsCV.CurrentItem != null)
                     {
                         ILR.DPOutcome lr = LearnerOutcomeItemsCV.CurrentItem as ILR.DPOutcome;
                         lr.IsSelected = true;
                     }
                 }
             }
         }
         LearnerOutcomeItemsCV.Refresh();
         OnPropertyChanged("LearnerOutcomeItemsCV");
         ShowHidChildControls();
     }
 }
 public void Delete(DPOutcome DPOutcome)
 {
     Node.RemoveChild(DPOutcome.Node);
     this.DPOutcomeList.Remove(DPOutcome);
 }
Ejemplo n.º 9
0
 public void Delete(DPOutcome DPOutcome)
 {
     Node.RemoveChild(DPOutcome.Node);
     DPOutcome.OutcomeChanged -= NewInstance_OutcomeChanged;
     this.DPOutcomeList.Remove(DPOutcome);
 }