コード例 #1
0
 //Boton Agregar Tuve problemas al cambiar nombre
 private void button1_Click(object sender, EventArgs e)
 {
     Entidades.Retenciones retencion = new Entidades.Retenciones();
     retencion = (Entidades.Retenciones)comboBoxRetenciones.SelectedItem;
     empleadoG.RetencionesList.Add(retencion);
     LlenarData(empleadoG);
 }
コード例 #2
0
        private void buttonGuardar_Click(object sender, EventArgs e)
        {
            var retenciones = new Entidades.Retenciones();
            int id          = 0;

            try
            {
                if (!Validar())
                {
                    MessageBox.Show("Por favor llenar los campos");
                }
                else
                {
                    retenciones.Descripcion = descripcionTextBox.Text;
                    retenciones.Valor       = Utilidades.TOIN(valorTextBox.Text);
                    retenciones.RetencionId = Utilidades.TOIN(retencionIdMaskedTextBox.Text);

                    if (id != retenciones.RetencionId)
                    {
                        BLL.RetencionesBLL.Mofidicar(retenciones);
                        MessageBox.Show("Modificada");
                    }
                    else
                    {
                        BLL.RetencionesBLL.Guardar(retenciones);
                        MessageBox.Show("Agregado con exito!");
                    }
                }
                Limpiar();
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #3
0
 private void Limpiar()
 {
     descripcionTextBox.Clear();
     retencionIdMaskedTextBox.Clear();
     valorTextBox.Clear();
     errorProvider1.Clear();
     descripcionTextBox.Focus();
     retenciones = new Entidades.Retenciones();
 }
コード例 #4
0
        public static Entidades.Retenciones Buscar(Expression <Func <Entidades.Retenciones, bool> > tipo)
        {
            Entidades.Retenciones Result = null;
            using (var repoitorio = new Repositorio <Entidades.Retenciones>())
            {
                Result = repoitorio.Buscar(tipo);
            }

            return(Result);
        }
コード例 #5
0
        public static bool Eliminar(Entidades.Retenciones existente)
        {
            bool eliminado = false;

            using (var repositorio = new Repositorio <Entidades.Retenciones>())
            {
                eliminado = repositorio.Eliminar(existente);
            }

            return(eliminado);
        }
コード例 #6
0
        public static bool Guardar(Entidades.Retenciones retencion)
        {
            using (var db = new Repositorio <Entidades.Retenciones>())
            {
                try
                {
                    return(db.Guardar(retencion));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(false);
        }
コード例 #7
0
        public static bool Modificar(Entidades.Retenciones retencion)
        {
            using (var conec = new DAL.Respository <Entidades.Retenciones>())
            {
                try
                {
                    return(conec.Modificar(retencion));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(false);
        }
コード例 #8
0
        private void button4_Click(object sender, EventArgs e)
        {
            int id = int.Parse(retencionIdMaskedTextBox.Text);

            Entidades.Retenciones retenciones;
            retenciones = BLL.RetencionesBLL.Buscar(p => p.RetencionId == id);
            if (retenciones != null)
            {
                retencionIdMaskedTextBox.Text = Convert.ToString(retenciones.RetencionId);
                descripcionTextBox.Text       = retenciones.Descripcion;
                valorTextBox.Text             = Convert.ToString(retenciones.Valor);
                MessageBox.Show("Resultados");
            }
            else
            {
                MessageBox.Show("No Existe");
            }
        }
コード例 #9
0
        private void retencionIdTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            int id = Utilidad.ToInt(retencionIdTextBox.Text);

            if (e.KeyChar == (char)Keys.Enter)
            {
                Entidades.Retenciones retencion = BLL.RetencionBLL.Buscar(id);
                if (retencion != null)
                {
                    retencionDescripcionTextBox.Text = retencion.Descripcion;
                    retencionValorTextBox.Text       = retencion.Valor.ToString();
                    retencionSeleccionada            = retencion;
                }
                else
                {
                    MessageBox.Show("Retencion no encontrada...");
                }
            }
        }
コード例 #10
0
 private void Limpiar()
 {
     empleado = new Entidades.Empleados();
     retencionSeleccionada = null;
     detalle = new Entidades.EmpleadosEmails("");
     retencionesDataGridView.DataSource = null;
     emailsDataGridView.DataSource      = null;
     empleadoIdTextBox.Clear();
     nombresTextBox.Clear();
     fechaNacimientoDateTimePicker.Value = DateTime.Today;
     sueldoTextBox.Clear();
     retencionIdTextBox.Clear();
     retencionDescripcionTextBox.Clear();
     retencionValorTextBox.Clear();
     emailIdTextBox.Clear();
     emailTipoTextBox.Clear();
     emailEmailTextBox.Clear();
     nombresTextBox.Focus();
 }