| 1 | using System;
|
|---|
| 2 | using System.Collections.Generic;
|
|---|
| 3 | using System.ComponentModel;
|
|---|
| 4 | using System.Data;
|
|---|
| 5 | using System.Drawing;
|
|---|
| 6 | using System.Text;
|
|---|
| 7 | using System.Windows.Forms;
|
|---|
| 8 | using Microsoft.Reporting.WinForms;
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | namespace 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 | } |
|---|