Index: /trunk/BazaReklam/OrderDetails.cs
===================================================================
--- /trunk/BazaReklam/OrderDetails.cs (revision 819)
+++ /trunk/BazaReklam/OrderDetails.cs (revision 829)
@@ -496,5 +496,5 @@
             Dictionary<int, DateTime> datyEmisji = null;
             if (ukazeSieDataGridView.Rows.Count > 0)
-                datyEmisji = ReklamaHelper.GetDatyEmisji(Convert.ToInt32(ukazeSieDataGridView.Rows[0].Cells["ReklamaId"].Value));
+                datyEmisji = AdHelper.GetDatyEmisji(Convert.ToInt32(ukazeSieDataGridView.Rows[0].Cells["ReklamaId"].Value));
 
             DateTime firstDayOfCurrentMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
@@ -1373,5 +1373,5 @@
 
                 if (emisja.zafakturowana && (staraEmisja != kalendarz.NowaEmisja))
-                    ReklamaHelper.AddUpdateIssueChange((double)emisja.ID, staraEmisja, kalendarz.NowaEmisja.Value);
+                    AdHelper.AddUpdateIssueChange((double)emisja.ID, staraEmisja, kalendarz.NowaEmisja.Value);
             }
         }
Index: /trunk/BazaReklam/OrdersForm.cs
===================================================================
--- /trunk/BazaReklam/OrdersForm.cs (revision 742)
+++ /trunk/BazaReklam/OrdersForm.cs (revision 829)
@@ -1140,5 +1140,5 @@
             REKLAMADataSet.ReklamyZestawienieRow reklama = Reklama;
 
-            if (reklama == null || ReklamaHelper.IsReklamaNew(reklama)) return;
+            if (reklama == null || AdHelper.IsReklamaNew(reklama)) return;
 
             Facturer f = new Facturer(reklama.ReklamaID);
@@ -1205,5 +1205,5 @@
             REKLAMADataSet.ReklamyZestawienieRow reklama = Reklama;
 
-            if (reklama == null || ReklamaHelper.IsReklamaNew(reklama)) return;
+            if (reklama == null || AdHelper.IsReklamaNew(reklama)) return;
 
             Cursor = Cursors.WaitCursor;
Index: /trunk/BazaReklam/OgloszenieForm.Designer.cs
===================================================================
--- /trunk/BazaReklam/OgloszenieForm.Designer.cs (revision 829)
+++ /trunk/BazaReklam/OgloszenieForm.Designer.cs (revision 829)
@@ -0,0 +1,62 @@
+namespace Baza_Reklam
+{
+    partial class OgloszenieForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(12, 9);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(35, 13);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "label1";
+            // 
+            // OgloszenieForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(292, 273);
+            this.Controls.Add(this.label1);
+            this.Name = "OgloszenieForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "OgloszenieForm";
+            this.Load += new System.EventHandler(this.OgloszenieForm_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+    }
+}
Index: /trunk/BazaReklam/Baza Reklam.csproj
===================================================================
--- /trunk/BazaReklam/Baza Reklam.csproj (revision 824)
+++ /trunk/BazaReklam/Baza Reklam.csproj (revision 829)
@@ -152,5 +152,4 @@
     <Compile Include="Classes\PrintDGV.cs" />
     <Compile Include="Classes\Produkcja.cs" />
-    <Compile Include="Classes\Helpers\ReklamaHelper.cs" />
     <Compile Include="Classes\Repositories\AdLocationRepository.cs" />
     <Compile Include="Classes\Repositories\AgentRepository.cs" />
@@ -199,4 +198,10 @@
       <DependentUpon>KorektyForm.cs</DependentUpon>
     </Compile>
+    <Compile Include="OgloszenieForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="OgloszenieForm.Designer.cs">
+      <DependentUpon>OgloszenieForm.cs</DependentUpon>
+    </Compile>
     <Compile Include="PaymentForm2.cs">
       <SubType>Form</SubType>
@@ -596,4 +601,8 @@
       <DependentUpon>KorektyForm.cs</DependentUpon>
       <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="OgloszenieForm.resx">
+      <SubType>Designer</SubType>
+      <DependentUpon>OgloszenieForm.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="PaymentForm2.resx">
Index: /trunk/BazaReklam/ProjectForm.cs
===================================================================
--- /trunk/BazaReklam/ProjectForm.cs (revision 824)
+++ /trunk/BazaReklam/ProjectForm.cs (revision 829)
@@ -64,12 +64,4 @@
         }
 
-
-        private bool IsOgloszenie()
-        {
-            if (Reklama == null) return false;
-
-            return GetProjectType(Reklama.TYTU£, Reklama.MOD_TYP) == 2;
-        }
-
         private void InitReklama()
         {
@@ -86,6 +78,6 @@
             toolTip.SetToolTip(btnOpenFolder, "Otwórz folder z materia³ami");
 
-            EnableControls(!IsOgloszenie());
-            if (IsOgloszenie())
+            EnableControls(!AdHelper.IsOgloszenie(Reklama));
+            if (AdHelper.IsOgloszenie(Reklama))
             {
                 tYP_PROJEKTUComboBox.Items.Clear();
@@ -153,5 +145,5 @@
             row2["NAZWA_ZAMOWIENIA"] = row["Id reklamy"];
             row2["modu³"] = row["MOD_TYP"];
-            row2["Type"] = GetProjectType(row["TYTU£"].ToString(), row["MOD_TYP"].ToString());
+            row2["Type"] = AdHelper.GetProjectType(row["TYTU£"].ToString(), row["MOD_TYP"].ToString());
             row2["reklamaId"] = ReklamaId;
             row2["szer"] = row["SZER"];
@@ -182,21 +174,4 @@
 
         }
-
-        //TODO: find better method to find out if this is ogloszenie or reklama
-        private static int GetProjectType(string title, string moduleName)
-        {
-            if (!title.StartsWith("AS-")) return 1;
-
-            switch (moduleName.ToLower())
-            {
-                case "standard":
-                case "billboard":
-                case "space":
-                    return 2;
-                default:
-                    return 1;
-            }
-        }
-
 
         private void dodajButton_Click(object sender, EventArgs e)
Index: /trunk/BazaReklam/OgloszenieForm.cs
===================================================================
--- /trunk/BazaReklam/OgloszenieForm.cs (revision 829)
+++ /trunk/BazaReklam/OgloszenieForm.cs (revision 829)
@@ -0,0 +1,21 @@
+using System;
+using System.Windows.Forms;
+
+namespace Baza_Reklam
+{
+    public partial class OgloszenieForm : Form
+    {
+        private readonly REKLAMADataSet.REKLAMARow _reklama;
+
+        public OgloszenieForm(REKLAMADataSet.REKLAMARow reklama)
+        {
+            InitializeComponent();
+            _reklama = reklama;
+        }
+
+        private void OgloszenieForm_Load(object sender, EventArgs e)
+        {
+            label1.Text = _reklama.ID_REKLAMY;
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Helpers/AdHelper.cs
===================================================================
--- /trunk/BazaReklam/Classes/Helpers/AdHelper.cs (revision 819)
+++ /trunk/BazaReklam/Classes/Helpers/AdHelper.cs (revision 829)
@@ -1,3 +1,6 @@
 using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
 using Baza_Reklam.Classes.Model;
 
@@ -17,4 +20,11 @@
             AdSize adSize = new AdSize();
 
+            if (module == null)
+            {
+                adSize.Width = 0;
+                adSize.Height = 0;
+                return adSize;
+            }
+
             if (!module.MultiModule)
             {
@@ -31,4 +41,117 @@
             return adSize;
         }
+
+        public static bool IsReklamaNew(REKLAMADataSet.ReklamyZestawienieRow reklama)
+        {
+            if (!reklama.IsidZamowieniaNull()) return true;
+
+            return reklama.DATA_ZAMÓWIENIA.Year >= 2009;
+        }
+
+        public static bool IsReklamaNew(REKLAMADataSet.REKLAMARow reklama)
+        {
+            if (!reklama.IsidZamowieniaNull()) return true;
+
+            return reklama.DATA_ZAMÓWIENIA.Year >= 2009;
+        }
+
+        public static bool IsReklamaOldExpo(REKLAMADataSet.REKLAMARow reklama)
+        {
+            return (reklama.IsidZamowieniaNull() && reklama.TYTU£.ToUpper() == "EXPO");
+        }
+
+        public static Dictionary<int, DateTime> GetDatyEmisji(int reklamaId)
+        {
+            Dictionary<int, DateTime> datyEmisji = new Dictionary<int, DateTime>();
+
+            const string query = "sp_GetDatyEmisjiByReklama";
+
+            SqlConnection conn = null;
+            SqlCommand cmd = null;
+            SqlDataReader reader = null;
+            try
+            {
+                conn = new SqlConnection(ConnString.getConnString().Value);
+                conn.Open();
+                cmd = new SqlCommand(query, conn);
+                cmd.CommandType = CommandType.StoredProcedure;
+                cmd.Parameters.AddWithValue("@reklama", reklamaId);
+                reader = cmd.ExecuteReader();
+                if (reader != null)
+                {
+                    while (reader.Read())
+                        datyEmisji.Add(reader.GetInt32(0), reader.GetDateTime(1));
+                }
+            }
+            finally
+            {
+                if (reader != null)
+                {
+                    reader.Close();
+                    reader.Dispose();
+                }
+                if (cmd != null) cmd.Dispose();
+                if (conn != null)
+                {
+                    conn.Close();
+                    conn.Dispose();
+                }
+
+            }
+            return datyEmisji;
+
+        }
+
+        public static void AddUpdateIssueChange(double issueId, int currentIssueNumer, int newIssueNumber)
+        {
+            SqlConnection conn = null;
+            SqlCommand cmd = null;
+
+            try
+            {
+                conn = new SqlConnection(ConnString.getConnString().Value);
+                conn.Open();
+                cmd = new SqlCommand("sp_AddUpdateIssueChange", conn);
+                cmd.CommandType = CommandType.StoredProcedure;
+                cmd.Parameters.AddWithValue("@issueId", issueId);
+                cmd.Parameters.AddWithValue("@currentIssueNumer", currentIssueNumer);
+                cmd.Parameters.AddWithValue("@newIssueNumber", newIssueNumber);
+                cmd.ExecuteNonQuery();
+            }
+            finally
+            {
+                if (cmd != null)
+                    cmd.Dispose();
+
+                if (conn != null && conn.State == ConnectionState.Open)
+                {
+                    conn.Close();
+                    conn.Dispose();
+                }
+            }
+        }
+
+        public static bool IsOgloszenie(REKLAMADataSet.REKLAMARow reklama)
+        {
+            if (reklama == null) return false;
+
+            return GetProjectType(reklama.TYTU£, reklama.MOD_TYP) == 2;
+        }
+
+        //TODO: find better method to find out if this is ogloszenie or reklama
+        public static int GetProjectType(string title, string moduleName)
+        {
+            if (!title.StartsWith("AS-")) return 1;
+
+            switch (moduleName.ToLower())
+            {
+                case "standard":
+                case "billboard":
+                case "space":
+                    return 2;
+                default:
+                    return 1;
+            }
+        }
     }
 }
Index: /unk/BazaReklam/Classes/Helpers/ReklamaHelper.cs
===================================================================
--- /trunk/BazaReklam/Classes/Helpers/ReklamaHelper.cs (revision 764)
+++  (revision )
@@ -1,101 +1,0 @@
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Data.SqlClient;
-
-namespace Baza_Reklam.Classes.Helpers
-{
-    public class ReklamaHelper
-    {
-        public static bool IsReklamaNew(REKLAMADataSet.ReklamyZestawienieRow reklama)
-        {
-            if (!reklama.IsidZamowieniaNull()) return true;
-
-            return reklama.DATA_ZAMÓWIENIA.Year >= 2009;
-        }
-
-        public static bool IsReklamaNew(REKLAMADataSet.REKLAMARow reklama)
-        {
-            if (!reklama.IsidZamowieniaNull()) return true;
-
-            return reklama.DATA_ZAMÓWIENIA.Year >= 2009;
-        }
-
-        public static bool IsReklamaOldExpo(REKLAMADataSet.REKLAMARow reklama)
-        {
-            return (reklama.IsidZamowieniaNull() && reklama.TYTU£.ToUpper() == "EXPO");
-        }
-
-        public static Dictionary<int, DateTime> GetDatyEmisji(int reklamaId)
-        {
-            Dictionary<int, DateTime> datyEmisji = new Dictionary<int, DateTime>();
-
-            const string query = "sp_GetDatyEmisjiByReklama";
-
-            SqlConnection conn = null;
-            SqlCommand cmd = null;
-            SqlDataReader reader = null;
-            try
-            {
-                conn = new SqlConnection(ConnString.getConnString().Value);
-                conn.Open();
-                cmd = new SqlCommand(query, conn);
-                cmd.CommandType = CommandType.StoredProcedure;
-                cmd.Parameters.AddWithValue("@reklama", reklamaId);
-                reader = cmd.ExecuteReader();
-                if (reader != null)
-                {
-                    while (reader.Read())
-                        datyEmisji.Add(reader.GetInt32(0), reader.GetDateTime(1));
-                }
-            }
-            finally
-            {
-                if (reader != null)
-                {
-                    reader.Close();
-                    reader.Dispose();
-                }
-                if (cmd != null) cmd.Dispose();
-                if (conn != null)
-                {
-                    conn.Close();
-                    conn.Dispose();
-                }
-
-            }
-            return datyEmisji;
-
-        }
-
-        public static void AddUpdateIssueChange(double issueId, int currentIssueNumer, int newIssueNumber)
-        {
-            SqlConnection conn = null;
-            SqlCommand cmd = null;
-
-            try
-            {
-                conn = new SqlConnection(ConnString.getConnString().Value);
-                conn.Open();
-                cmd = new SqlCommand("sp_AddUpdateIssueChange", conn);
-                cmd.CommandType = CommandType.StoredProcedure;
-                cmd.Parameters.AddWithValue("@issueId", issueId);
-                cmd.Parameters.AddWithValue("@currentIssueNumer", currentIssueNumer);
-                cmd.Parameters.AddWithValue("@newIssueNumber", newIssueNumber);
-                cmd.ExecuteNonQuery();
-            }
-            finally
-            {
-                if (cmd != null)
-                    cmd.Dispose();
-
-                if (conn != null && conn.State == ConnectionState.Open)
-                {
-                    conn.Close();
-                    conn.Dispose();
-                }
-            }
-
-        }
-    }
-}
Index: /trunk/BazaReklam/OgloszenieForm.resx
===================================================================
--- /trunk/BazaReklam/OgloszenieForm.resx (revision 829)
+++ /trunk/BazaReklam/OgloszenieForm.resx (revision 829)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
Index: /trunk/BazaReklam/ClientsForm.cs
===================================================================
--- /trunk/BazaReklam/ClientsForm.cs (revision 732)
+++ /trunk/BazaReklam/ClientsForm.cs (revision 829)
@@ -3,5 +3,4 @@
 using System.Data;
 using System.Data.SqlClient;
-using System.Diagnostics;
 using System.Drawing;
 using System.Windows.Forms;
@@ -823,9 +822,18 @@
         {
             if (rEKLAMABindingSource.Current == null) return;
-            
+
             DataRowView row = (DataRowView) rEKLAMABindingSource.Current;
-            int idRek = Int32.Parse(row["reklamaId"].ToString());
-            ProjectForm pf = new ProjectForm(idRek);
-            pf.ShowDialog();
+            REKLAMADataSet.REKLAMARow reklama = (REKLAMADataSet.REKLAMARow) row.Row;
+
+            if (AdHelper.IsOgloszenie(reklama))
+            {
+                OgloszenieForm ogloszenieForm = new OgloszenieForm(reklama);
+                ogloszenieForm.ShowDialog();
+            }
+            else
+            {
+                ProjectForm pf = new ProjectForm(reklama.ReklamaID);
+                pf.ShowDialog();
+            }
         }
 
@@ -2321,5 +2329,5 @@
             REKLAMADataSet.REKLAMARow reklama = (REKLAMADataSet.REKLAMARow)((DataRowView)rEKLAMABindingSource.Current).Row;
 
-            pokazZamButton.Enabled = ReklamaHelper.IsReklamaOldExpo(reklama) || !ReklamaHelper.IsReklamaNew(reklama);
+            pokazZamButton.Enabled = AdHelper.IsReklamaOldExpo(reklama) || !AdHelper.IsReklamaNew(reklama);
             fakturaButton.Enabled = pokazZamButton.Enabled;
             pokFaktureButton.Enabled = pokazZamButton.Enabled;
