Index: branches/ReklamaReorganizacja/SQL/Triggers/KLIENCI_DELETE.txt
===================================================================
--- branches/ReklamaReorganizacja/SQL/Triggers/KLIENCI_DELETE.txt (revision 616)
+++ branches/ReklamaReorganizacja/SQL/Triggers/KLIENCI_DELETE.txt (revision 616)
@@ -0,0 +1,27 @@
+
+SET ANSI_NULLS ON
+GO
+SET QUOTED_IDENTIFIER ON
+GO
+
+ALTER TRIGGER [KLIENCI_DELETE]
+ON [dbo].[KLIENCI]
+FOR DELETE 
+AS
+
+DECLARE @id INT
+DECLARE @Klient nvarchar(50)
+SELECT @id=CustomerId, @Klient=FirstName FROM deleted
+
+-- zapis do logu
+INSERT INTO dbo.[LOG](OPERACJA, TABELA, OPIS)
+VALUES('DELETE', 'KLIENCI', 'ID: ' + CAST(@id AS varchar) + ' | Name: ' + @Klient + ' | User: ' + USER_NAME())
+
+
+GO
+
+SET ANSI_NULLS OFF
+GO
+SET QUOTED_IDENTIFIER OFF
+GO
+
Index: branches/ReklamaReorganizacja/BazaReklam/ClientsForm.Designer.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/ClientsForm.Designer.cs (revision 601)
+++ branches/ReklamaReorganizacja/BazaReklam/ClientsForm.Designer.cs (revision 616)
@@ -4056,5 +4056,4 @@
             // 
             this.dodajToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
-            this.dodajToolStripButton.Enabled = false;
             this.dodajToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("dodajToolStripButton.Image")));
             this.dodajToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
@@ -4067,5 +4066,4 @@
             // 
             this.btnEditClient.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
-            this.btnEditClient.Enabled = false;
             this.btnEditClient.Image = ((System.Drawing.Image)(resources.GetObject("btnEditClient.Image")));
             this.btnEditClient.ImageTransparentColor = System.Drawing.Color.Magenta;
Index: branches/ReklamaReorganizacja/BazaReklam/AddClient.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/AddClient.cs (revision 613)
+++ branches/ReklamaReorganizacja/BazaReklam/AddClient.cs (revision 616)
@@ -6,4 +6,6 @@
 using System.Windows.Forms;
 using Baza_Reklam.Classes.Helpers;
+using Baza_Reklam.Classes.Model;
+using Baza_Reklam.Classes.Repositories;
 
 namespace Baza_Reklam
@@ -13,15 +15,21 @@
         private readonly int _clientId;
         private REKLAMADataSet.KLIENCIRow _client;
-
-        protected REKLAMADataSet.KLIENCIRow Client
+        private bool _reload;
+
+        public REKLAMADataSet.KLIENCIRow Client
         {
             get { return _client; }
         }
 
-        public AddClient(BindingSource bindingSource)
+        public bool Reload
+        {
+            get { return _reload; }
+            set { _reload = value; }
+        }
+
+        public AddClient()
         {
             InitializeComponent();
-            rEKLAMADataSet = (REKLAMADataSet)bindingSource.DataSource;
-            clientsBindingSource = bindingSource;
+            Init();
         }
 
@@ -32,20 +40,38 @@
             clientsBindingSource = bindingSource;
             _clientId = clientId;
-        }
-
-        private void AddClient_Load(object sender, EventArgs e)
-        {
-            bool update = false;
+            
             // rebind controls to use passed binding source
             ReBindControls(this, clientsBindingSource);
+            
+            Init();
+        }
+
+        private void Init()
+        {
             LoadTitleList();
-
-            agenciTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
             clientsAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
             clientTitlesAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
-            //TODO: try to display only active agents...
-            agenciTableAdapter.Fill(sLOWNIKDataSet.AGENCI);
-            //agenciTableAdapter.FillByAktywny(sLOWNIKDataSet.AGENCI);
-
+
+            BindComboBox(CountryRepository.FindAll(), cbCountry);
+            cbCountry.DisplayMember = "Name";
+            cbCountry.ValueMember = "Name";
+
+            BindComboBox(StateRepository.FindAll(), cbState);
+            cbState.DisplayMember = "Name";
+            cbState.ValueMember = "Name";
+
+            BindComboBox(new AgentRepository().FindAllActive(), cbUserName);
+            cbUserName.DisplayMember = "LoginName";
+            cbUserName.ValueMember = "LoginName";
+
+            BindComboBox(new AgentRepository().FindAllActive(), cbAgentExpo);
+            cbAgentExpo.DisplayMember = "LoginName";
+            cbAgentExpo.ValueMember = "LoginName";
+        }
+
+        private void AddClient_Load(object sender, EventArgs e)
+        {
+            Reload = false;
+            bool update = false;
             if (_clientId == 0) // add new client
             {
@@ -69,5 +95,5 @@
             }
 
-            SetUserNameAndAgentExpo(_client);
+            SetStateUserNameAndAgentExpo(_client, update);
 
             SetFormCaption(update);
@@ -89,32 +115,29 @@
         }
 
-        private void SetUserNameAndAgentExpo(REKLAMADataSet.KLIENCIRow client)
-        {
-            cbUserName.SelectedIndex = cbUserName.FindString(client.UserName);
-            cbAgentExpo.SelectedIndex = cbAgentExpo.FindString(client.AgentExpo);
-
-            //TODO: try to display only active agents...
-            //if (cbUserName.SelectedIndex == -1)
-            //{
-            //    int index = cbUserName.Items.Add(client.UserName);
-            //    cbUserName.SelectedIndex = index;
-            //}
-
-            //if (cbAgentExpo.SelectedIndex == -1)
-            //{
-            //    int index = cbAgentExpo.Items.Add(client.AgentExpo);
-            //    cbAgentExpo.SelectedIndex = index;
-            //}
-
-            //if (User.Instance().St_kierownik)
-            //{
-            //    cbUserName.Enabled = User.Instance().UserAgencyList.Contains(DbUtils.idAgencji(client.UserName));
-            //    cbAgentExpo.Enabled = User.Instance().UserAgencyList.Contains(DbUtils.idAgencji(client.AgentExpo));
-            //}
-            //else
-            //{
-            //    cbUserName.Enabled = client.UserName.Trim().ToLower() == User.Instance().Symbol_agenta.Trim().ToLower();
-            //    cbAgentExpo.Enabled = client.AgentExpo.Trim().ToLower() == User.Instance().Symbol_agenta.Trim().ToLower();
-            //}
+        private void SetStateUserNameAndAgentExpo(REKLAMADataSet.KLIENCIRow client, bool update)
+        {
+            if (update)
+            {
+                if (!client.IsStateNull())
+                {
+                    int stateIndex = cbState.FindString(client.State);
+                    if (stateIndex < 0)
+                    {
+                        cbState.Items.Insert(0, new State(client.State));
+                        cbState.SelectedIndex = 0;
+                    }
+                }
+
+                int userNameIndex = cbUserName.FindString(client.UserName);
+                if (userNameIndex < 0)
+                    cbUserName.Items.Insert(0, new Agent(client.UserName.Trim().ToLower()));
+
+                int agentExpoIndex = cbAgentExpo.FindString(client.AgentExpo);
+                if (agentExpoIndex < 0)
+                    cbAgentExpo.Items.Insert(0, new Agent(client.AgentExpo.Trim().ToLower()));
+            }
+
+            cbUserName.SelectedIndex = cbUserName.FindString(client.UserName.Trim().ToLower());
+            cbAgentExpo.SelectedIndex = cbAgentExpo.FindString(client.AgentExpo.Trim().ToLower());
 
             cbUserName.Enabled = (DbUtils.idAgencji(client.UserName) == User.Instance().IdAgencji);
@@ -165,8 +188,9 @@
                 clientsAdapter.Update(rEKLAMADataSet.KLIENCI);
                 Cursor = Cursors.Default;
+                Reload = true;
                 Close();
                 return;
             }
-
+            Reload = false;
             MessageBox.Show("Proszê wprowadziæ wszystkie wymagane dane.");
         }
@@ -247,7 +271,11 @@
         }
 
-        private void AddClient_FormClosing(object sender, FormClosingEventArgs e)
-        {
-            rEKLAMADataSet.KLIENCI.RejectChanges();
+        void BindComboBox<T>(IEnumerable<T> list, ComboBox comboBox)
+        {
+            comboBox.Items.Clear();
+            foreach (T item in list)
+            {
+                comboBox.Items.Add(item);
+            }
         }
     }
Index: branches/ReklamaReorganizacja/BazaReklam/Docs/versioninfo.html
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Docs/versioninfo.html (revision 613)
+++ branches/ReklamaReorganizacja/BazaReklam/Docs/versioninfo.html (revision 616)
@@ -6,4 +6,17 @@
 <body>
    <h1>Baza reklam - Informacje o wersji</h1>
+   <div>
+        <a id="1.1.7" />
+        <h2>Wersja 1.1.7 (2009-04-28)</h2>
+        <p>Opis zmian wprowadzonych do wersji 1.1.7</p>
+        <ul>
+            <li>Zgłoszenie #160: Bieżące poprawki na podstawie logu błędów:
+                <ul>
+                    <li>- naprawiono błąd występujący przy usuwaniu klienta</li>
+                    <li>- poprawiono dodawanie nowego klienta oraz walidację danych</li>
+                </ul>
+            </li>
+        </ul>
+   </div>
    <div>
         <a id="1.1.6" />
Index: branches/ReklamaReorganizacja/BazaReklam/Baza Reklam.csproj
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Baza Reklam.csproj (revision 613)
+++ branches/ReklamaReorganizacja/BazaReklam/Baza Reklam.csproj (revision 616)
@@ -116,4 +116,6 @@
     <Compile Include="Classes\Interfaces\IInvoiceProvider.cs" />
     <Compile Include="Classes\Interfaces\IForm.cs" />
+    <Compile Include="Classes\Model\Agent.cs" />
+    <Compile Include="Classes\Model\Country.cs" />
     <Compile Include="Classes\Model\Invoice.cs" />
     <Compile Include="Classes\InvoiceProvider.cs" />
@@ -122,8 +124,14 @@
     <Compile Include="Classes\Global.cs" />
     <Compile Include="Classes\Logger.cs" />
+    <Compile Include="Classes\Model\State.cs" />
     <Compile Include="Classes\Model\UserAgency.cs" />
     <Compile Include="Classes\PrintDGV.cs" />
     <Compile Include="Classes\Produkcja.cs" />
     <Compile Include="Classes\Helpers\ReklamaHelper.cs" />
+    <Compile Include="Classes\Repositories\AgentRepository.cs" />
+    <Compile Include="Classes\Repositories\CountryRepository.cs" />
+    <Compile Include="Classes\Repositories\IRepository.cs" />
+    <Compile Include="Classes\Repositories\Repository.cs" />
+    <Compile Include="Classes\Repositories\StateRepository.cs" />
     <Compile Include="Classes\Repositories\UserAgencyRepository.cs" />
     <Compile Include="Classes\User.cs" />
Index: branches/ReklamaReorganizacja/BazaReklam/AddClient.Designer.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/AddClient.Designer.cs (revision 613)
+++ branches/ReklamaReorganizacja/BazaReklam/AddClient.Designer.cs (revision 616)
@@ -90,9 +90,9 @@
             this.krsLabel = new System.Windows.Forms.Label();
             this.cbUserName = new System.Windows.Forms.ComboBox();
-            this.agenciBindingSource = new System.Windows.Forms.BindingSource(this.components);
             this.cbActive = new System.Windows.Forms.CheckBox();
             this.txtKrs = new System.Windows.Forms.TextBox();
             this.regonLabel = new System.Windows.Forms.Label();
             this.txtRegon = new System.Windows.Forms.TextBox();
+            this.agenciBindingSource = new System.Windows.Forms.BindingSource(this.components);
             this.btnSave = new System.Windows.Forms.Button();
             this.btnCancel = new System.Windows.Forms.Button();
@@ -177,21 +177,4 @@
             this.cbState.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.clientsBindingSource, "State", true));
             this.cbState.FormattingEnabled = true;
-            this.cbState.Items.AddRange(new object[] {
-            "dolnol¹skie ",
-            "kujawsko-pomorskie",
-            "lubelskie ",
-            "lubuskie",
-            "³ódzkie",
-            "ma³opolskie",
-            "mazowieckie",
-            "opolskie",
-            "podkarpackie",
-            "podlaskie",
-            "pomorskie",
-            "l¹skie",
-            "wiêtokrzyskie",
-            "warmiñsko-mazurskie",
-            "wielkopolskie",
-            "zachodniopomorskie"});
             this.cbState.Location = new System.Drawing.Point(148, 109);
             this.cbState.Name = "cbState";
@@ -214,209 +197,4 @@
             this.cbCountry.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cbCountry.FormattingEnabled = true;
-            this.cbCountry.Items.AddRange(new object[] {
-            "Abchazja",
-            "Afganistan",
-            "Albania",
-            "Algieria",
-            "Andora",
-            "Angola",
-            "Antigua i Barbuda",
-            "Arabia Saudyjska",
-            "Argentyna",
-            "Armenia",
-            "Australia",
-            "Austria",
-            "Azerbejd¿an",
-            "Bahamy",
-            "Bahrajn",
-            "Bangladesz",
-            "Barbados",
-            "Belgia",
-            "Belize",
-            "Benin",
-            "Bhutan",
-            "Bia³oru",
-            "Birma",
-            "Boliwia",
-            "Bonia i Hercegowina",
-            "Botswana",
-            "Brazylia",
-            "Brunei",
-            "Bu³garia",
-            "Burkina Faso",
-            "Burundi",
-            "Chile",
-            "Chiny",
-            "Chorwacja",
-            "Cypr",
-            "Cypr Pó³nocny",
-            "Czad",
-            "Czarnogóra",
-            "Czechy",
-            "Dania",
-            "Demokratyczna Republika Konga",
-            "Dominika",
-            "Dominikana",
-            "D¿ibuti",
-            "Egipt",
-            "Ekwador",
-            "Erytrea",
-            "Estonia",
-            "Etiopia",
-            "Fid¿i",
-            "Filipiny",
-            "Finlandia",
-            "Francja",
-            "Gabon",
-            "Gambia",
-            "Ghana",
-            "Górski Karabach",
-            "Grecja",
-            "Grenada",
-            "Gruzja",
-            "Gujana",
-            "Gwatemala",
-            "Gwinea",
-            "Gwinea Bissau",
-            "Gwinea Równikowa",
-            "Haiti",
-            "Hiszpania",
-            "Holandia",
-            "Honduras",
-            "Indie",
-            "Indonezja",
-            "Irak",
-            "Iran",
-            "Irlandia",
-            "Irlandia Pó³nocna",
-            "Islandia",
-            "Izrael",
-            "Jamajka",
-            "Japonia",
-            "Jemen",
-            "Jordania",
-            "Kambod¿a",
-            "Kamerun",
-            "Kanada",
-            "Katar",
-            "Kazachstan",
-            "Kenia",
-            "Kirgistan",
-            "Kiribati",
-            "Kolumbia",
-            "Komory",
-            "Kongo",
-            "Korea Po³udniowa",
-            "Korea Pó³nocna",
-            "Kostaryka",
-            "Kuba",
-            "Kuwejt",
-            "Laos",
-            "Lesotho",
-            "Liban",
-            "Liberia",
-            "Libia",
-            "Liechtenstein",
-            "Litwa",
-            "Luksemburg",
-            "£otwa",
-            "Macedonia",
-            "Madagaskar",
-            "Malawi",
-            "Malediwy",
-            "Malezja",
-            "Mali",
-            "Malta",
-            "Maroko",
-            "Mauretania",
-            "Mauritius",
-            "Meksyk",
-            "Mikronezja",
-            "Mo³dawia",
-            "Monako",
-            "Mongolia",
-            "Mozambik",
-            "Naddniestrze",
-            "Namibia",
-            "Nauru",
-            "Nepal",
-            "Niemcy",
-            "Niger",
-            "Nigeria",
-            "Nikaragua",
-            "Norwegia",
-            "Nowa Zelandia",
-            "Oman",
-            "Osetia Po³udniowa",
-            "Pakistan",
-            "Palau",
-            "Palestyna",
-            "Panama",
-            "Papua-Nowa Gwinea",
-            "Paragwaj",
-            "Peru",
-            "Polska",
-            "Portugalia",
-            "Portoryko",
-            "Republika Po³udniowej Afryki",
-            "Republika rodkowoafrykañska",
-            "Republika Zielonego Przyl¹dka",
-            "Rosja",
-            "Rumunia",
-            "Rwanda",
-            "Sahara Zachodnia",
-            "Saint Kitts i Nevis",
-            "Saint Lucia",
-            "Saint Vincent i Grenadyny",
-            "Salwador",
-            "Samoa",
-            "San Marino",
-            "Senegal",
-            "Serbia",
-            "Seszele",
-            "Sierra Leone",
-            "Singapur",
-            "S³owacja",
-            "S³owenia",
-            "Somalia",
-            "Somaliland",
-            "Sri Lanka",
-            "Stany Zjednoczone",
-            "Suazi",
-            "Sudan",
-            "Surinam",
-            "Syria",
-            "Szwajcaria",
-            "Szwecja",
-            "Tad¿ykistan",
-            "Tajlandia",
-            "Tajwan",
-            "Tanzania",
-            "Timor Wschodni",
-            "Togo",
-            "Tonga",
-            "Trynidad i Tobago",
-            "Tunezja",
-            "Turcja",
-            "Turkmenistan",
-            "Tuvalu",
-            "Uganda",
-            "Ukraina",
-            "Urugwaj",
-            "Uzbekistan",
-            "Vanuatu",
-            "Watykan",
-            "Wenezuela",
-            "Wêgry",
-            "Wielka Brytania",
-            "Wietnam",
-            "W³ochy",
-            "Wybrze¿e Koci S³oniowej",
-            "Wyspy Marshalla",
-            "Wyspy Salomona",
-            "Wyspy wiêtego Tomasza i Ksi¹¿êca",
-            "Zambia",
-            "Zimbabwe",
-            "Zjednoczone Emiraty Arabskie"});
             this.cbCountry.Location = new System.Drawing.Point(148, 148);
             this.cbCountry.Name = "cbCountry";
@@ -888,7 +666,5 @@
             // cbAgentExpo
             // 
-            this.cbAgentExpo.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.clientsBindingSource, "AgentExpo", true));
-            this.cbAgentExpo.DataSource = this.agenciExpoBindingSource;
-            this.cbAgentExpo.DisplayMember = "Symbol";
+            this.cbAgentExpo.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.clientsBindingSource, "AgentExpo", true));
             this.cbAgentExpo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cbAgentExpo.FormattingEnabled = true;
@@ -897,5 +673,4 @@
             this.cbAgentExpo.Size = new System.Drawing.Size(118, 21);
             this.cbAgentExpo.TabIndex = 26;
-            this.cbAgentExpo.ValueMember = "Symbol";
             // 
             // agenciExpoBindingSource
@@ -920,7 +695,5 @@
             // cbUserName
             // 
-            this.cbUserName.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.clientsBindingSource, "UserName", true));
-            this.cbUserName.DataSource = this.agenciBindingSource;
-            this.cbUserName.DisplayMember = "Symbol";
+            this.cbUserName.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.clientsBindingSource, "UserName", true));
             this.cbUserName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cbUserName.FormattingEnabled = true;
@@ -929,10 +702,4 @@
             this.cbUserName.Size = new System.Drawing.Size(117, 21);
             this.cbUserName.TabIndex = 25;
-            this.cbUserName.ValueMember = "Symbol";
-            // 
-            // agenciBindingSource
-            // 
-            this.agenciBindingSource.DataMember = "AGENCI";
-            this.agenciBindingSource.DataSource = this.sLOWNIKDataSet;
             // 
             // cbActive
@@ -972,4 +739,9 @@
             this.txtRegon.Size = new System.Drawing.Size(232, 20);
             this.txtRegon.TabIndex = 21;
+            // 
+            // agenciBindingSource
+            // 
+            this.agenciBindingSource.DataMember = "AGENCI";
+            this.agenciBindingSource.DataSource = this.sLOWNIKDataSet;
             // 
             // btnSave
@@ -1034,5 +806,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.CausesValidation = false;
             this.ClientSize = new System.Drawing.Size(649, 533);
+            this.ControlBox = false;
             this.Controls.Add(this.label1);
             this.Controls.Add(this.txtNote);
@@ -1043,4 +817,5 @@
             this.Controls.Add(this.gbContact);
             this.Controls.Add(this.gbAddress);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
             this.MaximizeBox = false;
             this.MinimizeBox = false;
@@ -1050,5 +825,4 @@
             this.Text = "Dodaj/modyfikuj klienta";
             this.Load += new System.EventHandler(this.AddClient_Load);
-            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AddClient_FormClosing);
             this.gbAddress.ResumeLayout(false);
             this.gbAddress.PerformLayout();
Index: branches/ReklamaReorganizacja/BazaReklam/AddClient.resx
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/AddClient.resx (revision 601)
+++ branches/ReklamaReorganizacja/BazaReklam/AddClient.resx (revision 616)
@@ -130,6 +130,15 @@
     <value>153, 17</value>
   </metadata>
+  <metadata name="clientsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>153, 17</value>
+  </metadata>
   <metadata name="rEKLAMADataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
+  </metadata>
+  <metadata name="rEKLAMADataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="clientTitlesBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>1051, 17</value>
   </metadata>
   <metadata name="clientTitlesBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
@@ -198,4 +207,7 @@
     <value>429, 17</value>
   </metadata>
+  <metadata name="sLOWNIKDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>429, 17</value>
+  </metadata>
   <metadata name="agenciBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>567, 17</value>
Index: branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/AgentRepository.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/AgentRepository.cs (revision 616)
+++ branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/AgentRepository.cs (revision 616)
@@ -0,0 +1,50 @@
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using Baza_Reklam.Classes.Model;
+
+namespace Baza_Reklam.Classes.Repositories
+{
+    public class AgentRepository : Repository<Agent>
+    {
+        public List<Agent> FindAllActive()
+        {
+            const string query = "SELECT Symbol FROM dbo.Agenci WHERE aktywny=1 ORDER BY Symbol";
+
+            List<Agent> agents = new List<Agent>();
+
+            SqlConnection conn = null;
+            SqlCommand cmd = null;
+            SqlDataReader reader = null;
+            try
+            {
+                conn = new SqlConnection(ConnString.getConnString().Value);
+                conn.Open();
+                cmd = new SqlCommand(query, conn);
+                reader = cmd.ExecuteReader();
+                if (reader != null)
+                {
+                    while (reader.Read())
+                    {
+                        agents.Add(new Agent(reader.GetString(0).Trim().ToLower()));
+                    }
+                }
+            }
+            finally
+            {
+                if (reader != null)
+                {
+                    reader.Close();
+                    reader.Dispose();
+                }
+                if (cmd != null) cmd.Dispose();
+                if (conn != null)
+                {
+                    conn.Close();
+                    conn.Dispose();
+                }
+
+            }
+            return agents;
+        }
+    }
+}
Index: branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/Repository.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/Repository.cs (revision 616)
+++ branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/Repository.cs (revision 616)
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+
+namespace Baza_Reklam.Classes.Repositories
+{
+    public class Repository<T> : IRepository<T>
+    {
+        public virtual T Find(int id)
+        {
+            throw new NotImplementedException();
+        }
+
+        public List<T> FindAll()
+        {
+            throw new NotImplementedException();
+        }
+
+        public void Save()
+        {
+            throw new NotImplementedException();
+        }
+
+        public void Delete()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}
Index: branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/StateRepository.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/StateRepository.cs (revision 616)
+++ branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/StateRepository.cs (revision 616)
@@ -0,0 +1,71 @@
+using System.Collections.Generic;
+using Baza_Reklam.Classes.Model;
+
+namespace Baza_Reklam.Classes.Repositories
+{
+    public class StateRepository
+    {
+        public static List<State> FindAll()
+        {
+            return StaticStates.GetStates();
+        }
+
+        public static int Count()
+        {
+            return StaticStates.Count();
+        }
+    }
+
+    //TODO: replace it with the function which gets the states from DB
+    internal class StaticStates
+    {
+        private static StaticStates _instance;
+        private readonly List<State> _states = new List<State>();
+
+        private StaticStates()
+        {
+            #region Add States
+
+            _states.Add(new State("dolnol¹skie"));
+            _states.Add(new State("kujawsko-pomorskie"));
+            _states.Add(new State("lubelskie "));
+            _states.Add(new State("lubuskie"));
+            _states.Add(new State("³ódzkie"));
+            _states.Add(new State("ma³opolskie"));
+            _states.Add(new State("mazowieckie"));
+            _states.Add(new State("opolskie"));
+            _states.Add(new State("podkarpackie"));
+            _states.Add(new State("podlaskie"));
+            _states.Add(new State("pomorskie"));
+            _states.Add(new State("l¹skie"));
+            _states.Add(new State("wiêtokrzyskie"));
+            _states.Add(new State("warmiñsko-mazurskie"));
+            _states.Add(new State("wielkopolskie"));
+            _states.Add(new State("zachodniopomorskie"));
+
+            #endregion
+        }
+
+        public static StaticStates Instance
+        {
+            get
+            {
+                if (_instance == null)
+                {
+                    _instance = new StaticStates();
+                }
+                return _instance;
+            }
+        }
+
+        public static List<State> GetStates()
+        {
+            return Instance._states;
+        }
+
+        public static int Count()
+        {
+            return Instance._states.Count;
+        }
+    }
+}
Index: branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/CountryRepository.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/CountryRepository.cs (revision 616)
+++ branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/CountryRepository.cs (revision 616)
@@ -0,0 +1,268 @@
+using System.Collections.Generic;
+using Baza_Reklam.Classes.Model;
+
+namespace Baza_Reklam.Classes.Repositories
+{
+    public class CountryRepository
+    {
+        public static List<Country> FindAll()
+        {
+            return StaticConuntries.GetCountries();
+        }
+
+        public static int Count ()
+        {
+            return StaticConuntries.Count();
+        }
+    }
+
+    //TODO: replace it with the function which gets the countries from DB
+    internal class StaticConuntries
+    {
+        private static StaticConuntries _instance;
+        private readonly List<Country> _countries = new List<Country>();
+
+        private StaticConuntries()
+        {
+            #region Add Countries
+
+            _countries.Add(new Country("Abchazja"));
+            _countries.Add(new Country("Afganistan"));
+            _countries.Add(new Country("Albania"));
+            _countries.Add(new Country("Algieria"));
+            _countries.Add(new Country("Andora"));
+            _countries.Add(new Country("Angola"));
+            _countries.Add(new Country("Antigua i Barbuda"));
+            _countries.Add(new Country("Arabia Saudyjska"));
+            _countries.Add(new Country("Argentyna"));
+            _countries.Add(new Country("Armenia"));
+            _countries.Add(new Country("Australia"));
+            _countries.Add(new Country("Austria"));
+            _countries.Add(new Country("Azerbejd¿an"));
+
+            _countries.Add(new Country("Bahamy"));
+            _countries.Add(new Country("Bahrajn"));
+            _countries.Add(new Country("Bangladesz"));
+            _countries.Add(new Country("Barbados"));
+            _countries.Add(new Country("Belgia"));
+            _countries.Add(new Country("Belize"));
+            _countries.Add(new Country("Benin"));
+            _countries.Add(new Country("Bhutan"));
+            _countries.Add(new Country("Bia³oru"));
+            _countries.Add(new Country("Birma"));
+            _countries.Add(new Country("Boliwia"));
+            _countries.Add(new Country("Bonia i Hercegowina"));
+            _countries.Add(new Country("Botswana"));
+            _countries.Add(new Country("Brazylia"));
+            _countries.Add(new Country("Brunei"));
+            _countries.Add(new Country("Bu³garia"));
+            _countries.Add(new Country("Burkina Faso"));
+            _countries.Add(new Country("Burundi"));
+
+            _countries.Add(new Country("Chile"));
+            _countries.Add(new Country("Chiny"));
+            _countries.Add(new Country("Chorwacja"));
+            _countries.Add(new Country("Cypr"));
+            _countries.Add(new Country("Cypr Pó³nocny"));
+            _countries.Add(new Country("Czad"));
+            _countries.Add(new Country("Czarnogóra"));
+            _countries.Add(new Country("Czechy"));
+
+            _countries.Add(new Country("Dania"));
+            _countries.Add(new Country("Demokratyczna Republika Konga"));
+            _countries.Add(new Country("Dominika"));
+            _countries.Add(new Country("Dominikana"));
+            _countries.Add(new Country("D¿ibuti"));
+            _countries.Add(new Country("Egipt"));
+            _countries.Add(new Country("Ekwador"));
+            _countries.Add(new Country("Erytrea"));
+            _countries.Add(new Country("Estonia"));
+            _countries.Add(new Country("Etiopia"));
+            _countries.Add(new Country("Fid¿i"));
+            _countries.Add(new Country("Filipiny"));
+            _countries.Add(new Country("Finlandia"));
+            _countries.Add(new Country("Francja"));
+
+            _countries.Add(new Country("Gabon"));
+            _countries.Add(new Country("Gambia"));
+            _countries.Add(new Country("Ghana"));
+            _countries.Add(new Country("Górski Karabach"));
+            _countries.Add(new Country("Grecja"));
+            _countries.Add(new Country("Grenada"));
+            _countries.Add(new Country("Gruzja"));
+            _countries.Add(new Country("Gujana"));
+            _countries.Add(new Country("Gwatemala"));
+            _countries.Add(new Country("Gwinea"));
+            _countries.Add(new Country("Gwinea Bissau"));
+            _countries.Add(new Country("Gwinea Równikowa"));
+            _countries.Add(new Country("Haiti"));
+            _countries.Add(new Country("Hiszpania"));
+            _countries.Add(new Country("Holandia"));
+            _countries.Add(new Country("Honduras"));
+
+            _countries.Add(new Country("Indie"));
+            _countries.Add(new Country("Indonezja"));
+            _countries.Add(new Country("Irak"));
+            _countries.Add(new Country("Iran"));
+            _countries.Add(new Country("Irlandia"));
+            _countries.Add(new Country("Irlandia Pó³nocna"));
+            _countries.Add(new Country("Islandia"));
+            _countries.Add(new Country("Izrael"));
+            _countries.Add(new Country("Jamajka"));
+            _countries.Add(new Country("Japonia"));
+            _countries.Add(new Country("Jemen"));
+            _countries.Add(new Country("Jordania"));
+            _countries.Add(new Country("Kambod¿a"));
+            _countries.Add(new Country("Kamerun"));
+            _countries.Add(new Country("Kanada"));
+            _countries.Add(new Country("Katar"));
+            _countries.Add(new Country("Kazachstan"));
+            _countries.Add(new Country("Kenia"));
+            _countries.Add(new Country("Kirgistan"));
+            _countries.Add(new Country("Kiribati"));
+            _countries.Add(new Country("Kolumbia"));
+            _countries.Add(new Country("Komory"));
+            _countries.Add(new Country("Kongo"));
+            _countries.Add(new Country("Korea Po³udniowa"));
+            _countries.Add(new Country("Korea Pó³nocna"));
+            _countries.Add(new Country("Kostaryka"));
+            _countries.Add(new Country("Kuba"));
+            _countries.Add(new Country("Kuwejt"));
+
+            _countries.Add(new Country("Laos"));
+            _countries.Add(new Country("Lesotho"));
+            _countries.Add(new Country("Liban"));
+            _countries.Add(new Country("Liberia"));
+            _countries.Add(new Country("Libia"));
+            _countries.Add(new Country("Liechtenstein"));
+            _countries.Add(new Country("Litwa"));
+            _countries.Add(new Country("Luksemburg"));
+            _countries.Add(new Country("£otwa"));
+            _countries.Add(new Country("Macedonia"));
+            _countries.Add(new Country("Madagaskar"));
+            _countries.Add(new Country("Malawi"));
+            _countries.Add(new Country("Malediwy"));
+            _countries.Add(new Country("Malezja"));
+            _countries.Add(new Country("Mali"));
+            _countries.Add(new Country("Malta"));
+            _countries.Add(new Country("Maroko"));
+            _countries.Add(new Country("Mauretania"));
+            _countries.Add(new Country("Mauritius"));
+            _countries.Add(new Country("Meksyk"));
+            _countries.Add(new Country("Mikronezja"));
+            _countries.Add(new Country("Mo³dawia"));
+            _countries.Add(new Country("Monako"));
+            _countries.Add(new Country("Mongolia"));
+            _countries.Add(new Country("Mozambik"));
+            _countries.Add(new Country("Naddniestrze"));
+            _countries.Add(new Country("Namibia"));
+            _countries.Add(new Country("Nauru"));
+            _countries.Add(new Country("Nepal"));
+            _countries.Add(new Country("Niemcy"));
+            _countries.Add(new Country("Niger"));
+            _countries.Add(new Country("Nigeria"));
+            _countries.Add(new Country("Nikaragua"));
+            _countries.Add(new Country("Norwegia"));
+            _countries.Add(new Country("Nowa Zelandia"));
+
+            _countries.Add(new Country("Oman"));
+            _countries.Add(new Country("Osetia Po³udniowa"));
+            _countries.Add(new Country("Pakistan"));
+            _countries.Add(new Country("Palau"));
+            _countries.Add(new Country("Palestyna"));
+            _countries.Add(new Country("Panama"));
+            _countries.Add(new Country("Papua-Nowa Gwinea"));
+            _countries.Add(new Country("Paragwaj"));
+            _countries.Add(new Country("Peru"));
+            _countries.Add(new Country("Polska"));
+            _countries.Add(new Country("Portugalia"));
+            _countries.Add(new Country("Portoryko"));
+            _countries.Add(new Country("Republika Po³udniowej Afryki"));
+            _countries.Add(new Country("Republika rodkowoafrykañska"));
+            _countries.Add(new Country("Republika Zielonego Przyl¹dka"));
+            _countries.Add(new Country("Rosja"));
+            _countries.Add(new Country("Rumunia"));
+            _countries.Add(new Country("Rwanda"));
+
+            _countries.Add(new Country("Sahara Zachodnia"));
+            _countries.Add(new Country("Saint Kitts i Nevis"));
+            _countries.Add(new Country("Saint Lucia"));
+            _countries.Add(new Country("Saint Vincent i Grenadyny"));
+            _countries.Add(new Country("Salwador"));
+            _countries.Add(new Country("Samoa"));
+            _countries.Add(new Country("San Marino"));
+            _countries.Add(new Country("Senegal"));
+            _countries.Add(new Country("Serbia"));
+            _countries.Add(new Country("Seszele"));
+            _countries.Add(new Country("Sierra Leone"));
+            _countries.Add(new Country("Singapur"));
+            _countries.Add(new Country("S³owacja"));
+            _countries.Add(new Country("S³owenia"));
+            _countries.Add(new Country("Somalia"));
+            _countries.Add(new Country("Somaliland"));
+            _countries.Add(new Country("Sri Lanka"));
+            _countries.Add(new Country("Stany Zjednoczone"));
+            _countries.Add(new Country("Suazi"));
+            _countries.Add(new Country("Sudan"));
+            _countries.Add(new Country("Surinam"));
+            _countries.Add(new Country("Syria"));
+            _countries.Add(new Country("Szwajcaria"));
+            _countries.Add(new Country("Szwecja"));
+            _countries.Add(new Country("Tad¿ykistan"));
+            _countries.Add(new Country("Tajlandia"));
+            _countries.Add(new Country("Tajwan"));
+            _countries.Add(new Country("Tanzania"));
+            _countries.Add(new Country("Timor Wschodni"));
+            _countries.Add(new Country("Togo"));
+            _countries.Add(new Country("Tonga"));
+            _countries.Add(new Country("Trynidad i Tobago"));
+            _countries.Add(new Country("Tunezja"));
+            _countries.Add(new Country("Turcja"));
+            _countries.Add(new Country("Turkmenistan"));
+            _countries.Add(new Country("Tuvalu"));
+
+            _countries.Add(new Country("Uganda"));
+            _countries.Add(new Country("Ukraina"));
+            _countries.Add(new Country("Urugwaj"));
+            _countries.Add(new Country("Uzbekistan"));
+            _countries.Add(new Country("Vanuatu"));
+            _countries.Add(new Country("Watykan"));
+            _countries.Add(new Country("Wenezuela"));
+            _countries.Add(new Country("Wêgry"));
+            _countries.Add(new Country("Wielka Brytania"));
+            _countries.Add(new Country("Wietnam"));
+            _countries.Add(new Country("W³ochy"));
+            _countries.Add(new Country("Wybrze¿e Koci S³oniowej"));
+            _countries.Add(new Country("Wyspy Marshalla"));
+            _countries.Add(new Country("Wyspy Salomona"));
+            _countries.Add(new Country("Wyspy wiêtego Tomasza i Ksi¹¿êca"));
+            _countries.Add(new Country("Zambia"));
+            _countries.Add(new Country("Zimbabwe"));
+            _countries.Add(new Country("Zjednoczone Emiraty Arabskie"));
+
+            #endregion
+        }
+
+        public static StaticConuntries Instance
+        {
+            get
+            {
+                if (_instance == null)
+                {
+                    _instance = new StaticConuntries();
+                }
+                return _instance;
+            }
+        }
+
+        public static List<Country> GetCountries()
+        {
+            return Instance._countries;
+        }
+
+        public static int Count()
+        {
+            return Instance._countries.Count;
+        }
+    }
+}
Index: branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/IRepository.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/IRepository.cs (revision 616)
+++ branches/ReklamaReorganizacja/BazaReklam/Classes/Repositories/IRepository.cs (revision 616)
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+
+namespace Baza_Reklam.Classes.Repositories
+{
+    public interface IRepository<T>
+    {
+        T Find(int id);
+        List<T> FindAll();
+        void Save();
+        void Delete();
+    }
+}
Index: branches/ReklamaReorganizacja/BazaReklam/Classes/Model/Agent.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Classes/Model/Agent.cs (revision 616)
+++ branches/ReklamaReorganizacja/BazaReklam/Classes/Model/Agent.cs (revision 616)
@@ -0,0 +1,18 @@
+namespace Baza_Reklam.Classes.Model
+{
+    public class Agent
+    {
+        private string _loginName;
+
+        public Agent(string loginName)
+        {
+            LoginName = loginName;
+        }
+
+        public string LoginName
+        {
+            get { return _loginName; }
+            set { _loginName = value; }
+        }
+    }
+}
Index: branches/ReklamaReorganizacja/BazaReklam/Classes/Model/State.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Classes/Model/State.cs (revision 616)
+++ branches/ReklamaReorganizacja/BazaReklam/Classes/Model/State.cs (revision 616)
@@ -0,0 +1,18 @@
+namespace Baza_Reklam.Classes.Model
+{
+    public class State
+    {
+        private string _name;
+
+        public string Name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        public State(string name)
+        {
+            _name = name;
+        }
+    }
+}
Index: branches/ReklamaReorganizacja/BazaReklam/Classes/Model/Country.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Classes/Model/Country.cs (revision 616)
+++ branches/ReklamaReorganizacja/BazaReklam/Classes/Model/Country.cs (revision 616)
@@ -0,0 +1,18 @@
+namespace Baza_Reklam.Classes.Model
+{
+    public class Country
+    {
+        private string _name;
+
+        public string Name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        public Country(string name)
+        {
+            _name = name;
+        }
+    }
+}
Index: branches/ReklamaReorganizacja/BazaReklam/Properties/AssemblyInfo.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/Properties/AssemblyInfo.cs (revision 613)
+++ branches/ReklamaReorganizacja/BazaReklam/Properties/AssemblyInfo.cs (revision 616)
@@ -30,3 +30,3 @@
 //
 [assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.1.6")]
+[assembly: AssemblyFileVersion("1.1.7")]
Index: branches/ReklamaReorganizacja/BazaReklam/ClientsForm.cs
===================================================================
--- branches/ReklamaReorganizacja/BazaReklam/ClientsForm.cs (revision 613)
+++ branches/ReklamaReorganizacja/BazaReklam/ClientsForm.cs (revision 616)
@@ -204,15 +204,11 @@
             if (tabs.SelectedTab.Name != "daneKlientaTab")
             {
-                dodajToolStripButton.Enabled = false;
                 zapiszDaneToolStripButton.Enabled = false;
                 usunToolStripButton.Enabled = false;
-                btnEditClient.Enabled = false;
             }
             else
             {
-                dodajToolStripButton.Enabled = true;
                 zapiszDaneToolStripButton.Enabled = true;
                 usunToolStripButton.Enabled = true;
-                btnEditClient.Enabled = kLIENCIBindingSource.Current != null;
             }
 
@@ -405,4 +401,14 @@
         {
             if (kLIENCIBindingSource.Current == null) return;
+            
+            const string caption = "Klient - usuwanie klienta";
+
+            DialogResult dialogResult = MessageBox.Show("Czy na pewno checsz usun¹æ klienta?",
+                                                        caption,
+                                                        MessageBoxButtons.YesNo,
+                                                        MessageBoxIcon.Question);
+            
+            if (dialogResult != DialogResult.Yes) return;
+
 
             DataRowView row = (DataRowView) kLIENCIBindingSource.Current;
@@ -413,11 +419,15 @@
                 || kL_KLIENCITableAdapter.GetDataByCustomerId(custId).Count != 0)
             {
-                if (MessageBox.Show("S¹ inne dane zwi¹zane z klientem! Usun¹æ klienta?", "", MessageBoxButtons.YesNo,
-                                    MessageBoxIcon.Question) == DialogResult.Yes)
+
+                dialogResult = MessageBox.Show("Istniej¹ dane (reklamy, osoby do kontaktu lub klasyfikacja klienta) zwi¹zane z klientem! Usun¹æ klienta?", 
+                                                caption,
+                                               MessageBoxButtons.YesNo,
+                                               MessageBoxIcon.Question);
+                
+                if (dialogResult == DialogResult.Yes)
                 {
                     kLIENCIBindingSource.RemoveCurrent();
                     kLIENCIBindingSource.EndEdit();
                     kLIENCITableAdapter.Update(rEKLAMADataSet.KLIENCI);
-                    MessageBox.Show("Dane usuniêto");
                 }
             }
@@ -427,5 +437,4 @@
                 kLIENCIBindingSource.EndEdit();
                 kLIENCITableAdapter.Update(rEKLAMADataSet.KLIENCI);
-                MessageBox.Show("Dane usuniêto");
             }
 
@@ -994,6 +1003,4 @@
                 panel1.Visible = false;
                 ukryjToolStripButton.ToolTipText = "Poka¿ szczegó³y";
-                dodajToolStripButton.Enabled = false;
-                btnEditClient.Enabled = false;
                 usunToolStripButton.Enabled = false;
                 zapiszDaneToolStripButton.Enabled = false;
@@ -1003,6 +1010,4 @@
                 panel1.Visible = true;
                 ukryjToolStripButton.ToolTipText = "Ukryj szczegó³y";
-                dodajToolStripButton.Enabled = true;
-                btnEditClient.Enabled = kLIENCIBindingSource.Current != null;
                 usunToolStripButton.Enabled = true;
                 zapiszDaneToolStripButton.Enabled = true;
@@ -1017,63 +1022,9 @@
         private void dodajToolStripButton_Click(object sender, EventArgs e)
         {
-            AddClient addClient = new AddClient(kLIENCIBindingSource);
+            AddClient addClient = new AddClient();
             addClient.ShowDialog();
-            return;
-
-            //if (!ValidateChildren())
-            //{
-            //    MessageBox.Show("Proszê uzupe³niæ dane klienta.", "Walidacja danych [dodajToolStripButton_Click]");
-            //    return;
-            //}
-
-            //dodajKlienta = true;
-
-            //kLIENCIBindingSource.EndEdit();
-
-            //// pyta o zACHOWANIE zmian przed zalozeniem kolejnego rekordu
-            //REKLAMADataSet.KLIENCIDataTable changes =
-            //  rEKLAMADataSet.KLIENCI.GetChanges(DataRowState.Added | DataRowState.Modified) as REKLAMADataSet.KLIENCIDataTable;
-
-            //if (changes != null)
-            //{
-            //    if (MessageBox.Show("Czy zapisaæ zmiany?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
-            //    {
-            //        foreach (DataRow r in changes)
-            //        {
-            //            r["Last_Modify"] = DateTime.Now;
-            //            r["Modify_User"] = User.Instance().Login;
-            //        }
-
-            //        kLIENCITableAdapter.Update(rEKLAMADataSet.KLIENCI);
-            //    }
-            //    else
-            //    {
-            //        rEKLAMADataSet.KLIENCI.RejectChanges();
-            //        daneKlientaTab.Select();
-            //    }
-            //}
-
-            ////dodaje nowy rekord
-            //DataView datatable = (DataView)kLIENCIBindingSource.List;
-            //DataRowView row = datatable.AddNew();
-            //row["Last_Modify"] = DateTime.Now;
-            //row["data"] = DateTime.Now;
-            //// nie dziala, bo trigger w bazie zmienia
-            //row["Modify_User"] = User.Instance().Login;
-            //row["UserName"] = User.Instance().Login;
-            //row["AgentExpo"] = User.Instance().Login;
-
-            //kLIENCIBindingSource.MoveLast();
-            //kLIENCIBindingSource.EndEdit();
-            //tabs.SelectedIndex = 0;
-            //countryComboBox.SelectedIndex = -1;
-
-            //groupBox1.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true;
-            //groupBox2.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true;
-            //groupBox3.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true;
-            //groupBox4.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true;
-            //groupBox5.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true;
-            //tabControl1.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true;
-            //firstNameTextBox.Focus();
+
+            if (addClient.Reload)
+                pokazKlienta(addClient.Client.CustomerID);
         }
 
Index: branches/ReklamaReorganizacja/BazaReklamSetup/BazaReklamSetup.vdproj
===================================================================
--- branches/ReklamaReorganizacja/BazaReklamSetup/BazaReklamSetup.vdproj (revision 613)
+++ branches/ReklamaReorganizacja/BazaReklamSetup/BazaReklamSetup.vdproj (revision 616)
@@ -725,6 +725,6 @@
         "Name" = "8:Microsoft Visual Studio"
         "ProductName" = "8:Baza Reklam"
-        "ProductCode" = "8:{E94CA729-B311-4DE5-BF21-DF116210CC02}"
-        "PackageCode" = "8:{724D56E2-C502-4EF3-9B3E-C5044DE7D117}"
+        "ProductCode" = "8:{BA6013D0-CAE4-43E4-9F97-7307F220E75E}"
+        "PackageCode" = "8:{E4AC78AD-7024-43AD-B570-FB80AF2E64DC}"
         "UpgradeCode" = "8:{4E2DBBA4-3139-4790-8DDB-7AADFC963A7D}"
         "RestartWWWService" = "11:FALSE"
@@ -732,5 +732,5 @@
         "DetectNewerInstalledVersion" = "11:TRUE"
         "InstallAllUsers" = "11:TRUE"
-        "ProductVersion" = "8:1.1.6"
+        "ProductVersion" = "8:1.1.7"
         "Manufacturer" = "8:AACT"
         "ARPHELPTELEPHONE" = "8:"
