private void LetterIsComeback(AddedEntityMessage <PlanReceiptOrderPersonalAccount> addedEntityMessage) { var target = this.GetTarget(); if (target != null) { PersonalAccountOfPlanReceiptOrderLiteDto newItem = GetPersonalAccount(addedEntityMessage.Entity.Rn); PersonalAccountOfPlanReceiptOrderLiteDto insertingItem = newItem ?? addedEntityMessage.Entity.MapTo <PersonalAccountOfPlanReceiptOrderLiteDto>(); target.PersonalAccountFilterViewModel.Result.Insert(0, insertingItem); target.SelectedPlanReceiptOrderPersonalAccount = insertingItem; } }
private void LetterIsComeback(UpdatedEntityMessage <PlanReceiptOrderPersonalAccount> updatedEntityMessage) { var target = this.GetTarget(); if (target == null) { return; } int index = 0; PersonalAccountOfPlanReceiptOrderLiteDto oldItem = target.PersonalAccountFilterViewModel.Result.FirstOrDefault( x => x.Rn == updatedEntityMessage.Entity.Rn); PersonalAccountOfPlanReceiptOrderLiteDto newItem = this.GetPersonalAccount(updatedEntityMessage.Entity.Rn); if (oldItem != null) { index = target.PersonalAccountFilterViewModel.Result.IndexOf(oldItem); target.PersonalAccountFilterViewModel.Result.Remove(oldItem); } target.PersonalAccountFilterViewModel.Result.Insert( index, newItem ?? updatedEntityMessage.Entity.MapTo <PersonalAccountOfPlanReceiptOrderLiteDto>()); }