Example #1
0
 protected void Func_GuardarUsuario()
 {
     if (((((TxtNombres.Text == "") || (TxtApellidos.Text == "") || (TxtCorreo.Text == "") || (TxtDireccion.Text == "") || (TxtMovil.Text == "")))))
     {
         MessageBox.Show("Debe diligenciar toda la informacion", "Validacion de informacion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         TxtIdentificacion.Focus();
     }
     else
     {
         ClsUsuario ObjUsuario = new ClsUsuario();
         ObjUsuario.id        = TxtIdentificacion.Text;
         ObjUsuario.nombre    = TxtNombres.Text;
         ObjUsuario.apellidos = TxtApellidos.Text;
         ObjUsuario.sexo      = Convert.ToString(CbxSexo.SelectedValue);
         ObjUsuario.estado    = Convert.ToString(CbxEstado.SelectedValue);
         ObjUsuario.direccion = TxtDireccion.Text;
         ObjUsuario.correo    = TxtCorreo.Text;
         ObjUsuario.telefono  = TxtTelefono.Text;
         ObjUsuario.movil     = TxtMovil.Text;
         ObjUsuario.rol       = LblRol.Text;
         Func_GuardarFoto();
         ObjUsuario.foto = Filename;
         Func_Espacio();
         ObjUsuario.usuario = TxtUsuario.Text;
         ObjUsuario.Func_GuardarUsuarios();
         Func_LimpiarControles();
         MessageBox.Show("El usuario " + TxtNombres.Text + " ha sido creado exitosamente", "Validacion de informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #2
0
 public FrmCuentas()
 {
     InitializeComponent();
     Func_ConsultarTipoCuenta();
     Func_ConsultarEstado();
     TxtIdentificacion.Focus();
 }
Example #3
0
 private void TxtIdentificacion_Validating(object sender, CancelEventArgs e)
 {
     if (string.IsNullOrEmpty((TxtIdentificacion.Text)))
     {
         errorP1.SetError(TxtIdentificacion, "Debe ingresar la identificación.");
         TxtIdentificacion.Focus();
     }
     else
     {
         errorP1.SetError(TxtIdentificacion, "");
     }
 }
Example #4
0
 protected void Fnt_LimpiarControles()
 {
     TxtNombres.Clear();
     TxtContacto.Clear();
     TxtCorreo.Clear();
     TxtEdad.Clear();
     TxtEmpresa.Clear();
     TxtIngresos.Clear();
     TxtContactoEmpresa.Clear();
     CbxEstadoCivil.SelectedIndex = 0;
     CbxSexo.SelectedIndex        = 0;
     TxtIdentificacion.Clear();
     contador = 0;
     var      = "";
     Fnt_HabilitarTeclado();
     TxtIdentificacion.Focus();
 }
Example #5
0
 protected void Func_LimpiarControles()
 {
     TxtIdentificacion.Clear();
     TxtNombres.Clear();
     TxtApellidos.Clear();
     CbxSexo.SelectedIndex   = 0;
     CbxEstado.SelectedIndex = 0;
     TxtDireccion.Clear();
     TxtCorreo.Clear();
     TxtTelefono.Clear();
     TxtUsuario.Clear();
     TxtMovil.Clear();
     LblUser.Text  = "";
     ruta_default  = Filename = Path.Combine(folder, "default.png");
     PtbFoto.Image = Image.FromFile(ruta_default);
     TxtIdentificacion.Focus();
 }
Example #6
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            DialogResult respuesta;

            try
            {
                if ((TxtIdentificacion.Text != "") && (TxtCodigo.Text != "") && (TxtNombre.Text != "") && (TxtApellido.Text != "") && (TxtTipoIdenti.Text != "") && (TxtTipoUsu.Text != ""))
                {
                    respuesta = MessageBox.Show("Esta seguro de eliminarlo", "Bibliosoft", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                    if (respuesta == DialogResult.OK)
                    {
                        Libros.Fechaprestamo  = TxtFechaPrestamo.Text;
                        Libros.Fechaentrega   = TxtFechaDevolucion.Text;
                        Libros.TipoIdentidad  = TxtTipoIdenti.Text;
                        Libros.TipoUsuario    = TxtTipoUsu.Text;
                        Libros.Nombre         = TxtNombre.Text;
                        Libros.Identificacion = TxtIdentificacion.Text;
                        Libros.Apellido       = TxtApellido.Text;
                        Libros.Codigo         = TxtCodigo.Text;
                        Libros.Estado         = "Prestado";

                        string dato = servicio.Eliminar(Libros);
                        limpiar();
                        TxtIdentificacion.Focus();
                        MessageBox.Show(dato, "Bibliosoft", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    }
                    else
                    {
                        limpiar();
                    }

                    Eliminar.Visible = false;
                    Editar.Visible   = false;
                    Guardar.Visible  = true;
                }
                else
                {
                    MessageBox.Show("Identificacion no encontrada");
                }
            }
            catch (Exception error)
            {
                MessageBox.Show("Error " + error.Message.ToString());
            }
        }
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            DialogResult resultado; Bloquear();

            try
            {
                if (TxtIdentificacion.Text != "")
                {
                    resultado = MessageBox.Show("Desea eliminar al usuario?", "Bibliosoft", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                    string dato;
                    if (resultado == DialogResult.OK)
                    {
                        Libros.TipoIdentidad  = TxtTipoIdenti.Text;
                        Libros.TipoUsuario    = TxtTipoUsu.Text;
                        Libros.Nombre         = TxtNombre.Text;
                        Libros.Identificacion = TxtIdentificacion.Text;
                        Libros.Apellido       = TxtApellido.Text;

                        dato = servicio.EliminarUsuario(Libros);
                        limpiar();
                        MessageBox.Show(dato, "Bibliosoft", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        limpiar();
                    }
                    TxtIdentificacion.Focus();

                    Eliminar.Visible = false;
                    Editar.Visible   = false;
                    Guardar.Visible  = true;
                }
                else
                {
                    MessageBox.Show("Identificacion no encontrada");
                }
            }
            catch (Exception error)
            {
                MessageBox.Show("Error " + error.Message.ToString());
            }
        }
Example #8
0
        public bool ValidarPersona()
        {
            bool retorno = true;

            if (string.IsNullOrEmpty((TxtPrNombre.Text)))
            {
                errorP1.SetError(TxtPrNombre, "Debe ingresar el primer nombre.");
                TxtPrNombre.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtPrNombre, "");
            }

            if (string.IsNullOrEmpty((TxtPrApellido.Text)))
            {
                errorP1.SetError(TxtPrApellido, "Debe ingresar el primer apellido.");
                TxtPrApellido.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtPrApellido, "");
            }

            if (string.IsNullOrEmpty((TxtIdentificacion.Text)))
            {
                errorP1.SetError(TxtIdentificacion, "Debe ingresar la identificación.");
                TxtIdentificacion.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtIdentificacion, "");
            }


            return(retorno);
        }
Example #9
0
        private bool ConsultarIdentificacion()
        {
            string identifi  = "";
            int    idPersona = 0;
            bool   retorno   = true;

            Profesor pf = new Profesor();

            pf.Persona.Identificacion = TxtIdentificacion.Text.Trim();

            DataSet ds = CtrlProfesores.GetPersonaIdentificacion(pf);

            if (ds.Tables[0].Rows.Count > 0)
            {
                identifi  = ds.Tables[0].Rows[0]["Identificacion"].ToString();
                idPersona = Convert.ToInt32(ds.Tables[0].Rows[0]["Id"]);
            }

            if (Modo != "E")
            {
                if (TxtIdentificacion.Text.Trim() == identifi)
                {
                    retorno = false;
                    XtraMessageBox.Show("Ya existe una persona con esa identificación.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                    TxtIdentificacion.Focus();
                }
            }
            else
            {
                if (TxtIdentificacion.Text.Trim() == identifi && idPersona != Id)
                {
                    retorno = false;
                    XtraMessageBox.Show("Ya existe una persona con esa identificación.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                    TxtIdentificacion.Focus();
                }
            }

            return(retorno);
        }
 private void RegistroUsuarios_Load(object sender, EventArgs e)
 {
     TxtIdentificacion.Focus();
     Eliminar.Visible = false;
     Editar.Visible   = false;
 }
Example #11
0
 private void FrmCuentas_Load(object sender, EventArgs e)
 {
     TxtIdentificacion.Focus();
 }
Example #12
0
 private void BtnNuevo_Click(object sender, EventArgs e)
 {
     Func_LimpiarControles();
     TxtIdentificacion.Focus();
 }