public NoteControl(NotesForm notesForm, NotesModel model, NotesModel.Note note) { InitializeComponent(); this.notesForm = notesForm; this.model = model; this.note = note; }
private void runOnline() { AuthorizationForm auth = new AuthorizationForm(); auth.ShowDialog(); if (auth.isBackwardPressed) { auth.isBackwardPressed = false; init(); return; } if (!auth.isDataEntered) { var res = MessageBox.Show("You can't be authorized without login and password. Retry?", "Oops! Are you shure?", MessageBoxButtons.RetryCancel); if (res == DialogResult.Cancel) { System.Environment.Exit(0); } if (res == DialogResult.Retry) { auth.ShowDialog(); } } if (auth.isBackwardPressed) { auth.isBackwardPressed = false; init(); return; } if (!auth.isDataEntered) { System.Environment.Exit(0); } model = new NotesSqlModel(auth.login, auth.password); (model as NotesSqlModel).loadNotes(); showNotes(); }
private void runOffline() { model = new NotesOfflineModel(); showNotes(); }