Exemple #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (CheckForEmptyString() && CheckCredentials(tbUsername.Text, tbPassword.Text))
            {
                this.Hide();
                Form mainMenu = new Forms.MainMenu();
                mainMenu.Closed += (s, args) => this.Close();
                mainMenu.Show();

                DateTime date = DateTime.Now;
                string   Time = date.ToString("HH:mm:ss - dd MMM, yyyy");

                SQLiteCommand command = new SQLiteCommand
                                        (
                    "INSERT INTO LoggedIn" +
                    "(Корисничко_име, " +
                    "Време)" +
                    "VALUES" +
                    "(@Username, " +
                    "@Time)",
                    connection);
                connection.Open();
                command.Parameters.AddWithValue("Username", tbUsername.Text);
                command.Parameters.AddWithValue("Time", Time);
                command.ExecuteNonQuery();
                connection.Close();
            }
        }