Index: Baza Reklam 2 - Faktury/ZamowieniaForm.cs
===================================================================
--- Baza Reklam 2 - Faktury/ZamowieniaForm.cs (revision 34)
+++ Baza Reklam 2 - Faktury/ZamowieniaForm.cs (revision 38)
@@ -121,5 +121,12 @@
             if (klient != null)
             {
-                this.KlientLabel.Text = "KOD KLIENTA:  " + klient.kodKlienta;
+                if (klient.IskodKlientaNull())
+                {
+                    this.KlientLabel.Text = "BRAK KODU KLIENTA";
+                }
+                else
+                {
+                    this.KlientLabel.Text = "KOD KLIENTA:  " + klient.kodKlienta;
+                }
             }
         }
@@ -217,7 +224,7 @@
             REKLAMADataSet.REKLAMARow row, string s)
         {
-            if (zamowienie.zafakturowanoWszystko)
-            {
-                s += "Zamówienie jest ju¿ w ca³oci zafakturowane.";
+            if (zamowienie.zafakturowanoWszystko || zamowienie.zafakturowano)
+            {
+                s += "Zamówienie jest ju¿ zafakturowane.";
             }
 
@@ -308,4 +315,6 @@
 
                 wystawFakture(zamowienie, klient);
+
+                this.zamowieniaBindingSource.ResetBindings(false);
 
                 this.Cursor = Cursors.Default;
@@ -1115,4 +1124,5 @@
                 DataRowView z = (DataRowView)zamowieniaBindingSource.Current;
                 REKLAMADataSet.zamowieniaRow zamowienie = (REKLAMADataSet.zamowieniaRow)z.Row;
+                
                 rEKLAMATableAdapter.FillByIdZamowienia(this.rEKLAMADataSet.REKLAMA, zamowienie.idZamowienia);
                 fAKTURYTableAdapter.FillByIdZamowienia(this.rEKLAMADataSet.FAKTURY, zamowienie.idZamowienia);
@@ -1120,4 +1130,21 @@
                 dodajDoZamButton.Enabled = !zamowienie.zafakturowanoWszystko;
                 usunZZamButton.Enabled = !zamowienie.zafakturowanoWszystko;
+                fakturujButton.Enabled = !zamowienie.zafakturowanoWszystko;
+
+                if (!zamowienie.IsdataOstatniejZafakturowanejEmisjiNull())
+                {
+                    DateTime data = zamowienie.dataOstatniejZafakturowanejEmisji;
+                    DateTime dzis = DateTime.Today;
+
+                    if ((dzis.Year > data.Year) ||
+                        (dzis.Year == data.Year & dzis.Month > data.Month))
+                    {
+                        fakturujButton.Enabled = true;
+                    }
+                    else
+                    {
+                        fakturujButton.Enabled = false;
+                    }
+                }
             }
         }
Index: Baza Reklam 2 - Faktury/ZamowieniaForm.Designer.cs
===================================================================
--- Baza Reklam 2 - Faktury/ZamowieniaForm.Designer.cs (revision 25)
+++ Baza Reklam 2 - Faktury/ZamowieniaForm.Designer.cs (revision 38)
@@ -92,4 +92,5 @@
             this.label1 = new System.Windows.Forms.Label();
             this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.proformaButton = new System.Windows.Forms.Button();
             this.dtpZmianaDaty = new System.Windows.Forms.DateTimePicker();
             this.groupBox3 = new System.Windows.Forms.GroupBox();
@@ -100,5 +101,4 @@
             this.toolTip = new System.Windows.Forms.ToolTip(this.components);
             this.KlientLabel = new System.Windows.Forms.Label();
-            this.proformaButton = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.zamowieniaDataGridView)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.zamowieniaBindingSource)).BeginInit();
@@ -680,4 +680,14 @@
             this.groupBox2.Text = "Zamówienia";
             // 
+            // proformaButton
+            // 
+            this.proformaButton.Location = new System.Drawing.Point(180, 292);
+            this.proformaButton.Name = "proformaButton";
+            this.proformaButton.Size = new System.Drawing.Size(36, 37);
+            this.proformaButton.TabIndex = 13;
+            this.proformaButton.Text = "P";
+            this.proformaButton.UseVisualStyleBackColor = true;
+            this.proformaButton.Click += new System.EventHandler(this.proformaButton_Click);
+            // 
             // dtpZmianaDaty
             // 
@@ -757,14 +767,4 @@
             this.KlientLabel.TabIndex = 15;
             this.KlientLabel.Text = "----";
-            // 
-            // proformaButton
-            // 
-            this.proformaButton.Location = new System.Drawing.Point(180, 292);
-            this.proformaButton.Name = "proformaButton";
-            this.proformaButton.Size = new System.Drawing.Size(36, 37);
-            this.proformaButton.TabIndex = 13;
-            this.proformaButton.Text = "P";
-            this.proformaButton.UseVisualStyleBackColor = true;
-            this.proformaButton.Click += new System.EventHandler(this.proformaButton_Click);
             // 
             // ZamowieniaForm
Index: Baza Reklam 2 - Faktury/ZamowieniaForm.resx
===================================================================
--- Baza Reklam 2 - Faktury/ZamowieniaForm.resx (revision 19)
+++ Baza Reklam 2 - Faktury/ZamowieniaForm.resx (revision 38)
@@ -352,5 +352,5 @@
   </metadata>
   <metadata name="rEKLAMATableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>727, 17</value>
+    <value>543, 17</value>
   </metadata>
   <metadata name="fAKTURYTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
@@ -540,5 +540,5 @@
   </data>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>38</value>
+    <value>183</value>
   </metadata>
 </root>
Index: Baza Reklam 2 - Faktury/app.config
===================================================================
--- Baza Reklam 2 - Faktury/app.config (revision 8)
+++ Baza Reklam 2 - Faktury/app.config (revision 38)
@@ -8,7 +8,5 @@
        <connectionStrings>
               <clear />
-              <add name="Baza_Reklam.Properties.Settings.testowe" connectionString="Data Source=WSIEDZIK\SQL2005DEV;Initial Catalog=BAZA_REKLAM_TEST;Integrated Security=True"
-               providerName="System.Data.SqlClient" />
-              <add name="CT" connectionString="Data Source=sql.ct.com.pl;Initial Catalog=BAZA_REKLAM_TEST;Persist Security Info=True"
+              <add name="CT" connectionString="Data Source=10.0.0.21;Initial Catalog=BAZA_REKLAM_TEST;Persist Security Info=True"
                      providerName="System.Data.SqlClient" />
               <add name="Baza_Reklam.Properties.Settings.BAZA_REKLAMConnectionString1"
@@ -19,4 +17,9 @@
               <add name="Baza_Reklam.Properties.Settings.BAZA_REKLAM_PROMO"
                      connectionString="Data Source=DOROTA-PC\SQL2005MSDN;Initial Catalog=BAZA_REKLAM;Integrated Security=True" />
+              <add name="Baza_Reklam.Properties.Settings.testowe" connectionString="Data Source=10.0.0.21;Initial Catalog=BAZA_REKLAM_TEST;User ID=sa"
+                     providerName="System.Data.SqlClient" />
+              <add name="Baza_Reklam.Properties.Settings.BAZA_REKLAM_TESTConnectionString"
+                     connectionString="Data Source=WSIEDZIK\SQL2005DEV;Initial Catalog=BAZA_REKLAM_TEST;Integrated Security=True"
+                     providerName="System.Data.SqlClient" />
        </connectionStrings>
        <applicationSettings>
