Index: trunk/BazaReklam/FactureViewer.Designer.cs
===================================================================
--- trunk/BazaReklam/FactureViewer.Designer.cs (revision 372)
+++ trunk/BazaReklam/FactureViewer.Designer.cs (revision 522)
@@ -267,4 +267,5 @@
             this.btnRefresh.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
             this.btnRefresh.UseVisualStyleBackColor = true;
+            //this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
             // 
             // reportViewer1
Index: trunk/BazaReklam/FactureViewer.cs
===================================================================
--- trunk/BazaReklam/FactureViewer.cs (revision 457)
+++ trunk/BazaReklam/FactureViewer.cs (revision 522)
@@ -35,5 +35,5 @@
             proforma = rodzaj;
 
-            btnRefresh.Click += zapiszButton_Click;
+            btnRefresh.Click += btnRefresh_Old_Click;
 
             fakturaTableAdapter1.Connection.ConnectionString = ConnString.getConnString().Value;
@@ -119,9 +119,8 @@
             InitializeComponent();
 
+            btnRefresh.Click += btnRefresh_Click;
 
             idFaktury = idFakt;
             proforma = r;
-
-            btnRefresh.Click += Refresh_Click;
 
             fakturaTableAdapter1.Connection.ConnectionString = ConnString.getConnString().Value;
@@ -272,46 +271,4 @@
         }
 
-        /*
-        /// <summary>
-        ///  FAKTURA DLA POZNANIA
-        /// </summary>
-        /// <param name="idFakt"></param>
-        public FactureViewer(int idFakt)
-        {
-            InitializeComponent();
-
-            idFaktury = idFakt;
-
-            this.btnRefresh.Click += new EventHandler(zapiszPoznanButton_Click);
-
-            fakturaTableAdapter1.Connection.ConnectionString = ConnString.getConnString().Value;
-            fakturA_DETAILSTableAdapter1.Connection.ConnectionString = ConnString.getConnString().Value;
-            fAKTURYTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
-            proformaTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
-
-            ds = new DataSet();
-
-            //zczytuje dane z pliku z tlumaczeniami
-            Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream("Baza_Reklam.Raporty.faktura.xml");
-            ds.ReadXml(s);
-
-            fAKTURYTableAdapter.FillByIdFaktury(this.rEKLAMADataSet.FAKTURY, idFakt);
-
-            typComboBox.Enabled = false;
-          //  wersjaComboBox.Enabled = false;
-         // jezykComboBox.Enabled = false;
-
-            reportViewer1.LocalReport.ReportEmbeddedResource = "Baza_Reklam.Raporty.fakturaPoznan.rdlc";
-            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Faktura", fakturaTableAdapter1.GetDataByIdFaktury(idFakt)));
-            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("FakturaDetails", fakturA_DETAILSTableAdapter1.GetDataByIdFaktury(idFakt)));
-            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("tlumaczenia", ds.Tables[0]));
-
-            jezykComboBox.SelectedIndex = 0;
-            typComboBox.SelectedIndex = 1;
-        //    wersjaComboBox.SelectedIndex = 0;
-        }
-        */
-
-
         private void FactureViewer_Load(object sender, EventArgs e)
         {
@@ -322,5 +279,5 @@
         }
 
-        private void zapiszButton_Click(object sender, EventArgs e)
+        private void btnRefresh_Old_Click(object sender, EventArgs e)
         {
             Cursor = Cursors.WaitCursor;
@@ -332,5 +289,5 @@
 
             reportViewer1.Reset();
-            reportViewer1.LocalReport.ReportEmbeddedResource = proforma ? "Baza_Reklam.Raporty.fakturaReversed.rdlc" : "Baza_Reklam.Raporty.proformaReversed.rdlc";
+            reportViewer1.LocalReport.ReportEmbeddedResource = proforma ? "Baza_Reklam.Raporty.proformaReversed.rdlc" : "Baza_Reklam.Raporty.fakturaReversed.rdlc";
 
             //ustawienie parametrów, nowych datasoure dla raportu
@@ -338,4 +295,12 @@
 
             if (proforma)
+            {
+                //paramList.Add(new ReportParameter("typ", typComboBox.SelectedItem.ToString(), true));
+                paramList.Add(new ReportParameter("podpis", podpisCheckBox.Checked.ToString(), true));
+                reportViewer1.LocalReport.SetParameters(paramList);
+                reportViewer1.LocalReport.DataSources.Clear();
+                reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Faktura", proformaTableAdapter.GetDataByIdFaktury(idFaktury)));
+            }
+            else
             {
                 paramList.Add(new ReportParameter("jezyk", jezykComboBox.SelectedItem.ToString(), true));
@@ -343,14 +308,5 @@
                 reportViewer1.LocalReport.SetParameters(paramList);
                 reportViewer1.LocalReport.DataSources.Clear();
-                reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Faktura", fakturaTableAdapter1.GetDataByIdFaktury(idFaktury)));
-
-            }
-            else
-            {
-                paramList.Add(new ReportParameter("typ", typComboBox.SelectedItem.ToString(), true));
-                paramList.Add(new ReportParameter("podpis", podpisCheckBox.Checked.ToString(), true));
-                reportViewer1.LocalReport.SetParameters(paramList);
-                reportViewer1.LocalReport.DataSources.Clear();
-                reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Faktura", proformaTableAdapter.GetDataByIdFaktury(idFaktury)));
+                reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Faktura", fakturaTableAdapter1.GetDataByIdFaktury(idFaktury)));   
             }
 
@@ -435,5 +391,5 @@
         }
 
-        private void Refresh_Click(object sender, EventArgs e)
+        private void btnRefresh_Click(object sender, EventArgs e)
         {
             Cursor = Cursors.WaitCursor;
@@ -472,115 +428,4 @@
 
         }
-
-        //drukowanie raportu serwerowego
-        /*
-        private int m_currentPageIndex;
-        private IList<Stream> m_streams;
-
-
-        public void HandlePrint(object sender, CancelEventArgs e)
-        {
-            Run();
-            //MessageBox.Show("Drukowanie");
-            e.Cancel = true;
-        }
-
-        private void Print(PrinterSettings printerSettings)
-        {
-            MessageBox.Show("PrintBegin");
-            if (m_streams == null || m_streams.Count == 0)
-                return;
-
-            PrintDocument printDoc = new PrintDocument();
-            printDoc.PrinterSettings = printerSettings;
-            printDoc.PrintPage += new PrintPageEventHandler(PrintPage);
-            MessageBox.Show("Print");
-            printDoc.Print();
-        }
-
-        private void Run()
-        {
-            PrintDialog printDialog = new PrintDialog();
-            if (printDialog.ShowDialog() == DialogResult.OK)
-            {
-                MessageBox.Show("Export");
-                Export(reportViewer1.ServerReport);
-                m_currentPageIndex = 0;
-                MessageBox.Show("Print");
-                Print(printDialog.PrinterSettings);
-            }
-        }
-
-        private void PrintPage(object sender, PrintPageEventArgs ev)
-        {
-            MessageBox.Show("PrintPage1");
-            Metafile pageImage = new Metafile(m_streams[m_currentPageIndex]);
-            pageImage.Save("C:\\testestPRO.emf");
-
-            // Note: Coordinate (0,0) does not coincide with the top left corner of
-            // the page; it coincides with the top left corner of the printable area
-            // of the page. To account for this we have to subtract the hard margin.
-
-            MessageBox.Show("PrintPage2nnn");
-            RectangleF adjustedRect = new RectangleF(
-                ev.PageBounds.Left - ev.PageSettings.HardMarginX,
-                ev.PageBounds.Top - ev.PageSettings.HardMarginY,
-                ev.PageBounds.Width, ev.PageBounds.Height);
-            MessageBox.Show(adjustedRect.Top.ToString() + "*" + adjustedRect.Height.ToString() + "*" + adjustedRect.Width.ToString());
-            ev.Graphics.DrawImage(pageImage, adjustedRect);
-            MessageBox.Show("PrintPage4");
-            m_currentPageIndex++;
-            ev.HasMorePages = (m_currentPageIndex < m_streams.Count);
-            MessageBox.Show("PrintPage5");
-        }
-
-        private void Export(ServerReport report)
-        {
-            MessageBox.Show("ExportBegin");
-
-            string deviceInfo =
-
-              "<DeviceInfo>" +
-
-              "  <OutputFormat>EMF</OutputFormat>" +
-
-              "  <PageWidth>21cm</PageWidth>" +
-
-              "  <PageHeight>29cm</PageHeight>" +
-
-              "  <MarginTop>1cm</MarginTop>" +
-
-              "  <MarginLeft>1cm</MarginLeft>" +
-
-              "  <MarginRight>1cm</MarginRight>" +
-
-              "  <MarginBottom>1cm</MarginBottom>" +
-
-              "</DeviceInfo>";
-
-            m_streams = new List<Stream>();
-            string mimeType;
-            string extension;
-            System.Collections.Specialized.NameValueCollection urlAccessParameters = new System.Collections.Specialized.NameValueCollection();
-            urlAccessParameters.Add("rs:PersistStreams", "True");
-            Stream reportStream = report.Render("Image", deviceInfo, urlAccessParameters, out mimeType, out extension);
-            m_streams.Add(reportStream);
-            urlAccessParameters.Remove("rs:PersistStreams");
-            urlAccessParameters.Add("rs:GetNextStream", "True");
-            while (reportStream.Length != 0)
-            {
-                reportStream =
-                    report.Render("Image", deviceInfo, urlAccessParameters, out mimeType, out extension);
-                m_streams.Add(reportStream);
-            }
-
-            m_streams.RemoveAt(m_streams.Count - 1);
-
-            foreach (Stream stream in m_streams)
-                stream.Position = 0;
-
-            MessageBox.Show("ExportEnd");
-        }
-        */
 
         // drukowanie raportu lokalnego
@@ -675,5 +520,4 @@
             opisTextBox.Text = powodKorektyComboBox.SelectedItem.ToString();
         }
-
     }
 }
