コード例 #1
0
ファイル: LoginForm.cs プロジェクト: whfm/Movie-Library
 private void LoginForm_Load(object sender, EventArgs e)
 {
     save                   = true;
     deleted                = false;
     addsuccess             = false;
     MovieLibraryMain.close = true;
     LoginHandler.ReadUsers();
     MovieLibraryMain.listOfUser = new List <LoginData>();
     MovieLibraryMain.listOfUser = LoginHandler.ReadUsers();
     DisplayUsers(MovieLibraryMain.listOfUser);
 }
コード例 #2
0
ファイル: LoginForm.cs プロジェクト: whfm/Movie-Library
        private void btnSave_Click(object sender, EventArgs e)
        {
            save       = true;
            deleted    = false;
            addsuccess = false;
            var confirmResult = MessageBox.Show("Would you like to save the database to the file?\nIt will overwrite the previous database.",
                                                "Confirm Save!",
                                                MessageBoxButtons.YesNo);

            if (confirmResult == DialogResult.Yes)
            {
                LoginHandler.WriteUser(MovieLibraryMain.listOfUser);
            }
            else
            {
                MessageBox.Show("The data wasn't saved!");
            }
        }
コード例 #3
0
 /// <summary>
 /// The constructor method of the interface, which initalizes the components needed for the system.
 /// Also sets the default index for the "User Type" combobox to Students.
 /// </summary>
 public LoginInterface()
 {
     InitializeComponent();
     comboBox_userType.SelectedIndex = 0;
     loginHandler = new LoginHandler();
 }