Пример #1
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.dgvSueldos.CurrentRow != null)
                {
                    if (Util.ConfirmationMessage("¿Desea eliminar el Sueldo seleccionado?") == false)
                    {
                        return;
                    }

                    var uiSueldoCandidato = (BE.UI.SueldoCandidato) this.dgvSueldos.CurrentRow.DataBoundItem;

                    int  idSueldo = uiSueldoCandidato.ID;
                    bool rpta     = new LN.SueldoCandidato().Eliminar(idSueldo);

                    if (rpta == true)
                    {
                        Util.InformationMessage("Se eliminó el Sueldo seleccionado");
                        this.CargarListadoSueldos();
                    }
                }
            }
            catch (Exception ex)
            {
                Util.ErrorMessage(ex.Message);
            }
        }
Пример #2
0
        public void CargarListadoSueldos()
        {
            try
            {
                int anho = int.Parse(this.cboAnho.SelectedValue.ToString());
                int mes  = int.Parse(this.cboMes.SelectedValue.ToString());

                var lstUiSueldos = new LN.SueldoCandidato().Listar(anho, mes);
                var cntSueldos   = lstUiSueldos.Count;
                var sumSueldos   = lstUiSueldos.Sum(x => x.TotalNeto);

                var sorted = new SortableBindingList <BE.UI.SueldoCandidato>(lstUiSueldos);

                this.dgvSueldos.DataSource = sorted;
                this.txtNroRegistros.Text  = cntSueldos.ToString();
                this.txtTotal.Text         = sumSueldos.ToString("N2");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }