Example #1
0
 public EditFormPresenter(IEditFormView form, Type publicationType, Library library)
 {
     _form        = form;
     _library     = library;
     _dataManager = new LibraryDataManager(publicationType, _library);
     LoadData();
     _form.Delete += Form_Delete;
     _form.Update += Form_Update;
     _form.Back   += Form_Back;
     _dataManager.UpdateData();
     _dataManager.DeleteData();
 }
Example #2
0
 public LibraryFormPresenter(ILibraryFormView form, Library library)
 {
     _form                  = form;
     _library               = library;
     _booksDataManager      = new LibraryDataManager(typeof(Book), _library);
     _magazinesDataManager  = new LibraryDataManager(typeof(Magazine), _library);
     _newspapersDataManager = new LibraryDataManager(typeof(Newspaper), _library);
     LoadLibary();
     _form.Search         += Form_Search;
     _form.Back           += Form_Back;
     _form.NewBook        += Form_NewBook;
     _form.EditBook       += Form_EditBook;
     _form.NewMagazine    += Form_NewMagazine;
     _form.EditMagazines  += Form_EditMagazines;
     _form.NewNewspaper   += Form_NewNewspaper;
     _form.EditNewspapers += Form_EditNewspapers;
 }