Beispiel #1
0
        //Kardex handler
        private void KardexInsert(string description)
        {
            //MessageBox.Show("Congratulations you are logged in");
            string _username = GlobalVariables.Usuario;

            //Add to the Kardex Routine
            //build the SQL query
            string query = @"INSERT INTO naut_kardex (Kardex_Modulo,Kardex_Fecha,Kardex_Hora,Kardex_Usuario,Kardex_Descripcion) 
VALUES 
('User-Module',curdate(), curtime(),'" + _username + "','" + description + "')";

            if (KardexController.Injector(query, description) != true)
            {
                MessageBox.Show("Error en el kardex.");
            }
        }
Beispiel #2
0
        /*Buttons functionality
         *
         *
         */
        //Login
        private void btnLogin_Click(object sender, EventArgs e)
        {
            bool   login     = new bool();
            string _username = txtLoginUsername.Text;
            string _password = txtLoginPassword.Text;

            login = DBManager.LogOk(_username, _password);

            if (login == true)
            {
                //MessageBox.Show("Congratulations you are logged in");
                GlobalVariables.Usuario = _username;
                GlobalVariables.Login   = true;
                //Add to the Kardex Routine
                string description = GlobalVariables.LoginOk;
                //build the SQL query
                string query = @"INSERT INTO naut_kardex (Kardex_Modulo,Kardex_Fecha,Kardex_Hora,Kardex_Usuario,Kardex_Descripcion) 
VALUES 
('Login-Module',curdate(), curtime(),'" + _username + "','" + description + "')";
                // String to write in the LOG file
                string LogText = @"El usuario: " + _username + " efectuo un login exitoso a la fecha/hora: " + DateTime.Now;

                if (KardexController.Injector(query, LogText) == true)
                {
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Error en el kardex.");
                }
            }
            else
            {
                MessageBox.Show("Username or password Incorrect");
                txtLoginPassword.Text = "";
                txtLoginUsername.Text = "";
                txtLoginUsername.Focus();
                GlobalVariables.Login = false;
            }
        }