static void Main() { RepoInterface<Transaction> repo = new Repository<Transaction>(); Validator val = new Validator(repo); Controller.Controller ctrl = new Controller.Controller(repo,val); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new HomeForm(ctrl)); }
static void Main() { RepoInterface <Transaction> repo = new Repository <Transaction>(); Validator val = new Validator(repo); Controller.Controller ctrl = new Controller.Controller(repo, val); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new HomeForm(ctrl)); }
public HomeForm(Controller.Controller ctrl) { this.ctrl = ctrl; try { ctrl.readFromFile("transactions.txt"); } catch (MyException ex) { MessageBox.Show(ex.getMessage()); } if (this.ctrl.errorCounter > 0) { MessageBox.Show("No of errors: " + this.ctrl.errorCounter); } this.Text = "Real Estate Agency"; this.Size = new Size(600, 600); this.CenterToScreen(); this.addListView(); this.addButtons(); }