Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
            FormularioPrincipal frmPrincipal = new FormularioPrincipal();

            frmPrincipal.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string user, pass, data;
            int    value = 0;

            user = pass = data = "";


            user = this.txtIngreseUsuario.Text;
            pass = this.txtIngresePassword.Text;

            data = getDataError(user, pass);

            if (data == "No ha ingresado ")
            {
                value = 1;
                data  = getValidateUserPass(user, pass);
            }

            if (value == 1)
            {
                if (!data.Equals(""))
                {
                    MessageBox.Show(data, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                if (!data.Equals(""))
                {
                    MessageBox.Show(data, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }

            txtIngreseUsuario.Text  = "";
            txtIngresePassword.Text = "";
            txtIngreseUsuario.Focus();

            if (data.Equals(""))
            {
                this.Hide();
                FormularioPrincipal frmPrincipal = new FormularioPrincipal();
                frmPrincipal.ShowDialog();
            }
        }