Esempio n. 1
0
        public PantallaAnadirProducto(int idAlmacen)
        {
            InitializeComponent();
            logicaProductos      = new AlmacenProductosBL();
            this.idAlmacen       = idAlmacen;
            this.prodAlmReciente = null;
            dataGridProductosRegistrables.AutoGenerateColumns = false;
            dataGridProductosRegistrables.DataSource          = logicaProductos.obtenerProductosRegistrables(this.idAlmacen);

            txtNumResultados.Text    = ((BindingList <Producto>)dataGridProductosRegistrables.DataSource).Count.ToString() + " Resultado(s)";
            txtNumResultados.Visible = true;

            logicaProductos.actualizarAlmacenPedidoProd();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != null && textBox1.Text != "")
            {
                txtCargando.Visible = true;
                txtCargando.Refresh();
                txtCargando.Update();

                dataGridProductosRegistrables.DataSource = logicaProductos.obtenerProductosRegistrables(this.idAlmacen, Int32.Parse(textBox1.Text), textBox2.Text);
                dataGridProductosRegistrables.Refresh();
                dataGridProductosRegistrables.Update();

                txtCargando.Visible = false;
                txtCargando.Refresh();
                txtCargando.Update();

                txtNumResultados.Text = ((BindingList <Producto>)dataGridProductosRegistrables.DataSource).Count.ToString() + " Resultado(s)";
                txtNumResultados.Refresh();
                txtNumResultados.Update();
            }
            else if (textBox2.Text != null && textBox2.Text != "")
            {
                txtCargando.Visible = true;
                txtCargando.Refresh();
                txtCargando.Update();

                dataGridProductosRegistrables.DataSource = logicaProductos.obtenerProductosRegistrables(this.idAlmacen, textBox2.Text);
                dataGridProductosRegistrables.Refresh();
                dataGridProductosRegistrables.Update();

                txtCargando.Visible = false;
                txtCargando.Refresh();
                txtCargando.Update();

                txtNumResultados.Text = ((BindingList <Producto>)dataGridProductosRegistrables.DataSource).Count.ToString() + " Resultado(s)";
                txtNumResultados.Refresh();
                txtNumResultados.Update();
            }
            else if (textBox2.Text == null || textBox2.Text == "")
            {
                txtCargando.Visible = true;
                txtCargando.Refresh();
                txtCargando.Update();

                dataGridProductosRegistrables.DataSource = logicaProductos.obtenerProductosRegistrables(this.idAlmacen);
                dataGridProductosRegistrables.Refresh();
                dataGridProductosRegistrables.Update();

                txtCargando.Visible = false;
                txtCargando.Refresh();
                txtCargando.Update();

                txtNumResultados.Text = ((BindingList <Producto>)dataGridProductosRegistrables.DataSource).Count.ToString() + " Resultado(s)";
                txtNumResultados.Refresh();
                txtNumResultados.Update();
            }
            //actualizar las etiquetas
            if (dataGridProductosRegistrables.CurrentRow != null)
            {
                labelNombre.Text = ((Producto)dataGridProductosRegistrables.CurrentRow.DataBoundItem).Nombre;
            }
            else
            {
                labelNombre.Text = "";
            }
        }