Exemple #1
0
        private void btnContinuar_Click(object sender, EventArgs e)
        {
            txtbxCentro.Text  = txtbxCentro.Text.ToUpper();
            txtbxBascula.Text = txtbxBascula.Text.ToUpper();

            if (txtbxCentro.Text == "" || txtbxBascula.Text == "")
            {
                base.MostrarError("Todos los campos son obligatorios");
                return;
            }

            if (txtbxCentro.Text != "0R00")
            {
                base.MostrarError("No existe centro!");
                return;
            }

            if (txtbxBascula.Text != "MANUAL")
            {
                base.MostrarError("No existe el modelo de Báscula");
                return;
            }

            if (txtbxBascula.Text.Trim().StartsWith("0") == true)
            {
                base.MostrarError("No existe el modelo de Báscula");
                return;
            }

            this.Hide();
            FrmZPPG01Captura zppg01 = new FrmZPPG01Captura();

            zppg01.ShowDialog();
        }
 private void btnContinuar_Click(object sender, EventArgs e)
 {
     try
     {
         ValidarDatos();
         FrmZPPG01Captura       zppg01 = new FrmZPPG01Captura();
         string                 cadena = "WHERE (WERKS = '" + txtbxCentro.Text + "')";
         CLSCatCentroCollection centro = new CLSCatCentroBAL().MostrarCatCentroBAL(cadena);
         IEnumerator            lista  = centro.GetEnumerator();
         while (lista.MoveNext())
         {
             CLSCatCentro centroM = (CLSCatCentro)lista.Current;
             cadena = centroM.DescCentro.ToString();
         }
         if (MessageBox.Show("Estas seguro de entrar con centro " + cadena, "AVISO", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             zppg01.CodCentro = txtbxCentro.Text;
             zppg01.DesCentro = cadena;
             string bascula = txtbxBascula.Text.ToUpper();
             if (bascula != "MANUAL")
             {
                 zppg01.Bascula       = true;
                 zppg01.CodBascula    = codBascula;
                 zppg01.ModeloBascula = txtbxBascula.Text.ToUpper();
             }
             else
             {
                 zppg01.Bascula = false;
             }
             zppg01.PuertoFatom  = txtbxPuertoSrl.Text;
             zppg01.SettingFatom = txtbxSettings.Text;
             zppg01.IniciarForma();
             this.Hide();
             zppg01.ShowDialog();
             zppg01.CerrarPuerto();
         }
     }
     catch (Exception ex)
     {
         base.MostrarError(ex.Message);
     }
 }