コード例 #1
0
        private void confirmarCompraButton_Click(object sender, EventArgs e)
        {
            List <int> pasajerosIds   = new List <int>();
            List <int> butacasNumeros = new List <int>();

            List <int>     clientesIds = new List <int>();
            List <Decimal> pesos       = new List <Decimal>();

            foreach (DataRow d in this.pasajerosDatatable.Rows)
            {
                pasajerosIds.Add((int)d.ItemArray[0]);
                butacasNumeros.Add((int)d.ItemArray[4]);
            }

            foreach (DataRow d in this.paquetesDatatable.Rows)
            {
                clientesIds.Add((int)d.ItemArray[0]);
                pesos.Add(Convert.ToDecimal(d.ItemArray[4]));
            }

            if (pasajerosIds.Count == 0 && clientesIds.Count == 0)
            {
                MessageBox.Show("No selecciono nada para comprar.");
                return;
            }

            List <String> detalle = this.buildDetalle(pasajerosIds, butacasNumeros, clientesIds, pesos);

            Confirmacion confirmacionDialog = new Confirmacion(detalle, pasajerosIds, butacasNumeros, clientesIds, pesos, selectedViaje, selectedAeronave, this.loginform);
            var          dr = confirmacionDialog.ShowDialog();

            if (dr == DialogResult.OK)
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
コード例 #2
0
ファイル: Compra.cs プロジェクト: leopaglia/TP-2C-2015-GDD
        private void confirmarCompraButton_Click(object sender, EventArgs e)
        {
            List<int> pasajerosIds = new List<int>();
            List<int> butacasNumeros = new List<int>();

            List<int> clientesIds = new List<int>();
            List<Decimal> pesos = new List<Decimal>();

            foreach (DataRow d in this.pasajerosDatatable.Rows) {
                pasajerosIds.Add((int)d.ItemArray[0]);
                butacasNumeros.Add((int)d.ItemArray[4]);
            }

            foreach (DataRow d in this.paquetesDatatable.Rows) {
                clientesIds.Add((int)d.ItemArray[0]);
                pesos.Add(Convert.ToDecimal(d.ItemArray[4]));
            }

            if (pasajerosIds.Count == 0 && clientesIds.Count == 0) {
                MessageBox.Show("No selecciono nada para comprar.");
                return;
            }

            List<String> detalle = this.buildDetalle(pasajerosIds, butacasNumeros, clientesIds, pesos);

            Confirmacion confirmacionDialog = new Confirmacion(detalle, pasajerosIds, butacasNumeros, clientesIds, pesos, selectedViaje, selectedAeronave, this.loginform);
            var dr = confirmacionDialog.ShowDialog();

            if (dr == DialogResult.OK) {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }