示例#1
0
        private void LetterIsComeback(UpdatedEntityMessage <PlanCertificate> updatedEntityMessage)
        {
            var target = this.GetTarget();

            if (target == null)
            {
                return;
            }

            int index = 0;
            PlanCertificateLiteDto oldItem =
                target.PlanCertificateFilterViewModel.Result.FirstOrDefault(
                    x => x.Rn == updatedEntityMessage.Entity.Rn);
            PlanCertificateLiteDto newItem = this.GetCertificate(updatedEntityMessage.Entity.Rn);

            if (oldItem != null)
            {
                index = target.PlanCertificateFilterViewModel.Result.IndexOf(oldItem);
                target.PlanCertificateFilterViewModel.Result.Remove(oldItem);
            }

            target.PlanCertificateFilterViewModel.Result.Insert(
                index,
                newItem ?? updatedEntityMessage.Entity.MapTo <PlanCertificateLiteDto>());
        }
示例#2
0
        private void LetterIsComeback(AddedEntityMessage <PlanCertificate> addedEntityMessage)
        {
            var target = this.GetTarget();

            if (target != null)
            {
                PlanCertificateLiteDto newItem       = GetCertificate(addedEntityMessage.Entity.Rn);
                PlanCertificateLiteDto insertingItem =
                    newItem ?? addedEntityMessage.Entity.MapTo <PlanCertificateLiteDto>();
                target.PlanCertificateFilterViewModel.Result.Insert(0, insertingItem);
                target.SelectedPlanCertificate = insertingItem;
            }
        }
示例#3
0
        private void OnSelectedPlanCertificate(PlanCertificateLiteDto planCertificate)
        {
            if (planCertificate == null)
            {
                if (PersonalAccountFilterViewModel.Result != null)
                {
                    PersonalAccountFilterViewModel.Result.Clear();
                }

                return;
            }

            PersonalAccountFilterViewModel.Filter.PlanCertificate.Rn = planCertificate.Rn;
            PersonalAccountFilterViewModel.InvokeCommand.Execute(null);
        }