コード例 #1
0
        private void CboTipoDocumentos_SelectedValueChanged(object sender, EventArgs e)
        {
            if (CboTipoComprobante.SelectedIndex != -1 & CboTipoComprobante.SelectedValue != null)
            {
                DataView Dv = new DataView(DtserieGuias);
                Dv.RowFilter = "TipoDocumento = '" + CboTipoComprobante.SelectedValue + "'";
                CboSerieGuias.HoldFields();
                CboSerieGuias.DataSource    = Dv;
                CboSerieGuias.DisplayMember = "Serie";
                CboSerieGuias.ValueMember   = "Serie";

                if (Convert.ToInt16(CboTipoComprobante.SelectedValue) == 1)//es boleta
                {
                    //tamaño de la boleta
                    printDocument1.DefaultPageSettings.PaperSize      = new System.Drawing.Printing.PaperSize("BoletaHalley", 510, 550);
                    printDocument1.DefaultPageSettings.Margins.Left   = 0;
                    printDocument1.DefaultPageSettings.Margins.Right  = 0;
                    printDocument1.DefaultPageSettings.Margins.Top    = 0;
                    printDocument1.DefaultPageSettings.Margins.Bottom = 0;
                    printDocument1.OriginAtMargins = true;
                    //printDocument1.DefaultPageSettings.Landscape = false;
                }
                else if (Convert.ToInt16(CboTipoComprobante.SelectedValue) == 2)//es factura
                {
                    //tamaño de la Factura
                    printDocument1.DefaultPageSettings.PaperSize      = new System.Drawing.Printing.PaperSize("Facturalley", 810, 550);
                    printDocument1.DefaultPageSettings.Margins.Left   = 0;
                    printDocument1.DefaultPageSettings.Margins.Right  = 0;
                    printDocument1.DefaultPageSettings.Margins.Top    = 0;
                    printDocument1.DefaultPageSettings.Margins.Bottom = 0;
                    printDocument1.OriginAtMargins = true;
                    //printDocument1.DefaultPageSettings.Landscape = false;
                }
            }
        }
コード例 #2
0
 private void CboTipoComprobante2_SelectedValueChanged(object sender, EventArgs e)
 {
     if (CboTipoComprobante2.SelectedIndex != -1 & CboTipoComprobante2.SelectedValue != null)
     {
         DataView Dv = new DataView(DtserieGuias);
         Dv.RowFilter = "TipoDocumento = '" + CboTipoComprobante2.SelectedValue + "'";
         CboSerieGuias.HoldFields();
         CboSerieGuias.DataSource    = Dv;
         CboSerieGuias.DisplayMember = "Serie";
         CboSerieGuias.ValueMember   = "Serie";
     }
 }
コード例 #3
0
 private void cbComprobante2_SelectedValueChanged(object sender, EventArgs e)
 {
     if (cbComprobante2.SelectedIndex != -1 & DtserieGuias.Rows.Count > 0)
     {
         DataView Dv = new DataView(DtserieGuias);
         Dv.RowFilter = "TipoDocumento = '" + cbComprobante2.SelectedValue + "'";
         CboSerieGuias.HoldFields();
         CboSerieGuias.DataSource    = Dv.ToTable();
         CboSerieGuias.DisplayMember = "Serie";
         CboSerieGuias.ValueMember   = "Serie";
         //c1Combo.FillC1Combo1(CboSerieGuias, Dv.ToTable(), "", "Serie");
     }
 }