Exemplo n.º 1
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;
            }
        }
Exemplo n.º 2
0
        private void Txt_DesTiv_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_DesTiv.Text.Trim() != "")
                {
                    Cmd_Guardar.PerformClick();
                }
                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_DesTiv, Txt_TipTiv);
                }
                else
                {
                    if (Evento.CompareTo("Nuevo") == 0)
                    {
                        e.SuppressKeyPress = true;
                        Cmd_Cancelar.PerformClick();
                    }
                }
                break;
            }
        }
Exemplo n.º 3
0
        private void Txt_CodDpt_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_CodDpt.Text.Trim() != "")
                {
                    if (FunDP.Existe(Convert.ToInt32(Txt_CodDpt.Text)))
                    {
                        if (FunDP.StatudAI(Convert.ToInt32(Txt_CodDpt.Text)))
                        {
                            Llenar_Lb_NomDpt(Convert.ToInt32(Txt_CodDpt.Text));
                            Cmd_Guardar.PerformClick();
                        }
                        else
                        {
                            MessageBox.Show("El departamento se encuentra inactivo", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            Txt_CodDpt.Focus();
                        }
                    }
                    else
                    {
                        MessageBox.Show("El departamento no existe.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        Txt_CodDpt.Focus();
                    }
                }
                else
                {
                    FormBUSQUEDAS f = new FormBUSQUEDAS();
                    f.ListaDepartamentosAI();
                    f.ShowDialog();
                    if (f._CodDpt != "")
                    {
                        Txt_CodDpt.Text = f._CodDpt;
                        Llenar_Lb_NomDpt(Convert.ToInt32(f._CodDpt));
                        Cmd_Guardar.PerformClick();
                    }
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Util.CambiarTxt(Txt_CodDpt, Txt_NomUsu);
                break;
            }
        }
Exemplo n.º 4
0
        private void Com_ForTid_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Com_ForTid.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;
                Util.CambiarTxt(Com_ForTid, Txt_DesTid);
                break;
            }
        }
Exemplo n.º 5
0
        private void Txt_DesGru_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_DesGru.Text.Trim() != "")
                {
                    Cmd_Guardar.PerformClick();
                }
                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;
            }
        }
        private void Dat_FeiPer_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Dat_FeiPer.Text.Trim() != "")
                {
                    Cmd_Guardar.PerformClick();
                }
                else
                {
                    MessageBox.Show("El campo de fecha de ingreso está vacío.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Util.CambiarTxt(Dat_FeiPer, Txt_CodGco);
                break;
            }
        }
        private void Txt_PrePro_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_PrePro.Text.Trim().CompareTo("") != 0)
                {
                    Cmd_Guardar.PerformClick();
                }
                else
                {
                    Txt_PrePro.Text = "0,00";
                    Cmd_Guardar.PerformClick();
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Util.CambiarTxt(Txt_PrePro, Txt_TipTiv);
                break;
            }
        }
        private void Txt_CatMov_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_CatMov.Text.Trim() != "" && Util.FormatDecimal(Txt_CatMov.Text) > 0)
                {
                    Cmd_Guardar.PerformClick();
                }
                else
                {
                    MessageBox.Show("El campo de cantidad debe ser mayor a 0 ó esta vaio.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    Txt_CatMov.SelectAll();
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Util.CambiarTxt(Txt_CatMov, Txt_ObsVac);
                break;
            }
        }
Exemplo n.º 9
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;
            }
        }
Exemplo n.º 10
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;
            }
        }