コード例 #1
0
        private void CargaContacto(string campoCondicion, TextBox textBox)
        {
            string campoValor = textBox.Text.Replace("'", "\\'").Trim();

            DataTableContacto = ConsultasSql.Busqueda(tabla: "contact", condicion: campoCondicion, valor: campoValor, campo: "id, id_number, business_name, address, landline", campoOrden: "business_name");
            if (campoValor.Length > 0 && DataTableContacto.Rows.Count > 0)
            {
                ContactoDataGridView.DataSource               = DataTableContacto;
                ContactoDataGridView.Size                     = new Size(350, 120);
                ContactoDataGridView.Location                 = new Point(textBox.Location.X + 10, textBox.Location.Y + 26);
                ContactoDataGridView.ColumnHeadersVisible     = false;
                ContactoDataGridView.RowHeadersVisible        = false;
                ContactoDataGridView.AllowUserToAddRows       = false;
                ContactoDataGridView.AllowUserToDeleteRows    = false;
                ContactoDataGridView.BackgroundColor          = Color.White;
                ContactoDataGridView.AllowUserToResizeColumns = false;
                ContactoDataGridView.AllowUserToResizeRows    = false;
                ContactoDataGridView.SelectionMode            = DataGridViewSelectionMode.FullRowSelect;
                ContactoDataGridView.ReadOnly                 = true;

                Controls.Add(ContactoDataGridView);
                ContactoDataGridView.BringToFront();
                ContactoDataGridView.Visible = true;

                ContactoDataGridView.Columns["id_number"].Width     = 90;
                ContactoDataGridView.Columns["business_name"].Width = 256;
                ContactoDataGridView.Columns["id"].Visible          = false;
                ContactoDataGridView.Columns["address"].Visible     = false;
                ContactoDataGridView.Columns["landline"].Visible    = false;
            }
            else
            {
                ContactoDataGridView.Visible = false;
            }
        }
コード例 #2
0
        public void Busqueda()
        {
            string busqueda = busquedaTextBox.Text.Replace("'", "\\'").Trim();

            listadoDataGridView.DataSource = ConsultasSql.Busqueda(tabla: TableBdd, condicion: "name", valor: $"{ busqueda }");
            listadoDataGridView.Sort(listadoDataGridView.Columns["name"], ListSortDirection.Ascending);
        }
コード例 #3
0
        private void BusquedaTextBox_TextChanged(object sender, EventArgs e)
        {
            string busqueda = busquedaTextBox.Text.Replace("'", "\\'").Trim();

            stockDataGridView.DataSource = ConsultasSql.Busqueda(tabla: "product", condicion: "name", valor: $"{busqueda}", "stock", "ASC", "stock_indicator", "ASC", campo: "name, stock, minimum_stock_level, stock_indicator");
            stockDataGridView.ClearSelection();
        }
コード例 #4
0
        public void Busqueda()
        {
            string busqueda = busquedaTextBox.Text.Replace("'", "\\'").Trim();

            listadoDataGridView.DataSource = ConsultasSql.Busqueda(TableBdd, "business_name", $"{ busqueda }", campoOrden: "business_name");
            listadoDataGridView.Sort(listadoDataGridView.Columns["business_name"], ListSortDirection.Ascending);
        }
コード例 #5
0
        public void Busqueda()
        {
            DateTime dateTimeStart = toDateTimePicker.Value;
            string   fechaInicio   = $"'{dateTimeStart: yyyy-MM-dd} 00:00:00'";
            DateTime dateTimeEnd   = fromDateTimePicker.Value;
            string   fechaFin      = $"'{dateTimeEnd: yyyy-MM-dd} 23:59:59'";
            string   busqueda      = busquedaTextBox.Text.Replace("'", "\\'").Trim();

            listadoDataGridView.DataSource = ConsultasSql.Busqueda(tabla: TableBdd, condicion1: "name", condicion2: "number", condicion3: "product", valor: $"{ busqueda }", campoFecha: "date_of_issue", fechaInicio: $"{ fechaInicio }", fechaFin: $"{ fechaFin }", campo: "*", campoOrden: "date_of_issue", orden: "DESC");
        }
コード例 #6
0
        private void FiltrarProducto()
        {
            string campoValor = BusquedaProductoTextBox.Text.Replace("'", "\\'").Trim();

            DataTableProducto = ConsultasSql.Busqueda(tabla: "product_iva_rate_view", condicion1: "name", condicion2: "main_code", valor: campoValor, campo: "id, main_code, name, stock, cost, iva_rate_name");
            ProductoDataGridView.DataSource = DataTableProducto;

            ProductoDataGridView.Columns["main_code"].Width       = 100;
            ProductoDataGridView.Columns["name"].Width            = 275;
            ProductoDataGridView.Columns["id"].Visible            = false;
            ProductoDataGridView.Columns["stock"].Visible         = false;
            ProductoDataGridView.Columns["cost"].Visible          = false;
            ProductoDataGridView.Columns["iva_rate_name"].Visible = false;
        }