Beispiel #1
0
        private void Eliminarbutton_Click(object sender, EventArgs e)
        {
            if (Validar(1))
            {
                MessageBox.Show("El TipoID esta vacio", "Llene Campo",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                int id = Convert.ToInt32(LibroIDnumericUpDown.Value);

                if (BLL.LibrosBLL.Eliminar(id))
                {
                    MessageBox.Show("Eliminado", "Bien hecho", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LibroIDnumericUpDown.Value = 0;
                    DescripciontextBox.Clear();
                    FechadateTimePicker.Value = DateTime.Now;
                    SiglastextBox.Clear();
                    TipotextBox.Clear();
                    ValidarerrorProvider.Clear();
                }
                else
                {
                    MessageBox.Show("No se puede Eliminar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Beispiel #2
0
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     LibroIdnumericUpDown.Value = 0;
     DescripcionrichTextBox.Clear();
     SiglastextBox.Clear();
     TipotextBox.Clear();
 }
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     IdnumericUpDown.Value     = 0;
     FechadateTimePicker.Value = DateTime.Now;
     DescripciontextBox.Clear();
     SiglastextBox.Clear();
     TipotextBox.Clear();
 }
Beispiel #4
0
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     LibroIDnumericUpDown.Value = 0;
     DescripciontextBox.Clear();
     FechadateTimePicker.Value = DateTime.Now;
     SiglastextBox.Clear();
     TipotextBox.Clear();
     ValidarerrorProvider.Clear();
 }
Beispiel #5
0
        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            LibrosBiblia Libros = LlenaClase();

            bool paso = false;

            if (Validar(2))
            {
                MessageBox.Show("Llenar campos", "Llene los campos",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                int id = Convert.ToInt32(LibroIDnumericUpDown.Value);
                if (id == 0)
                {
                    paso = BLL.LibrosBLL.Guardar(Libros);
                }
                else
                {
                    var L = BLL.LibrosBLL.Buscar(id);

                    if (L != null)
                    {
                        paso = BLL.LibrosBLL.Modificar(Libros);
                    }
                }

                if (paso)
                {
                    MessageBox.Show("Guardado!!", "Se Guardo Correctamente",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);

                    LibroIDnumericUpDown.Value = 0;
                    DescripciontextBox.Clear();
                    FechadateTimePicker.Value = DateTime.Now;
                    SiglastextBox.Clear();
                    TipotextBox.Clear();
                    ValidarerrorProvider.Clear();
                }
                else
                {
                    MessageBox.Show("No se guardo!!", "Intente Guardar de nuevo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
        private void Limpiar()
        {
            Empleado = new Empleados();
            Detalle  = new EmpleadosEmails();

            empleadoIdMaskedTextBox.Clear();
            nombresTextBox.Clear();
            fechaNacimientoDateTimePicker.Value = DateTime.Today;
            sueldoMaskedTextBox.Clear();
            CamposVacioserrorProvider.Clear();
            RetencionesdataGridView.DataSource = null;
            retencionesComboBox.Text           = null;

            TipoIdtextBox.Clear();
            TipotextBox.Clear();
            EmailtextBox.Clear();
            TiposEmailsdataGridView.DataSource = null;

            nombresTextBox.Focus();
        }
Beispiel #7
0
        private void Eliminarbutton_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(LibroIdnumericUpDown.Value);

            if (BLL.LibrosBLL.Eliminar(id))

            {
                MessageBox.Show("eliminado", "exitosamente",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                LibroIdnumericUpDown.Value = 0;
                DescripcionrichTextBox.Clear();
                SiglastextBox.Clear();
                TipotextBox.Clear();
            }
            else
            {
                MessageBox.Show("no fueeliminado", "trate de nuevo",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #8
0
        private bool Validar()
        {
            bool paso = true;



            if (string.IsNullOrEmpty(TipotextBox.Text))
            {
                Myerror.SetError(TipotextBox, "El campo tipo no debe estar vacio");
                TipotextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(DirecciontextBox.Text))
            {
                Myerror.SetError(DirecciontextBox, "El campo dirección no debe estar vació");
                DirecciontextBox.Focus();
                paso = false;
            }

            return(paso);
        }