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.TipoPrestamo_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) == 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 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["cprestamo"].Value.ToString();
                tmpcursor = BL.TipoPrestamo_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["cprestamo"].Value.ToString();
                    BECO.norden = 1;
                    BECO.ver_blanco = 0;
                    tmptabla = BLCO.TipoPrestamo_CONSULTA(VariablesPublicas.EmpresaID, BECO).Tables[0];
                    if (BLCO.Sql_Error.Length == 0)
                    {
                        var message = "Desea eliminar datos del cargo  " + tmptabla.Rows[0]["cprestamo"].ToString().Trim() + "-" + tmptabla.Rows[0]["dprestamo"].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)
                        {
                            BLCO.TipoPrestamo_ELIMINAR(VariablesPublicas.EmpresaID, BECO);
                            if (BLCO.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["cprestamo"].Value.ToString();
                                BEL.cuser = VariablesPublicas.Usuar;
                                BEL.fecha = DateTime.Now;
                                BEL.pc = VariablesPublicas.userip;
                                BEL.accion = "B";
                                BEL.detalle = "Descripción: " + txtdescripcion.Text;
                                BLL.Insert(VariablesPublicas.EmpresaID.ToString(), BEL);
                                Examinar.Rows.Remove(Examinar.CurrentRow);

                                Examinar.Refresh();
                                u_PintaDatos();
                            }
                            else
                            {
                                Frm_Class.ShowError(BLCO.Sql_Error, this);
                            }
                        }
                    }
                    else
                    {
                        Frm_Class.ShowError(BLCO.Sql_Error, this);
                    }
                }
                else
                {
                    MessageBox.Show(xnomcampo, "IMPOSIBLE ELIMINAR REGISTRO");
                }
            }
            U_RefrescaControles();
        }