예제 #1
0
 protected void ButEntrar_Click(object sender, EventArgs e)
 {
     /*if (obj1.ValidarPaciente(Convert.ToInt32(TextNombreUsuario.Text), TextContrasena.Text))
      * {
      *  Response.Redirect("Listacitas.aspx?username="******"CancelarCita.aspx?username="******"Listacitas.aspx?username="******"Menu.aspx?username=" + TextNombreUsuario.Text);
     }
     else
     {
         String IP = Request.UserHostAddress;
         obj1.LoginError(Convert.ToInt32(TextNombreUsuario.Text), IP);
         LabMSMError.Visible = true;
     }
 }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            GestorPaciente obj = new GestorPaciente();

            int temp = 0;

            if (int.TryParse(USUARIO.Text, out temp))
            {
                bool si = obj.ValidarPaciente(Convert.ToInt32(USUARIO.Text), CONTRASENA.Text.ToString());
                if (si == true)
                {
                    Pacientes pacientes = new Pacientes(Convert.ToInt32(USUARIO.Text));
                    pacientes.Visible = true;
                    this.Visible      = false;
                    Inicio inicio = new Inicio();
                    inicio.Visible = false;
                }
                else
                {
                    USUARIO.Text    = "";
                    CONTRASENA.Text = "";
                    MessageBox.Show("Lo sentimos, sus credenciales no se encuentran registradas "
                                    + " Verifiquelas e intentelo de nuevo");
                }
            }
            else
            {
                MessageBox.Show("El campo Usuario esta incorrecto, deben ser numeros");
            }
        }
예제 #3
0
        public void TestValidarPaciente()
        {
            bool           ValidarPaciente = true;
            GestorPaciente Gp = new GestorPaciente();

            Assert.AreEqual(ValidarPaciente, Gp.ValidarPaciente(43165413, "Cecilia4316"));
        }
예제 #4
0
        public void TestValidarPaciente()
        {
            bool           ValidarPaciente = true;
            GestorPaciente Gp = new GestorPaciente();

            Assert.AreEqual(ValidarPaciente, Gp.ValidarPaciente(1026163147, "szs1"));
        }
예제 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            GestorPaciente obj = new GestorPaciente();

            int temp = 0;

            if (int.TryParse(USUARIO.Text, out temp))
            {
                bool si = obj.ValidarPaciente(Convert.ToInt32(USUARIO.Text), CONTRASENA.Text.ToString());
                if (si == true)
                {
                    obj.LoginRegistro(Convert.ToInt32(USUARIO.Text));
                    Pacientes pacientes = new Pacientes(Convert.ToInt32(USUARIO.Text));
                    pacientes.Visible = true;
                    this.Visible      = false;
                    Inicio inicio = new Inicio();
                    inicio.Visible = false;
                }
                else
                {
                    IPHostEntry host;
                    string      localIP = "";
                    host = Dns.GetHostEntry(Dns.GetHostName());
                    foreach (IPAddress ip in host.AddressList)
                    {
                        if (ip.AddressFamily.ToString() == "InterNetwork")
                        {
                            localIP = ip.ToString();
                        }
                    }
                    obj.LoginError(Convert.ToInt32(USUARIO.Text), localIP);
                    USUARIO.Text    = "";
                    CONTRASENA.Text = "";
                    MessageBox.Show("Lo sentimos, sus credenciales no se encuentran registradas "
                                    + " Verifiquelas e intentelo de nuevo");
                }
            }
            else
            {
                MessageBox.Show("El campo Usuario esta incorrecto, deben ser numeros");
            }
        }