示例#1
0
 private void Presionar(object sender, KeyEventArgs e)
 {
     ctrl = (Control)sender;
     if (ctrl.Name.Equals("TxtNom") && !Activo) Activo = true;
     if (e.Key == Key.Enter)
     {
         if (ctrl.Name.Equals("TxtNom") && !string.IsNullOrEmpty(TxtNom.Text))
         {
             int idExiste = Paquete.ComprobarExistencia(TxtNom.Text);
             if (idExiste != -1) CargarPaquete(idExiste);
             TxtVer.Focus();
         }
         if (ctrl.Name.Equals("TxtVer") && !string.IsNullOrEmpty(TxtVer.Text))
         {
             if (ClsFunciones.TryConvertToDouble(TxtVer.Text)) TxtFec.Focus();
             else MessageBox.Show(StrMenEVer);
         }
         if (ctrl.Name.Equals("TxtFec") && !string.IsNullOrEmpty(TxtFec.Text))
         {
             if (ClsFunciones.TryConvertToDate(TxtFec.Text)) TxtCom.Focus();
             else MessageBox.Show(StrMenEFec);
         }
         if (ctrl.Name.Equals("TxtBus")) ButBusc.Focus();
     }
 }
 public void Presionar(object sender, KeyEventArgs e)
 {
     ctrl = ((Control)sender);
     if (ctrl.Name.Equals("TxtNom") && !Activo)
     {
         Activo = true;
     }
     if (e.Key == Key.Enter)
     {
         if (ctrl.Name.Equals("TxtNom") && !string.IsNullOrEmpty(TxtNom.Text))
         {
             int idExiste = Trabajador.ComprobarExistencia(TxtNom.Text);
             if (idExiste != -1)
             {
                 CargarPersona(idExiste);
             }
             TxtVer.Focus();
         }
         if (ctrl.Name.Equals("TxtVer") && !string.IsNullOrEmpty(TxtVer.Text))
         {
             if (ClsFunciones.TryConvertToDouble(TxtVer.Text))
             {
                 TxtFec.Focus();
             }
             else
             {
                 MessageBox.Show(StrMenEVer);
             }
         }
         if (ctrl.Name.Equals("TxtFec") && !string.IsNullOrEmpty(TxtFec.Text))
         {
             if (ClsFunciones.TryConvertToDate(TxtFec.Text))
             {
                 TxtOrg.Focus();
             }
             else
             {
                 MessageBox.Show(StrMenEFec);
             }
         }
         if (ctrl.Name.Equals("TxtOrg") && !string.IsNullOrEmpty(TxtOrg.Text))
         {
             TxtRol.Focus();
         }
         if (ctrl.Name.Equals("TxtRol") && !string.IsNullOrEmpty(TxtRol.Text))
         {
             TxtCom.Focus();
         }
         if (ctrl.Name.Equals("TxtBus"))
         {
             ButBusc.Focus();
         }
     }
 }
示例#3
0
    protected void TxtNStock_TextChanged(object sender, EventArgs e)
    {
        int OldStock = Convert.ToInt32(TxtCVStock.Text);
        int NewStock;

        if (TxtNStock.Text == "")
        {
            TxtTStock.Text = "";
            //NewStock = 0;
        }
        else
        {
            NewStock = Convert.ToInt32(TxtNStock.Text);
            int TotalStock = (OldStock + NewStock);

            if (TxtCStock.Text != "")
            {
                TxtTStock.Text = Convert.ToString(TotalStock);
                TxtCom.Focus();
            }
        }
    }
示例#4
0
 private void Presionar(object sender, KeyEventArgs e)
 {
     ctrl = (Control)sender;
     if (ctrl.Name.Equals("TxtNom") && !Activo)
     {
         Activo = true;
     }
     if (e.Key == Key.Enter)
     {
         if (ctrl.Name.Equals("TxtNom") && !string.IsNullOrEmpty(TxtNom.Text))
         {
             int idExiste = Requisito.ComprobarExistencia(TxtNom.Text);
             if (idExiste != -1)
             {
                 CargarRequisito(idExiste);
             }
             TxtVer.Focus();
         }
         if (ctrl.Name.Equals("TxtVer") && !string.IsNullOrEmpty(TxtVer.Text))
         {
             if (ClsFunciones.TryConvertToDouble(TxtVer.Text))
             {
                 TxtFec.Focus();
             }
             else
             {
                 MessageBox.Show(StrMenEVer);
             }
         }
         if (ctrl.Name.Equals("TxtFec") && !string.IsNullOrEmpty(TxtFec.Text))
         {
             if (ClsFunciones.TryConvertToDate(TxtFec.Text))
             {
                 TxtDesc.Focus();
             }
             else
             {
                 MessageBox.Show(StrMenEFec);
             }
         }
         if (ctrl.Name.Equals("TxtDesc") && !string.IsNullOrEmpty(TxtDesc.Text))
         {
             TxtCom.Focus();
         }
         if (ctrl.Name.Equals("TxtBus"))
         {
             ButBusc.Focus();
         }
         if (ctrl.Name.Equals("TxtDat") && !string.IsNullOrEmpty(TxtDat.Text))
         {
             if (LinDatEsp == -1)
             {
                 Requisito.DatosEspeci.Add(new ClsDatDG()
                 {
                     Descrip = TxtDat.Text
                 });
             }
             else
             {
                 Requisito.DatosEspeci.Insert(LinDatEsp, new ClsDatDG()
                 {
                     Descrip = TxtDat.Text
                 });
             }
             LinDatEsp   = -1;
             TxtDat.Text = string.Empty;
         }
     }
 }