コード例 #1
0
        private void btnReservar_Click(object sender, EventArgs e)
        {
            if (cboRegimen.Text == "Seleccionar")
            {
                MessageBox.Show("Debe seleccionar el regimen", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }
            float precio;

            precio = getPrecio();

            List <TipoCant> tcs = new List <TipoCant>();

            if (Int32.Parse(txtC1.Text) > 0)
            {
                TipoCant tc = new TipoCant();
                tc.cant = Int32.Parse(txtC1.Text);
                tc.desc = "BASE SIMPLE";
                tcs.Add(tc);
            }
            if (Int32.Parse(txtC2.Text) > 0)
            {
                TipoCant tc = new TipoCant();
                tc.cant = Int32.Parse(txtC2.Text);
                tc.desc = "BASE DOBLE";
                tcs.Add(tc);
            }
            if (Int32.Parse(txtC3.Text) > 0)
            {
                TipoCant tc = new TipoCant();
                tc.cant = Int32.Parse(txtC3.Text);
                tc.desc = "BASE TRIPLE";
                tcs.Add(tc);
            }
            if (Int32.Parse(txtC4.Text) > 0)
            {
                TipoCant tc = new TipoCant();
                tc.cant = Int32.Parse(txtC4.Text);
                tc.desc = "BASE CUADRUPLE";
                tcs.Add(tc);
            }
            if (Int32.Parse(txtC5.Text) > 0)
            {
                TipoCant tc = new TipoCant();
                tc.cant = Int32.Parse(txtC4.Text);
                tc.desc = "KING";
                tcs.Add(tc);
            }



            ConfirmarReserva cr = new ConfirmarReserva(idHotel, dtDesde.Value, dtHasta.Value, cboHotel.Text, cboRegimen.Text, precio, tcs);

            cr.Show();
            this.Hide();
        }
コード例 #2
0
        private void btn1_Click_1(object sender, EventArgs e)
        {
            string        strCo = ConfigurationManager.AppSettings["stringConexion"];
            SqlConnection con   = new SqlConnection(strCo);

            SqlCommand cmd;

            cmd = new SqlCommand("MMEL.removerPasaporte", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@idPersona", SqlDbType.Int).Value = idPersona;
            if (cmd.Connection.State == ConnectionState.Closed)
            {
                cmd.Connection.Open();
            }
            cmd.ExecuteNonQuery();
            this.Hide();
            crform.Show();
        }