root/Baza Reklam 2 - Faktury/DaneKlientaViewer.cs @ 448

Wersja 65, 2.2 KB (wprowadzona przez dorota, 17 years temu)
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Text;
7using System.Windows.Forms;
8using Microsoft.Reporting.WinForms;
9
10
11namespace Baza_Reklam
12{
13    public partial class DaneKlientaViewer : Form
14    {
15        public DaneKlientaViewer(int custId)
16        {
17            InitializeComponent();
18
19            KLIENCITableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
20            kliencI_OSOBY_DO_KONTAKTUTableAdapter1.Connection.ConnectionString = ConnString.getConnString().Value;
21
22            KLIENCITableAdapter.FillByCustomerId(REKLAMADataSet.KLIENCI, custId);
23            kliencI_OSOBY_DO_KONTAKTUTableAdapter1.FillByCustomerId(REKLAMADataSet.KLIENCI_OSOBY_DO_KONTAKTU, custId);
24
25            reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubreportProcessing);
26        }
27
28        public DaneKlientaViewer(List<int> custId)
29        {
30            InitializeComponent();
31
32            KLIENCITableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
33            kliencI_OSOBY_DO_KONTAKTUTableAdapter1.Connection.ConnectionString = ConnString.getConnString().Value;
34
35            KLIENCITableAdapter.ClearBeforeFill = false;
36            kliencI_OSOBY_DO_KONTAKTUTableAdapter1.ClearBeforeFill = false;
37
38            foreach (int i in custId)
39            {
40                KLIENCITableAdapter.FillByCustomerId(REKLAMADataSet.KLIENCI, i);
41                kliencI_OSOBY_DO_KONTAKTUTableAdapter1.FillByCustomerId(REKLAMADataSet.KLIENCI_OSOBY_DO_KONTAKTU, i);
42            }
43
44            reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubreportProcessing);
45        }
46
47        private void DaneKlientaViewer_Load(object sender, EventArgs e)
48        {
49            this.reportViewer1.RefreshReport();
50        }
51
52        void SubreportProcessing(object sender, SubreportProcessingEventArgs e)
53        {
54            e.DataSources.Add(new ReportDataSource("REKLAMADataSet_KLIENCI_OSOBY_DO_KONTAKTU", this.REKLAMADataSet.KLIENCI_OSOBY_DO_KONTAKTU));
55        }
56    }
57}
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.