public BankEditorViewModel( IBankRepository bankRepository, IDialogService dialogService, Bank entity) { this.bankRepository = bankRepository; this.dialogService = dialogService; this.entity = entity; ImportLogoCommand = base.AddNewCommand(new ActionCommand(this.ImportLogo)); ClearLogoCommand = base.AddNewCommand(new ActionCommand(ClearLogo,CanClearLogo)); }
public int Add() { int id = 0; var entity = new Bank(); var editor = this.bankEditorViewModelFactory.Create(entity); editor.InitializeForAddEdit(true); while (this.dialogService.ShowDialogView(editor)) { id = this.bankRepository.Add(entity); if (id>0) { break; } } this.bankEditorViewModelFactory.Release(editor); return id; }
public BankItemViewModel(Bank entity) { this.entity = entity; }