Exemplo n.º 1
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtExpediente.Text.Trim()))
            {
                ErrorDatos.SetError(txtExpediente, "No ha elegido \nningun pacinte");
            }
            else
            {
                bool   ResultadoOK  = false;
                string mensajeError = "";
                objPaciente = new clFachadaPaciente();
                try
                {
                    objPaciente.EliminarPaciente(Convert.ToInt32(txtExpediente.Text), 1, ref ResultadoOK, ref mensajeError);
                }
                catch (Exception error)
                {
                    MessageBox.Show(error.Message.ToString());
                }

                if (ResultadoOK)
                {
                    MessageBox.Show("Paciente Elimnado con exito \n\n En cualquier momento puede restaurar el paciente ");
                    Efecto.LimpiarForm(this);
                }
                else
                {
                    MessageBox.Show("Paciente no Eliminado");
                }
            }
        }
Exemplo n.º 2
0
 private void btnGuardaryConsultar_Click(object sender, EventArgs e)
 {
     if (Efecto.ValidarFormulario(this, ErrorDatos) == false)
     {
         manipulable.manipular(ucRealizarConsulta.Instance(manipulable), this.txtExpediente.Text);
         Efecto.LimpiarForm(this);
     }
 }
 private void btnEditarPaciente_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtExpediente.Text.Trim()))
     {
         ErrorDatos.SetError(btnBuscarPaciente, "No ha elegido un paciente");
     }
     else
     {
         manipulable.manipular(ucRegistroP.Instance(manipulable), this.txtExpediente.Text);
         Efecto.LimpiarForm(this);
     }
 }
Exemplo n.º 4
0
 private void btnNuevo_Click(object sender, EventArgs e)
 {
     // Efecto.LimpiarFormulario(this);
     Efecto.LimpiarForm(this);
 }
        private void signIn()
        {
            Autenticacion aut = Autenticacion.Instance;

            if (string.IsNullOrEmpty(txtUserName.Text))
            {
                errorProvider.SetError(txtUserName, "Debe llenar el usuario");
            }
            else
            {
                if (string.IsNullOrEmpty(txtPassword.Text))
                {
                    user       = txtUserName.Text;
                    subControl = 3;//para seleccionar solo por el usuario y verificar si existe;
                    dataTable  = aut.IniciarSeccion(user, password, subControl, ref resultadoOk, ref mensajeError);
                    if (dataTable.Rows.Count == 1)
                    {
                        panelPasswordContainer.Visible = true;
                        txtPassword.Focus();
                        txtUserName.Enabled   = false;
                        lblBienvenido.Visible = true;
                        btnBack.Visible       = true;
                        string nombre   = dataTable.Rows[0]["Doc_Nombre"].ToString();
                        string apellido = dataTable.Rows[0]["Doc_Apellido"].ToString();

                        if (!string.IsNullOrEmpty(dataTable.Rows[0]["Us_Foto"].ToString()))
                        {
                            byte[] imgageURL = (byte[])dataTable.Rows[0]["Us_Foto"];
                            imgUserLogin.Image = SolutionHelper.ConvertToImage(imgageURL);
                        }

                        lblUserInfoName.Text     = nombre;
                        lblUserInfoLastName.Text = apellido;
                        btnLogin.Text            = "Sing In";
                    }
                    else
                    {
                        MessageBox.Show("Usuario no Encontrado");
                    }
                }
                else
                {
                    password   = txtPassword.Text;
                    subControl = 2;//para seleccionar solo por el usuario y la contyrasena;
                    dataTable  = aut.IniciarSeccion(user, password, subControl, ref resultadoOk, ref mensajeError);
                    if (dataTable.Rows.Count == 1)
                    {
                        //El usuario  esta autenticado
                        Form_Principal FP = new Form_Principal();
                        FP.receiveUser(dataTable);
                        FP.Show();
                        Efecto.LimpiarForm(this);
                        this.Hide();
                        //this.Close();
                    }
                    else
                    {
                        errorProvider.SetError(txtPassword, "Contraseña Inavalida");
                    }
                }
            }
        }