Beispiel #1
0
        private void RemoveLearningDeliveryRecord()
        {
            if (LearningDeliveryItemsCV.CurrentItem != null)
            {
                ILR.LearningDelivery ld2Remove = LearningDeliveryItemsCV.CurrentItem as ILR.LearningDelivery;

                MessageBoxResult result = MessageBox.Show(String.Format("Are you sure you want to delete Learning Deliver Records ? {0}{0} Aim Seq : {1} {0} Aim Ref {2}", Environment.NewLine, ld2Remove.AimSeqNumber, ld2Remove.LearnAimRef)
                                                          , "Confirmation"
                                                          , MessageBoxButton.YesNo
                                                          , MessageBoxImage.Stop
                                                          , MessageBoxResult.No);
                if (result == MessageBoxResult.Yes)
                {
                    if (ld2Remove != null)
                    {
                        if (LearningDeliveryItemsCV.CurrentPosition == 0)
                        {
                            LearningDeliveryItemsCV.MoveCurrentToNext();
                        }
                        else if (_learner.LearningDeliveryList.Count() > 0)
                        {
                            LearningDeliveryItemsCV.MoveCurrentToPrevious();
                        }

                        _learner.Delete(ld2Remove);
                        LearningDelivery ldTmp = LearningDeliveryItemsCV.CurrentItem as LearningDelivery;
                        if (ldTmp != null)
                        {
                            ldTmp.IsSelected = true;
                        }
                    }
                }
            }
            LearningDeliveryItemsCV.Refresh();
            OnPropertyChanged("LearningDeliveryItemsCV");
        }
        internal LearningDelivery(LearningDelivery MigrationLearningDelivery, XmlNode Node, XmlNamespaceManager NSMgr)
        {
            IsImportRunning = true;
            this.Node       = Node;
            this.NSMgr      = NSMgr;

            this.LearnAimRef = MigrationLearningDelivery.LearnAimRef;
            if (MigrationLearningDelivery.AimType == 4 && MigrationLearningDelivery.HasFAM("LDM", "323"))
            {
                this.AimType  = 3;
                this.ProgType = 24;
            }
            else
            {
                this.AimType  = MigrationLearningDelivery.AimType;
                this.ProgType = MigrationLearningDelivery.ProgType;
            }
            this.AimSeqNumber       = MigrationLearningDelivery.AimSeqNumber;
            this.LearnStartDate     = MigrationLearningDelivery.LearnStartDate;
            this.OrigLearnStartDate = MigrationLearningDelivery.OrigLearnStartDate;
            this.LearnPlanEndDate   = MigrationLearningDelivery.LearnPlanEndDate;
            this.FundModel          = MigrationLearningDelivery.FundModel;
            this.FworkCode          = MigrationLearningDelivery.FworkCode;
            this.PwayCode           = MigrationLearningDelivery.PwayCode;
            this.PartnerUKPRN       = MigrationLearningDelivery.PartnerUKPRN;
            this.DelLocPostCode     = MigrationLearningDelivery.DelLocPostCode;
            if (this.AimType != 1)
            {
                this.PriorLearnFundAdj = MigrationLearningDelivery.PriorLearnFundAdj;
                this.OtherFundAdj      = MigrationLearningDelivery.OtherFundAdj;
            }
            this.ESFProjDosNumber = MigrationLearningDelivery.ESFProjDosNumber;
            this.ESFLocProjNumber = MigrationLearningDelivery.ESFLocProjNumber;
            this.EmpOutcome       = MigrationLearningDelivery.EmpOutcome;
            this.CompStatus       = MigrationLearningDelivery.CompStatus;
            this.LearnActEndDate  = MigrationLearningDelivery.LearnActEndDate;
            this.WithdrawReason   = MigrationLearningDelivery.WithdrawReason;
            this.Outcome          = MigrationLearningDelivery.Outcome;
            this.OutGrade         = MigrationLearningDelivery.OutGrade;

            foreach (LearningDeliveryFAM migrationItem in MigrationLearningDelivery.LearningDeliveryFAMList)
            {
                XmlNode             newNode     = Node.OwnerDocument.CreateElement("LearningDeliveryFAM", NSMgr.LookupNamespace("ia"));
                LearningDeliveryFAM newInstance = new LearningDeliveryFAM(migrationItem, newNode, NSMgr);
                LearningDeliveryFAMList.Add(newInstance);
                AppendToLastOfNodeNamed(newNode, newNode.Name);
            }
            foreach (ProviderSpecDeliveryMonitoring migrationItem in MigrationLearningDelivery.ProviderSpecDeliveryMonitoringList)
            {
                XmlNode newNode = Node.OwnerDocument.CreateElement("ProviderSpecDeliveryMonitoring", NSMgr.LookupNamespace("ia"));
                ProviderSpecDeliveryMonitoring newInstance = new ProviderSpecDeliveryMonitoring(migrationItem, newNode, NSMgr);
                ProviderSpecDeliveryMonitoringList.Add(newInstance);
                AppendToLastOfNodeNamed(newNode, newNode.Name);
            }
            if (MigrationLearningDelivery.LearningDeliveryHE != null)
            {
                XmlNode newNode = Node.OwnerDocument.CreateElement("LearningDeliveryHE", NSMgr.LookupNamespace("ia"));
                LearningDeliveryHE = new LearningDeliveryHE(MigrationLearningDelivery.LearningDeliveryHE, newNode, NSMgr);
                AppendToLastOfNodeNamed(newNode, newNode.Name);
            }
            IsImportRunning = false;
        }