Ejemplo n.º 1
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.dgvFeriados.CurrentRow != null)
                {
                    if (Util.ConfirmationMessage("¿Desea eliminar el registro seleccionado?") == false)
                    {
                        return;
                    }

                    var uiFeriado = (BE.UI.Feriado) this.dgvFeriados.CurrentRow.DataBoundItem;

                    bool rpta = new LN.Feriado().Eliminar(uiFeriado.Fecha);

                    if (rpta == true)
                    {
                        int anho = int.Parse(this.cboAnho.SelectedValue.ToString());
                        this.CargarFeriados(anho);

                        Util.InformationMessage("Se eliminó el registro seleccionado");
                    }
                }
            }
            catch (Exception ex)
            {
                Util.ErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void CargarFeriados(int anho)
        {
            try
            {
                var lstUiFeriados = new LN.Feriado().ListarAnho(anho);

                var source = new BindingSource();
                source.DataSource = lstUiFeriados;

                this.dgvFeriados.DataSource = source;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }