Esempio n. 1
0
        private void Login_Button_Click(object sender, EventArgs e)
        {
            user CurrentlyLoggedUser = new user(this.Login_Login.Text, this.Login_Password.Text,this);

            //user CurrentlyLoggedUser = new user("czajmen", "test", this);
              // user CurrentlyLoggedUser = new user("czajmen", "test", this);
        }
Esempio n. 2
0
        private int getUserID(user user)
        {
            int ID=0;

            try
            {
                DataBaseControl.OpenConnection(conn);
                string queryText = string.Format("Select ID from users where login='******'", user.login);

                List<string> result = DataBaseControl.Select(conn, queryText);
                string stringResult = DataBaseControl.ResultToString(result);

                ID=Convert.ToInt16(stringResult);
            }
            catch (MySqlException myexc)
            {
                MessageBox.Show(myexc.Message);
            }
            finally
            {
                DataBaseControl.CloseConnection(conn);
            }

            return ID;
        }