public SeleccionVueloForm()
 {
     InitializeComponent();
     string queryCiudades = "SELECT Ciudad_Cod, Ciudad_Nombre FROM TS.Ciudad WHERE Ciudad_Borrada = 0";
     DbComunicator db = new DbComunicator();
     origenComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryCiudades, "Ciudad_Cod", "Ciudad_Nombre"), null);
     origenComboBox.DisplayMember = "Value";
     origenComboBox.ValueMember = "Key";
     origenComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
     destinoComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryCiudades, "Ciudad_Cod", "Ciudad_Nombre"), null);
     destinoComboBox.DisplayMember = "Value";
     destinoComboBox.ValueMember = "Key";
     destinoComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
 }
Пример #2
0
 public Llegada()
 {
     InitializeComponent();
     string queryCiudades = "SELECT Ciudad_Nombre, Ciudad_Cod FROM TS.Ciudad";
     DbComunicator db = new DbComunicator();
     origenComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryCiudades, "Ciudad_Nombre", "Ciudad_Cod"), null);
     origenComboBox.DisplayMember = "Key";
     origenComboBox.ValueMember = "Value";
     origenComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
     llegadaComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryCiudades, "Ciudad_Nombre", "Ciudad_Cod"), null);
     llegadaComboBox.DisplayMember = "Key";
     llegadaComboBox.ValueMember = "Value";
     llegadaComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
 }
Пример #3
0
 public CanjeForm()
 {
     InitializeComponent();
     this.validator = new Commons.Validator();
     quantityTextBox.KeyPress += this.InputNumField_KeyPress;
     string queryClientes = "SELECT Cli_DNI + ' Nombre: ' + Cli_Nombre Cli_Detalle, Cli_Cod FROM TS.Cliente ";
     DbComunicator db = new DbComunicator();
     clienteComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryClientes, "Cli_Detalle", "Cli_Cod"), null);
     clienteComboBox.DisplayMember = "Key";
     clienteComboBox.ValueMember = "Value";
     clienteComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
     clienteComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
     string queryProductos = "SELECT Prod_Nombre + ' (' + CAST (Prod_Valor AS nvarchar(255)) + ')' Prod_Detalle, Prod_Cod FROM TS.Producto";
     productoComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryProductos, "Prod_Detalle", "Prod_Cod"), null);
     productoComboBox.DisplayMember = "Key";
     productoComboBox.ValueMember = "Value";
     productoComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
     db.CerrarConexion();
 }
Пример #4
0
 public ConsultaForm()
 {
     InitializeComponent();
     DbComunicator db = new DbComunicator();
     string queryClientes = "SELECT Cli_DNI + ' Nombre: ' + Cli_Nombre Cli_Detalle, Cli_Cod FROM TS.Cliente ";
     dniComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryClientes, "Cli_Detalle", "Cli_Cod"), null);
     db.CerrarConexion();
     dniComboBox.DisplayMember = "Key";
     dniComboBox.ValueMember = "Value";
     dniComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
     dniComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
     db.CerrarConexion();
 }
Пример #5
0
 public TarjetaBaseForm()
 {
     InitializeComponent();
     this.validator = new Commons.Validator();
     cardDateTextBox.KeyPress += InputNumField_KeyPress;
     cardCodeTextBox.KeyPress += InputNumField_KeyPress;
     cardNumberTextBoxt.KeyPress += InputNumField_KeyPress;
     string queryCiudades = "SELECT TipoTar_Nombre, TipoTar_Cod FROM TS.Tipo_Tarjeta";
     DbComunicator db = new DbComunicator();
     cardEmitterComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryCiudades, "TipoTar_Nombre", "TipoTar_Cod"), null);
     cardEmitterComboBox.DisplayMember = "Key";
     cardEmitterComboBox.ValueMember = "Value";
     cardEmitterComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
     db.CerrarConexion();
 }
Пример #6
0
        public DatosBuscadorForm()
        {
            InitializeComponent();
            DbComunicator db = new DbComunicator();
            string queryClientes = "SELECT Cli_DNI + ' Nombre: ' + Cli_Nombre Cli_Detalle, Cli_Cod FROM TS.Cliente ";
            dniComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryClientes, "Cli_Detalle", "Cli_Cod"), null);
            db.CerrarConexion();
            dniComboBox.DisplayMember = "Key";
            dniComboBox.ValueMember = "Value";
            dniComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            dniComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
            dniComboBox.SelectedValueChanged += dniComboBox_SelectedValueChanged;
            dniComboBox.TextChanged += dniComboBox_TextChanged;

            fullNameTextBox.Enabled = false;
            addressTextBox.Enabled = false;
            phoneTextBox.Enabled = false;
            bornDateTimePicker.Enabled = false;
            mailTextBox.Enabled = false;
            cliCod = "";
            editClientButton.Enabled = false;
        }
Пример #7
0
        public DatosPasajeForm(int viajCod, DataGridView pasajeGridView, List<int> butacasReservadas)
        {
            // TODO: Complete member initialization
            InitializeComponent();
            this.pasajeGridView = pasajeGridView;
            this.butacaReservada = 0;
            this.viajCod = viajCod;
            acceptButton.Enabled = false;
            string butacasR = "";
            butacaComboBox.DropDownStyle = ComboBoxStyle.DropDownList;

            DbComunicator db = new DbComunicator();
            SqlCommand storeProcedure = db.GetStoreProcedure("TS.fnGetPrecioPasaje");
            SqlParameter returnParameter = storeProcedure.Parameters.Add("RetVal", SqlDbType.Decimal);
            returnParameter.Direction = ParameterDirection.ReturnValue;
            storeProcedure.Parameters.Add(new SqlParameter("@Viaj_Cod", viajCod));
            storeProcedure.ExecuteNonQuery();
            db.CerrarConexion();

            precioTextBox.Text = Convert.ToDecimal(returnParameter.Value).ToString();

            foreach (var butaca in butacasReservadas)
            {
                butacasR += " AND B.But_Cod != " + butaca + " ";
            }

            string queryButacas = "SELECT B.But_Cod, CAST (B.But_Piso AS nvarchar(255)) + ' ' + CAST (B.But_Numero AS nvarchar(255)) + ' ' + B.But_Tipo But_Label FROM TS.Butaca as B, TS.Viaje as V ";
            queryButacas += "WHERE B.But_Cod NOT IN (SELECT But_Cod FROM TS.Pasaje as P WHERE P.Can_Cod IS NULL AND P.Viaj_Cod = "+ viajCod + ") ";
            queryButacas += "AND B.Aero_Num = V.Aero_Num AND V.Viaj_Cod = " + viajCod + " " + butacasR;
            queryButacas += "ORDER BY B.But_Piso ASC, B.But_Numero ASC";
            DbComunicator db2 = new DbComunicator();
            butacaComboBox.DataSource = new BindingSource(db2.GetQueryDictionary(queryButacas, "But_Cod", "But_Label"), null);
            butacaComboBox.DisplayMember = "Value";
            butacaComboBox.ValueMember = "Key";
            db2.CerrarConexion();
        }
Пример #8
0
 public override void foundCliCod(string cliCod)
 {
     DbComunicator db1 = new DbComunicator();
     cardNumberTextBox.SelectedValueChanged -= this.cardNumberTextBoxt_valueChanged;
     string queryCuentas = "SELECT Tar_Numero FROM TS.Tarjeta WHERE Cli_Cod = " + this.cliCod;
     cardNumberTextBox.DataSource = new BindingSource(db1.GetQueryDictionary(queryCuentas, "Tar_Numero", "Tar_Numero"), null);
     cardNumberTextBox.DisplayMember = "Value";
     cardNumberTextBox.ValueMember = "Key";
     cardNumberTextBox.Enabled = true;
     addCreditCardButton.Enabled = true;
     cardNumberTextBox.SelectedValueChanged += this.cardNumberTextBoxt_valueChanged;
     cardNumberTextBox.DropDownStyle = ComboBoxStyle.DropDownList;
     cardNumberDuesComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
     this.Cli_Cod = Convert.ToDouble(this.cliCod);
     this.clientLoaded();
     db1.CerrarConexion();
 }
Пример #9
0
 private void addClientButton_Click(object sender, EventArgs e)
 {
     ClienteAgregarForm ca = new ClienteAgregarForm();
     ca.ShowDialog();
     DbComunicator db = new DbComunicator();
     string queryClientes = "SELECT Cli_DNI + ' Nombre: ' + Cli_Nombre Cli_Detalle, Cli_Cod FROM TS.Cliente ";
     dniComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryClientes, "Cli_Detalle", "Cli_Cod"), null);
     db.CerrarConexion();
     fillInputs();
 }
Пример #10
0
 private void editClientButton_Click(object sender, EventArgs e)
 {
     string cliDni = "";
     DbComunicator db1 = new DbComunicator();
     db1.EjecutarQuery("SELECT Cli_DNI FROM TS.Cliente WHERE Cli_Cod = " + this.cliCod);
     db1.getLector().Read();
     cliDni = db1.getLector()["Cli_DNI"].ToString();
     db1.CerrarConexion();
     ClienteEditarForm ce = new ClienteEditarForm(cliCod, cliDni ,fullNameTextBox.Text, addressTextBox.Text, phoneTextBox.Text, mailTextBox.Text, bornDateTimePicker.Value);
     ce.ShowDialog();
     DbComunicator db = new DbComunicator();
     string queryClientes = "SELECT Cli_DNI + ' Nombre: ' + Cli_Nombre Cli_Detalle, Cli_Cod FROM TS.Cliente ";
     dniComboBox.DataSource = new BindingSource(db.GetQueryDictionary(queryClientes, "Cli_Detalle", "Cli_Cod"), null);
     db.CerrarConexion();
     fillInputs();
 }