/// <summary> /// Загрузка окна, инициализация контроллеров, загрузка в listview данных и сброс управления. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void MetroWindow_Loaded(object sender, RoutedEventArgs e) { Firts_Start = true; DBConnection oDBConnection = new DBConnection(); await oDBConnection.InitializeDatabase(); oOrdersRepository = new OrdersRepository(oDBConnection); oClientsRepository = new ClientsRepository(oDBConnection); oCardsRepository = new CardsRepository(oDBConnection); oBouquetsRepository = new BouquetsRepository(oDBConnection); oContentsRepository = new ContentsRepository(oDBConnection); oCartsRepository = new CartsRepository(oDBConnection); oAccessoriesRepository = new AccessoriesRepository(oDBConnection); oFlowersRepository = new FlowersRepository(oDBConnection); oSpecialDealsRepository = new SpecialDealsRepository(oDBConnection); oDiscountRepository = new DiscountsRepository(oDBConnection); conn = oDBConnection.GetAsyncConnection(); lCart_Bouquet = new List <Cart_Bouquet>(); await Update_ListView_Clients(); await Update_ListView_Bouquets(); Clear_Control_All(); }
Flowers oFlowers; // Хранит в себе выделенный в ListView объект /// <summary> /// Инициализация контроллеров при загрузке формы /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void MetroWindow_Loaded(object sender, RoutedEventArgs e) { DBConnection oDBConnection = new DBConnection(); await oDBConnection.InitializeDatabase(); oAccessoriesRepository = new AccessoriesRepository(oDBConnection); oFlowersRepository = new FlowersRepository(oDBConnection); await Update_ListView(); Clear_Controls(); }
public FlowersController(FlowersRepository fr) { _fr = fr; }
// injection dependency: service depends on repository public FlowerService(FlowersRepository repo) { _repo = repo; }
public FlowersService(FlowersRepository repo, BoquetsRepository brepo) { _repo = repo; _brepo = brepo; }