Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (maskedTextBox1.Text == "")
            {
                maskedTextBox1.Text = "0";
            }
            if (maskedTextBox2.Text == "")
            {
                maskedTextBox2.Text = "0";
            }

            if (Convert.ToInt32(maskedTextBox1.Text) > this.buta_libre)
            {
                MessageBox.Show("No hay las suficientes butacas", "Error");
            }
            else if (Convert.ToInt32(maskedTextBox2.Text) > this.kg_libre)
            {
                MessageBox.Show("No hay suficiente tamaño en la bodega", "Error");
            }
            else
            {
                Usuario_datos data = new Usuario_datos();
                data.cant_kg   = Convert.ToInt32(maskedTextBox2.Text);
                data.cant_pasj = Convert.ToInt32(maskedTextBox1.Text);
                data.viaje_id  = this.viaje_id;
                data.admin     = this.admin;
                if (data.cant_kg > 0)
                {
                    data.has_kg = true;
                }
                data.Show();
                this.Close();
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (maskedTextBox1.Text == "")
            {
                maskedTextBox1.Text = "0";
            }
            if (maskedTextBox2.Text == "")
            {
                maskedTextBox2.Text = "0";
            }

            if (Convert.ToInt32(maskedTextBox1.Text) > this.buta_libre)
            {
                MessageBox.Show("No hay las suficientes butacas", "Error");
            }
            else if (Convert.ToInt32(maskedTextBox2.Text) > this.kg_libre)
            {
                MessageBox.Show("No hay suficiente tamaño en la bodega", "Error");
            }
            else
            {
                Usuario_datos data = new Usuario_datos();
                data.cant_kg = Convert.ToInt32(maskedTextBox2.Text);
                data.cant_pasj = Convert.ToInt32(maskedTextBox1.Text);
                data.viaje_id = this.viaje_id;
                data.admin = this.admin;
                if (data.cant_kg > 0)
                {
                    data.has_kg = true;
                }
                data.Show();
                this.Close();
            }
        }