Exemplo n.º 1
0
        public NoteControl(NotesForm notesForm, NotesModel model, NotesModel.Note note)
        {
            InitializeComponent();

            this.notesForm = notesForm;
            this.model     = model;
            this.note      = note;
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        private void runOffline()
        {
            model = new NotesOfflineModel();

            showNotes();
        }