Пример #1
0
        //protected void Page_Error(object sender, EventArgs e)
        //{
        //    Exception exc = Server.GetLastError();
        //    Response.Write("<h2>Error:</h2>\n");
        //    Response.Write("<b>Exepcion en Page_Error: </b>" + exc.Message.ToString() + "\n");
        //    Response.Write("Retorna al <a href='../Default.aspx'>Inicio</a>\n");
        //    Server.ClearError();
        //}

        void Buscar()
        {
            //gvProductos.DataSource = _logicaNegocio.SeleccionarTodos();
            //Se obtiene la categoria seleccionada
            int categoriaID = Int32.Parse(ddlFiltroCategoria.SelectedValue);
            //Se otbiene la fecha de inicio
            DateTime inicioFechaCreacion = new DateTime();
            DateTime finFechaCreacion    = new DateTime();

            DateTime.TryParseExact(txtFiltroFechaInicioCreacion.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out inicioFechaCreacion);
            //Se obtiene la fecha fin
            DateTime.TryParseExact(txtFiltroFechaFinCreacion.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out finFechaCreacion);
            finFechaCreacion = finFechaCreacion.AddDays(1);
            //Se trae informacion desde la capa de negocio
            gvProductos.DataSource = _logicaNegocio.SeleccionarTodosPorFiltro(categoriaID,
                                                                              inicioFechaCreacion,
                                                                              finFechaCreacion);
            gvProductos.DataBind();
        }