public BalanceDateEditorViewModel(
                 IBankAccountRepository bankAccountRepository,
                 IBalanceDateRepository balanceDateRepository,
                 BalanceDate entity
                 )
 {
     this.bankAccountRepository = bankAccountRepository;
     this.balanceDateRepository = balanceDateRepository;
     this.entity = entity;
 }
        public int Add()
        {
            int id = 0;

            var entity = new BalanceDate();

            var editor = this.balanceDateEditorViewModelFactory.Create(entity);

            editor.InitializeForAddEdit(true);

            while (this.dialogService.ShowDialogView(editor))
            {
                id = this.balanceDateRepository.Add(entity);

                if (id > 0)
                {
                    break;
                }
            }

            this.balanceDateEditorViewModelFactory.Release(editor);

            return id;
        }
 public BalanceDateItemViewModel(BalanceDate entity)
 {
     this.entity = entity;
 }