private void Accion(int naccion)
 {
     switch (naccion)
     {
         case 1:
             u_n_opsel = 1;
             U_RefrescaControles();
             Blanquear();
             tb_plla_tipocontratoBL BL = new tb_plla_tipocontratoBL();
             tb_plla_tipocontrato BE = new tb_plla_tipocontrato();
             txtcodigo.Text = BL.GetAll_MaxCodigo(VariablesPublicas.EmpresaID, BE).Tables[0].Rows[0]["maximo_codigo"].ToString();
             if (Examinar.CurrentRow != null)
             {
                 Examinar.CurrentRow.Selected = false;
             }
             break;
         case 2:
             POnedatos();
             u_n_opsel = 2;
             U_RefrescaControles();
             Examinar.CurrentRow.Selected = true;
             break;
         case 3:
             xnomcampo = "";
             if ((Examinar.CurrentRow != null))
             {
                 tb_plla_tipocontratoBL BLIR = new tb_plla_tipocontratoBL();
                 tb_plla_tipocontrato BEIR = new tb_plla_tipocontrato();
                 BEIR.tipocontratoid = Examinar.Rows[Examinar.CurrentRow.Index].Cells["tipocontratoid"].Value.ToString();
                 //tmpcursor = BLIR.GetAll_CONSULTAIR(VariablesPublicas.EmpresaID, BEIR).Tables[0];
                 //tmpcursor = ocapa.IR_PAG1500(GlobalVars.GetInstance.Company, Examinar.Rows(Examinar.CurrentRow.Index).Cells("tipocontratoid").Value);
                 if (BLIR.Sql_Error.Length > 0)
                 {
                     xnomcampo = BLIR.Sql_Error;
                     Frm_Class.ShowError(BLIR.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)
             {
                 if (MessageBox.Show("Desea Eliminar Registro ..?", "Mensaje del Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                 {
                     tb_plla_tipocontratoBL BLCO = new tb_plla_tipocontratoBL();
                     tb_plla_tipocontrato BECO = new tb_plla_tipocontrato();
                     BECO.tipocontratoid = Examinar.Rows[Examinar.CurrentRow.Index].Cells["tipocontratoid"].Value.ToString();
                     BECO.norden = 1;
                     BECO.ver_blanco = 0;
                     tmpcursor = BLCO.GetAll_CONSULTA(VariablesPublicas.EmpresaID, BECO).Tables[0];
                     if (BLCO.Sql_Error.Length == 0)
                     {
                         if (BLCO.Eliminar(VariablesPublicas.EmpresaID, tmpcursor))
                         {
                             for (lc_cont = 0; lc_cont <= Tabla.Rows.Count - 1; lc_cont++)
                             {
                                 if (Tabla.Rows[lc_cont]["tipocontratoid"] == Examinar.Rows[Examinar.CurrentRow.Index].Cells["tipocontratoid"].Value)
                                 {
                                     Tabla.Rows[lc_cont].Delete();
                                     Tabla.AcceptChanges();
                                     break;
                                 }
                             }
                             Examinar.Refresh();
                         }
                         else
                         {
                             Frm_Class.ShowError(BLCO.Sql_Error, this);
                         }
                     }
                     else
                     {
                         Frm_Class.ShowError(BLCO.Sql_Error, this);
                     }
                 }
             }
             else
             {
                 MessageBox.Show(xnomcampo, "Imposible Eliminar Registro");
             }
             break;
     }
 }