public void ELIMINAR()
        {
            var BL = new tb_plla_tab0100BL();
            var BE = new tb_plla_tab0100();
            BE.codigo = cboTipoPlanilla.SelectedValue.ToString().Trim();
            if (BL.QuincenalRubros_DELETED(VariablesPublicas.EmpresaID, BE) == true)
            {
                var BLL = new tb_co_seguridadlogBL();
                var BEL = new tb_co_seguridadlog();
                BEL.moduloid = Name;
                BEL.clave = VariablesPublicas.EmpresaID + cboTipoPlanilla.SelectedValue.ToString().Trim();
                BEL.cuser = VariablesPublicas.Usuar;
                BEL.fecha = DateTime.Now;
                BEL.pc = VariablesPublicas.userip;
                BEL.accion = "B";
                BEL.detalle = "Descripción: " + "Quincena";
                BLL.Insert(VariablesPublicas.EmpresaID.ToString(), BEL);

                LIMPIARDETALLE();
                GRILLARUBROS();

                MessageBox.Show("Los Datos han sido Eliminados", "Información Del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);

                HABILITARBOTONES(true);
                HABILITARCONTROLES(true);
                cboTipoPlanilla.Focus();
            }
        }
 public void COMBOPLANILLA()
 {
     cboTipoPlanilla.DisplayMember = "tipopllaname";
     cboTipoPlanilla.ValueMember = "tipoplla";
     var BL = new tb_plla_tab0100BL();
     var BE = new tb_plla_tab0100();
     cboTipoPlanilla.DataSource = BL.Quincenal_CONSULTA(VariablesPublicas.EmpresaID, BE).Tables[0];
 }
        private void Frm_Planilla_RubrosDescuento_Activated(object sender, EventArgs e)
        {
            if (Sw_LOad)
            {
                cmbfiltrotipoplanilla.ValueMember = "tipoplla";
                cmbfiltrotipoplanilla.DisplayMember = "tipopllaname";
                var BL = new tb_plla_tipoplanillaBL();
                var BE = new tb_plla_tipoplanilla();

                BE.norden = 1;
                BE.ver_blanco = 0;
                tmpcursor = BL.GetAll_Consulta(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
                cmbfiltrotipoplanilla.SelectedValue = string.Empty;

                if (BL.Sql_Error.Length == 0)
                {
                    cmbfiltrotipoplanilla.DataSource = tmpcursor;
                    if (tmpcursor.Rows.Count > 0)
                    {
                        cmbfiltrotipoplanilla.SelectedValue = tmpcursor.Rows[0]["tipoplla"];
                    }
                }

                cmbmodalidad.ValueMember = "cele";
                cmbmodalidad.DisplayMember = "descripcion";
                var BL1 = new tb_plla_tab0100BL();
                var BE1 = new tb_plla_tab0100();
                BE1.ver_blanco = 1;
                cmbmodalidad.DataSource = BL1.gspTbPllaModalidadRubros(VariablesPublicas.EmpresaID.ToString(), BE1).Tables[0];

                cmbtipocalculo.ValueMember = "cele";
                cmbtipocalculo.DisplayMember = "descripcion";
                var BL2 = new tb_plla_tab0100BL();
                var BE2 = new tb_plla_tab0100();
                BE2.ver_blanco = 1;
                cmbtipocalculo.DataSource = BL2.gspTbPllaTipoCalculoRubros(VariablesPublicas.EmpresaID.ToString(), BE2).Tables[0];

                cmbtipo.ValueMember = "cele";
                cmbtipo.DisplayMember = "descripcion";
                var BL3 = new tb_plla_tab0100BL();
                var BE3 = new tb_plla_tab0100();
                BE3.ver_blanco = 1;
                cmbtipo.DataSource = BL3.GetTipoDescuento(VariablesPublicas.EmpresaID.ToString(), BE3).Tables[0];

                RequeryTipoPlanilla();

                cmbrubrorpts.ValueMember = "rubroid";
                cmbrubrorpts.DisplayMember = "descripcion";
                var BL4 = new tb_plla_pdt_tabla22BL();
                var BE4 = new tb_plla_pdt_tabla22();
                BE4.relrubroidtipo = GlobalVars.GetInstance().RubrosDescuentoRPTS;
                BE4.detallado = 1;
                BE4.norden = 1;
                BE4.incluir_blanco = 1;
                cmbrubrorpts.DataSource = BL4.GetAll_Consulta(VariablesPublicas.EmpresaID, BE4).Tables[0];

                U_RefrescaControles();
                CargaDatos();
                U_RefrescaControles();
                Sw_LOad = false;
            }
        }
        private void Llenar_cboTipoRegi()
        {
            cmbtipo.ValueMember = "cele";
            cmbtipo.DisplayMember = "descripcion";

            var BL = new tb_plla_tab0100BL();
            var BE = new tb_plla_tab0100();
            cmbtipo.DataSource = BL.GetAllTiRegi(VariablesPublicas.EmpresaID, BE).Tables[0];
        }
        private void Frm_Planilla_RubrosCopiar_Activated(object sender, EventArgs e)
        {
            if (sw_Load)
            {
                cmbtiporubro.ValueMember = "codigo";
                cmbtiporubro.DisplayMember = "descripcion";
                var BLI = new tb_plla_tab0100BL();
                var BEI = new tb_plla_tab0100();

                BEI.norden = 2;
                cmbtiporubro.DataSource = BLI.gspTbPllaTipoRubro(VariablesPublicas.EmpresaID.ToString(), BEI).Tables[0];

                cmbtipoplanillaorigen.ValueMember = "tipoplla";
                cmbtipoplanillaorigen.DisplayMember = "tipopllaname";
                var BL = new tb_plla_tipoplanillaBL();
                var BE = new tb_plla_tipoplanilla();

                BE.norden = 1;
                BE.ver_blanco = 0;
                cmbtipoplanillaorigen.DataSource = BL.GetAll_Consulta(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];

                cmbtipoplanilladestino.ValueMember = "tipoplla";
                cmbtipoplanilladestino.DisplayMember = "tipopllaname";
                cmbtipoplanilladestino.DataSource = BL.GetAll_Consulta(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
                if (_LpTipoRubro.Trim().Length > 0)
                {
                    cmbtiporubro.SelectedValue = _LpTipoRubro;
                }
                if (_LpPlanillaOrigen.Trim().Length > 0)
                {
                    cmbtipoplanillaorigen.SelectedValue = _LpTipoRubro;
                }
                if (_LpPlanillaDestino.Trim().Length > 0)
                {
                    cmbtipoplanilladestino.SelectedValue = _LpPlanillaDestino;
                }
                U_RefrescaControles();
                sw_Load = false;
            }
        }
        private void CargaDatos()
        {
            var nposcolumnasortear = 0;
            var PrvSotOrder = default(SortOrder);
            var zordenado = false;
            var xcodcliente = "..";
            var xpalabra1 = string.Empty;
            var xpalabra2 = string.Empty;
            var xpalabra3 = string.Empty;
            if (txtfiltronombre.Text.Trim().Length > 0)
            {
                xpalabra1 = VariablesPublicas.Palabras(txtfiltronombre.Text, 1);
                xpalabra2 = VariablesPublicas.Palabras(txtfiltronombre.Text, 2);
                xpalabra3 = VariablesPublicas.Palabras(txtfiltronombre.Text, 3);
            }
            if ((Examinar.CurrentRow != null))
            {
                xcodcliente = Examinar.Rows[Examinar.CurrentRow.Index].Cells["cmotivo"].Value.ToString();
            }
            if ((Examinar.SortedColumn != null))
            {
                nposcolumnasortear = Examinar.SortedColumn.Index;
                PrvSotOrder = Examinar.SortOrder;
                zordenado = true;
            }
            var BL = new tb_plla_tab0100BL();
            var BE = new tb_plla_tab0100();
            BE.nomlike1 = xpalabra1;
            BE.nomlike2 = xpalabra2;
            BE.nomlike3 = xpalabra3;
            BE.norden = 1;
            BE.ver_blanco = 0;
            tablaclientes = BL.GetAllMotivosPermiso(VariablesPublicas.EmpresaID, BE).Tables[0];
            Examinar.AutoGenerateColumns = false;
            Examinar.DataSource = tablaclientes;

            VariablesPublicas.PintaEncabezados(Examinar);

            if (zordenado)
            {
                if (PrvSotOrder == SortOrder.Ascending)
                {
                    Examinar.Sort(Examinar.Columns[nposcolumnasortear], System.ComponentModel.ListSortDirection.Ascending);
                }
                else
                {
                    Examinar.Sort(Examinar.Columns[nposcolumnasortear], System.ComponentModel.ListSortDirection.Descending);
                }
            }
            else
            {
                Examinar.Sort(Examinar.Columns["cmotivo"], System.ComponentModel.ListSortDirection.Ascending);
            }
            if (Examinar.CurrentRow == null)
            {
                if (Examinar.RowCount > 0)
                {
                    Examinar.CurrentCell = Examinar.Rows[0].Cells["cmotivo"];
                }
            }
            for (lc_cont = 0; lc_cont <= Examinar.Rows.Count - 1; lc_cont++)
            {
                if (Examinar.Rows[lc_cont].Cells["cmotivo"].Value.ToString() == xcodcliente)
                {
                    Examinar.CurrentCell = Examinar.Rows[lc_cont].Cells["cmotivo"];
                    break;
                }
            }
        }
 private void btngrabar_Click(object sender, EventArgs e)
 {
     if (U_Validacion())
     {
         var BL = new tb_plla_tab0100BL();
         var BE = new tb_plla_tab0100();
         BE.codigo = txtcodigo.Text.Trim();
         BE.norden = 1;
         BE.ver_blanco = 0;
         tmpcursor = BL.GetAllMotivosPermiso(VariablesPublicas.EmpresaID, BE).Tables[0];
         if (u_n_opsel == 1)
         {
             while (1 == 1)
             {
                 tmpcursor = BL.GetAllMotivosPermiso(VariablesPublicas.EmpresaID, BE).Tables[0];
                 if (BL.Sql_Error.Length > 0)
                 {
                     Frm_Class.ShowError(BL.Sql_Error + "\r" + "Error al buscar código", this);
                     return;
                 }
                 if (tmpcursor.Rows.Count > 0)
                 {
                     var BLMX = new tb_plla_tab0100BL();
                     var BEMX = new tb_plla_tab0100();
                     txtcodigo.Text = BLMX.MotivosPermiso_MAXCODIGO(VariablesPublicas.EmpresaID.ToString(), BEMX).Tables[0].Rows[0]["maximo_codigo"].ToString();
                 }
                 else
                 {
                     break;
                 }
             }
             tmpcursor = BL.GetAllMotivosPermiso(VariablesPublicas.EmpresaID, BE).Tables[0];
             tmpcursor.Rows.Add(VariablesPublicas.InsertIntoTable(tmpcursor));
             tmpcursor.Rows[0]["cmotivo"] = txtcodigo.Text.Trim();
         }
         tmpcursor.Rows[0]["dmotivo"] = txtdescripcion.Text.Trim();
         tmpcursor.AcceptChanges();
         if (BL.MotivosPermiso_InsertUpdate(VariablesPublicas.EmpresaID, BE, tmpcursor))
         {
             seguridadlog();
             U_CancelarEdicion(0);
         }
         else
         {
             Frm_Class.ShowError(BL.Sql_Error, this);
         }
     }
 }
        public void GRILLARUBROS()
        {
            var BL = new tb_plla_tab0100BL();
            var BE = new tb_plla_tab0100();
            BE.codigo = cboTipoPlanilla.SelectedValue.ToString().Trim();
            BE.norden = 2;
            _dtDetalle = BL.QuincenalRubros_CONSULTA(VariablesPublicas.EmpresaID, BE).Tables[0];

            _dtDetalle.Columns["TIPO_PLANILLA"].AllowDBNull = true;
            _dtDetalle.Columns["COD_RUBRO"].AllowDBNull = true;
            _dtDetalle.Columns["DES_RUBRO"].AllowDBNull = true;
            _dtDetalle.Columns["PORCENTAJE"].AllowDBNull = true;

            _dtDetalle.Columns["TIPO_PLANILLA"].ReadOnly = false;
            _dtDetalle.Columns["COD_RUBRO"].ReadOnly = false;
            _dtDetalle.Columns["DES_RUBRO"].ReadOnly = false;
            _dtDetalle.Columns["PORCENTAJE"].ReadOnly = false;

            dgRubroQuincenal.DataSource = _dtDetalle;

            VariablesPublicas.PintaEncabezados(dgRubroQuincenal);
        }
 private void btngrabar_Click(object sender, EventArgs e)
 {
     if (U_Validacion())
     {
         var BL = new tb_plla_tab0100BL();
         var BE = new tb_plla_tab0100();
         BE.codigo = txtcodigo.Text.Trim();
         tmpcursor = BL.TipoPrestamo_CONSULTA(VariablesPublicas.EmpresaID, BE).Tables[0];
         if (u_n_opsel == 1)
         {
             while (1 == 1)
             {
                 tmpcursor = BL.TipoPrestamo_CONSULTA(VariablesPublicas.EmpresaID, BE).Tables[0];
                 if (BL.Sql_Error.Length > 0)
                 {
                     Frm_Class.ShowError(BL.Sql_Error + "\r" + "Error al buscar código", this);
                     return;
                 }
                 if (tmpcursor.Rows.Count > 0)
                 {
                     var BLMX = new tb_plla_tab0100BL();
                     var BEMX = new tb_plla_tab0100();
                     txtcodigo.Text = BLMX.TipoPrestamo_MAXCODIGO(VariablesPublicas.EmpresaID, BEMX).Tables[0].Rows[0]["maximo_codigo"].ToString();
                 }
                 else
                 {
                     break;
                 }
             }
             tmpcursor = BL.TipoPrestamo_CONSULTA(VariablesPublicas.EmpresaID, BE).Tables[0];
             tmpcursor.Rows.Add(VariablesPublicas.INSERTINTOTABLE(tmpcursor));
             tmpcursor.Rows[0]["cprestamo"] = txtcodigo.Text;
         }
         tmpcursor.Rows[0]["dprestamo"] = txtdescripcion.Text.Trim();
         tmpcursor.Rows[0]["estadoprestamo"] = (chkactivo.Checked ? 1 : 0);
         tmpcursor.AcceptChanges();
         if (BL.TipoPrestamo_InsertUpdate(VariablesPublicas.EmpresaID, BE, tmpcursor))
         {
             seguridadlog();
             U_CancelarEdicion(0);
         }
         else
         {
             Frm_Class.ShowError(BL.Sql_Error, this);
         }
     }
 }
        private BindingSource NewMethoTP()
        {
            var BL = new tb_plla_tab0100BL();
            var BE = new tb_plla_tab0100();

            var table = BL.Quincenal_CONSULTA(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            var rows = table.Rows;

            object[] cell;
            var dic = new Dictionary<string, string>();
            var binding = new BindingSource();

            foreach (DataRow item in rows)
            {
                cell = item.ItemArray;
                dic.Add(cell[0].ToString(), cell[0].ToString() + " - " + cell[1].ToString());
                cell = null;
            }
            binding.DataSource = dic;
            return binding;
        }
 private void Llenar_cboModalidadPlla()
 {
     var BL = new tb_plla_tab0100BL();
     var BE = new tb_plla_tab0100();
     cboModalidadPlanillaADE.ValueMember = "cele";
     cboModalidadPlanillaADE.DisplayMember = "descrip";
     cboModalidadPlanillaADE.DataSource = BL.ModalidadPlanilla_CONSULTA(VariablesPublicas.EmpresaID, BE).Tables[0];
 }
 private void Llenar_cboTipoQuincena()
 {
     var BL = new tb_plla_tab0100BL();
     var BE = new tb_plla_tab0100();
     cmbtipoquincena.ValueMember = "codigo";
     cmbtipoquincena.DisplayMember = "descrip";
     cmbtipoquincena.DataSource = BL.TipoQuincena_CONSULTA(VariablesPublicas.EmpresaID, BE).Tables[0];
 }
 private void FormatoGrilla()
 {
     dgIngresos.AutoGenerateColumns = false;
     var xvmtipoplanilla = "..";
     var xvmtiporubro = "..";
     if ((cbPlanilla.SelectedValue != null))
     {
         xvmtipoplanilla = cbPlanilla.SelectedValue.ToString();
     }
     if ((cboTipoRubro.SelectedValue != null))
     {
         xvmtiporubro = cboTipoRubro.SelectedValue.ToString();
     }
     var BL = new tb_plla_tab0100BL();
     var BE = new tb_plla_tab0100();
     BE.ctab = xvmtipoplanilla;
     BE.cele = xvmtiporubro;
     tabla = BL.GetAllConfiguracionRubroTareo(VariablesPublicas.EmpresaID, BE).Tables[0];
     dgIngresos.DataSource = tabla;
 }
 private void btngrabar_Click(object sender, EventArgs e)
 {
     if (dgIngresos.IsCurrentCellInEditMode)
     {
         dgIngresos.EndEdit();
     }
     tabla.AcceptChanges();
     var BL = new tb_plla_tab0100BL();
     var BE = new tb_plla_tab0100();
     BE.ctab = cbPlanilla.SelectedValue.ToString();
     BE.cele = cboTipoRubro.SelectedValue.ToString();
     if (BL.ConfiguracionRubrotareoInsert(VariablesPublicas.EmpresaID, BE, tabla))
     {
         CargaRubroIngreso();
         dgIngresos.ReadOnly = true;
         EnabledTool(true);
         GroupBox2.Enabled = false;
     }
     else
     {
         Frm_Class.ShowError(BL.Sql_Error, this);
     }
 }
        private void Llenar_cboEstadoContrato()
        {
            cmb_tipoestado.ValueMember = "cele";
            cmb_tipoestado.DisplayMember = "descripcion";

            var BL = new tb_plla_tab0100BL();
            var BE = new tb_plla_tab0100();
            cmb_tipoestado.DataSource = BL.GetAllEstadoContrato(VariablesPublicas.EmpresaID, BE).Tables[0];
        }
 public void GUARDARACTUALIZAR()
 {
     dgRubroQuincenal.EndEdit();
     btnNuevaFila.Focus();
     _dtDetalle.AcceptChanges();
     var BL = new tb_plla_tab0100BL();
     var BE = new tb_plla_tab0100();
     BE.codigo = cboTipoPlanilla.SelectedValue.ToString().Trim();
     if (BL.QuincenalRubros_InsertUpdate(VariablesPublicas.EmpresaID, BE, _dtDetalle) == true)
     {
         seguridadlog();
         MessageBox.Show("Los Datos han sido Guardados Correctamente !!!", "Información Del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);
         HABILITARBOTONES(true);
         HABILITARCONTROLES(true);
         GRILLARUBROS();
         cboTipoPlanilla.Focus();
     }
 }
        private BindingSource NewMethoTC()
        {
            var BL = new tb_plla_tab0100BL();
            var BE = new tb_plla_tab0100();

            BE.ver_blanco = 1;
            var table = BL.gspTbPllaTipoCalculoRubros(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            var rows = table.Rows;

            object[] cell;
            var dic = new Dictionary<string, string>();
            var binding = new BindingSource();

            foreach (DataRow item in rows)
            {
                cell = item.ItemArray;
                dic.Add(cell[0].ToString(), cell[0].ToString() + "    " + cell[1].ToString());
                cell = null;
            }
            binding.DataSource = dic;
            return binding;
        }
 private void CargaDatos()
 {
     var sorted = default(SortOrder);
     var xnomcolumna = string.Empty;
     if ((Examinar.SortedColumn != null))
     {
         xnomcolumna = Examinar.Columns[Examinar.SortedColumn.Index].Name;
         sorted = Examinar.SortOrder;
     }
     var BL = new tb_plla_tab0100BL();
     var BE = new tb_plla_tab0100();
     BE.norden = 0;
     Tabla = BL.TeleCredito_CONSULTA(VariablesPublicas.EmpresaID, BE).Tables[0];
     if (BL.Sql_Error.Length == 0)
     {
         Examinar.AutoGenerateColumns = false;
         Examinar.DataSource = Tabla;
         if (xnomcolumna.Trim().Length > 0)
         {
             if (sorted == SortOrder.Ascending)
             {
                 Examinar.Sort(Examinar.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Ascending);
             }
             else
             {
                 Examinar.Sort(Examinar.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Descending);
             }
         }
         else
         {
             Examinar.Sort(Examinar.Columns["codigo"], System.ComponentModel.ListSortDirection.Ascending);
         }
     }
     else
     {
         Sw_LOad = false;
         Frm_Class.ShowError(BL.Sql_Error, this);
     }
     VariablesPublicas.PintaEncabezados(Examinar);
 }
 private void save()
 {
     if (u_Validate())
     {
         tmpcursor = null;
         var BL = new tb_plla_tab0100BL();
         var BE = new tb_plla_tab0100();
         BE.norden = 0;
         tmpcursor = BL.TeleCredito_CONSULTA(VariablesPublicas.EmpresaID, BE).Tables[0];
         var ofila = tmpcursor.NewRow();
         ofila = VariablesPublicas.INSERTINTOTABLE(tmpcursor);
         ofila["codigo"] = Examinar.Rows[Examinar.CurrentRow.Index].Cells["codigo"].Value;
         for (lc_cont = 0; lc_cont <= Examinar.ColumnCount - 1; lc_cont++)
         {
             xnomcampo = Examinar.Columns[lc_cont].Name;
             ofila[xnomcampo] = Examinar.Rows[Examinar.CurrentRow.Index].Cells[lc_cont].Value;
         }
         ofila["codigo"] = txtcodigo.Text.Trim();
         ofila["descripcion"] = txtDescripcion.Text.Trim();
         ofila["valor"] = txtvalor.Text.Trim();
         tmpcursor.Rows.Add(ofila);
         if (BL.TeleCredito_InsertUpdate(VariablesPublicas.EmpresaID, BE, tmpcursor))
         {
             U_CancelarEdicion(0);
         }
         else
         {
             Frm_Class.ShowError(BL.Sql_Error, this);
         }
     }
 }
        private void btneliminar_Click(object sender, EventArgs e)
        {
            if ((Examinar.CurrentRow != null))
            {
                xnomcampo = string.Empty;
                var BL = new tb_plla_tab0100BL();
                var BE = new tb_plla_tab0100();
                BE.codigo = Examinar.Rows[Examinar.CurrentRow.Index].Cells["cmotivo"].Value.ToString();
                tmpcursor = BL.MotivosPermiso_IR(VariablesPublicas.EmpresaID, BE).Tables[0];
                if (BL.Sql_Error.Length > 0)
                {
                    xnomcampo = BL.Sql_Error;
                    Frm_Class.ShowError(BL.Sql_Error, this);
                }
                else
                {
                    if (tmpcursor.Rows.Count == 0)
                    {
                    }
                    else
                    {
                        for (lc_cont = 0; lc_cont <= tmpcursor.Rows.Count - 1; lc_cont++)
                        {
                            xnomcampo = xnomcampo + tmpcursor.Rows[lc_cont]["relacion"] + "\r";
                            if (lc_cont + 1 == 10)
                            {
                                break;
                            }
                        }
                    }
                }
                if (xnomcampo.Length == 0)
                {
                    var BLCO = new tb_plla_tab0100BL();
                    var BECO = new tb_plla_tab0100();
                    BECO.codigo = Examinar.Rows[Examinar.CurrentRow.Index].Cells["cmotivo"].Value.ToString();
                    BECO.norden = 1;
                    BECO.ver_blanco = 0;
                    tmptabla = BLCO.GetAllMotivosPermiso(VariablesPublicas.EmpresaID, BECO).Tables[0];
                    if (BLCO.Sql_Error.Length == 0)
                    {
                        var message = "Desea eliminar datos  " + tmptabla.Rows[0]["cmotivo"].ToString().Trim() + "-" + tmptabla.Rows[0]["dmotivo"].ToString().Trim() + " ...?";
                        var caption = "Mensaje del Sistema";
                        var buttons = MessageBoxButtons.YesNo;
                        DialogResult result;
                        result = MessageBox.Show(this, message, caption, buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                        if (result == DialogResult.Yes)
                        {
                            BL.MotivosPermiso_ELIMINAR(VariablesPublicas.EmpresaID, BE);
                            if (BL.Sql_Error.Length == 0)
                            {
                                var BLL = new tb_co_seguridadlogBL();
                                var BEL = new tb_co_seguridadlog();

                                BEL.moduloid = Name;
                                BEL.clave = VariablesPublicas.EmpresaID + Examinar.Rows[Examinar.CurrentRow.Index].Cells["cmotivo"].Value.ToString();
                                BEL.cuser = VariablesPublicas.Usuar;
                                BEL.fecha = DateTime.Now;
                                BEL.pc = VariablesPublicas.userip;
                                BEL.accion = "B";
                                BEL.detalle = "Motivo: " + txtdescripcion.Text;
                                BLL.Insert(VariablesPublicas.EmpresaID.ToString(), BEL);

                                Examinar.Rows.Remove(Examinar.CurrentRow);
                                Examinar.Refresh();
                                u_PintaDatos();
                            }
                            else
                            {
                                Frm_Class.ShowError(BL.Sql_Error, this);
                            }
                        }
                    }
                    else
                    {
                        Frm_Class.ShowError(BLCO.Sql_Error, this);
                    }
                }
                else
                {
                    MessageBox.Show(xnomcampo, "IMPOSIBLE ELIMINAR REGISTRO");
                }
            }
            U_RefrescaControles();
        }
        private void Frm_Planilla_RubrosPermanente_Activated(object sender, EventArgs e)
        {
            if (Sw_LOad)
            {
                cmbfiltrotipoplanilla.ValueMember = "tipoplla";
                cmbfiltrotipoplanilla.DisplayMember = "tipopllaname";
                var BL = new tb_plla_tipoplanillaBL();
                var BE = new tb_plla_tipoplanilla();

                BE.norden = 1;
                BE.ver_blanco = 0;
                tmpcursor = BL.GetAll_Consulta(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
                cmbfiltrotipoplanilla.SelectedValue = string.Empty;

                if (BL.Sql_Error.Length == 0)
                {
                    cmbfiltrotipoplanilla.DataSource = tmpcursor;
                    if (tmpcursor.Rows.Count > 0)
                    {
                        cmbfiltrotipoplanilla.SelectedValue = tmpcursor.Rows[0]["tipoplla"];
                    }
                }

                cmbmodalidad.ValueMember = "cele";
                cmbmodalidad.DisplayMember = "descripcion";
                var BL1 = new tb_plla_tab0100BL();
                var BE1 = new tb_plla_tab0100();
                cmbmodalidad.DataSource = BL1.GetAllModalidadRubroPermanente(VariablesPublicas.EmpresaID.ToString(), BE1).Tables[0];

                cmbtipo.ValueMember = "cele";
                cmbtipo.DisplayMember = "descripcion";
                cmbtipo.DataSource = BL1.GetAllTipoRubroPermanente(VariablesPublicas.EmpresaID.ToString(), BE1).Tables[0];
                RequeryRubroIngresoPlanilla();
                RequeryTipoPlanilla();

                U_RefrescaControles();
                CargaDatos();
                U_RefrescaControles();
                Sw_LOad = false;
            }
        }
 private void btnnuevo_Click(object sender, EventArgs e)
 {
     if (!(TabControl1.SelectedIndex == 0))
     {
         TabControl1.SelectedIndex = 0;
     }
     u_n_opsel = 1;
     Blanquear();
     U_RefrescaControles();
     TabControl1.SelectedIndex = 0;
     TabControl1.SelectedIndex = 1;
     var BL = new tb_plla_tab0100BL();
     var BE = new tb_plla_tab0100();
     txtcodigo.Text = BL.MotivosPermiso_MAXCODIGO(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0].Rows[0]["maximo_codigo"].ToString();
     txtdescripcion.Focus();
 }
        private void Llenar_cboTipoComisionAFP()
        {
            cboTComision.ValueMember = "cele";
            cboTComision.DisplayMember = "descripcion";

            var BL = new tb_plla_tab0100BL();
            var BE = new tb_plla_tab0100();
            BE.norden = 1;
            BE.ver_blanco = 1;
            cboTComision.DataSource = BL.gspTbPllaTipoComisionAFP(VariablesPublicas.EmpresaID, BE).Tables[0];
        }
        public bool U_Validacion()
        {
            var xmsg = string.Empty;
            var objeto = new object();

            if (txtdescripcion.Text.Trim().Length == 0)
            {
                xmsg = "Ingrese Descripción";
                objeto = txtdescripcion;
            }
            if (!(VM_DESCRIPCION == txtdescripcion.Text) & u_n_opsel > 1)
            {
                xnomcampo = string.Empty;
                var BL = new tb_plla_tab0100BL();
                var BE = new tb_plla_tab0100();
                BE.codigo = txtcodigo.Text.Trim();
                tmpcursor = BL.MotivosPermiso_IR(VariablesPublicas.EmpresaID, BE).Tables[0];
                if (BL.Sql_Error.Length > 0)
                {
                    xnomcampo = BL.Sql_Error;
                    Frm_Class.ShowError(BL.Sql_Error, this);
                    return false;
                }
                else
                {
                    if (tmpcursor.Rows.Count == 0)
                    {
                    }
                    else
                    {
                        for (lc_cont = 0; lc_cont <= tmpcursor.Rows.Count - 1; lc_cont++)
                        {
                            xnomcampo = xnomcampo + tmpcursor.Rows[lc_cont]["relacion"] + "\r";
                            if (lc_cont + 1 == 10)
                            {
                                break;
                            }
                        }
                    }
                }
                if (xnomcampo.Length > 0)
                {
                    if (!(MessageBox.Show("DESCRIPCION ANTERIOR :" + VM_DESCRIPCION + " SE USA EN " + "\r" + xnomcampo + "\r" + "DESEA REEMPLAZAR DESCRIPCION ...?", "Mensaje del Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes))
                    {
                        return false;
                    }
                }
            }
            if (xmsg.Trim().Length > 0)
            {
                MessageBox.Show(xmsg.Trim(), "Error en Ingreso de Datos");
                if ((objeto != null))
                {
                    objeto = Focus();
                }
            }
            return xmsg.Trim().Length == 0;
        }
        private void Frm_RubrosGeneralesPlanilla_Activated(object sender, EventArgs e)
        {
            if (Sw_LOad)
            {
                cmbtipo.ValueMember = "codigo";
                cmbtipo.DisplayMember = "descripcion";
                var BLI = new tb_plla_tab0100BL();
                var BEI = new tb_plla_tab0100();
                BEI.norden = 2;
                cmbtipo.DataSource = BLI.gspTbPllaTipoRubro(VariablesPublicas.EmpresaID.ToString(), BEI).Tables[0];

                cmbfiltrotipo.ValueMember = "codigo";
                cmbfiltrotipo.DisplayMember = "descripcion";
                cmbfiltrotipo.DataSource = BLI.gspTbPllaTipoRubro(VariablesPublicas.EmpresaID.ToString(), BEI).Tables[0];

                for (lc_contador = 0; lc_contador <= DataGridView1.ColumnCount - 1; lc_contador++)
                {
                    DataGridView1.Columns[lc_contador].SortMode = DataGridViewColumnSortMode.NotSortable;
                }
                U_RefrescaControles();
                CargaDatos();
                U_RefrescaControles();
                Sw_LOad = false;
            }
        }