コード例 #1
0
        private void Txt_TipTid_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_TipTid.Text.Trim() != "")
                {
                    if (!(FunTID.Existe(Txt_TipTid.Text)))
                    {
                        Util.CambiarTxt(Txt_TipTid, Txt_DesTid);
                    }
                    else
                    {
                        MessageBox.Show("El tipo de documento ya existe.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        Txt_TipTid.Focus();
                        Txt_TipTid.SelectAll();
                    }
                }
                else
                {
                    MessageBox.Show("El campo de tipo de documeto está vacío.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                break;
            }
        }
コード例 #2
0
        private void Txt_DesTid_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_DesTid.Text.Trim() != "")
                {
                    Util.CambiarTxt(Txt_DesTid, Com_ForTid);
                }
                else
                {
                    MessageBox.Show("El campo de descripción está vacío.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                if (Evento.CompareTo("Nuevo") == 0)
                {
                    Util.CambiarTxt(Txt_DesTid, Txt_TipTid);
                }
                else
                {
                    if (Evento.CompareTo("Modificar") == 0)
                    {
                        Cmd_Cancelar.PerformClick();
                    }
                }
                break;
            }
        }
コード例 #3
0
        private void Txt_UndUnm_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_UndUnm.Text.Trim() != "")
                {
                    if (!(FunUND.Existe(Txt_UndUnm.Text)))
                    {
                        Util.CambiarTxt(Txt_UndUnm, Txt_DesUnm);
                    }
                    else
                    {
                        MessageBox.Show("La unidad ya existe.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        Txt_UndUnm.Focus();
                        Txt_UndUnm.SelectAll();
                    }
                }
                else
                {
                    MessageBox.Show("El campo de unidad está vacío.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                break;
            }
        }
コード例 #4
0
        private void Com_ForTmc_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Com_ForTmc.Text.Trim() != "")
                {
                    Cmd_Guardar.PerformClick();
                }
                else
                {
                    MessageBox.Show("Debe de seleccionar un registro está vacío.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                if (Evento.CompareTo("Nuevo") == 0)
                {
                    Util.CambiarTxt(Com_ForTmc, Txt_DesTmc);
                }
                else
                {
                    if (Evento.CompareTo("Modificar") == 0)
                    {
                        Cmd_Cancelar.PerformClick();
                    }
                }
                break;
            }
        }
コード例 #5
0
 private void listView2_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
 {
     if (listView2.SelectedItems.Count > 0)
     {
         Cmd_Cancelar.PerformClick();
     }
 }
コード例 #6
0
        private void Txt_CedPer_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_CedPer.Text.Trim() != "")
                {
                    if (!(FunPER.Existe(Convert.ToInt32(Txt_CedPer.Text))))
                    {
                        Util.CambiarTxt(Txt_CedPer, Txt_NomPer);
                    }
                    else
                    {
                        MessageBox.Show("La cedula del trabajador existe.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        Txt_CedPer.SelectAll();
                    }
                }
                else
                {
                    MessageBox.Show("El campo de cedula está vacío.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                break;
            }
        }
コード例 #7
0
 private void listView1_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         LlenarNivel2(Convert.ToInt32(listView0.SelectedItems[0].Text), Convert.ToInt32(listView1.SelectedItems[0].Text));
         Cmd_AgrNivel0.Visible = false;
         Cmd_AgrNivel1.Visible = true;
         Cmd_AgrNivel2.Visible = true;
         Cmd_Cancelar.PerformClick();
     }
 }
コード例 #8
0
        private void Txt_Nivel_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                Util.CambiarTxt(Txt_Nivel, Txt_Nombre);
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                break;
            }
        }
コード例 #9
0
        private void Txt_CedPer_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_CedPer.Text.Trim() != "")
                {
                    if (FunPER.Existe(Convert.ToInt32(Txt_CedPer.Text)))
                    {
                        if (FunPER.StatudAI(Convert.ToInt32(Txt_CedPer.Text)))
                        {
                            Llenar_Lb_NomPer(Convert.ToInt32(Txt_CedPer.Text));
                            Util.CambiarTxt(Txt_CedPer, Txt_ComAsd);
                        }
                        else
                        {
                            MessageBox.Show("El trabajador se encuentra egresado", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            Txt_CedPer.SelectAll();
                        }
                    }
                    else
                    {
                        MessageBox.Show("El trabajador no extiste.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        Txt_CedPer.SelectAll();
                    }
                }
                else
                {
                    FormBUSQUEDAS f = new FormBUSQUEDAS();
                    f.ListaPersonalAI();
                    f.ShowDialog();
                    if (f._CedPer != "")
                    {
                        Txt_CedPer.Text = f._CedPer;
                        Llenar_Lb_NomPer(Convert.ToInt32(Txt_CedPer.Text));
                        Util.CambiarTxt(Txt_CedPer, Txt_ComAsd);
                    }
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                Txt_ComAsd.Text = "";
                break;
            }
        }
コード例 #10
0
        private void Txt_TipTra_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_TipTra.Text.Trim() != "")
                {
                    if (FunTIPTRA.Existe(Txt_TipTra.Text))
                    {
                        if (FunTIPTRA.StatusAI(Txt_TipTra.Text))
                        {
                            Llenar_Lb_TipTra(Txt_TipTra.Text);
                            Util.CambiarTxt(Txt_TipTra, Txt_ComMov);
                        }
                        else
                        {
                            MessageBox.Show("La transacción se encuentra inactiva", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            Txt_TipTra.SelectAll();
                        }
                    }
                    else
                    {
                        MessageBox.Show("La transacción no existe en el sistema.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        Txt_TipTra.SelectAll();
                    }
                }
                else
                {
                    FormBUSQUEDAS f = new FormBUSQUEDAS();
                    f.ListaTransaccionesAI();
                    f.ShowDialog();
                    if (f._TipTra != "")
                    {
                        Txt_TipTra.Text = f._TipTra;
                        Llenar_Lb_TipTra(Txt_TipTra.Text);
                        Util.CambiarTxt(Txt_TipTra, Txt_ComMov);
                    }
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                break;
            }
        }
コード例 #11
0
        private void Txt_DesPro_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_DesPro.Text.Trim() != "")
                {
                    Util.CambiarTxt(Txt_DesPro, Txt_UndUnm);
                }
                else
                {
                    MessageBox.Show("El campo de descripción está vacío.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                break;
            }
        }
コード例 #12
0
        private void Txt_NomDpt_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_NomDpt.Text.Trim() != "")
                {
                    Cmd_Guardar.PerformClick();
                }
                else
                {
                    MessageBox.Show("El campo de nombre está vacío.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                break;
            }
        }
コード例 #13
0
        private void FormTIPDOC_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.F1:
                e.SuppressKeyPress = true;
                Cmd_Nuevo.PerformClick();
                break;

            case Keys.F2:
                e.SuppressKeyPress = true;
                Cmd_Modificar.PerformClick();
                break;

            case Keys.F3:
                e.SuppressKeyPress = true;
                Cmd_Primero.PerformClick();
                break;

            case Keys.F4:
                e.SuppressKeyPress = true;
                Cmd_Anterior.PerformClick();
                break;

            case Keys.F5:
                e.SuppressKeyPress = true;
                Cmd_Siguiente.PerformClick();
                break;

            case Keys.F6:
                e.SuppressKeyPress = true;
                Cmd_Ultimo.PerformClick();
                break;

            case Keys.F7:
                e.SuppressKeyPress = true;
                Cmd_Buscar.PerformClick();
                break;

            case Keys.F8:
                e.SuppressKeyPress = true;
                Cmd_Eliminar.PerformClick();
                break;

            case Keys.F9:
                e.SuppressKeyPress = true;
                Cmd_Imprimir.PerformClick();
                break;

            case Keys.F10:
                e.SuppressKeyPress = true;
                Cmd_Aceptar.PerformClick();
                break;

            case Keys.F11:
                e.SuppressKeyPress = true;
                Cmd_Guardar.PerformClick();
                break;

            case Keys.F12:
                e.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                break;
            }
        }
コード例 #14
0
        private void FormVACACION_KeyDown(object sender, KeyEventArgs l)
        {
            switch (l.KeyCode)
            {
            case Keys.F1:
                l.SuppressKeyPress = true;
                Cmd_Nuevo.PerformClick();
                break;

            case Keys.F2:
                l.SuppressKeyPress = true;
                Cmd_Modificar.PerformClick();
                break;

            case Keys.F3:
                l.SuppressKeyPress = true;
                Cmd_Primero.PerformClick();
                break;

            case Keys.F4:
                l.SuppressKeyPress = true;
                Cmd_Anterior.PerformClick();
                break;

            case Keys.F5:
                l.SuppressKeyPress = true;
                Cmd_Siguiente.PerformClick();
                break;

            case Keys.F6:
                l.SuppressKeyPress = true;
                Cmd_Ultimo.PerformClick();
                break;

            case Keys.F7:
                l.SuppressKeyPress = true;
                Cmd_Buscar.PerformClick();
                break;

            case Keys.F8:
                l.SuppressKeyPress = true;
                Cmd_Anular.PerformClick();
                break;

            case Keys.F9:
                l.SuppressKeyPress = true;
                Cmd_Imprimir.PerformClick();
                break;

            case Keys.F10:
                l.SuppressKeyPress = true;
                Cmd_Aceptar.PerformClick();
                break;

            case Keys.F11:
                l.SuppressKeyPress = true;
                Cmd_Guardar.PerformClick();
                break;

            case Keys.F12:
                l.SuppressKeyPress = true;
                Cmd_Cancelar.PerformClick();
                break;
            }
        }