private void BuscarBebidas(string tipo_busqueda, string texto_busqueda)
        {
            try
            {
                string    estado = this.rdActivo.Checked ? "ACTIVO" : "INACTIVO";
                DataTable Tabla  =
                    NBebidas.BuscarBebida(tipo_busqueda, texto_busqueda, estado, out string rpta);
                if (Tabla != null)
                {
                    this.dgvBebidas.Enabled  = true;
                    this.dgvBebidas.Enabled  = true;
                    this.dgvBebidas.PageSize = 25;
                    this.dgvBebidas.SetPagedDataSource(Tabla, this.bindingNavigator1);

                    this.lblResultados.Text =
                        "Se encontraron " + Tabla.Rows.Count + " bebidas";
                    string[] columns_header_text =
                    {
                        "Id bebida",    "Nombre",             "Precio",
                        "Precio trago", "Precio trago doble", "Precio proveedor",
                        "Id proveedor", "Imagen",             "Id Tipo",         "Cantidad (Unidades)","Cantidad por unidad", "Cantidad total", "Estado",
                        "Id tipo",      "Tipo"
                    };

                    bool[] columns_visible =
                    {
                        false, true, true, false, false, false, false, false, false, true, true, true, false, false, true
                    };

                    this.dgvBebidas =
                        DatagridString.ChangeHeaderTextAndVisibleCustomDataGrid(this.dgvBebidas, columns_header_text, columns_visible);
                }
                else
                {
                    this.dgvBebidas.clearDataSource();
                    this.dgvBebidas.Enabled = false;
                    this.lblResultados.Text =
                        "No se encontraron bebidas";

                    if (!rpta.Equals("OK"))
                    {
                        throw new Exception(rpta);
                    }
                }
            }
            catch (Exception ex)
            {
                Mensajes.MensajeErrorCompleto(this.Name, "BuscarBebidas",
                                              "Hubo un error al buscar una bebida", ex.Message);
            }
        }
示例#2
0
        private void BuscarProveedores(string tipo_busqueda, string texto_busqueda)
        {
            try
            {
                DataTable tableProveedores =
                    NProveedores.BuscarProveedores(tipo_busqueda, texto_busqueda, out string rpta);
                if (tableProveedores != null)
                {
                    this.dgvProveedores.Enabled  = true;
                    this.dgvProveedores.PageSize = 30;
                    this.dgvProveedores.SetPagedDataSource(tableProveedores, this.bindingNavigator1);

                    string[] columns_header =
                    {
                        "Id proveedor", "Fecha ingreso", "Nombre", "Teléfono", "Correo electrónico"
                    };

                    bool[] columns_visible =
                    {
                        false, false, true, true, true
                    };

                    this.dgvProveedores =
                        DatagridString.ChangeHeaderTextAndVisibleCustomDataGrid(this.dgvProveedores,
                                                                                columns_header, columns_visible);
                    this.lblResultados.Text = "Se encontraron " + tableProveedores.Rows.Count + " proveedores";
                }
                else
                {
                    if (!rpta.Equals("OK"))
                    {
                        throw new Exception(rpta);
                    }

                    this.dgvProveedores.clearDataSource();
                    this.dgvProveedores.Enabled = false;
                    this.lblResultados.Text     = "No se encontraron proveedores";
                }
            }
            catch (Exception ex)
            {
                Mensajes.MensajeErrorCompleto(this.Name, "BuscarProveedores",
                                              "Hubo un error al buscar un proveedor", ex.Message);
            }
        }
示例#3
0
        private void BuscarTipoArticulos(string tipo_busqueda, string texto_busqueda)
        {
            try
            {
                DataTable tableTipoArticulos =
                    NTipo_articulos.BuscarTipoArticulos(tipo_busqueda, texto_busqueda, out string rpta);
                if (tableTipoArticulos != null)
                {
                    this.dgvTipoArticulos.Enabled  = true;
                    this.dgvTipoArticulos.PageSize = 30;
                    this.dgvTipoArticulos.SetPagedDataSource(tableTipoArticulos, this.bindingNavigator1);

                    string[] columns_header =
                    {
                        "Id tipo artículo", "Nombre", "Descripción"
                    };

                    bool[] columns_visible =
                    {
                        false, true, true
                    };

                    this.dgvTipoArticulos =
                        DatagridString.ChangeHeaderTextAndVisibleCustomDataGrid(this.dgvTipoArticulos,
                                                                                columns_header, columns_visible);
                    this.lblResultados.Text = "Se encontraron " + tableTipoArticulos.Rows.Count + " tipos de artículos";
                }
                else
                {
                    if (!rpta.Equals("OK"))
                    {
                        throw new Exception(rpta);
                    }

                    this.dgvTipoArticulos.clearDataSource();
                    this.dgvTipoArticulos.Enabled = false;
                    this.lblResultados.Text       = "No se encontraron tipos de artículos";
                }
            }
            catch (Exception ex)
            {
                Mensajes.MensajeErrorCompleto(this.Name, "BuscarProveedores",
                                              "Hubo un error al buscar un tipo de artículo", ex.Message);
            }
        }
示例#4
0
        private void Buscar(string tipo_busqueda, string texto_busqueda)
        {
            try
            {
                DataTable dtPedidosEliminados =
                    NPedido.BuscarPedidosEliminados(tipo_busqueda, texto_busqueda);
                if (dtPedidosEliminados != null)
                {
                    this.dgvPedidosEliminados.Enabled  = true;
                    this.dgvPedidosEliminados.PageSize = 15;
                    this.dgvPedidosEliminados.SetPagedDataSource(dtPedidosEliminados, this.bindingNavigator1);

                    lblRespuesta.Text =
                        "Se encontraron " + dtPedidosEliminados.Rows.Count + " pedidos eliminados";

                    string[] columns_header_text =
                    {
                        "Id pedido", "Id usuario clave maestra", "Ingresó clave maestra",   "Id tipo", "Tipo", "Fecha", "Hora", "Motivo", "Nombre producto",
                        "Precio",    "Id usuario sesion",        "Tenía la sesión abierta", "Cargo",   "Teléfono"
                    };
                    bool[] columns_visible =
                    {
                        false, false, true, false, true, true, true, true, true, true, false, true, false, false
                    };
                    this.dgvPedidosEliminados =
                        DatagridString.ChangeHeaderTextAndVisibleCustomDataGrid(this.dgvPedidosEliminados,
                                                                                columns_header_text, columns_visible);
                    this.dgvPedidosEliminados.Columns["Precio"].DefaultCellStyle.Format = "C";
                    this.dgvPedidosEliminados.Columns["Hora"].DefaultCellStyle.Format   = "hh:mm tt";
                }
                else
                {
                    this.dgvPedidosEliminados.clearDataSource();
                    this.dgvPedidosEliminados.Enabled = false;
                    lblRespuesta.Text = "No se encontraron pedidos eliminados";
                }
            }
            catch (Exception ex)
            {
                Mensajes.MensajeErrorCompleto(this.Name, "Buscar",
                                              "Hubo un error al Buscar los pedidos eliminados",
                                              ex.Message);
            }
        }
        private void BuscarInsumos(string tipo_busqueda, string texto_busqueda)
        {
            try
            {
                DataTable table =
                    NInsumos.BuscarInsumos(tipo_busqueda, texto_busqueda, out string rpta);
                if (table != null)
                {
                    this.dgvInsumos.Enabled = true;
                    this.lblResultados.Text = "Se encontraron " + table.Rows.Count + " insumos";

                    this.dgvInsumos.PageSize = 25;
                    this.dgvInsumos.SetPagedDataSource(table, this.bindingNavigator1);

                    string[] columns_text_header =
                    {
                        "Id insumo", "Nombre", "Id tipo insumo", "Cantidad", "Medida", "Observaciones", "Id tipo insumo", "Tipo"
                    };
                    bool[] columns_visible =
                    {
                        false, true, false, true, true, true, false, true
                    };
                    this.dgvInsumos =
                        DatagridString.ChangeHeaderTextAndVisibleCustomDataGrid(this.dgvInsumos, columns_text_header, columns_visible);
                }
                else
                {
                    this.dgvInsumos.clearDataSource();
                    this.dgvInsumos.Enabled = false;
                    this.lblResultados.Text = "No se encontraron insumos";

                    if (!rpta.Equals("OK"))
                    {
                        throw new Exception(rpta);
                    }
                }
            }
            catch (Exception ex)
            {
                Mensajes.MensajeErrorCompleto(this.Name, "BuscarInsumos",
                                              "Hubo un error al buscar insumos", ex.Message);
            }
        }