Index: /trunk/RaportySQL/ErrorLog.rdl
===================================================================
--- /trunk/RaportySQL/ErrorLog.rdl (revision 554)
+++ /trunk/RaportySQL/ErrorLog.rdl (revision 981)
@@ -193,5 +193,5 @@
   </DataSets>
   <Code />
-  <Width>27cm</Width>
+  <Width>26.82002cm</Width>
   <Body>
     <ColumnSpacing>1cm</ColumnSpacing>
@@ -199,4 +199,5 @@
       <Textbox Name="textbox1">
         <rd:DefaultName>textbox1</rd:DefaultName>
+        <Width>26.75cm</Width>
         <Style>
           <FontSize>14pt</FontSize>
@@ -497,5 +498,4 @@
           </TableGroup>
         </TableGroups>
-        <Width>26.82002cm</Width>
         <Details>
           <TableRows>
Index: /trunk/BazaReklamSetup/BazaReklamSetup.vdproj
===================================================================
--- /trunk/BazaReklamSetup/BazaReklamSetup.vdproj (revision 924)
+++ /trunk/BazaReklamSetup/BazaReklamSetup.vdproj (revision 981)
@@ -578,6 +578,6 @@
         "Name" = "8:Microsoft Visual Studio"
         "ProductName" = "8:Baza Reklam"
-        "ProductCode" = "8:{C1C574BC-ED7C-4CEA-B487-ADC2A164F25D}"
-        "PackageCode" = "8:{251D93B0-039F-4CC7-9ED8-3F5EF4F936B2}"
+        "ProductCode" = "8:{0553529D-70F2-40D5-9ED7-0DAB681B62BB}"
+        "PackageCode" = "8:{F7CFD8B8-FE02-4E5C-9665-28F5691FBC7C}"
         "UpgradeCode" = "8:{4E2DBBA4-3139-4790-8DDB-7AADFC963A7D}"
         "RestartWWWService" = "11:FALSE"
@@ -585,5 +585,5 @@
         "DetectNewerInstalledVersion" = "11:TRUE"
         "InstallAllUsers" = "11:TRUE"
-        "ProductVersion" = "8:1.2.7"
+        "ProductVersion" = "8:1.2.8"
         "Manufacturer" = "8:AACT"
         "ARPHELPTELEPHONE" = "8:"
Index: /trunk/BazaReklam.sln
===================================================================
--- /trunk/BazaReklam.sln (revision 609)
+++ /trunk/BazaReklam.sln (revision 981)
@@ -1,8 +1,6 @@
 ﻿
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Baza Reklam", "BazaReklam\Baza Reklam.csproj", "{BBBFA978-486C-4BE9-88C7-F24C0496D0FC}"
-EndProject
-Project("{F14B399A-7131-4C87-9E4B-1186C45EF12D}") = "RaportySQL", "RaportySQL\RaportySQL.rptproj", "{C21ED0FA-2806-4BE2-8843-530364FBA631}"
 EndProject
 Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "BazaReklamSetup", "BazaReklamSetup\BazaReklamSetup.vdproj", "{376FC7DF-ED3D-4EF4-81F9-92249C2A8335}"
@@ -28,8 +26,4 @@
 		{BBBFA978-486C-4BE9-88C7-F24C0496D0FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{BBBFA978-486C-4BE9-88C7-F24C0496D0FC}.Release|Any CPU.Build.0 = Release|Any CPU
-		{C21ED0FA-2806-4BE2-8843-530364FBA631}.Debug|Any CPU.ActiveCfg = Debug
-		{C21ED0FA-2806-4BE2-8843-530364FBA631}.DebugLocal|Any CPU.ActiveCfg = DebugLocal
-		{C21ED0FA-2806-4BE2-8843-530364FBA631}.Production|Any CPU.ActiveCfg = Debug
-		{C21ED0FA-2806-4BE2-8843-530364FBA631}.Release|Any CPU.ActiveCfg = Production
 		{376FC7DF-ED3D-4EF4-81F9-92249C2A8335}.Debug|Any CPU.ActiveCfg = Debug
 		{376FC7DF-ED3D-4EF4-81F9-92249C2A8335}.DebugLocal|Any CPU.ActiveCfg = Debug
Index: /trunk/BazaReklam/Baza Reklam.csproj.user
===================================================================
--- /trunk/BazaReklam/Baza Reklam.csproj.user (revision 890)
+++ /trunk/BazaReklam/Baza Reklam.csproj.user (revision 981)
@@ -9,5 +9,4 @@
     <BootstrapperUrlHistory>
     </BootstrapperUrlHistory>
-    <ApplicationRevision>0</ApplicationRevision>
     <FallbackCulture>en-US</FallbackCulture>
     <VerifyUploadedFiles>true</VerifyUploadedFiles>
Index: /trunk/BazaReklam/ClientsForm.Designer.cs
===================================================================
--- /trunk/BazaReklam/ClientsForm.Designer.cs (revision 889)
+++ /trunk/BazaReklam/ClientsForm.Designer.cs (revision 981)
@@ -7089,5 +7089,4 @@
         private System.Windows.Forms.Button btnAddSubscription;
         private System.Windows.Forms.DataGridView gridSubscriptions;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Price;
         private System.Windows.Forms.Button btnEditSubscription;
         private System.Windows.Forms.Button btnDelSubscription;
Index: /trunk/BazaReklam/SubscriptionForm.Designer.cs
===================================================================
--- /trunk/BazaReklam/SubscriptionForm.Designer.cs (revision 981)
+++ /trunk/BazaReklam/SubscriptionForm.Designer.cs (revision 981)
@@ -0,0 +1,373 @@
+namespace Baza_Reklam
+{
+    partial class SubscriptionForm
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            this.lblSubscriptionType = new System.Windows.Forms.Label();
+            this.cbSubscriptionType = new System.Windows.Forms.ComboBox();
+            this.lblCustomer = new System.Windows.Forms.Label();
+            this.lblCustomerName = new System.Windows.Forms.Label();
+            this.lblPrice = new System.Windows.Forms.Label();
+            this.txtPricePln = new System.Windows.Forms.TextBox();
+            this.lblSubscriptionsCount = new System.Windows.Forms.Label();
+            this.dateStartDate = new System.Windows.Forms.DateTimePicker();
+            this.lblStartDate = new System.Windows.Forms.Label();
+            this.btnAdd = new System.Windows.Forms.Button();
+            this.txtPriceEur = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.txtTotalPricePln = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.txtTotalPriceEur = new System.Windows.Forms.TextBox();
+            this.btnCancel = new System.Windows.Forms.Button();
+            this.numSubscriptionCount = new System.Windows.Forms.NumericUpDown();
+            this.lblCurrency = new System.Windows.Forms.Label();
+            this.cbCurrency = new System.Windows.Forms.ComboBox();
+            this.numDiscount = new System.Windows.Forms.NumericUpDown();
+            this.lblDiscount = new System.Windows.Forms.Label();
+            this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
+            ((System.ComponentModel.ISupportInitialize)(this.numSubscriptionCount)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.numDiscount)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // lblSubscriptionType
+            // 
+            this.lblSubscriptionType.AutoSize = true;
+            this.lblSubscriptionType.Location = new System.Drawing.Point(49, 52);
+            this.lblSubscriptionType.Name = "lblSubscriptionType";
+            this.lblSubscriptionType.Size = new System.Drawing.Size(90, 13);
+            this.lblSubscriptionType.TabIndex = 0;
+            this.lblSubscriptionType.Text = "Typ abonamentu:";
+            // 
+            // cbSubscriptionType
+            // 
+            this.cbSubscriptionType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cbSubscriptionType.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.cbSubscriptionType.FormattingEnabled = true;
+            this.cbSubscriptionType.Location = new System.Drawing.Point(145, 44);
+            this.cbSubscriptionType.Name = "cbSubscriptionType";
+            this.cbSubscriptionType.Size = new System.Drawing.Size(395, 21);
+            this.cbSubscriptionType.TabIndex = 1;
+            this.cbSubscriptionType.Validating += new System.ComponentModel.CancelEventHandler(this.cbSubscriptionType_Validating);
+            this.cbSubscriptionType.SelectedIndexChanged += new System.EventHandler(this.cbSubscriptionType_SelectedIndexChanged);
+            // 
+            // lblCustomer
+            // 
+            this.lblCustomer.AutoSize = true;
+            this.lblCustomer.Location = new System.Drawing.Point(103, 20);
+            this.lblCustomer.Name = "lblCustomer";
+            this.lblCustomer.Size = new System.Drawing.Size(36, 13);
+            this.lblCustomer.TabIndex = 0;
+            this.lblCustomer.Text = "Klient:";
+            // 
+            // lblCustomerName
+            // 
+            this.lblCustomerName.AutoSize = true;
+            this.lblCustomerName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
+            this.lblCustomerName.Location = new System.Drawing.Point(145, 20);
+            this.lblCustomerName.Name = "lblCustomerName";
+            this.lblCustomerName.Size = new System.Drawing.Size(99, 13);
+            this.lblCustomerName.TabIndex = 0;
+            this.lblCustomerName.Text = "[CustomerName]";
+            // 
+            // lblPrice
+            // 
+            this.lblPrice.AutoSize = true;
+            this.lblPrice.Location = new System.Drawing.Point(11, 166);
+            this.lblPrice.Name = "lblPrice";
+            this.lblPrice.Size = new System.Drawing.Size(128, 13);
+            this.lblPrice.TabIndex = 0;
+            this.lblPrice.Text = "Cena jednostkowa (PLN):";
+            this.lblPrice.Visible = false;
+            // 
+            // txtPricePln
+            // 
+            this.txtPricePln.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.txtPricePln.Location = new System.Drawing.Point(145, 159);
+            this.txtPricePln.Name = "txtPricePln";
+            this.txtPricePln.ReadOnly = true;
+            this.txtPricePln.Size = new System.Drawing.Size(121, 20);
+            this.txtPricePln.TabIndex = 6;
+            this.txtPricePln.Visible = false;
+            // 
+            // lblSubscriptionsCount
+            // 
+            this.lblSubscriptionsCount.AutoSize = true;
+            this.lblSubscriptionsCount.Location = new System.Drawing.Point(338, 82);
+            this.lblSubscriptionsCount.Name = "lblSubscriptionsCount";
+            this.lblSubscriptionsCount.Size = new System.Drawing.Size(75, 13);
+            this.lblSubscriptionsCount.TabIndex = 0;
+            this.lblSubscriptionsCount.Text = "Iloæ miesiêcy:";
+            // 
+            // dateStartDate
+            // 
+            this.dateStartDate.CustomFormat = "yyyy-MM";
+            this.dateStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
+            this.dateStartDate.Location = new System.Drawing.Point(145, 75);
+            this.dateStartDate.Name = "dateStartDate";
+            this.dateStartDate.Size = new System.Drawing.Size(121, 20);
+            this.dateStartDate.TabIndex = 2;
+            // 
+            // lblStartDate
+            // 
+            this.lblStartDate.AutoSize = true;
+            this.lblStartDate.Location = new System.Drawing.Point(30, 82);
+            this.lblStartDate.Name = "lblStartDate";
+            this.lblStartDate.Size = new System.Drawing.Size(109, 13);
+            this.lblStartDate.TabIndex = 0;
+            this.lblStartDate.Text = "Start abonamentu od:";
+            // 
+            // btnAdd
+            // 
+            this.btnAdd.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.btnAdd.Location = new System.Drawing.Point(328, 209);
+            this.btnAdd.Name = "btnAdd";
+            this.btnAdd.Size = new System.Drawing.Size(75, 28);
+            this.btnAdd.TabIndex = 10;
+            this.btnAdd.Text = "Zapisz";
+            this.btnAdd.UseVisualStyleBackColor = true;
+            this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
+            // 
+            // txtPriceEur
+            // 
+            this.txtPriceEur.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.txtPriceEur.Location = new System.Drawing.Point(145, 133);
+            this.txtPriceEur.Name = "txtPriceEur";
+            this.txtPriceEur.ReadOnly = true;
+            this.txtPriceEur.Size = new System.Drawing.Size(121, 20);
+            this.txtPriceEur.TabIndex = 8;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(9, 140);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(130, 13);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "Cena jednostkowa (EUR):";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(298, 166);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(115, 13);
+            this.label2.TabIndex = 0;
+            this.label2.Text = "Cena ca³kowita (PLN):";
+            this.label2.Visible = false;
+            // 
+            // txtTotalPricePln
+            // 
+            this.txtTotalPricePln.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.txtTotalPricePln.Location = new System.Drawing.Point(419, 159);
+            this.txtTotalPricePln.Name = "txtTotalPricePln";
+            this.txtTotalPricePln.ReadOnly = true;
+            this.txtTotalPricePln.Size = new System.Drawing.Size(121, 20);
+            this.txtTotalPricePln.TabIndex = 7;
+            this.txtTotalPricePln.Visible = false;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(296, 140);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(117, 13);
+            this.label3.TabIndex = 0;
+            this.label3.Text = "Cena ca³kowita (EUR):";
+            // 
+            // txtTotalPriceEur
+            // 
+            this.txtTotalPriceEur.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.txtTotalPriceEur.Location = new System.Drawing.Point(419, 133);
+            this.txtTotalPriceEur.Name = "txtTotalPriceEur";
+            this.txtTotalPriceEur.ReadOnly = true;
+            this.txtTotalPriceEur.Size = new System.Drawing.Size(121, 20);
+            this.txtTotalPriceEur.TabIndex = 9;
+            // 
+            // btnCancel
+            // 
+            this.btnCancel.CausesValidation = false;
+            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.btnCancel.Location = new System.Drawing.Point(148, 209);
+            this.btnCancel.Name = "btnCancel";
+            this.btnCancel.Size = new System.Drawing.Size(75, 28);
+            this.btnCancel.TabIndex = 11;
+            this.btnCancel.Text = "Anuluj";
+            this.btnCancel.UseVisualStyleBackColor = true;
+            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+            // 
+            // numSubscriptionCount
+            // 
+            this.numSubscriptionCount.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.numSubscriptionCount.Enabled = false;
+            this.numSubscriptionCount.Location = new System.Drawing.Point(419, 75);
+            this.numSubscriptionCount.Maximum = new decimal(new int[] {
+            12,
+            0,
+            0,
+            0});
+            this.numSubscriptionCount.Minimum = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            this.numSubscriptionCount.Name = "numSubscriptionCount";
+            this.numSubscriptionCount.ReadOnly = true;
+            this.numSubscriptionCount.Size = new System.Drawing.Size(91, 20);
+            this.numSubscriptionCount.TabIndex = 3;
+            this.numSubscriptionCount.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            this.numSubscriptionCount.ValueChanged += new System.EventHandler(this.numSubscriptionCount_ValueChanged);
+            // 
+            // lblCurrency
+            // 
+            this.lblCurrency.AutoSize = true;
+            this.lblCurrency.Location = new System.Drawing.Point(95, 112);
+            this.lblCurrency.Name = "lblCurrency";
+            this.lblCurrency.Size = new System.Drawing.Size(44, 13);
+            this.lblCurrency.TabIndex = 0;
+            this.lblCurrency.Text = "Waluta:";
+            // 
+            // cbCurrency
+            // 
+            this.cbCurrency.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cbCurrency.Enabled = false;
+            this.cbCurrency.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.cbCurrency.FormattingEnabled = true;
+            this.cbCurrency.Items.AddRange(new object[] {
+            "EUR",
+            "PLN"});
+            this.cbCurrency.Location = new System.Drawing.Point(145, 105);
+            this.cbCurrency.Name = "cbCurrency";
+            this.cbCurrency.Size = new System.Drawing.Size(121, 21);
+            this.cbCurrency.TabIndex = 4;
+            // 
+            // numDiscount
+            // 
+            this.numDiscount.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.numDiscount.Location = new System.Drawing.Point(419, 105);
+            this.numDiscount.Maximum = new decimal(new int[] {
+            99,
+            0,
+            0,
+            0});
+            this.numDiscount.Name = "numDiscount";
+            this.numDiscount.Size = new System.Drawing.Size(91, 20);
+            this.numDiscount.TabIndex = 5;
+            this.numDiscount.ValueChanged += new System.EventHandler(this.numDiscount_ValueChanged);
+            // 
+            // lblDiscount
+            // 
+            this.lblDiscount.AutoSize = true;
+            this.lblDiscount.Location = new System.Drawing.Point(357, 112);
+            this.lblDiscount.Name = "lblDiscount";
+            this.lblDiscount.Size = new System.Drawing.Size(56, 13);
+            this.lblDiscount.TabIndex = 0;
+            this.lblDiscount.Text = "Rabat (%):";
+            // 
+            // errorProvider
+            // 
+            this.errorProvider.ContainerControl = this;
+            // 
+            // SubscriptionForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.CancelButton = this.btnCancel;
+            this.ClientSize = new System.Drawing.Size(555, 263);
+            this.Controls.Add(this.numDiscount);
+            this.Controls.Add(this.lblDiscount);
+            this.Controls.Add(this.cbCurrency);
+            this.Controls.Add(this.lblCurrency);
+            this.Controls.Add(this.numSubscriptionCount);
+            this.Controls.Add(this.btnCancel);
+            this.Controls.Add(this.txtTotalPriceEur);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.txtTotalPricePln);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.txtPriceEur);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.btnAdd);
+            this.Controls.Add(this.lblStartDate);
+            this.Controls.Add(this.dateStartDate);
+            this.Controls.Add(this.lblSubscriptionsCount);
+            this.Controls.Add(this.txtPricePln);
+            this.Controls.Add(this.lblPrice);
+            this.Controls.Add(this.lblCustomerName);
+            this.Controls.Add(this.lblCustomer);
+            this.Controls.Add(this.cbSubscriptionType);
+            this.Controls.Add(this.lblSubscriptionType);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+            this.MaximizeBox = false;
+            this.MinimizeBox = false;
+            this.Name = "SubscriptionForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "Abonament";
+            this.Load += new System.EventHandler(this.SubscriptionForm_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.numSubscriptionCount)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.numDiscount)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label lblSubscriptionType;
+        private System.Windows.Forms.ComboBox cbSubscriptionType;
+        private System.Windows.Forms.Label lblCustomer;
+        private System.Windows.Forms.Label lblCustomerName;
+        private System.Windows.Forms.Label lblPrice;
+        private System.Windows.Forms.TextBox txtPricePln;
+        private System.Windows.Forms.Label lblSubscriptionsCount;
+        private System.Windows.Forms.DateTimePicker dateStartDate;
+        private System.Windows.Forms.Label lblStartDate;
+        private System.Windows.Forms.Button btnAdd;
+        private System.Windows.Forms.TextBox txtPriceEur;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox txtTotalPricePln;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.TextBox txtTotalPriceEur;
+        private System.Windows.Forms.Button btnCancel;
+        private System.Windows.Forms.NumericUpDown numSubscriptionCount;
+        private System.Windows.Forms.Label lblCurrency;
+        private System.Windows.Forms.ComboBox cbCurrency;
+        private System.Windows.Forms.NumericUpDown numDiscount;
+        private System.Windows.Forms.Label lblDiscount;
+        private System.Windows.Forms.ErrorProvider errorProvider;
+    }
+}
Index: /trunk/BazaReklam/Baza Reklam.csproj
===================================================================
--- /trunk/BazaReklam/Baza Reklam.csproj (revision 961)
+++ /trunk/BazaReklam/Baza Reklam.csproj (revision 981)
@@ -1,7 +1,7 @@
-﻿<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+﻿<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
+    <ProductVersion>9.0.30729</ProductVersion>
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{BBBFA978-486C-4BE9-88C7-F24C0496D0FC}</ProjectGuid>
@@ -16,4 +16,9 @@
     <SignManifests>true</SignManifests>
     <IsWebBootstrapper>true</IsWebBootstrapper>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>2.0</OldToolsVersion>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
     <PublishUrl>C:\CT\BazaReklam_ClickOnce\</PublishUrl>
     <Install>true</Install>
@@ -33,5 +38,7 @@
     <WebPage>index.htm</WebPage>
     <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
+    <ApplicationRevision>0</ApplicationRevision>
     <ApplicationVersion>1.2.8.0</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
     <BootstrapperEnabled>false</BootstrapperEnabled>
   </PropertyGroup>
@@ -782,6 +789,16 @@
     <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
       <Visible>False</Visible>
-      <ProductName>.NET Framework 2.0</ProductName>
+      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
       <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5</ProductName>
+      <Install>false</Install>
     </BootstrapperPackage>
   </ItemGroup>
Index: /trunk/BazaReklam/FactureViewer.cs
===================================================================
--- /trunk/BazaReklam/FactureViewer.cs (revision 961)
+++ /trunk/BazaReklam/FactureViewer.cs (revision 981)
@@ -510,5 +510,4 @@
                 Dispose();
             }
-
         }
 
Index: /trunk/BazaReklam/SubscriptionForm.resx
===================================================================
--- /trunk/BazaReklam/SubscriptionForm.resx (revision 981)
+++ /trunk/BazaReklam/SubscriptionForm.resx (revision 981)
@@ -0,0 +1,126 @@
+<?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>
+  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>51</value>
+  </metadata>
+</root>
Index: /trunk/BazaReklam/ZestawienieZamowienForm.Designer.cs
===================================================================
--- /trunk/BazaReklam/ZestawienieZamowienForm.Designer.cs (revision 791)
+++ /trunk/BazaReklam/ZestawienieZamowienForm.Designer.cs (revision 981)
@@ -1098,6 +1098,4 @@
         private System.Windows.Forms.BindingSource VIEW_ZESTAWIENIE_ZAMOWIEN_NOWEBindingSource;
         private Baza_Reklam.REKLAMADataSetTableAdapters.VIEW_ZESTAWIENIE_ZAMOWIEN_NOWETableAdapter VIEW_ZESTAWIENIE_ZAMOWIEN_NOWETableAdapter;
-        private System.Windows.Forms.DataGridViewTextBoxColumn usernameDataGridViewTextBoxColumn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn column1DataGridViewTextBoxColumn;
         private System.Windows.Forms.SplitContainer splitContainer2;
         private System.Windows.Forms.DataGridView fakturyDataGridView;
@@ -1120,6 +1118,4 @@
         private System.Windows.Forms.ToolStripTextBox rokToolStripTextBox;
         private System.Windows.Forms.ToolStripTextBox kodKlientaToolStripTextBox;
-        private System.Windows.Forms.DataGridViewTextBoxColumn iloscDataGridViewTextBoxColumn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn wartoscNettoZafakturowanaDataGridViewTextBoxColumn;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label1;
Index: /trunk/BazaReklam/ProjectForm.cs
===================================================================
--- /trunk/BazaReklam/ProjectForm.cs (revision 889)
+++ /trunk/BazaReklam/ProjectForm.cs (revision 981)
@@ -154,5 +154,5 @@
             row2["kolor"] = row["KOLOR"];
             row2["lokalizacja"] = row["strona"];
-            row2["dataemisji"] = piewrszaEmisja(ReklamaId);
+            row2["dataemisji"] = PierwszaEmisja(ReklamaId);
             row2["AGENT"] = User.Instance().Login;
             row2["DATA_AGENT"] = DateTime.Now;
@@ -253,6 +253,6 @@
         /// Wyszukuje nr pierwszej emisji...
         /// </summary>
-        private static int piewrszaEmisja(int reklamaId) {
-
+        private static int PierwszaEmisja(int reklamaId)
+        {
             SqlConnection conn = new SqlConnection(ConnString.getConnString().Value);
 
@@ -276,5 +276,4 @@
                 conn.Close();    
             }
-            return 0;
         }
               
Index: /trunk/BazaReklam/ProvisionEditForm.Designer.cs
===================================================================
--- /trunk/BazaReklam/ProvisionEditForm.Designer.cs (revision 981)
+++ /trunk/BazaReklam/ProvisionEditForm.Designer.cs (revision 981)
@@ -0,0 +1,310 @@
+namespace Baza_Reklam
+{
+    partial class ProvisionEditForm
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProvisionEditForm));
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
+            this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+            this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
+            this.toolStripTb_rok = new System.Windows.Forms.ToolStripTextBox();
+            this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
+            this.toolStripTb_mc = new System.Windows.Forms.ToolStripTextBox();
+            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+            this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
+            this.toolStripCb_Oddzial = new System.Windows.Forms.ToolStripComboBox();
+            this.toolStripBtn_Refresh = new System.Windows.Forms.ToolStripButton();
+            this.toolStripBtnSave = new System.Windows.Forms.ToolStripButton();
+            this.provisionsDataGridView = new System.Windows.Forms.DataGridView();
+            this.Rok = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Miesiac = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Agencja = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Agent = new System.Windows.Forms.DataGridViewComboBoxColumn();
+            this.agentsBindingSource = new System.Windows.Forms.BindingSource(this.components);
+            this.ProcentProwizji = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Prowizja = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Netto = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.NrFaktury = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.NrFakturyKorygowanej = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ZP = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.toolStrip1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.provisionsDataGridView)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.agentsBindingSource)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // toolStrip1
+            // 
+            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripLabel2,
+            this.toolStripTb_rok,
+            this.toolStripLabel3,
+            this.toolStripTb_mc,
+            this.toolStripSeparator1,
+            this.toolStripLabel1,
+            this.toolStripCb_Oddzial,
+            this.toolStripBtn_Refresh,
+            this.toolStripBtnSave});
+            this.toolStrip1.Location = new System.Drawing.Point(0, 0);
+            this.toolStrip1.Name = "toolStrip1";
+            this.toolStrip1.Size = new System.Drawing.Size(1075, 25);
+            this.toolStrip1.TabIndex = 0;
+            this.toolStrip1.Text = "toolStrip1";
+            // 
+            // toolStripLabel2
+            // 
+            this.toolStripLabel2.Name = "toolStripLabel2";
+            this.toolStripLabel2.Size = new System.Drawing.Size(24, 22);
+            this.toolStripLabel2.Text = "rok";
+            // 
+            // toolStripTb_rok
+            // 
+            this.toolStripTb_rok.Name = "toolStripTb_rok";
+            this.toolStripTb_rok.Size = new System.Drawing.Size(50, 25);
+            // 
+            // toolStripLabel3
+            // 
+            this.toolStripLabel3.Name = "toolStripLabel3";
+            this.toolStripLabel3.Size = new System.Drawing.Size(47, 22);
+            this.toolStripLabel3.Text = "miesi¹c";
+            // 
+            // toolStripTb_mc
+            // 
+            this.toolStripTb_mc.Name = "toolStripTb_mc";
+            this.toolStripTb_mc.Size = new System.Drawing.Size(50, 25);
+            // 
+            // toolStripSeparator1
+            // 
+            this.toolStripSeparator1.Name = "toolStripSeparator1";
+            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+            // 
+            // toolStripLabel1
+            // 
+            this.toolStripLabel1.Name = "toolStripLabel1";
+            this.toolStripLabel1.Size = new System.Drawing.Size(45, 22);
+            this.toolStripLabel1.Text = "oddzia³";
+            // 
+            // toolStripCb_Oddzial
+            // 
+            this.toolStripCb_Oddzial.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.toolStripCb_Oddzial.Name = "toolStripCb_Oddzial";
+            this.toolStripCb_Oddzial.Size = new System.Drawing.Size(121, 25);
+            // 
+            // toolStripBtn_Refresh
+            // 
+            this.toolStripBtn_Refresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+            this.toolStripBtn_Refresh.Image = ((System.Drawing.Image)(resources.GetObject("toolStripBtn_Refresh.Image")));
+            this.toolStripBtn_Refresh.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.toolStripBtn_Refresh.Name = "toolStripBtn_Refresh";
+            this.toolStripBtn_Refresh.Size = new System.Drawing.Size(23, 22);
+            this.toolStripBtn_Refresh.Text = "szukaj";
+            this.toolStripBtn_Refresh.Click += new System.EventHandler(this.toolStripBtn_Refresh_Click);
+            // 
+            // toolStripBtnSave
+            // 
+            this.toolStripBtnSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+            this.toolStripBtnSave.Image = ((System.Drawing.Image)(resources.GetObject("toolStripBtnSave.Image")));
+            this.toolStripBtnSave.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.toolStripBtnSave.Name = "toolStripBtnSave";
+            this.toolStripBtnSave.Size = new System.Drawing.Size(23, 22);
+            this.toolStripBtnSave.Text = "zapisz";
+            this.toolStripBtnSave.Click += new System.EventHandler(this.toolStripBtnSave_Click);
+            // 
+            // provisionsDataGridView
+            // 
+            this.provisionsDataGridView.BackgroundColor = System.Drawing.Color.White;
+            this.provisionsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.provisionsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.Rok,
+            this.Miesiac,
+            this.Agencja,
+            this.Agent,
+            this.ProcentProwizji,
+            this.Prowizja,
+            this.Netto,
+            this.NrFaktury,
+            this.NrFakturyKorygowanej,
+            this.ZP});
+            this.provisionsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.provisionsDataGridView.Location = new System.Drawing.Point(0, 25);
+            this.provisionsDataGridView.Name = "provisionsDataGridView";
+            this.provisionsDataGridView.Size = new System.Drawing.Size(1075, 433);
+            this.provisionsDataGridView.TabIndex = 1;
+            this.provisionsDataGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.provisionsDataGridView_CellValueChanged);
+            this.provisionsDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.provisionsDataGridView_DataError);
+            // 
+            // Rok
+            // 
+            this.Rok.DataPropertyName = "Rok";
+            this.Rok.HeaderText = "Rok";
+            this.Rok.Name = "Rok";
+            this.Rok.ReadOnly = true;
+            this.Rok.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.Rok.Width = 50;
+            // 
+            // Miesiac
+            // 
+            this.Miesiac.DataPropertyName = "Miesiac";
+            this.Miesiac.HeaderText = "Miesi¹c";
+            this.Miesiac.Name = "Miesiac";
+            this.Miesiac.ReadOnly = true;
+            this.Miesiac.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.Miesiac.Width = 50;
+            // 
+            // Agencja
+            // 
+            this.Agencja.DataPropertyName = "Agencja";
+            this.Agencja.HeaderText = "Agencja";
+            this.Agencja.Name = "Agencja";
+            this.Agencja.ReadOnly = true;
+            this.Agencja.Width = 120;
+            // 
+            // Agent
+            // 
+            this.Agent.DataPropertyName = "Agent";
+            this.Agent.DataSource = this.agentsBindingSource;
+            dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.Agent.DefaultCellStyle = dataGridViewCellStyle1;
+            this.Agent.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox;
+            this.Agent.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.Agent.HeaderText = "Agent";
+            this.Agent.Name = "Agent";
+            this.Agent.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.Agent.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.Agent.ToolTipText = "Wybierz agenta";
+            this.Agent.Width = 150;
+            // 
+            // ProcentProwizji
+            // 
+            this.ProcentProwizji.DataPropertyName = "ProcentProwizji";
+            dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            dataGridViewCellStyle2.Format = "P";
+            dataGridViewCellStyle2.NullValue = null;
+            this.ProcentProwizji.DefaultCellStyle = dataGridViewCellStyle2;
+            this.ProcentProwizji.HeaderText = "% prow.";
+            this.ProcentProwizji.Name = "ProcentProwizji";
+            this.ProcentProwizji.Width = 90;
+            // 
+            // Prowizja
+            // 
+            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            dataGridViewCellStyle3.BackColor = System.Drawing.Color.Honeydew;
+            dataGridViewCellStyle3.Format = "N2";
+            this.Prowizja.DefaultCellStyle = dataGridViewCellStyle3;
+            this.Prowizja.HeaderText = "Prowizja";
+            this.Prowizja.Name = "Prowizja";
+            // 
+            // Netto
+            // 
+            this.Netto.DataPropertyName = "Netto";
+            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            dataGridViewCellStyle4.Format = "N2";
+            this.Netto.DefaultCellStyle = dataGridViewCellStyle4;
+            this.Netto.HeaderText = "Kw. netto f-ry";
+            this.Netto.Name = "Netto";
+            this.Netto.ReadOnly = true;
+            this.Netto.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            // 
+            // NrFaktury
+            // 
+            this.NrFaktury.DataPropertyName = "NrFaktury";
+            this.NrFaktury.HeaderText = "Nr f-ry";
+            this.NrFaktury.Name = "NrFaktury";
+            this.NrFaktury.ReadOnly = true;
+            this.NrFaktury.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.NrFaktury.Width = 130;
+            // 
+            // NrFakturyKorygowanej
+            // 
+            this.NrFakturyKorygowanej.DataPropertyName = "NrFakturyKorygowanej";
+            this.NrFakturyKorygowanej.HeaderText = "Nr f-ry koryg.";
+            this.NrFakturyKorygowanej.Name = "NrFakturyKorygowanej";
+            this.NrFakturyKorygowanej.ReadOnly = true;
+            this.NrFakturyKorygowanej.Width = 130;
+            // 
+            // ZP
+            // 
+            this.ZP.DataPropertyName = "ZP";
+            this.ZP.HeaderText = "Blok. prow.";
+            this.ZP.Name = "ZP";
+            this.ZP.ReadOnly = true;
+            this.ZP.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.ZP.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.ZP.Width = 90;
+            // 
+            // ProvisionEditForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1075, 458);
+            this.Controls.Add(this.provisionsDataGridView);
+            this.Controls.Add(this.toolStrip1);
+            this.Name = "ProvisionEditForm";
+            this.ShowInTaskbar = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "Prowizje";
+            this.Load += new System.EventHandler(this.ProvisionEditForm_Load);
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ProvisionEditForm_FormClosing);
+            this.toolStrip1.ResumeLayout(false);
+            this.toolStrip1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.provisionsDataGridView)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.agentsBindingSource)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.ToolStrip toolStrip1;
+        private System.Windows.Forms.ToolStripLabel toolStripLabel1;
+        private System.Windows.Forms.ToolStripComboBox toolStripCb_Oddzial;
+        private System.Windows.Forms.ToolStripLabel toolStripLabel2;
+        private System.Windows.Forms.ToolStripTextBox toolStripTb_rok;
+        private System.Windows.Forms.ToolStripLabel toolStripLabel3;
+        private System.Windows.Forms.ToolStripTextBox toolStripTb_mc;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+        private System.Windows.Forms.ToolStripButton toolStripBtn_Refresh;
+        private System.Windows.Forms.DataGridView provisionsDataGridView;
+        private System.Windows.Forms.BindingSource agentsBindingSource;
+        private System.Windows.Forms.ToolStripButton toolStripBtnSave;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Rok;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Miesiac;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Agencja;
+        private System.Windows.Forms.DataGridViewComboBoxColumn Agent;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ProcentProwizji;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Prowizja;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Netto;
+        private System.Windows.Forms.DataGridViewTextBoxColumn NrFaktury;
+        private System.Windows.Forms.DataGridViewTextBoxColumn NrFakturyKorygowanej;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn ZP;
+    }
+}
Index: /trunk/BazaReklam/Classes/Interfaces/IProductDetail.cs
===================================================================
--- /trunk/BazaReklam/Classes/Interfaces/IProductDetail.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Interfaces/IProductDetail.cs (revision 981)
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Baza_Reklam.Classes.Interfaces
+{
+    public interface IProductDetail
+    {
+        int Id { get; set; }
+        int ProductId { get; set; }
+        decimal Price { get; set; }
+        decimal PricePln { get; set; }
+        decimal Vat { get; set; }
+        int? InvoiceId { get; set; }
+        int Year { get; set; }
+        int Month { get; set; }
+    }
+}
Index: /trunk/BazaReklam/Classes/Interfaces/IProduct.cs
===================================================================
--- /trunk/BazaReklam/Classes/Interfaces/IProduct.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Interfaces/IProduct.cs (revision 981)
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using Baza_Reklam.Classes.Model.Enums;
+
+namespace Baza_Reklam.Classes.Interfaces
+{
+    public interface IProduct
+    {
+        int Id { get; set; }
+        int TitleId { get; set; }
+        ProductType ProductType { get; set; }
+        string Type { get; set; }
+        string ShortName { get; set; }
+        DateTime? StartDate { get; set; }
+        decimal Price { get; set; }
+        decimal TotalPrice { get; set; }
+        decimal Vat { get; set; }
+        string Currency { get; set; }
+        bool IsActivated { get; set; }
+        int? OrderId { get; set; }
+        bool HasInvoice { get; set; }
+        int DetailCount { get; set; }
+        decimal Discount { get; set; }
+        List<IProductDetail> ProductDetails { get; }
+        void AddProductDetail(IProductDetail productDetail);
+    }
+}
Index: /trunk/BazaReklam/Classes/Repositories/ProductRepository.cs
===================================================================
--- /trunk/BazaReklam/Classes/Repositories/ProductRepository.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Repositories/ProductRepository.cs (revision 981)
@@ -0,0 +1,183 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Diagnostics;
+using System.Text;
+using Baza_Reklam.Classes.Interfaces;
+using Baza_Reklam.Classes.Model;
+using Baza_Reklam.Classes.Model.Enums;
+
+namespace Baza_Reklam.Classes.Repositories
+{
+    public class ProductRepository : Repository<IProduct>
+    {
+        public ProductRepository(string connectionString)
+            : base(connectionString)
+        {
+        }
+
+        public DateTime FindFirstDateForInvoice(List<IProduct> products)
+        {
+            string query = "SELECT  MIN(CAST(CAST([Year] AS varchar) + '-' + CAST([Month] AS varchar) + '-01' AS datetime)) "
+                           + "FROM SubscriptionDetail PD INNER JOIN Subscription P ON P.Id=PD.SubscriptionId "
+                           + "WHERE PD.InvoiceId IS NULL AND P.Id IN ({0}) ";
+            query = string.Format(query, ProductsIdToCommaSeparatedList(products));
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+                object date = _command.ExecuteScalar();
+                if (date != null && date != DBNull.Value)
+                    return Convert.ToDateTime(date);
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            return DateTime.MinValue;
+        }
+
+        public List<IProduct> FindProductsToInvoice(List<IProduct> products, InvoicingType invoicingType, DateTime date)
+        {
+            string query = "SELECT PD.Id, P.Id, PD.Price, PD.PricePLN, P.Vat, PD.InvoiceId, [Year], [Month] FROM SubscriptionDetail PD "
+                           + "INNER JOIN Subscription P ON P.Id=PD.SubscriptionId "
+                           + "WHERE PD.InvoiceId IS NULL ";
+
+            if (invoicingType == InvoicingType.OneMonth)
+            {
+                query += "AND PD.[Year] = YEAR(@date) AND PD.[Month]=MONTH(@date) ";
+            }
+            if (invoicingType == InvoicingType.ThreeMonths)
+            {
+                query +=
+                    "AND ((PD.[Year] = YEAR(@date) AND PD.[Month]=MONTH(@date)) OR (PD.[Year] = YEAR(DATEADD(MONTH, 1, @date)) AND PD.[Month]=MONTH(DATEADD(MONTH, 1, @date))) OR PD.[Year] = YEAR(DATEADD(MONTH, 2, @date)) AND PD.[Month]=MONTH(DATEADD(MONTH, 2, @date))) ";
+            }
+            query += "AND P.Id IN ({0})";
+
+            query = string.Format(query, ProductsIdToCommaSeparatedList(products));
+
+            Debug.WriteLine(query);
+
+            List<IProductDetail> productDetails = new List<IProductDetail>();
+
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+                if (invoicingType == InvoicingType.OneMonth || invoicingType == InvoicingType.ThreeMonths)
+                    _command.Parameters.AddWithValue("@date", date);
+                _reader = _command.ExecuteReader();
+                if (_reader != null)
+                {
+                    while (_reader.Read())
+                    {
+                        IProductDetail productDetail = new ProductDetail();
+                        productDetail.Id = _reader.GetInt32(0);
+                        productDetail.ProductId = _reader.GetInt32(1);
+                        productDetail.Price = _reader.GetDecimal(2);
+                        productDetail.PricePln = _reader.GetDecimal(3);
+                        productDetail.Vat = _reader.GetDecimal(4);
+                        productDetail.Year = _reader.GetInt32(6);
+                        productDetail.Month = _reader.GetInt32(7);
+
+                        productDetails.Add(productDetail);
+                    }
+                }
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            List<IProduct> invoiceProducts = new List<IProduct>();
+            foreach (IProduct product in products)
+            {
+                List<IProductDetail> invoiceProductDetails = productDetails.FindAll(delegate(IProductDetail pd)
+                                                                                  { return pd.ProductId == product.Id; });
+                foreach (IProductDetail productDetail in invoiceProductDetails)
+                {
+                    product.AddProductDetail(productDetail);  
+                }
+                invoiceProducts.Add(product);
+            }
+
+            return invoiceProducts;
+        }
+
+        private string ProductsIdToCommaSeparatedList(List<IProduct> products)
+        {
+            StringBuilder sb = new StringBuilder();
+            foreach (IProduct product in products)
+            {
+                sb.Append(product.Id + ",");
+            }
+
+            return sb.ToString().Remove(sb.ToString().Length - 1);
+        }
+
+        public void UpdateInvoiceId(List<IProduct> products, int invoiceId)
+        {
+            string querySub = "UPDATE Subscription SET InvoiceId=@invoiceId WHERE Id IN ({0}) ";
+            string querySubDet = "UPDATE SubscriptionDetail SET InvoiceId=@invoiceId WHERE SubscriptionId IN ({0}) ";
+
+            try
+            {
+                string subscriptionIdList = "-1";
+                foreach (IProduct pr in products)
+                {
+                    if (pr.ProductType == ProductType.Subscription)
+                        subscriptionIdList += ", " + pr.Id;
+                }
+
+                _connection.Open();
+                _command = _connection.CreateCommand();
+
+                _command.Parameters.AddWithValue("@invoiceId", invoiceId);
+
+                _command.CommandText = string.Format(querySub, subscriptionIdList);
+                _command.ExecuteNonQuery();
+
+                _command.CommandText = string.Format(querySubDet, subscriptionIdList);
+                _command.ExecuteNonQuery();
+            }
+            finally
+            {
+                CleanUp();
+            }
+        }
+
+        public void ClearInvoiceId(List<IProduct> products)
+        {
+            string querySub = "UPDATE Subscription SET InvoiceId=NULL WHERE Id IN ({0}) ";
+            string querySubDet = "UPDATE SubscriptionDetail SET InvoiceId=NULL WHERE SubscriptionId IN ({0}) ";
+
+            try
+            {
+                string subscriptionIdList = "-1";
+                foreach (IProduct pr in products)
+                {
+                    if (pr.ProductType == ProductType.Subscription)
+                    {
+                        pr.HasInvoice = false;
+                        ((Subscription)pr).InvoiceId = 0;
+                        subscriptionIdList += ", " + pr.Id;
+                    }
+                }
+
+                _connection.Open();
+                _command = _connection.CreateCommand();
+
+                _command.CommandText = string.Format(querySub, subscriptionIdList);
+                _command.ExecuteNonQuery();
+
+                _command.CommandText = string.Format(querySubDet, subscriptionIdList);
+                _command.ExecuteNonQuery();
+            }
+            finally
+            {
+                CleanUp();
+            }
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Repositories/SubscriptionTypeRepository.cs
===================================================================
--- /trunk/BazaReklam/Classes/Repositories/SubscriptionTypeRepository.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Repositories/SubscriptionTypeRepository.cs (revision 981)
@@ -0,0 +1,47 @@
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using Baza_Reklam.Classes.Model;
+
+namespace Baza_Reklam.Classes.Repositories
+{
+    public class SubscriptionTypeRepository : Repository<SubscriptionType>
+    {
+        public SubscriptionTypeRepository(string connectionString)
+            : base(connectionString)
+        {
+        }
+
+        public override List<SubscriptionType> FindAll()
+        {
+            const string query = "SELECT Id, TitleId, Name, PricePln, PriceEur, AmtMounth FROM SubscriptionType";
+
+            List<SubscriptionType> subscriptionTypes = new List<SubscriptionType>();
+
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+
+                _reader = _command.ExecuteReader();
+                if (_reader != null)
+                {
+                    while (_reader.Read())
+                    {  
+                        subscriptionTypes.Add(new SubscriptionType(_reader.GetInt32(0), 
+                                                                   _reader.GetInt32(1),
+                                                                   _reader.GetString(2),
+                                                                   _reader.GetDecimal(3),
+                                                                   _reader.GetDecimal(4),
+                                                                   _reader.GetInt32(5)));
+                    }
+                }
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            return subscriptionTypes;
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Repositories/ProvisionRepository.cs
===================================================================
--- /trunk/BazaReklam/Classes/Repositories/ProvisionRepository.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Repositories/ProvisionRepository.cs (revision 981)
@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data.SqlClient;
+using Baza_Reklam.Classes.Model;
+using System.Windows.Forms;
+
+namespace Baza_Reklam.Classes.Repositories
+{
+    class ProvisionRepository : Repository<Provision>
+    {
+        public ProvisionRepository(string connectionString)
+            : base(connectionString)
+        {
+            ;
+        }
+
+        public List<Provision> FindAll(int year, int month, string oddzial)
+        {
+            string query = "SELECT idProwizji, agencja, IsNull(agent, '') AS agent, rok, ms, nrFaktury, IsNull(netto, 0) AS netto, "
+                            + "IsNull(nrFakturyKorygowanej, '') AS nrFakturyKorygowanej, IsNull(procentProwizji, 0) AS procentProwizji, "
+                            + "IsNull(ZP, 0) AS ZP, IsNull(kwotaProwizji, 0) AS kwotaProwizji, idFaktury "
+                            + "FROM PROWIZJE WHERE rok=@year AND ms=@month";
+
+            if (!string.IsNullOrEmpty(oddzial))
+                query += " AND agencja=@oddzial ";
+
+            List<Provision> provisions = new List<Provision>();
+
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+                _command.Parameters.AddWithValue("@year", year);
+                _command.Parameters.AddWithValue("@month", month);
+                if (!string.IsNullOrEmpty(oddzial))
+                    _command.Parameters.AddWithValue("@oddzial", oddzial);
+
+                _reader = _command.ExecuteReader();
+
+                while (_reader.Read())
+                {
+                    provisions.Add(new Provision(_reader.GetInt32(0), _reader.GetString(1), _reader.GetString(2), _reader.GetInt32(3), _reader.GetInt32(4),
+                        _reader.GetString(5), _reader.GetDecimal(6), _reader.GetString(7), _reader.GetDouble(8), _reader.GetBoolean(9), _reader.GetDecimal(10), _reader.GetInt32(11)));
+                }
+            }
+            catch (Exception ex)
+            {
+                string s1 = ex.ToString();
+                MessageBox.Show(s1);
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            return provisions;
+        }
+
+        public bool Save(List<Provision> provisions)
+        {
+            const string query = "UPDATE PROWIZJE SET agencja=@agencja, agent=@agent, procentProwizji=@procentProwizji, ZP=@ZP "
+                            + "WHERE idProwizji=@id";
+
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+
+                foreach (Provision pr in provisions)
+                {
+                    _command.Parameters.Clear();
+                    _command.Parameters.AddWithValue("@agencja", pr.Agencja);
+                    _command.Parameters.AddWithValue("@agent", pr.Agent);
+                    _command.Parameters.AddWithValue("@procentProwizji", pr.ProcentProwizji);
+                    _command.Parameters.AddWithValue("@ZP", pr.ZP);
+                    _command.Parameters.AddWithValue("@id", pr.Id);
+
+                    int n = _command.ExecuteNonQuery();
+                }
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                string s1 = ex.ToString();
+                MessageBox.Show(s1);
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            return false;
+        }
+
+    }
+}
Index: /trunk/BazaReklam/Classes/Repositories/CustomerRepository.cs
===================================================================
--- /trunk/BazaReklam/Classes/Repositories/CustomerRepository.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Repositories/CustomerRepository.cs (revision 981)
@@ -0,0 +1,415 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using Baza_Reklam.Classes.Interfaces;
+using Baza_Reklam.Classes.Model;
+using Baza_Reklam.Classes.Model.Enums;
+
+namespace Baza_Reklam.Classes.Repositories
+{
+    public class CustomerRepository : Repository<Customer>
+    {
+        public CustomerRepository(string connectionString)
+            : base(connectionString)
+        {
+        }
+
+        public override Customer Find(int id)
+        {
+            string query = "SELECT CustomerId, FirstName FROM Klienci WHERE CustomerId={0}";
+            query = string.Format(query, id);
+
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+
+                _reader = _command.ExecuteReader();
+                if (_reader != null && _reader.Read())
+                    return new Customer(_reader.GetInt32(0), _reader.GetString(1));
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            return null;
+        }
+
+        public override void Save(Customer customer)
+        {
+            const string insertSubscriptionQuery = "INSERT INTO Subscription(Guid, CustomerId, SubscriptionTypeId, SubscriptionItems, BasePrice, TotalPrice, Discount, Vat, Currency, OrderId, CreatedOn, CreatedBy, UpdatedOn, UpdatedBy, StartDate) "
+                                 + "VALUES(@guid, @customerId, @subscriptionTypeId, @subscriptionItems, @basePrice, @totalPrice, @discount, @vat, @currency, @orderId, @createdOn, @createdBy, @updatedOn, @updatedBy, @startDate) "
+                                 + "SELECT SCOPE_IDENTITY();";
+
+            const string updateSubscriptionQuery = "UPDATE Subscription SET SubscriptionTypeId=@subscriptionTypeId, SubscriptionItems=@subscriptionItems, "
+                                 + "BasePrice=@basePrice, TotalPrice=@totalPrice, Discount=@discount, Vat=@vat, Currency=@currency, OrderId=@orderId, "
+                                 + "UpdatedOn=@updatedOn, @updatedBy=UpdatedBy, StartDate=@startDate "
+                                 + "WHERE Id=@id";
+
+            const string insertSubscriptionDetailQuery = "INSERT INTO SubscriptionDetail(SubscriptionId, Price, PricePln, [Year], [Month]) "
+                                                         + "VALUES(@subscriptionId, @price, @pricePln, @year, @month) "
+                                                         + "SELECT SCOPE_IDENTITY();";
+
+            const string deleteSubscriptionDetailQuery = "DELETE FROM SubscriptionDetail WHERE SubscriptionId=@subscriptionId";
+
+            try
+            {
+                _connection.Open();
+                _transaction = _connection.BeginTransaction();
+                _command = _connection.CreateCommand();
+                _command.Transaction = _transaction;
+
+                int subscriptionId;
+
+                foreach (Subscription subscription in customer.Subscriptions)
+                {
+                    _command.Parameters.Clear();
+
+                    if (subscription.Id == 0)
+                    {
+                        _command.CommandText = insertSubscriptionQuery;
+                        _command.Parameters.AddWithValue("@guid", subscription.Guid);
+                        _command.Parameters.AddWithValue("@customerId", customer.Id);
+                        _command.Parameters.AddWithValue("@createdOn", subscription.CreatedOn);
+                        _command.Parameters.AddWithValue("@createdBy", subscription.CreatedBy);
+                    }
+                    else
+                    {
+                        _command.CommandText = updateSubscriptionQuery;
+                        _command.Parameters.AddWithValue("@id", subscription.Id);
+                    }
+
+                    _command.Parameters.AddWithValue("@subscriptionTypeId", subscription.SubscriptionTypeId);
+                    _command.Parameters.AddWithValue("@subscriptionItems", subscription.SubscriptionItems);
+                    _command.Parameters.AddWithValue("@basePrice", subscription.BasePrice);
+                    _command.Parameters.AddWithValue("@totalPrice", subscription.TotalPrice);
+                    _command.Parameters.AddWithValue("@discount", subscription.Discount);
+                    _command.Parameters.AddWithValue("@vat", subscription.Vat);
+                    _command.Parameters.AddWithValue("@currency", subscription.Currency);
+                    if (subscription.OrderId > 0)
+                        _command.Parameters.AddWithValue("@orderId", subscription.OrderId);
+                    else
+                        _command.Parameters.AddWithValue("@orderId", DBNull.Value);
+
+                    _command.Parameters.AddWithValue("@updatedBy", subscription.UpdatedBy);
+                    _command.Parameters.AddWithValue("@updatedOn", subscription.UpdatedOn);
+                    _command.Parameters.AddWithValue("@startDate", subscription.StartDate);
+
+                    if (subscription.Id == 0)
+                        subscriptionId = Convert.ToInt32(_command.ExecuteScalar());
+                    else
+                    {
+                        _command.ExecuteNonQuery();
+                        subscriptionId = subscription.Id;
+                    }
+
+                    if (subscription.Id > 0)
+                    {
+                        _command.Parameters.Clear();
+                        _command.CommandText = deleteSubscriptionDetailQuery;
+                        _command.Parameters.AddWithValue("@subscriptionId", subscription.Id);
+                        _command.ExecuteNonQuery();
+                    }
+
+                    _command.CommandText = insertSubscriptionDetailQuery;
+
+                    foreach (SubscriptionDetail subscriptionDetail in subscription.SubscriptionDetails)
+                    {
+                        subscriptionDetail.SubscriptionId = subscriptionId;
+
+                        _command.Parameters.Clear();
+                        _command.Parameters.AddWithValue("@subscriptionId", subscriptionDetail.SubscriptionId);
+                        _command.Parameters.AddWithValue("@price", subscriptionDetail.Price);
+                        _command.Parameters.AddWithValue("@pricePln", subscriptionDetail.PricePln);
+                        _command.Parameters.AddWithValue("@year", subscriptionDetail.Year);
+                        _command.Parameters.AddWithValue("@month", subscriptionDetail.Month);
+
+                        _command.ExecuteScalar();
+                    }
+                }
+
+                _transaction.Commit();
+            }
+            catch (Exception) 
+            {
+                _transaction.Rollback();
+                throw;
+            }
+            finally
+            {
+                CleanUp();
+            }
+        }
+
+        public List<Subscription> FindSubscriptions(int customerId)
+        {
+            string query = "SELECT Id, Guid, CustomerId, SubscriptionTypeId, SubscriptionItems, BasePrice, Discount, Vat, TotalPrice, Currency, OrderId, CreatedOn, CreatedBy, UpdatedOn, UpdatedBy, StartDate, InvoiceId FROM Subscription WHERE CustomerId={0} ORDER BY UpdatedOn DESC";
+            query = string.Format(query, customerId);
+
+            List<Subscription> subscriptions = new List<Subscription>();
+
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+
+                _reader = _command.ExecuteReader();
+                if (_reader != null)
+                {
+                    while (_reader.Read())
+                    {
+/*
+                        Subscription subscription = new Subscription(_reader.GetInt32(0));
+                        subscription.Guid = _reader.GetGuid(1);
+                        subscription.CustomerId = _reader.GetInt32(2);
+                        subscription.SubscriptionTypeId = _reader.GetInt32(3);
+                        subscription.SubscriptionItems = _reader.GetInt32(4);
+                        subscription.BasePrice = _reader.GetDecimal(5);
+                        subscription.Discount = _reader.GetDecimal(6);
+                        subscription.Vat = _reader.GetDecimal(7);
+                        subscription.TotalPrice = _reader.GetDecimal(8);
+                        subscription.Currency = _reader.GetString(9);
+                        if (_reader[10] != DBNull.Value)
+                            subscription.OrderId = _reader.GetInt32(10);
+                        subscription.CreatedOn = _reader.GetDateTime(11);
+                        subscription.CreatedBy = _reader.GetInt32(12);
+                        subscription.UpdatedOn = _reader.GetDateTime(13);
+                        subscription.UpdatedBy = _reader.GetInt32(14);
+                        subscription.StartDate = _reader.GetDateTime(15);
+                        if (_reader[16] != DBNull.Value)
+                            subscription.InvoiceId = _reader.GetInt32(16);
+                        subscriptions.Add(subscription);
+*/
+                        subscriptions.Add(SetSubscription(_reader));
+                    }
+                }
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            return subscriptions;
+        }
+
+        public List<IProduct> FindProductsWithoutOrders(int customerId)
+        {
+            List<IProduct> products = new List<IProduct>();
+
+            const string query = "sp_GetProductsWithoutOrder";
+
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+                _command.Parameters.AddWithValue("@customerId", customerId);
+                _command.CommandType = CommandType.StoredProcedure;
+                _command.CommandTimeout = 5 * 60;
+
+                _reader = _command.ExecuteReader();
+                if (_reader != null)
+                {
+                    while (_reader.Read())
+                    {
+                        Product product = new Product();
+                        product.Id = _reader.GetInt32(0);
+                        product.TitleId = _reader.GetInt32(1);
+                        product.Type = _reader.GetString(2);
+                        product.ProductType = (ProductType)_reader.GetInt32(3);
+                        product.ShortName = _reader.GetString(4);
+                        if (_reader[5] != DBNull.Value)
+                            product.StartDate = _reader.GetDateTime(5);
+                        product.Price = _reader.GetDecimal(6);
+                        product.TotalPrice = _reader.GetDecimal(7);
+                        product.Vat = _reader.GetDecimal(8);
+                        product.Currency = _reader.GetString(9);
+                        product.IsActivated = _reader.GetBoolean(10);
+                        product.HasInvoice = _reader.GetBoolean(11);                        
+
+                        if (_reader[12].GetType() == typeof(System.DBNull))
+                            product.DetailCount = 0;
+                        else
+                            product.DetailCount = _reader.GetInt32(12);
+
+                        product.Discount = _reader.GetDecimal(13);
+
+                        products.Add(product);
+                    }
+                }
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            return products;
+        }
+
+        public List<IProduct> FindProductsWithOrders(int clientId)
+        {
+            List<IProduct> products = new List<IProduct>();
+
+            const string query = "sp_GetProductsWithOrder";
+
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+                _command.Parameters.AddWithValue("@clientId", clientId);
+                _command.CommandType = CommandType.StoredProcedure;
+
+                _reader = _command.ExecuteReader();
+                if (_reader != null)
+                {
+                    while (_reader.Read())
+                    {
+                        Product product = new Product();
+                        product.Id = _reader.GetInt32(0);
+                        product.TitleId = _reader.GetInt32(1);
+                        product.Type = _reader.GetString(2);
+                        product.ProductType = (ProductType) _reader.GetInt32(3);
+                        product.ShortName = _reader.GetString(4);
+                        //TODO: check datetime
+                        if (!_reader.IsDBNull(5))
+                            product.StartDate = _reader.GetDateTime(5);
+                        product.Price = _reader.GetDecimal(6);
+                        product.TotalPrice = _reader.GetDecimal(7);
+                        product.Vat = _reader.GetDecimal(8);
+                        product.Currency = _reader.GetString(9);
+                        product.IsActivated = _reader.GetBoolean(10);
+                        if (_reader[11] != DBNull.Value)
+                            product.OrderId = _reader.GetInt32(11);
+                        product.HasInvoice = _reader.GetBoolean(12);
+
+                        if (_reader[13].GetType() == typeof(System.DBNull))
+                            product.DetailCount = 0;
+                        else
+                            product.DetailCount = _reader.GetInt32(13);
+
+                        product.Discount = _reader.GetDecimal(14);
+
+                        products.Add(product);
+                    }
+                }
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            return products;
+        }
+
+        public void RemoveProductFromOrder(IProduct product)
+        {
+            const string query = "sp_RemoveProductFromOrder";
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+                _command.Parameters.AddWithValue("@productId", product.Id);
+                _command.Parameters.AddWithValue("@productType", product.ProductType);
+                _command.CommandType = CommandType.StoredProcedure;
+
+                _command.ExecuteNonQuery();
+            }
+            finally
+            {
+                CleanUp();
+            }
+        }
+
+        public void AddProductToOrder(IProduct product)
+        {
+            const string query = "sp_AddProductToOrder";
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+                _command.Parameters.AddWithValue("@productId", product.Id);
+                _command.Parameters.AddWithValue("@productType", product.ProductType);
+                _command.Parameters.AddWithValue("@orderId", product.OrderId);
+                _command.CommandType = CommandType.StoredProcedure;
+
+                _command.ExecuteNonQuery();
+            }
+            finally
+            {
+                CleanUp();
+            }
+        }
+
+        public void RemoveSubscription(int subscriptionId)
+        {
+            const string queryDetails = "DELETE FROM SubscriptionDetail WHERE SubscriptionId=@subscriptionId";
+            const string query = "DELETE FROM Subscription WHERE Id=@subscriptionId";
+
+            try
+            {
+                _connection.Open();
+                _command = _connection.CreateCommand();
+
+                _command.CommandText = query;
+                _command.Parameters.AddWithValue("@subscriptionId", subscriptionId);
+                int n = _command.ExecuteNonQuery();
+
+                _command.CommandText = queryDetails;
+                n = _command.ExecuteNonQuery();
+            }
+            finally
+            {
+                CleanUp();
+            }
+        }
+
+        private Subscription SetSubscription(SqlDataReader rdr)
+        {
+            Subscription subscription = new Subscription(rdr.GetInt32(0));
+            subscription.Guid = rdr.GetGuid(1);
+            subscription.CustomerId = rdr.GetInt32(2);
+            subscription.SubscriptionTypeId = rdr.GetInt32(3);
+            subscription.SubscriptionItems = rdr.GetInt32(4);
+            subscription.BasePrice = rdr.GetDecimal(5);
+            subscription.Discount = rdr.GetDecimal(6);
+            subscription.Vat = rdr.GetDecimal(7);
+            subscription.TotalPrice = rdr.GetDecimal(8);
+            subscription.Currency = rdr.GetString(9);
+            if (rdr[10] != DBNull.Value)
+                subscription.OrderId = rdr.GetInt32(10);
+            subscription.CreatedOn = rdr.GetDateTime(11);
+            subscription.CreatedBy = rdr.GetInt32(12);
+            subscription.UpdatedOn = rdr.GetDateTime(13);
+            subscription.UpdatedBy = rdr.GetInt32(14);
+            subscription.StartDate = rdr.GetDateTime(15);
+            if (rdr[16] != DBNull.Value)
+                subscription.InvoiceId = rdr.GetInt32(16);
+
+            return subscription;
+        }
+
+        public Subscription GetSubscription(int subscrId)
+        {
+            string query = "SELECT Id, Guid, CustomerId, SubscriptionTypeId, SubscriptionItems, BasePrice, Discount, Vat, TotalPrice, Currency, OrderId, CreatedOn, CreatedBy, UpdatedOn, UpdatedBy, StartDate, InvoiceId FROM Subscription WHERE Id={0}";
+            query = string.Format(query, subscrId);
+
+            try
+            {
+                _connection.Open();
+                _command = new SqlCommand(query, _connection);
+
+                _reader = _command.ExecuteReader();
+                if (_reader != null)
+                    if (_reader.Read())
+                        return SetSubscription(_reader);
+            }
+            finally
+            {
+                CleanUp();
+            }
+
+            return null;
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Model/Product.cs
===================================================================
--- /trunk/BazaReklam/Classes/Model/Product.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Model/Product.cs (revision 981)
@@ -0,0 +1,128 @@
+using System;
+using System.Collections.Generic;
+using Baza_Reklam.Classes.Interfaces;
+using Baza_Reklam.Classes.Model.Enums;
+
+namespace Baza_Reklam.Classes.Model
+{
+    public class Product : IProduct
+    {
+        private int _id;
+        private int _titleId;
+        private ProductType _productType;
+        private string _type;
+        private string _shortName;
+        private DateTime? _startDate;
+        private decimal _price;
+        private decimal _totalPrice;
+        private decimal _vat;
+        private string _currency;
+        private bool _isActivated;
+        private int? _orderId;
+        private bool _hasInvoice;
+        private int _detailCount;
+        private decimal _discount;
+        private List<IProductDetail> _productDetails = new List<IProductDetail>();
+
+        public int Id
+        {
+            get { return _id; }
+            set { _id = value; }
+        }
+
+        public int TitleId
+        {
+            get { return _titleId; }
+            set { _titleId = value; }
+        }
+
+        public ProductType ProductType
+        {
+            get { return _productType; }
+            set { _productType = value; }
+        }
+
+        public string Type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+        public string ShortName
+        {
+            get { return _shortName; }
+            set { _shortName = value; }
+        }
+
+        public DateTime? StartDate
+        {
+            get { return _startDate; }
+            set { _startDate = value; }
+        }
+
+        public decimal Price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        public decimal TotalPrice
+        {
+            get { return _totalPrice; }
+            set { _totalPrice = value; }
+        }
+
+        public decimal Vat
+        {
+            get { return _vat; }
+            set { _vat = value; }
+        }
+
+        public string Currency
+        {
+            get { return _currency; }
+            set { _currency = value; }
+        }
+
+        public bool IsActivated
+        {
+            get { return _isActivated; }
+            set { _isActivated = value; }
+        }
+
+        public int? OrderId
+        {
+            get { return _orderId; }
+            set { _orderId = value; }
+        }
+
+        public bool HasInvoice
+        {
+            get { return _hasInvoice; }
+            set { _hasInvoice = value; }
+        }
+
+        public int DetailCount
+        {
+            get { return _detailCount; }
+            set { _detailCount = value; }
+        }
+
+        public decimal Discount
+        {
+            get { return _discount; }
+            set { _discount = value; }
+        }
+
+        public List<IProductDetail> ProductDetails
+        {
+            get { return _productDetails; }
+        }
+
+        public void AddProductDetail(IProductDetail productDetail)
+        {
+            productDetail.ProductId = _id;
+            _productDetails.Add(productDetail);
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Model/Subscription.cs
===================================================================
--- /trunk/BazaReklam/Classes/Model/Subscription.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Model/Subscription.cs (revision 981)
@@ -0,0 +1,170 @@
+using System;
+using System.Collections.Generic;
+
+namespace Baza_Reklam.Classes.Model
+{
+    public class Subscription
+    {
+        private readonly int _id;
+        private Guid _guid;
+        private int _customerId;
+        //private int _titleId;
+        private int _subscriptionTypeId;
+        private int _subscriptionItems;
+        private decimal _basePrice;
+        private decimal _totalPrice;
+        private decimal _discount;
+        private decimal _vat;
+        private string _currency;
+        private DateTime _startDate;
+        private int _orderId;
+        private DateTime _createdOn;
+        private int _createdBy;
+        private DateTime _updatedOn;
+        private int _updatedBy;
+
+        private int _invoiceId;
+
+        //private readonly SubscriptionType _subscriptionType;
+        //private readonly Customer _customer;
+        //private readonly Agent _agent;
+        private List<SubscriptionDetail> _subscriptionDetails;
+
+        public Subscription() { }
+
+        public Subscription(int id)
+        {
+            _id = id;
+        }
+
+        public int Id
+        {
+            get { return _id; }
+            //set { _id = value; }
+        }
+
+        public Guid Guid
+        {
+            get { return _guid; }
+            set { _guid = value; }
+        }
+
+        public int CustomerId
+        {
+            get { return _customerId; }
+            set { _customerId = value; }
+        }
+
+        public int SubscriptionTypeId
+        {
+            get { return _subscriptionTypeId; }
+            set { _subscriptionTypeId = value; }
+        }
+
+        public decimal BasePrice
+        {
+            get { return _basePrice; }
+            set { _basePrice = value; }
+        }
+
+        public decimal TotalPrice
+        {
+            get { return _totalPrice; }
+            set { _totalPrice = value; }
+        }
+
+        public decimal Discount
+        {
+            get { return _discount; }
+            set { _discount = value; }
+        }
+
+        public decimal Vat
+        {
+            get { return _vat; }
+            set { _vat = value; }
+        }
+
+        public string Currency
+        {
+            get { return _currency; }
+            set { _currency = value; }
+        }
+
+        public int OrderId
+        {
+            get { return _orderId; }
+            set { _orderId = value; }
+        }
+
+        public DateTime CreatedOn
+        {
+            get { return _createdOn; }
+            set { _createdOn = value; }
+        }
+
+        public int CreatedBy
+        {
+            get { return _createdBy; }
+            set { _createdBy = value; }
+        }
+
+        public DateTime UpdatedOn
+        {
+            get { return _updatedOn; }
+            set { _updatedOn = value; }
+        }
+
+        public int UpdatedBy
+        {
+            get { return _updatedBy; }
+            set { _updatedBy = value; }
+        }
+/*
+        public SubscriptionType SubscriptionType
+        {
+            get { return _subscriptionType; }
+        }
+
+        public Customer Customer
+        {
+            get { return _customer; }
+        }
+
+        public Agent Agent
+        {
+            get { return _agent; }
+        }
+*/
+        public DateTime StartDate
+        {
+            get { return _startDate; }
+            set { _startDate = value; }
+        }
+
+        public int SubscriptionItems
+        {
+            get { return _subscriptionItems; }
+            set { _subscriptionItems = value; }
+        }
+
+        public int InvoiceId
+        {
+            get { return _invoiceId; }
+            set { _invoiceId = value; }
+        }
+
+        public List<SubscriptionDetail> SubscriptionDetails
+        {
+            get { return _subscriptionDetails; }
+        }
+
+        public void AddSubscriptionDetail(SubscriptionDetail subscriptionDetail)
+        {
+            if (_subscriptionDetails == null)
+                _subscriptionDetails = new List<SubscriptionDetail>();
+
+            _subscriptionDetails.Add(subscriptionDetail);
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Model/SubscriptionType.cs
===================================================================
--- /trunk/BazaReklam/Classes/Model/SubscriptionType.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Model/SubscriptionType.cs (revision 981)
@@ -0,0 +1,57 @@
+namespace Baza_Reklam.Classes.Model
+{
+    public class SubscriptionType
+    {
+        private readonly int _id;
+        private int _titleId;
+        private string _name;
+        private decimal _pricePln;
+        private decimal _priceEur;
+        private int _amtMounth;
+
+        public SubscriptionType(int id, int titleId, string name, decimal pricePln, decimal priceEur, int amtMounth)
+        {
+            _id = id;
+            _titleId = titleId;
+            _priceEur = priceEur;
+            _pricePln = pricePln;
+            _name = name;
+            _amtMounth = amtMounth;
+        }
+
+        public decimal PriceEur
+        {
+            get { return _priceEur; }
+            set { _priceEur = value; }
+        }
+
+        public decimal PricePln
+        {
+            get { return _pricePln; }
+            set { _pricePln = value; }
+        }
+
+        public string Name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        public int Id
+        {
+            get { return _id; }
+        }
+
+        public int TitleId
+        {
+            get { return _titleId; }
+            set { _titleId = value; }
+        }
+
+        public int AmtMounth
+        {
+            get { return _amtMounth; }
+            set { _amtMounth = value; }
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Model/Provision.cs
===================================================================
--- /trunk/BazaReklam/Classes/Model/Provision.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Model/Provision.cs (revision 981)
@@ -0,0 +1,110 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Baza_Reklam.Classes.Model
+{
+    class Provision
+    {
+        private int _idProwizji;
+        private string _agencja;
+        private string _agent;
+        private int _rok;
+        private int _ms;
+        private string _nrFaktury;
+        private decimal _netto;
+        private string _nrFakturyKorygowanej;
+        private double _procentProwizji;
+        private bool _ZP;
+        private decimal _kwotaProwizji;
+        private int _idFaktury;
+
+        public Provision(int id, string agencja, string agent, int rok, int miesiac, string nrFaktury, decimal netto,
+                    string nrFakturyKorygowanej, double procentProwizji, bool ZP, decimal kwotaProwizji, int idFaktury)
+        {
+            _idProwizji = id;
+            _agencja = agencja;
+            _agent = agent;
+            _rok = rok;
+            _ms = miesiac;
+            _nrFaktury = nrFaktury;
+            _netto = netto;
+            _nrFakturyKorygowanej = nrFakturyKorygowanej;
+            _procentProwizji = procentProwizji;
+            _ZP = ZP;
+            _kwotaProwizji = kwotaProwizji;
+            _idFaktury = idFaktury;
+        }
+
+        public int Id            
+        {
+            get { return _idProwizji; }
+        }
+
+        public string Agencja
+        {
+            get { return _agencja; }
+            set { _agencja = value; }
+        }
+
+        public string Agent
+        {
+            get { return _agent; }
+            set { _agent = value; }
+        }
+
+        public int Rok
+        {
+            get { return _rok; }
+            set { _rok = value; }
+        }
+
+        public int Miesiac
+        {
+            get { return _ms; }
+            set { _ms = value; }
+        }
+
+        public string NrFaktury
+        {
+            get { return _nrFaktury; }
+            set { _nrFaktury = value; }
+        }
+
+        public decimal Netto
+        {
+            get { return _netto; }
+            set { _netto = value; }
+        }
+
+        public string NrFakturyKorygowanej
+        {
+            get { return _nrFakturyKorygowanej; }
+            set { _nrFakturyKorygowanej = value; }
+        }
+
+        public double ProcentProwizji
+        {
+            get { return _procentProwizji; }
+            set { _procentProwizji = value; }
+        }
+
+        public bool ZP
+        {
+            get { return _ZP; }
+            set { _ZP = value; }
+        }
+
+        public decimal KwotaProwizji
+        {
+            get { return _kwotaProwizji; }
+            set { _kwotaProwizji = value; }
+        }
+
+        public int IdFaktury
+        {
+            get { return _idFaktury; }
+            set { _idFaktury = value; }
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Model/Customer.cs
===================================================================
--- /trunk/BazaReklam/Classes/Model/Customer.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Model/Customer.cs (revision 981)
@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+
+namespace Baza_Reklam.Classes.Model
+{
+    public class Customer
+    {
+        private readonly int _id;
+        private readonly string _name;
+        private List<Subscription> _subscriptions;
+
+        public Customer(int id, string name)
+        {
+            _id = id;
+            _name = name;
+        }
+
+        public int Id
+        {
+            get { return _id; }
+        }
+
+        public string Name
+        {
+            get { return _name; }
+        }
+
+        public List<Subscription> Subscriptions
+        {
+            get { return _subscriptions; }
+        }
+
+        public void AddSubscription(Subscription subscription)
+        {
+            if (_subscriptions == null)
+                _subscriptions = new List<Subscription>();
+
+            _subscriptions.Add(subscription);
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Model/ProductDetail.cs
===================================================================
--- /trunk/BazaReklam/Classes/Model/ProductDetail.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Model/ProductDetail.cs (revision 981)
@@ -0,0 +1,64 @@
+using Baza_Reklam.Classes.Interfaces;
+
+namespace Baza_Reklam.Classes.Model
+{
+    public class ProductDetail : IProductDetail
+    {
+        private int _id;
+        private int _productId;
+        private decimal _price;
+        private decimal _pricePln;
+        private decimal _vat;
+        private int? _invoiceId;
+        private int _year;
+        private int _month;
+
+        public int Id
+        {
+            get { return _id; }
+            set { _id = value; }
+        }
+
+        public int ProductId
+        {
+            get { return _productId; }
+            set { _productId = value; }
+        }
+
+        public decimal Price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        public decimal PricePln
+        {
+            get { return _pricePln; }
+            set { _pricePln = value; }
+        }
+
+        public decimal Vat
+        {
+            get { return _vat; }
+            set { _vat = value; }
+        }
+
+        public int? InvoiceId
+        {
+            get { return _invoiceId; }
+            set { _invoiceId = value; }
+        }
+
+        public int Year
+        {
+            get { return _year; }
+            set { _year = value; }
+        }
+
+        public int Month
+        {
+            get { return _month; }
+            set { _month = value; }
+        }
+    }
+}
Index: /trunk/BazaReklam/Classes/Model/SubscriptionDetail.cs
===================================================================
--- /trunk/BazaReklam/Classes/Model/SubscriptionDetail.cs (revision 981)
+++ /trunk/BazaReklam/Classes/Model/SubscriptionDetail.cs (revision 981)
@@ -0,0 +1,47 @@
+namespace Baza_Reklam.Classes.Model
+{
+    public class SubscriptionDetail
+    {
+        //private readonly int _id;
+        private int _subscriptionId;
+        private decimal _price;
+        private decimal _pricePln;
+        private int _year;
+        private int _month;
+/*
+        public int Id
+        {
+            get { return _id; }
+        }
+*/
+        public int SubscriptionId
+        {
+            get { return _subscriptionId; }
+            set { _subscriptionId = value; }
+        }
+
+        public decimal Price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        public decimal PricePln
+        {
+            get { return _pricePln; }
+            set { _pricePln = value; }
+        }
+
+        public int Year
+        {
+            get { return _year; }
+            set { _year = value; }
+        }
+
+        public int Month
+        {
+            get { return _month; }
+            set { _month = value; }
+        }
+    }
+}
Index: /trunk/BazaReklam/SubscriptionForm.cs
===================================================================
--- /trunk/BazaReklam/SubscriptionForm.cs (revision 981)
+++ /trunk/BazaReklam/SubscriptionForm.cs (revision 981)
@@ -0,0 +1,228 @@
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using Baza_Reklam.Classes.Helpers;
+using Baza_Reklam.Classes.Model;
+using Baza_Reklam.Classes.Repositories;
+
+namespace Baza_Reklam
+{
+    public partial class SubscriptionForm : Form
+    {
+        //TODO: Create BaseClass for all forms and inherit from it - there can be defined stuff like connection strings and other dependecies...
+        private readonly string _connectionString = ConnString.getConnString().Value;
+
+        private readonly IRepository<Customer> _customerRepository;
+        private readonly IRepository<SubscriptionType> _subscriptionTypeRepository;
+        private readonly List<SubscriptionType> _subscriptionTypes = new List<SubscriptionType>();
+        private readonly Customer _customer;
+        private Subscription _subscript;
+
+        private SubscriptionType CurrentSubscriptionType
+        {
+            get
+            {
+                if (cbSubscriptionType.SelectedItem == null || ((SubscriptionType)cbSubscriptionType.SelectedItem).Id <= 0) return null;
+                return (SubscriptionType)cbSubscriptionType.SelectedItem;
+            }
+        }
+
+        public SubscriptionForm(int customerId, Subscription subscript)
+        {
+            InitializeComponent();
+
+            _customerRepository = new CustomerRepository(_connectionString);
+            _customer = _customerRepository.Find(customerId);
+
+            _subscriptionTypeRepository = new SubscriptionTypeRepository(_connectionString);
+            _subscriptionTypes = _subscriptionTypeRepository.FindAll();
+
+            _subscript = subscript;
+
+            BindControls();
+        }
+/*
+        [Obsolete("Use ComboBoxHelper after merge from ReklamaReorganizacja branch")]
+        static void BindComboBox<T>(IEnumerable<T> list, ComboBox comboBox)
+        {
+            comboBox.Items.Clear();
+            foreach (T item in list)
+            {
+                comboBox.Items.Add(item);
+            }
+        }
+*/
+        private void BindControls()
+        {
+            lblCustomerName.Text = _customer.Name;
+
+            //BindComboBox(_subscriptionTypes, cbSubscriptionType);
+            ComboBoxHelper.Bind(_subscriptionTypes, cbSubscriptionType);
+
+            cbSubscriptionType.DisplayMember = "Name";
+            cbSubscriptionType.ValueMember = "Id";
+
+            cbSubscriptionType.Items.Insert(0, new SubscriptionType(0, 0, "-- proszê wybraæ --", 0, 0, 0));
+            cbSubscriptionType.SelectedIndex = 0;
+
+            cbCurrency.SelectedIndex = 0;
+        }
+
+        private void SetControls(bool enable)
+        {
+            numSubscriptionCount.Value = 1;
+            numDiscount.Value = 0;
+            if (enable)
+            {
+                // numSubscriptionCount.Enabled = true;
+                numDiscount.Enabled = true;
+                txtPricePln.Text = CurrentSubscriptionType.PricePln.ToString();
+                txtPriceEur.Text = CurrentSubscriptionType.PriceEur.ToString();
+                numSubscriptionCount.Value = (decimal)CurrentSubscriptionType.AmtMounth;
+                ReCalculatePrices();
+            }
+            else
+            {
+                // numSubscriptionCount.Enabled = false;
+                numDiscount.Enabled = false;
+                txtPricePln.Text = string.Empty;
+                txtPriceEur.Text = string.Empty;
+                txtTotalPricePln.Text = string.Empty;
+                txtTotalPriceEur.Text = string.Empty;
+            }
+        }
+
+        private void ReCalculatePrices()
+        {
+            txtTotalPricePln.Text = (numSubscriptionCount.Value * CurrentSubscriptionType.PricePln * (1 - (numDiscount.Value / 100))).ToString("N2");
+            txtTotalPriceEur.Text = (numSubscriptionCount.Value * CurrentSubscriptionType.PriceEur * (1 - (numDiscount.Value / 100))).ToString("N2");
+        }
+
+        private void cbSubscriptionType_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (cbSubscriptionType.SelectedItem == null) return;
+
+            SubscriptionType subscriptionType = (SubscriptionType)cbSubscriptionType.SelectedItem;
+
+            numSubscriptionCount.Value = 1;
+
+            SetControls(subscriptionType.Id > 0);
+        }
+
+        private void numSubscriptionCount_ValueChanged(object sender, EventArgs e)
+        {
+            if (CurrentSubscriptionType == null)
+            {
+                SetControls(false);
+                return;
+            }
+
+            ReCalculatePrices();
+        }
+
+        private void numDiscount_ValueChanged(object sender, EventArgs e)
+        {
+            if (CurrentSubscriptionType == null)
+            {
+                SetControls(false);
+                return;
+            }
+
+            ReCalculatePrices();
+        }
+
+        private void btnAdd_Click(object sender, EventArgs e)
+        {
+            Subscription subscription = null;
+
+            if (_subscript == null)
+            {
+                subscription = new Subscription();
+
+                subscription.Guid = Guid.NewGuid();
+                subscription.CreatedBy = User.Instance().Id;
+                subscription.CreatedOn = DateTime.Now;
+            }
+            else
+            {
+                subscription = _subscript;
+            }
+
+            subscription.SubscriptionTypeId = CurrentSubscriptionType.Id;
+            subscription.SubscriptionItems = (int)numSubscriptionCount.Value;
+            subscription.Currency = cbCurrency.SelectedItem.ToString();
+            subscription.BasePrice = subscription.Currency == "PLN"
+                                              ? Decimal.Parse(txtPricePln.Text)
+                                              : Decimal.Parse(txtPriceEur.Text);
+            subscription.Discount = numDiscount.Value / 100;
+
+            subscription.Vat = subscription.Currency == "PLN"
+                                              ? (decimal)VatHelper.PL22
+                                              : (decimal)VatHelper.EU00;
+
+            subscription.TotalPrice = subscription.Currency == "PLN"
+                                              ? Decimal.Parse(txtTotalPricePln.Text)
+                                              : Decimal.Parse(txtTotalPriceEur.Text);
+
+            subscription.UpdatedBy = User.Instance().Id;
+            subscription.UpdatedOn = DateTime.Now;
+
+            subscription.StartDate = new DateTime(dateStartDate.Value.Year,
+                                                    dateStartDate.Value.Month,
+                                                    dateStartDate.Value.Day);
+
+            if (subscription.SubscriptionDetails != null)
+                subscription.SubscriptionDetails.Clear();
+
+            for (int i = 0; i < subscription.SubscriptionItems; i++)
+            {
+                SubscriptionDetail subscriptionDetail = new SubscriptionDetail();
+                subscriptionDetail.Month = dateStartDate.Value.AddMonths(i).Month;
+                subscriptionDetail.Year = dateStartDate.Value.AddMonths(i).Year;
+                subscriptionDetail.Price = subscription.BasePrice * (1 - subscription.Discount);
+                subscriptionDetail.PricePln = Decimal.Parse(txtPricePln.Text) * (1 - subscription.Discount);
+                subscription.AddSubscriptionDetail(subscriptionDetail);
+            }
+
+            _customer.AddSubscription(subscription);
+            _customerRepository.Save(_customer);
+
+            Close();
+        }
+
+        private void btnCancel_Click(object sender, EventArgs e)
+        {
+            Close();
+        }
+
+        private void cbSubscriptionType_Validating(object sender, System.ComponentModel.CancelEventArgs e)
+        {
+            ValidationHelper.IsComboValueSelected(cbSubscriptionType, 0, "Proszê wybraæ typ abonamentu", e, errorProvider);
+        }
+
+        private void SubscriptionForm_Load(object sender, EventArgs e)
+        {
+            if (_subscript == null)
+                return;
+
+            cbSubscriptionType.SelectedIndex = 0;
+            
+            foreach (SubscriptionType st in cbSubscriptionType.Items)
+                if (st.Id == _subscript.SubscriptionTypeId)
+                {
+                    cbSubscriptionType.SelectedItem = st;
+                    break;
+                }
+
+            numSubscriptionCount.Value = 1;
+            dateStartDate.Value = _subscript.StartDate;
+            cbCurrency.Text = _subscript.Currency;
+            txtPricePln.Text = _subscript.BasePrice.ToString();
+            //txtPriceEur;
+            txtTotalPricePln.Text = _subscript.TotalPrice.ToString();
+            //txtTotalPriceEur;
+            numDiscount.Value = _subscript.Discount * 100;
+            numSubscriptionCount.Value = _subscript.SubscriptionItems;
+        }
+    }
+}
Index: /trunk/BazaReklam/ProvisionEditForm.cs
===================================================================
--- /trunk/BazaReklam/ProvisionEditForm.cs (revision 981)
+++ /trunk/BazaReklam/ProvisionEditForm.cs (revision 981)
@@ -0,0 +1,248 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using Baza_Reklam.Classes.Repositories;
+using Baza_Reklam.Classes.Model;
+
+namespace Baza_Reklam
+{
+    public partial class ProvisionEditForm : Form
+    {
+        private ProvisionRepository repository;
+        private AgentRepository agentRepository;
+        private bool bReadData;
+        private bool bUpdateValue;
+        private List<Provision> changedProvisions;
+        private int _y;
+        private int _m;
+
+        public ProvisionEditForm(int y, int m) : this()
+        {
+            _y = y;
+            _m = m;
+        }
+
+        public ProvisionEditForm()
+        {
+            bReadData = true;
+
+            InitializeComponent();
+
+            changedProvisions = new List<Provision>();
+            repository = new ProvisionRepository(ConnString.getConnString().Value);
+            agentRepository = new AgentRepository(ConnString.getConnString().Value);
+
+            List<string> oddz = agentRepository.FindOdzialProvision();
+            toolStripCb_Oddzial.Items.Add("");
+            foreach (string s1 in oddz)
+                toolStripCb_Oddzial.Items.Add(s1);
+
+            toolStripCb_Oddzial.SelectedIndex = 0;
+
+            _y = DateTime.Today.Year;
+            _m = DateTime.Today.Month;
+        }
+
+        private void ProvisionEditForm_Load(object sender, EventArgs e)
+        {
+            toolStripTb_rok.Text = _y.ToString();
+            toolStripTb_mc.Text = _m.ToString();
+
+            bReadData = true;
+
+            agentsBindingSource.DataSource = null;
+            agentsBindingSource.DataSource = agentRepository.FindAllProvision();
+
+            provisionsDataGridView.AutoGenerateColumns = false;
+
+            RefreshProvisions();
+        }
+
+        private void ProvisionEditForm_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            e.Cancel = QuestionChange() == DialogResult.Cancel;
+        }
+
+        private void toolStripBtn_Refresh_Click(object sender, EventArgs e)
+        {
+            if (QuestionChange() == DialogResult.Cancel)
+                return;
+
+            RefreshProvisions();
+        }
+
+        private DialogResult QuestionChange()
+        {
+            if (changedProvisions.Count > 0)
+            {
+                switch (MessageBox.Show("Dane z " + toolStripTb_rok.Text + "-" + toolStripTb_mc.Text + " zosta³y zmienione.\nCzy chcesz zapiaæ zmiany?",
+                        "Baza Reklam", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
+                {
+                    case DialogResult.Yes:
+                        if (Save())
+                            return DialogResult.Yes;
+
+                        return DialogResult.Cancel;
+
+                    case DialogResult.No:
+                        break;
+
+                    case DialogResult.Cancel:
+                        return DialogResult.Cancel;
+                }
+            }
+
+            return DialogResult.No;
+        }
+
+        private void RefreshProvisions()
+        {
+            try
+            {
+                bReadData = true;
+                provisionsDataGridView.DataSource = null;
+
+                changedProvisions.Clear();
+
+                int y, m;
+                int.TryParse(toolStripTb_rok.Text, out y);
+                int.TryParse(toolStripTb_mc.Text, out m);
+
+                provisionsDataGridView.DataSource = repository.FindAll(y, m, (string)toolStripCb_Oddzial.SelectedItem);
+
+                CountProvision();
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.ToString());
+            }
+            finally
+            {
+                bReadData = false;
+            }
+        }
+
+        private void CountProvision()
+        {
+            foreach (DataGridViewRow r in provisionsDataGridView.Rows)
+                r.Cells["Prowizja"].Value = (double)((Provision)r.DataBoundItem).Netto * ((Provision)r.DataBoundItem).ProcentProwizji;
+        }
+
+        private bool Save()
+        {
+            bool bRet = false;
+            try
+            {
+                if ((bRet = repository.Save(changedProvisions)) == true)
+                {
+                    changedProvisions.Clear();
+                    foreach (DataGridViewRow r in provisionsDataGridView.Rows)
+                        r.DefaultCellStyle.ForeColor = provisionsDataGridView.DefaultCellStyle.ForeColor;
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.ToString());
+            }
+
+            return bRet;
+        }
+
+        private void provisionsDataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e)
+        {
+            if (bReadData ||
+                bUpdateValue)
+                return;
+
+            try
+            {
+                bUpdateValue = true;
+
+                DataGridViewColumn col1 = provisionsDataGridView.Columns["Agent"];
+                DataGridViewColumn col2 = provisionsDataGridView.Columns["ProcentProwizji"];
+                DataGridViewColumn col3 = provisionsDataGridView.Columns["Prowizja"];
+                DataGridViewColumn col4 = provisionsDataGridView.Columns["Netto"];
+
+                if (col1 == null ||
+                    col2 == null ||
+                    col3 == null ||
+                    col4 == null)
+                    return;
+
+                if (e.ColumnIndex == col1.Index)
+                {
+                    if (!changedProvisions.Contains((Provision)provisionsDataGridView.Rows[e.RowIndex].DataBoundItem))
+                        changedProvisions.Add((Provision)provisionsDataGridView.Rows[e.RowIndex].DataBoundItem);
+
+                    provisionsDataGridView.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.Red;
+                }
+                else if (e.ColumnIndex == col2.Index)
+                {
+                    string s1 = provisionsDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].EditedFormattedValue.ToString();
+
+                    string charsOk = ",.% ";
+
+                    foreach (char c1 in s1)
+                    {
+                        if (!char.IsDigit(c1) &&
+                            charsOk.IndexOf(c1) < 0)
+                        {
+                            // MessageBox.Show("Baza reklam", "Podaj prawid³ow¹ wartoæ prowizji!", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                            return;
+                        }
+                    }
+
+                    s1 = s1.Replace("%", "");
+                    s1 = s1.Replace(".", ",");
+
+                    double prPorowizji;
+                    if (!double.TryParse(s1, out prPorowizji))
+                        return;
+
+                    prPorowizji /= 100;
+
+                    if (provisionsDataGridView.Rows[e.RowIndex].Cells[col4.Index].Value == null)
+                        return;
+
+                    double kwNetto = (double)(decimal)provisionsDataGridView.Rows[e.RowIndex].Cells[col4.Index].Value;
+
+                    provisionsDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = prPorowizji;
+                    provisionsDataGridView.Rows[e.RowIndex].Cells[col3.Index].Value = (decimal)Math.Round(kwNetto * prPorowizji, 2);
+
+                    if (!changedProvisions.Contains((Provision)provisionsDataGridView.Rows[e.RowIndex].DataBoundItem))
+                        changedProvisions.Add((Provision)provisionsDataGridView.Rows[e.RowIndex].DataBoundItem);
+
+                    provisionsDataGridView.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.Red;
+                }
+            }
+            finally
+            {
+                bUpdateValue = false;
+            }
+        }
+
+        private void provisionsDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
+        {
+            MessageBox.Show("Podaj prawid³owe dane!", "Baza reklam", MessageBoxButtons.OK, MessageBoxIcon.Error);
+/*
+            if (e.ColumnIndex == provisionsDataGridView.Columns["Agent"].Index)
+            {
+                ;
+            }
+            else if (e.ColumnIndex == provisionsDataGridView.Columns["ProcentProwizji"].Index)
+            {
+                ;
+            }
+*/
+        }
+
+        private void toolStripBtnSave_Click(object sender, EventArgs e)
+        {
+            Save();
+        }
+    }
+}
Index: /trunk/BazaReklam/KorektyForm.cs
===================================================================
--- /trunk/BazaReklam/KorektyForm.cs (revision 676)
+++ /trunk/BazaReklam/KorektyForm.cs (revision 981)
@@ -20,5 +20,5 @@
         private SqlDataAdapter sqlDataAdapter;
 
-        private bool commandExecuted = false;
+        //private bool commandExecuted = false;
 
         public static KorektyForm getFacturesForm(MDIBazaReklam parent)
@@ -169,5 +169,5 @@
                                         command.Parameters.AddWithValue("@miesiac", e.Node.Name);
                                         sqlDataAdapter.Fill(this.rEKLAMADataSet.VIEW_ZESTAWIENIE_FAKTUR_NOWE);
-                                        commandExecuted = true;
+                                        //commandExecuted = true;
                                         fakturyDataGridView.Refresh();
 
@@ -183,5 +183,5 @@
                                         command.Parameters.AddWithValue("@miesiac", e.Node.Name);
                                         sqlDataAdapter.Fill(this.rEKLAMADataSet.VIEW_KOREKTY);
-                                        commandExecuted = true;
+                                        //commandExecuted = true;
                                         fakturyDataGridView.Refresh();
 
@@ -381,5 +381,5 @@
             {
                 sqlDataAdapter.Fill(rEKLAMADataSet.VIEW_KOREKTY);
-                commandExecuted = true;
+                //commandExecuted = true;
             }
             finally
Index: /trunk/BazaReklam/Properties/Settings.Designer.cs
===================================================================
--- /trunk/BazaReklam/Properties/Settings.Designer.cs (revision 906)
+++ /trunk/BazaReklam/Properties/Settings.Designer.cs (revision 981)
@@ -13,5 +13,5 @@
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
Index: /trunk/BazaReklam/ProvisionEditForm.resx
===================================================================
--- /trunk/BazaReklam/ProvisionEditForm.resx (revision 981)
+++ /trunk/BazaReklam/ProvisionEditForm.resx (revision 981)
@@ -0,0 +1,194 @@
+<?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>
+  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="toolStripBtn_Refresh.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAi1JREFUOE/Nkl9o
+        UnEUxzUD0VbXguRC9lKg9tKjWBLSRuibu61yOBVly5rQHxN6MER8ENKSwiztgozoYeGDRIaN7WXh1kOz
+        HnRRW/9gOdhLUoOgPdS387vdVWyM3qIffLn3nvs9H87vnKNQ/E9HScUoQ6EQ53K5BgVBGLFarSc4jttO
+        8c0bFup2uw/5fL6pcDhcy2Qyb9Pp9LdsNotCoYB8Pg+v1/vSbDb3E2AbSbUO5HA45lKpFJrNJur1OqrV
+        KorFIpLJJCKRCKLRKAKBwHeLxfJAr9cfIICGVfoLRD/elMtlVCoVlEoliKIoJTmdTng8Hgm0ehKJxFev
+        31+iiowEUEsgo9HoDAaDH2OxGHK5HDqdDtoLH3ApnsbJodPw+31ozMxgfOIxnrfaqL9eQe8x9xgl75Mh
+        ii6DwdBvs9mWWAXjYzWM3p9G5wtQay3DeaQHYvEWRideYP4TMLUEnLqY+kzJQySeXWUTaQfP831HBeH9
+        lavXMdkGnpGxugDY7fZXBy2W6ct3J3GnBdx+CvQKx2cpJ0nas9oL1hQdNcnlHfAs5p+sQGwA1x6+A8/v
+        vKdUKm9QTx6diRcwOHx+eYtGM0L+CyTDn1NhEM5kMvV5fKHFs/Gb6O7uaVCySPEBkk2n23pOpVJl6D1O
+        spO61o5VgqjV6sNarZaZmHmYZJLNu+i5X/7m5OuvZUgzZuS9snm33G1pU0lsK9lC/d6FdYifAdZcZv6r
+        cYP8fxT+AUP55a9sFlD4AAAAAElFTkSuQmCC
+</value>
+  </data>
+  <data name="toolStripBtnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAA0dJREFUOE9Nkn9I
+        02kcxx/TtI22pKyQqPXDNKL+qIguLir7IUXIXVBQdxmhmY68WER2lZGRY81+aSWVZr809bxyK12o6aYr
+        zZ1tailHl9Zp23S5uVxK+0XvPt9vUvvAi+cHz/v9+TzP5wkK+8Mo9/SPpp/+NTRk2zIR8/iDGBd+v4/5
+        fT7mI9weLxsHP9P+O8Lkz8L9Yc43uZ6avWfo2Ec2frfeyxZcxvlCLbh4b7bA1NaOtvYOGE1taH1hxMtX
+        nRh22HCuqAYRv2RDHK/ykngbEcFCE5vAluQju1DHG1BGDA0Nwel0wmazwWw28zg+WKG8rcFMmR6iTX+B
+        xHJiLgtLbAZbcRPZN+p4gzfdPWho1EP/9BkPN39hNGGw3wxlYSUkR4wQbyjmDHKIGDYh+TnYqruQF9SS
+        3Ivh4WHY7XYMDg5iYGCAz97b2wubpQ9nCh5h9lEjRBvucQa5vIEguQXB68uQdb0afs8IXnZ2oa5eC62u
+        AbqGRkIPwz+tsL5/R0keYm5GGxnwFVz6XoFgy30ob2jgc1nxyWHG6JAVIw4rnLZe2C09ML/tgrW7A9n5
+        DxB9sh3ijQEGgtQWRGxXY5n0IdYdVGGNrAKxh1RYe4jW6WrEHnmE9ceqEHeiCrGZ9Vic1QFxXMmPCoQp
+        BsxI0GB6wmNM+r0aE3bUQpighThRj/CUJkyRtmDaAQOi/jRhIWVfqnxFFfBv8O0KQqkBkqRqRCbWYftJ
+        Nep1jSi7r8bZ3GvIukDtvVqEW6UVkOzIwbyUUqzL+w+ijQEVTJS2Yl7qE0Tu0+FAThX2ZFSCbVZht0ID
+        Y7MOff+/5dsr2XuPyu9EmtoMQeAjilINWCBrwKy0p9ivKMVvGRUQ0DXS8pthefcabreb5G7MTCrCYkUX
+        pCoLhHEBbQyJryqenqRFDPVXpriJnYoaiGQmHFN1k/ALvF4vPvS9RpTsAZZf6cFhrR3C2Dufv38kJhRG
+        hi6RF7OVBf0/b810lJQUuUr+1rjqG/WulqYmV3l5+WjZ3esIWpRuD16eNyD+Kc8SNHV1KRmc4r8yRSgR
+        RewiMgklcZY4F8AFml8c21fQeJyIJyZzBlyMJ6YSc8bM5tPIER1AzNgel0wyJg75Cs3sJnR1hCqaAAAA
+        AElFTkSuQmCC
+</value>
+  </data>
+  <metadata name="Rok.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Miesiac.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Agencja.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Agent.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="agentsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>122, 17</value>
+  </metadata>
+  <metadata name="ProcentProwizji.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Prowizja.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Netto.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="NrFaktury.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="NrFakturyKorygowanej.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ZP.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>
Index: /trunk/BazaReklam/OrderViewer.cs
===================================================================
--- /trunk/BazaReklam/OrderViewer.cs (revision 923)
+++ /trunk/BazaReklam/OrderViewer.cs (revision 981)
@@ -12,5 +12,4 @@
 using System.IO;
 using System.Reflection;
-
 using Baza_Reklam.Classes.Helpers;
 using Baza_Reklam.Classes.Interfaces;
@@ -39,11 +38,22 @@
             reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("zamowienie", zamowienieTableAdapter.GetDataByReklamaId(reklamaId)));
 
-            
             SqlCommand cm = new SqlCommand();
             cm.Connection = new SqlConnection();
-            cm.CommandText = "declare @test varchar(800); set @test = ''; declare @nr_wyd int; " +
+            cm.CommandText = 
+                " declare @test varchar(800); " +
+                " set @test = ''; " +
+                " declare @nr_wyd int; " +
                 " DECLARE kur2 CURSOR FOR SELECT [Nr Wydania] FROM [UKA¯E SIÊ W NR] WHERE (ReklamaId = @param) order by [Nr Wydania];" +
-                " OPEN kur2; FETCH NEXT from kur2 into @nr_wyd; while @@fetch_status=0 begin   set @test  = @test + ', ' + CAST(@nr_wyd AS varchar); " +
-                " fetch next from kur2 into @nr_wyd; end CLOSE kur2; DEALLOCATE kur2; select @test; ";
+                " OPEN kur2; " +
+                " FETCH NEXT from kur2 into @nr_wyd; " +
+                " while @@fetch_status=0 " +
+                "  begin " +
+                "   set @test = @test + ', ' + CAST(@nr_wyd AS varchar); " +
+                "   fetch next from kur2 into @nr_wyd; " +
+                "  end " +
+                " CLOSE kur2; " +
+                " DEALLOCATE kur2; " +
+                " select @test; ";
+
             cm.Parameters.AddWithValue("@param", reklamaId);
             cm.Connection.ConnectionString = ConnString.getConnString().Value;
Index: /trunk/TruckExpoCDN/EXPODataSet.Designer.cs
===================================================================
--- /trunk/TruckExpoCDN/EXPODataSet.Designer.cs (revision 834)
+++ /trunk/TruckExpoCDN/EXPODataSet.Designer.cs (revision 981)
@@ -2,5 +2,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3082
+//     Runtime Version:2.0.50727.4200
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
Index: /trunk/TruckExpoCDN/Properties/Settings.Designer.cs
===================================================================
--- /trunk/TruckExpoCDN/Properties/Settings.Designer.cs (revision 479)
+++ /trunk/TruckExpoCDN/Properties/Settings.Designer.cs (revision 981)
@@ -2,5 +2,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3053
+//     Runtime Version:2.0.50727.4200
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
@@ -13,5 +13,5 @@
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
Index: /trunk/TruckExpoCDN/Properties/Resources.Designer.cs
===================================================================
--- /trunk/TruckExpoCDN/Properties/Resources.Designer.cs (revision 479)
+++ /trunk/TruckExpoCDN/Properties/Resources.Designer.cs (revision 981)
@@ -2,5 +2,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3053
+//     Runtime Version:2.0.50727.4200
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
Index: /trunk/TruckExpoCDN/ExportToCDN.csproj
===================================================================
--- /trunk/TruckExpoCDN/ExportToCDN.csproj (revision 528)
+++ /trunk/TruckExpoCDN/ExportToCDN.csproj (revision 981)
@@ -1,3 +1,3 @@
-﻿<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+﻿<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -10,4 +10,9 @@
     <RootNamespace>ExportFaktur</RootNamespace>
     <AssemblyName>ExportToCDN</AssemblyName>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>2.0</OldToolsVersion>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Index: /trunk/TruckExpoCDN/CDNDataSet.Designer.cs
===================================================================
--- /trunk/TruckExpoCDN/CDNDataSet.Designer.cs (revision 479)
+++ /trunk/TruckExpoCDN/CDNDataSet.Designer.cs (revision 981)
@@ -2,5 +2,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3053
+//     Runtime Version:2.0.50727.4200
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
Index: /trunk/BazaReklam.Updater/BazaReklam.Updater.csproj
===================================================================
--- /trunk/BazaReklam.Updater/BazaReklam.Updater.csproj (revision 609)
+++ /trunk/BazaReklam.Updater/BazaReklam.Updater.csproj (revision 981)
@@ -1,3 +1,3 @@
-﻿<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+﻿<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -11,4 +11,9 @@
     <AssemblyName>BazaReklam.Updater</AssemblyName>
     <ApplicationIcon>29.ico</ApplicationIcon>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>2.0</OldToolsVersion>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Index: /trunk/BazaReklam.Updater/Properties/Settings.Designer.cs
===================================================================
--- /trunk/BazaReklam.Updater/Properties/Settings.Designer.cs (revision 597)
+++ /trunk/BazaReklam.Updater/Properties/Settings.Designer.cs (revision 981)
@@ -2,5 +2,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3053
+//     Runtime Version:2.0.50727.4200
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
@@ -13,5 +13,5 @@
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
Index: /trunk/BazaReklam.Updater/Properties/Resources.Designer.cs
===================================================================
--- /trunk/BazaReklam.Updater/Properties/Resources.Designer.cs (revision 597)
+++ /trunk/BazaReklam.Updater/Properties/Resources.Designer.cs (revision 981)
@@ -2,5 +2,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3053
+//     Runtime Version:2.0.50727.4200
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
