protected void BindSuministro()
        {
            DataSet dsSuministros = ApoyoBD.BuscarSuministro(Busqueda.Text);

            dgSuministros.DataSource = dsSuministros;
            dgSuministros.DataBind();
        }
        protected void BindAnalisis()
        {
            DataSet dsAnalisis = ApoyoBD.BuscarAnalisis(Numero.Text);

            dgAnalisis.DataSource = dsAnalisis;
            dgAnalisis.DataBind();
        }
 protected void DataGrid_Edit(object sender, DataGridCommandEventArgs e)
 {
     if (e.CommandName.ToString() == "Editar")
     {
         dgAnalisis.EditItemIndex = e.Item.ItemIndex;
         BindAnalisis();
     }
     if (e.CommandName.ToString() == "Guardar")
     {
         string strCodigo        = ((TextBox)e.Item.Cells[2].Controls[0]).Text;
         string strDescripcion   = ((TextBox)e.Item.Cells[3].Controls[0]).Text;
         string strCantidad      = ((TextBox)e.Item.Cells[4].Controls[0]).Text;
         string strPrecio1       = ((TextBox)e.Item.Cells[5].Controls[0]).Text;
         string strPrecio2       = ((TextBox)e.Item.Cells[7].Controls[0]).Text;
         string strPrecio3       = ((TextBox)e.Item.Cells[9].Controls[0]).Text;
         string strObservaciones = ((TextBox)e.Item.Cells[12].Controls[0]).Text;
         ApoyoBD.Actualizar(strCodigo, strDescripcion, strCantidad, strPrecio1, strPrecio2, strPrecio3, strObservaciones, Numero.Text);
         dgAnalisis.EditItemIndex = -1;
         BindAnalisis();
     }
     if (e.CommandName.ToString() == "Eliminar")
     {
         string strCodigo = e.Item.Cells[2].Text;
         ApoyoBD.Eliminar(strCodigo, Numero.Text);
         BindAnalisis();
     }
 }
 protected void Insertar_Suministro(object sender, DataGridCommandEventArgs e)
 {
     if (e.CommandName.ToString() == "Select")
     {
         ApoyoBD.Crear(e.Item.Cells[2].Text, e.CommandArgument.ToString(), Numero.Text);
         BindAnalisis();
     }
 }
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Introducir aquí el código de usuario para inicializar la página
            if (Page.IsPostBack == false)
            {
                DataSet dsProveedores = ApoyoBD.ObtenerProveedores();

                foreach (DataRow dr in dsProveedores.Tables[0].Rows)
                {
                    tdl_Proveedor1.Items.Add(dr[0].ToString());
                    tdl_Proveedor2.Items.Add(dr[0].ToString());
                    tdl_Proveedor3.Items.Add(dr[0].ToString());
                }
            }
        }
        protected override void Create()
        {
            fd = new FontDef(this, "Arial");

            FontProp fp            = new FontPropMM(fd, 1.9);
            FontProp fp_Encabezado = new FontPropMM(fd, 1.9);

            fp_Encabezado.bBold = true;

            TableLayoutManager tlm = new TableLayoutManager(fp_Encabezado);

            tlm.rContainerHeightMM    = 50;          //rPosInferior - rPosSuperior;
            tlm.headerCellDef.rAlignV = RepObj.rAlignCenter;
            //tlm.cellDef.pp_LineBottom = new PenProp(this, 0.05, Color.LightGray);
            tlm.pp_LineV = null;
            tlm.pp_LineH = null;

            tlm.eNewContainer += new TableLayoutManager.NewContainerEventHandler(Tlm_NewContainer);

            TableLayoutManager.Column col;

            col = new TableLayoutManager.ColumnMM(tlm, "Nro.", 15);
            col = new TableLayoutManager.ColumnMM(tlm, "Fecha", 18);
            col.cellDef.rAlignH = RepObj.rAlignRight;
            col = new TableLayoutManager.ColumnMM(tlm, "Proveedor", 54);
            col.cellDef.textMode = TableLayoutManager.TextMode.MultiLine;
            col = new TableLayoutManager.ColumnMM(tlm, "Partida", 22);
            col.cellDef.textMode = TableLayoutManager.TextMode.MultiLine;
            col = new TableLayoutManager.ColumnMM(tlm, "Unidad Solicitante", 69);
            col.cellDef.textMode = TableLayoutManager.TextMode.MultiLine;
            col = new TableLayoutManager.ColumnMM(tlm, "Observaciones", 69);
            col.cellDef.textMode = TableLayoutManager.TextMode.MultiLine;
            col = new TableLayoutManager.ColumnMM(tlm, "Monto", 23);
            col.cellDef.rAlignH = RepObj.rAlignRight;

            BrushProp bp_Anulada = new BrushProp(this, Color.FromArgb(255, 255, 200));

            //rDatos = ComprasSuministrosBD.ObtenerOrdenesCompras(rSector, rDesde, rHasta);

            rDatos = ApoyoBD.ObtenerAnalisisDePrecios(rSector);
            int nTotal = 0;

            while ((rDatos.Read()) && (nTotal <= 88))
            //rDatos.Read();
            {
                //tlm.cellDef.bp_Back = ((rDatos["Indi_Anulacion"].ToString() == "1") ? bp_Anulada : null);
                tlm.NewRow();
                tlm.Add(0, new RepString(fp, nTotal.ToString()));
                tlm.Add(1, new RepString(fp, " "));
                tlm.Add(2, new RepString(fp, " "));
                tlm.Add(3, new RepString(fp, " "));
                //tlm.Add(4, new RepString(fp, " " ));
                //tlm.Add(5, new RepString(fp, " " ));
                //tlm.Add(6, new RepString(fp, rDatos["Monto"].ToString()));
                //tlm.Add(6, new RepString(fp, "Monto" ));
                nTotal += 1;
            }

            rDatos.Close();

            foreach (Page page in enum_Page)
            {
                Double rY = rPosInferior + 1.5;
                page.SetLandscape();
                page.AddLT_MM(rPosIzquierda, rY, new RepString(fp, DateTime.Now.ToShortDateString() +
                                                               " " + DateTime.Now.ToShortTimeString() + " " + nTotal.ToString()));
                page.AddRT_MM(rPosDerecha, rY, new RepString(fp, page.iPageNo + " / " + iPageCount));
            }
        }