public FormAuxiliary(UserControl userControl) { this.userControl = userControl; InitializeComponent(); this.Controls.Add(userControl); UsefulAlgorithms.AdjustFormSize(this); this.Text = TitleFactory.GetTitle(userControl.GetType()); }
private void Initialize() { ConnectionPostgres conn = new ConnectionPostgres("127.0.0.1", "5432", "postgres", "a.123456", "mealprep"); UserController userController = new UserController(new UserDao(conn)); FoodController foodController = new FoodController(new FoodDao(conn)); MealController mealController = new MealController(new MealDao(conn), new FoodDao(conn)); VitaminController vitaminController = new VitaminController(new VitaminDao(conn)); this.Controls.Add(new ucLoginPage(userController, mealController, foodController, vitaminController)); UsefulAlgorithms.AdjustFormSize(this); }