Example #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();
        }
Example #2
0
        public MailErroneoReserva(int idCliente, string nombre, string apellido, string idnro, string mail, ConfirmarReserva form)
        {
            this.idPersona = idCliente;
            this.nombre    = nombre;
            this.apellido  = apellido;
            this.nrodoc    = idnro;
            this.mail      = mail;
            this.formCr    = form;



            InitializeComponent();
            label1.Text = "El cliente seleccionado posee un mail duplicado con otro usuario.\n" +
                          " Seleccione los datos del usuario que posea la direccion de correo electronico seleccionado.";
            lblNombre1.Text   = nombre;
            lblApellido1.Text = apellido;
            lblNumero1.Text   = idnro;
            lblMail1.Text     = mail;

            string        consultaBusqueda = String.Format("select top 1 pe.idPersona, pe.Nombre,pe.Apellido,pe.NroDocumento,pe.Mail from mmel.Persona pe where pe.idPersona <>{0} and pe.Mail like  '{1}' ", idPersona, mail);
            string        strCo            = ConfigurationManager.AppSettings["stringConexion"];
            SqlConnection con = new SqlConnection(strCo);
            SqlCommand    cmd = new SqlCommand(consultaBusqueda, con);

            con.Open();
            if (cmd.Connection.State == ConnectionState.Closed)
            {
                cmd.Connection.Open();
            }
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                lblNombre2.Text   = (reader["Nombre"].ToString());
                lblApellido2.Text = (reader["Apellido"].ToString());
                lblnro2.Text      = (reader["NroDocumento"].ToString());
                lblMail2.Text     = (reader["Mail"].ToString());
                idPersona2        = Int32.Parse(reader["idPersona"].ToString());
            }
            reader.Close();
            con.Close();
        }
        public PasaporteErroneoReserva(int idPersona, string nombre, string apellido, string nroDoc, string mail, ConfirmarReserva crform)
        {
            this.idPersona = idPersona;

            this.nombre   = nombre;
            this.apellido = apellido;
            this.nrodoc   = nroDoc;
            this.mail     = mail;
            this.crform   = crform;
            InitializeComponent();
            label1.Text = "El cliente seleccionado posee un Nro de pasaporte duplicado. \n. Seleccione a quien le corresponda dicho nĂºmero";

            lblNombre1.Text   = nombre;
            lblApellido1.Text = apellido;
            lblNumero1.Text   = nrodoc;
            lblMail1.Text     = mail;

            string        consultaBusqueda = String.Format("select top 1 pe.idPersona, pe.Nombre,pe.Apellido,pe.NroDocumento,pe.Mail from mmel.Persona pe where pe.idPersona <>{0} and pe.NroDocumento like  '{1}' ", idPersona, nrodoc);
            string        strCo            = ConfigurationManager.AppSettings["stringConexion"];
            SqlConnection con = new SqlConnection(strCo);
            SqlCommand    cmd = new SqlCommand(consultaBusqueda, con);

            con.Open();
            if (cmd.Connection.State == ConnectionState.Closed)
            {
                cmd.Connection.Open();
            }
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                lblNombre2.Text   = (reader["Nombre"].ToString());
                lblApellido2.Text = (reader["Apellido"].ToString());
                lblnro2.Text      = (reader["NroDocumento"].ToString());
                lblMail2.Text     = (reader["Mail"].ToString());
                idPersona2        = Int32.Parse(reader["idPersona"].ToString());
            }
            reader.Close();
            con.Close();
        }