Zbiór zmian 616

Pokaż
Ignoruj:
Data:
2009-04-27 16:58:32 (17 years ago)
Autor:
marek
Opis:

re #165 - merged with latest trunk

Lokalizacja:
branches/ReklamaReorganizacja
Pliki:
9 zmodyfikowane
9 skopiowane

Legenda:

Bez zmian
Dodane
Usunięte
  • branches/ReklamaReorganizacja/BazaReklam/AddClient.Designer.cs

    r613 r616  
    9090            this.krsLabel = new System.Windows.Forms.Label(); 
    9191            this.cbUserName = new System.Windows.Forms.ComboBox(); 
    92             this.agenciBindingSource = new System.Windows.Forms.BindingSource(this.components); 
    9392            this.cbActive = new System.Windows.Forms.CheckBox(); 
    9493            this.txtKrs = new System.Windows.Forms.TextBox(); 
    9594            this.regonLabel = new System.Windows.Forms.Label(); 
    9695            this.txtRegon = new System.Windows.Forms.TextBox(); 
     96            this.agenciBindingSource = new System.Windows.Forms.BindingSource(this.components); 
    9797            this.btnSave = new System.Windows.Forms.Button(); 
    9898            this.btnCancel = new System.Windows.Forms.Button(); 
     
    177177            this.cbState.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.clientsBindingSource, "State", true)); 
    178178            this.cbState.FormattingEnabled = true; 
    179             this.cbState.Items.AddRange(new object[] { 
    180             "dolnoœl¹skie ", 
    181             "kujawsko-pomorskie", 
    182             "lubelskie ", 
    183             "lubuskie", 
    184             "³ódzkie", 
    185             "ma³opolskie", 
    186             "mazowieckie", 
    187             "opolskie", 
    188             "podkarpackie", 
    189             "podlaskie", 
    190             "pomorskie", 
    191             "œl¹skie", 
    192             "œwiêtokrzyskie", 
    193             "warmiñsko-mazurskie", 
    194             "wielkopolskie", 
    195             "zachodniopomorskie"}); 
    196179            this.cbState.Location = new System.Drawing.Point(148, 109); 
    197180            this.cbState.Name = "cbState"; 
     
    214197            this.cbCountry.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 
    215198            this.cbCountry.FormattingEnabled = true; 
    216             this.cbCountry.Items.AddRange(new object[] { 
    217             "Abchazja", 
    218             "Afganistan", 
    219             "Albania", 
    220             "Algieria", 
    221             "Andora", 
    222             "Angola", 
    223             "Antigua i Barbuda", 
    224             "Arabia Saudyjska", 
    225             "Argentyna", 
    226             "Armenia", 
    227             "Australia", 
    228             "Austria", 
    229             "Azerbejd¿an", 
    230             "Bahamy", 
    231             "Bahrajn", 
    232             "Bangladesz", 
    233             "Barbados", 
    234             "Belgia", 
    235             "Belize", 
    236             "Benin", 
    237             "Bhutan", 
    238             "Bia³oruœ", 
    239             "Birma", 
    240             "Boliwia", 
    241             "Boœnia i Hercegowina", 
    242             "Botswana", 
    243             "Brazylia", 
    244             "Brunei", 
    245             "Bu³garia", 
    246             "Burkina Faso", 
    247             "Burundi", 
    248             "Chile", 
    249             "Chiny", 
    250             "Chorwacja", 
    251             "Cypr", 
    252             "Cypr Pó³nocny", 
    253             "Czad", 
    254             "Czarnogóra", 
    255             "Czechy", 
    256             "Dania", 
    257             "Demokratyczna Republika Konga", 
    258             "Dominika", 
    259             "Dominikana", 
    260             "D¿ibuti", 
    261             "Egipt", 
    262             "Ekwador", 
    263             "Erytrea", 
    264             "Estonia", 
    265             "Etiopia", 
    266             "Fid¿i", 
    267             "Filipiny", 
    268             "Finlandia", 
    269             "Francja", 
    270             "Gabon", 
    271             "Gambia", 
    272             "Ghana", 
    273             "Górski Karabach", 
    274             "Grecja", 
    275             "Grenada", 
    276             "Gruzja", 
    277             "Gujana", 
    278             "Gwatemala", 
    279             "Gwinea", 
    280             "Gwinea Bissau", 
    281             "Gwinea Równikowa", 
    282             "Haiti", 
    283             "Hiszpania", 
    284             "Holandia", 
    285             "Honduras", 
    286             "Indie", 
    287             "Indonezja", 
    288             "Irak", 
    289             "Iran", 
    290             "Irlandia", 
    291             "Irlandia Pó³nocna", 
    292             "Islandia", 
    293             "Izrael", 
    294             "Jamajka", 
    295             "Japonia", 
    296             "Jemen", 
    297             "Jordania", 
    298             "Kambod¿a", 
    299             "Kamerun", 
    300             "Kanada", 
    301             "Katar", 
    302             "Kazachstan", 
    303             "Kenia", 
    304             "Kirgistan", 
    305             "Kiribati", 
    306             "Kolumbia", 
    307             "Komory", 
    308             "Kongo", 
    309             "Korea Po³udniowa", 
    310             "Korea Pó³nocna", 
    311             "Kostaryka", 
    312             "Kuba", 
    313             "Kuwejt", 
    314             "Laos", 
    315             "Lesotho", 
    316             "Liban", 
    317             "Liberia", 
    318             "Libia", 
    319             "Liechtenstein", 
    320             "Litwa", 
    321             "Luksemburg", 
    322             "£otwa", 
    323             "Macedonia", 
    324             "Madagaskar", 
    325             "Malawi", 
    326             "Malediwy", 
    327             "Malezja", 
    328             "Mali", 
    329             "Malta", 
    330             "Maroko", 
    331             "Mauretania", 
    332             "Mauritius", 
    333             "Meksyk", 
    334             "Mikronezja", 
    335             "Mo³dawia", 
    336             "Monako", 
    337             "Mongolia", 
    338             "Mozambik", 
    339             "Naddniestrze", 
    340             "Namibia", 
    341             "Nauru", 
    342             "Nepal", 
    343             "Niemcy", 
    344             "Niger", 
    345             "Nigeria", 
    346             "Nikaragua", 
    347             "Norwegia", 
    348             "Nowa Zelandia", 
    349             "Oman", 
    350             "Osetia Po³udniowa", 
    351             "Pakistan", 
    352             "Palau", 
    353             "Palestyna", 
    354             "Panama", 
    355             "Papua-Nowa Gwinea", 
    356             "Paragwaj", 
    357             "Peru", 
    358             "Polska", 
    359             "Portugalia", 
    360             "Portoryko", 
    361             "Republika Po³udniowej Afryki", 
    362             "Republika Œrodkowoafrykañska", 
    363             "Republika Zielonego Przyl¹dka", 
    364             "Rosja", 
    365             "Rumunia", 
    366             "Rwanda", 
    367             "Sahara Zachodnia", 
    368             "Saint Kitts i Nevis", 
    369             "Saint Lucia", 
    370             "Saint Vincent i Grenadyny", 
    371             "Salwador", 
    372             "Samoa", 
    373             "San Marino", 
    374             "Senegal", 
    375             "Serbia", 
    376             "Seszele", 
    377             "Sierra Leone", 
    378             "Singapur", 
    379             "S³owacja", 
    380             "S³owenia", 
    381             "Somalia", 
    382             "Somaliland", 
    383             "Sri Lanka", 
    384             "Stany Zjednoczone", 
    385             "Suazi", 
    386             "Sudan", 
    387             "Surinam", 
    388             "Syria", 
    389             "Szwajcaria", 
    390             "Szwecja", 
    391             "Tad¿ykistan", 
    392             "Tajlandia", 
    393             "Tajwan", 
    394             "Tanzania", 
    395             "Timor Wschodni", 
    396             "Togo", 
    397             "Tonga", 
    398             "Trynidad i Tobago", 
    399             "Tunezja", 
    400             "Turcja", 
    401             "Turkmenistan", 
    402             "Tuvalu", 
    403             "Uganda", 
    404             "Ukraina", 
    405             "Urugwaj", 
    406             "Uzbekistan", 
    407             "Vanuatu", 
    408             "Watykan", 
    409             "Wenezuela", 
    410             "Wêgry", 
    411             "Wielka Brytania", 
    412             "Wietnam", 
    413             "W³ochy", 
    414             "Wybrze¿e Koœci S³oniowej", 
    415             "Wyspy Marshalla", 
    416             "Wyspy Salomona", 
    417             "Wyspy Œwiêtego Tomasza i Ksi¹¿êca", 
    418             "Zambia", 
    419             "Zimbabwe", 
    420             "Zjednoczone Emiraty Arabskie"}); 
    421199            this.cbCountry.Location = new System.Drawing.Point(148, 148); 
    422200            this.cbCountry.Name = "cbCountry"; 
     
    888666            // cbAgentExpo 
    889667            //  
    890             this.cbAgentExpo.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.clientsBindingSource, "AgentExpo", true)); 
    891             this.cbAgentExpo.DataSource = this.agenciExpoBindingSource; 
    892             this.cbAgentExpo.DisplayMember = "Symbol"; 
     668            this.cbAgentExpo.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.clientsBindingSource, "AgentExpo", true)); 
    893669            this.cbAgentExpo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 
    894670            this.cbAgentExpo.FormattingEnabled = true; 
     
    897673            this.cbAgentExpo.Size = new System.Drawing.Size(118, 21); 
    898674            this.cbAgentExpo.TabIndex = 26; 
    899             this.cbAgentExpo.ValueMember = "Symbol"; 
    900675            //  
    901676            // agenciExpoBindingSource 
     
    920695            // cbUserName 
    921696            //  
    922             this.cbUserName.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.clientsBindingSource, "UserName", true)); 
    923             this.cbUserName.DataSource = this.agenciBindingSource; 
    924             this.cbUserName.DisplayMember = "Symbol"; 
     697            this.cbUserName.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.clientsBindingSource, "UserName", true)); 
    925698            this.cbUserName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 
    926699            this.cbUserName.FormattingEnabled = true; 
     
    929702            this.cbUserName.Size = new System.Drawing.Size(117, 21); 
    930703            this.cbUserName.TabIndex = 25; 
    931             this.cbUserName.ValueMember = "Symbol"; 
    932             //  
    933             // agenciBindingSource 
    934             //  
    935             this.agenciBindingSource.DataMember = "AGENCI"; 
    936             this.agenciBindingSource.DataSource = this.sLOWNIKDataSet; 
    937704            //  
    938705            // cbActive 
     
    972739            this.txtRegon.Size = new System.Drawing.Size(232, 20); 
    973740            this.txtRegon.TabIndex = 21; 
     741            //  
     742            // agenciBindingSource 
     743            //  
     744            this.agenciBindingSource.DataMember = "AGENCI"; 
     745            this.agenciBindingSource.DataSource = this.sLOWNIKDataSet; 
    974746            //  
    975747            // btnSave 
     
    1034806            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 
    1035807            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 
     808            this.CausesValidation = false; 
    1036809            this.ClientSize = new System.Drawing.Size(649, 533); 
     810            this.ControlBox = false; 
    1037811            this.Controls.Add(this.label1); 
    1038812            this.Controls.Add(this.txtNote); 
     
    1043817            this.Controls.Add(this.gbContact); 
    1044818            this.Controls.Add(this.gbAddress); 
     819            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 
    1045820            this.MaximizeBox = false; 
    1046821            this.MinimizeBox = false; 
     
    1050825            this.Text = "Dodaj/modyfikuj klienta"; 
    1051826            this.Load += new System.EventHandler(this.AddClient_Load); 
    1052             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AddClient_FormClosing); 
    1053827            this.gbAddress.ResumeLayout(false); 
    1054828            this.gbAddress.PerformLayout(); 
  • branches/ReklamaReorganizacja/BazaReklam/AddClient.cs

    r613 r616  
    66using System.Windows.Forms; 
    77using Baza_Reklam.Classes.Helpers; 
     8using Baza_Reklam.Classes.Model; 
     9using Baza_Reklam.Classes.Repositories; 
    810 
    911namespace Baza_Reklam 
     
    1315        private readonly int _clientId; 
    1416        private REKLAMADataSet.KLIENCIRow _client; 
    15  
    16         protected REKLAMADataSet.KLIENCIRow Client 
     17        private bool _reload; 
     18 
     19        public REKLAMADataSet.KLIENCIRow Client 
    1720        { 
    1821            get { return _client; } 
    1922        } 
    2023 
    21         public AddClient(BindingSource bindingSource) 
     24        public bool Reload 
     25        { 
     26            get { return _reload; } 
     27            set { _reload = value; } 
     28        } 
     29 
     30        public AddClient() 
    2231        { 
    2332            InitializeComponent(); 
    24             rEKLAMADataSet = (REKLAMADataSet)bindingSource.DataSource; 
    25             clientsBindingSource = bindingSource; 
     33            Init(); 
    2634        } 
    2735 
     
    3240            clientsBindingSource = bindingSource; 
    3341            _clientId = clientId; 
    34         } 
    35  
    36         private void AddClient_Load(object sender, EventArgs e) 
    37         { 
    38             bool update = false; 
     42             
    3943            // rebind controls to use passed binding source 
    4044            ReBindControls(this, clientsBindingSource); 
     45             
     46            Init(); 
     47        } 
     48 
     49        private void Init() 
     50        { 
    4151            LoadTitleList(); 
    42  
    43             agenciTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    4452            clientsAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    4553            clientTitlesAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    46             //TODO: try to display only active agents... 
    47             agenciTableAdapter.Fill(sLOWNIKDataSet.AGENCI); 
    48             //agenciTableAdapter.FillByAktywny(sLOWNIKDataSet.AGENCI); 
    49  
     54 
     55            BindComboBox(CountryRepository.FindAll(), cbCountry); 
     56            cbCountry.DisplayMember = "Name"; 
     57            cbCountry.ValueMember = "Name"; 
     58 
     59            BindComboBox(StateRepository.FindAll(), cbState); 
     60            cbState.DisplayMember = "Name"; 
     61            cbState.ValueMember = "Name"; 
     62 
     63            BindComboBox(new AgentRepository().FindAllActive(), cbUserName); 
     64            cbUserName.DisplayMember = "LoginName"; 
     65            cbUserName.ValueMember = "LoginName"; 
     66 
     67            BindComboBox(new AgentRepository().FindAllActive(), cbAgentExpo); 
     68            cbAgentExpo.DisplayMember = "LoginName"; 
     69            cbAgentExpo.ValueMember = "LoginName"; 
     70        } 
     71 
     72        private void AddClient_Load(object sender, EventArgs e) 
     73        { 
     74            Reload = false; 
     75            bool update = false; 
    5076            if (_clientId == 0) // add new client 
    5177            { 
     
    6995            } 
    7096 
    71             SetUserNameAndAgentExpo(_client); 
     97            SetStateUserNameAndAgentExpo(_client, update); 
    7298 
    7399            SetFormCaption(update); 
     
    89115        } 
    90116 
    91         private void SetUserNameAndAgentExpo(REKLAMADataSet.KLIENCIRow client) 
    92         { 
    93             cbUserName.SelectedIndex = cbUserName.FindString(client.UserName); 
    94             cbAgentExpo.SelectedIndex = cbAgentExpo.FindString(client.AgentExpo); 
    95  
    96             //TODO: try to display only active agents... 
    97             //if (cbUserName.SelectedIndex == -1) 
    98             //{ 
    99             //    int index = cbUserName.Items.Add(client.UserName); 
    100             //    cbUserName.SelectedIndex = index; 
    101             //} 
    102  
    103             //if (cbAgentExpo.SelectedIndex == -1) 
    104             //{ 
    105             //    int index = cbAgentExpo.Items.Add(client.AgentExpo); 
    106             //    cbAgentExpo.SelectedIndex = index; 
    107             //} 
    108  
    109             //if (User.Instance().St_kierownik) 
    110             //{ 
    111             //    cbUserName.Enabled = User.Instance().UserAgencyList.Contains(DbUtils.idAgencji(client.UserName)); 
    112             //    cbAgentExpo.Enabled = User.Instance().UserAgencyList.Contains(DbUtils.idAgencji(client.AgentExpo)); 
    113             //} 
    114             //else 
    115             //{ 
    116             //    cbUserName.Enabled = client.UserName.Trim().ToLower() == User.Instance().Symbol_agenta.Trim().ToLower(); 
    117             //    cbAgentExpo.Enabled = client.AgentExpo.Trim().ToLower() == User.Instance().Symbol_agenta.Trim().ToLower(); 
    118             //} 
     117        private void SetStateUserNameAndAgentExpo(REKLAMADataSet.KLIENCIRow client, bool update) 
     118        { 
     119            if (update) 
     120            { 
     121                if (!client.IsStateNull()) 
     122                { 
     123                    int stateIndex = cbState.FindString(client.State); 
     124                    if (stateIndex < 0) 
     125                    { 
     126                        cbState.Items.Insert(0, new State(client.State)); 
     127                        cbState.SelectedIndex = 0; 
     128                    } 
     129                } 
     130 
     131                int userNameIndex = cbUserName.FindString(client.UserName); 
     132                if (userNameIndex < 0) 
     133                    cbUserName.Items.Insert(0, new Agent(client.UserName.Trim().ToLower())); 
     134 
     135                int agentExpoIndex = cbAgentExpo.FindString(client.AgentExpo); 
     136                if (agentExpoIndex < 0) 
     137                    cbAgentExpo.Items.Insert(0, new Agent(client.AgentExpo.Trim().ToLower())); 
     138            } 
     139 
     140            cbUserName.SelectedIndex = cbUserName.FindString(client.UserName.Trim().ToLower()); 
     141            cbAgentExpo.SelectedIndex = cbAgentExpo.FindString(client.AgentExpo.Trim().ToLower()); 
    119142 
    120143            cbUserName.Enabled = (DbUtils.idAgencji(client.UserName) == User.Instance().IdAgencji); 
     
    165188                clientsAdapter.Update(rEKLAMADataSet.KLIENCI); 
    166189                Cursor = Cursors.Default; 
     190                Reload = true; 
    167191                Close(); 
    168192                return; 
    169193            } 
    170  
     194            Reload = false; 
    171195            MessageBox.Show("Proszê wprowadziæ wszystkie wymagane dane."); 
    172196        } 
     
    247271        } 
    248272 
    249         private void AddClient_FormClosing(object sender, FormClosingEventArgs e) 
    250         { 
    251             rEKLAMADataSet.KLIENCI.RejectChanges(); 
     273        void BindComboBox<T>(IEnumerable<T> list, ComboBox comboBox) 
     274        { 
     275            comboBox.Items.Clear(); 
     276            foreach (T item in list) 
     277            { 
     278                comboBox.Items.Add(item); 
     279            } 
    252280        } 
    253281    } 
  • branches/ReklamaReorganizacja/BazaReklam/AddClient.resx

    r601 r616  
    130130    <value>153, 17</value> 
    131131  </metadata> 
     132  <metadata name="clientsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     133    <value>153, 17</value> 
     134  </metadata> 
    132135  <metadata name="rEKLAMADataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
    133136    <value>17, 17</value> 
     137  </metadata> 
     138  <metadata name="rEKLAMADataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     139    <value>17, 17</value> 
     140  </metadata> 
     141  <metadata name="clientTitlesBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     142    <value>1051, 17</value> 
    134143  </metadata> 
    135144  <metadata name="clientTitlesBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     
    198207    <value>429, 17</value> 
    199208  </metadata> 
     209  <metadata name="sLOWNIKDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     210    <value>429, 17</value> 
     211  </metadata> 
    200212  <metadata name="agenciBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
    201213    <value>567, 17</value> 
  • branches/ReklamaReorganizacja/BazaReklam/Baza Reklam.csproj

    r613 r616  
    116116    <Compile Include="Classes\Interfaces\IInvoiceProvider.cs" /> 
    117117    <Compile Include="Classes\Interfaces\IForm.cs" /> 
     118    <Compile Include="Classes\Model\Agent.cs" /> 
     119    <Compile Include="Classes\Model\Country.cs" /> 
    118120    <Compile Include="Classes\Model\Invoice.cs" /> 
    119121    <Compile Include="Classes\InvoiceProvider.cs" /> 
     
    122124    <Compile Include="Classes\Global.cs" /> 
    123125    <Compile Include="Classes\Logger.cs" /> 
     126    <Compile Include="Classes\Model\State.cs" /> 
    124127    <Compile Include="Classes\Model\UserAgency.cs" /> 
    125128    <Compile Include="Classes\PrintDGV.cs" /> 
    126129    <Compile Include="Classes\Produkcja.cs" /> 
    127130    <Compile Include="Classes\Helpers\ReklamaHelper.cs" /> 
     131    <Compile Include="Classes\Repositories\AgentRepository.cs" /> 
     132    <Compile Include="Classes\Repositories\CountryRepository.cs" /> 
     133    <Compile Include="Classes\Repositories\IRepository.cs" /> 
     134    <Compile Include="Classes\Repositories\Repository.cs" /> 
     135    <Compile Include="Classes\Repositories\StateRepository.cs" /> 
    128136    <Compile Include="Classes\Repositories\UserAgencyRepository.cs" /> 
    129137    <Compile Include="Classes\User.cs" /> 
  • branches/ReklamaReorganizacja/BazaReklam/ClientsForm.Designer.cs

    r601 r616  
    40564056            //  
    40574057            this.dodajToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 
    4058             this.dodajToolStripButton.Enabled = false; 
    40594058            this.dodajToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("dodajToolStripButton.Image"))); 
    40604059            this.dodajToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; 
     
    40674066            //  
    40684067            this.btnEditClient.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 
    4069             this.btnEditClient.Enabled = false; 
    40704068            this.btnEditClient.Image = ((System.Drawing.Image)(resources.GetObject("btnEditClient.Image"))); 
    40714069            this.btnEditClient.ImageTransparentColor = System.Drawing.Color.Magenta; 
  • branches/ReklamaReorganizacja/BazaReklam/ClientsForm.cs

    r613 r616  
    204204            if (tabs.SelectedTab.Name != "daneKlientaTab") 
    205205            { 
    206                 dodajToolStripButton.Enabled = false; 
    207206                zapiszDaneToolStripButton.Enabled = false; 
    208207                usunToolStripButton.Enabled = false; 
    209                 btnEditClient.Enabled = false; 
    210208            } 
    211209            else 
    212210            { 
    213                 dodajToolStripButton.Enabled = true; 
    214211                zapiszDaneToolStripButton.Enabled = true; 
    215212                usunToolStripButton.Enabled = true; 
    216                 btnEditClient.Enabled = kLIENCIBindingSource.Current != null; 
    217213            } 
    218214 
     
    405401        { 
    406402            if (kLIENCIBindingSource.Current == null) return; 
     403             
     404            const string caption = "Klient - usuwanie klienta"; 
     405 
     406            DialogResult dialogResult = MessageBox.Show("Czy na pewno checsz usun¹æ klienta?", 
     407                                                        caption, 
     408                                                        MessageBoxButtons.YesNo, 
     409                                                        MessageBoxIcon.Question); 
     410             
     411            if (dialogResult != DialogResult.Yes) return; 
     412 
    407413 
    408414            DataRowView row = (DataRowView) kLIENCIBindingSource.Current; 
     
    413419                || kL_KLIENCITableAdapter.GetDataByCustomerId(custId).Count != 0) 
    414420            { 
    415                 if (MessageBox.Show("S¹ inne dane zwi¹zane z klientem! Usun¹æ klienta?", "", MessageBoxButtons.YesNo, 
    416                                     MessageBoxIcon.Question) == DialogResult.Yes) 
     421 
     422                dialogResult = MessageBox.Show("Istniej¹ dane (reklamy, osoby do kontaktu lub klasyfikacja klienta) zwi¹zane z klientem! Usun¹æ klienta?",  
     423                                                caption, 
     424                                               MessageBoxButtons.YesNo, 
     425                                               MessageBoxIcon.Question); 
     426                 
     427                if (dialogResult == DialogResult.Yes) 
    417428                { 
    418429                    kLIENCIBindingSource.RemoveCurrent(); 
    419430                    kLIENCIBindingSource.EndEdit(); 
    420431                    kLIENCITableAdapter.Update(rEKLAMADataSet.KLIENCI); 
    421                     MessageBox.Show("Dane usuniêto"); 
    422432                } 
    423433            } 
     
    427437                kLIENCIBindingSource.EndEdit(); 
    428438                kLIENCITableAdapter.Update(rEKLAMADataSet.KLIENCI); 
    429                 MessageBox.Show("Dane usuniêto"); 
    430439            } 
    431440 
     
    9941003                panel1.Visible = false; 
    9951004                ukryjToolStripButton.ToolTipText = "Poka¿ szczegó³y"; 
    996                 dodajToolStripButton.Enabled = false; 
    997                 btnEditClient.Enabled = false; 
    9981005                usunToolStripButton.Enabled = false; 
    9991006                zapiszDaneToolStripButton.Enabled = false; 
     
    10031010                panel1.Visible = true; 
    10041011                ukryjToolStripButton.ToolTipText = "Ukryj szczegó³y"; 
    1005                 dodajToolStripButton.Enabled = true; 
    1006                 btnEditClient.Enabled = kLIENCIBindingSource.Current != null; 
    10071012                usunToolStripButton.Enabled = true; 
    10081013                zapiszDaneToolStripButton.Enabled = true; 
     
    10171022        private void dodajToolStripButton_Click(object sender, EventArgs e) 
    10181023        { 
    1019             AddClient addClient = new AddClient(kLIENCIBindingSource); 
     1024            AddClient addClient = new AddClient(); 
    10201025            addClient.ShowDialog(); 
    1021             return; 
    1022  
    1023             //if (!ValidateChildren()) 
    1024             //{ 
    1025             //    MessageBox.Show("Proszê uzupe³niæ dane klienta.", "Walidacja danych [dodajToolStripButton_Click]"); 
    1026             //    return; 
    1027             //} 
    1028  
    1029             //dodajKlienta = true; 
    1030  
    1031             //kLIENCIBindingSource.EndEdit(); 
    1032  
    1033             //// pyta o zACHOWANIE zmian przed zalozeniem kolejnego rekordu 
    1034             //REKLAMADataSet.KLIENCIDataTable changes = 
    1035             //  rEKLAMADataSet.KLIENCI.GetChanges(DataRowState.Added | DataRowState.Modified) as REKLAMADataSet.KLIENCIDataTable; 
    1036  
    1037             //if (changes != null) 
    1038             //{ 
    1039             //    if (MessageBox.Show("Czy zapisaæ zmiany?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) 
    1040             //    { 
    1041             //        foreach (DataRow r in changes) 
    1042             //        { 
    1043             //            r["Last_Modify"] = DateTime.Now; 
    1044             //            r["Modify_User"] = User.Instance().Login; 
    1045             //        } 
    1046  
    1047             //        kLIENCITableAdapter.Update(rEKLAMADataSet.KLIENCI); 
    1048             //    } 
    1049             //    else 
    1050             //    { 
    1051             //        rEKLAMADataSet.KLIENCI.RejectChanges(); 
    1052             //        daneKlientaTab.Select(); 
    1053             //    } 
    1054             //} 
    1055  
    1056             ////dodaje nowy rekord 
    1057             //DataView datatable = (DataView)kLIENCIBindingSource.List; 
    1058             //DataRowView row = datatable.AddNew(); 
    1059             //row["Last_Modify"] = DateTime.Now; 
    1060             //row["data"] = DateTime.Now; 
    1061             //// nie dziala, bo trigger w bazie zmienia 
    1062             //row["Modify_User"] = User.Instance().Login; 
    1063             //row["UserName"] = User.Instance().Login; 
    1064             //row["AgentExpo"] = User.Instance().Login; 
    1065  
    1066             //kLIENCIBindingSource.MoveLast(); 
    1067             //kLIENCIBindingSource.EndEdit(); 
    1068             //tabs.SelectedIndex = 0; 
    1069             //countryComboBox.SelectedIndex = -1; 
    1070  
    1071             //groupBox1.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true; 
    1072             //groupBox2.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true; 
    1073             //groupBox3.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true; 
    1074             //groupBox4.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true; 
    1075             //groupBox5.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true; 
    1076             //tabControl1.Enabled = kLIENCIBindingSource.List.Count == 0 ? false : true; 
    1077             //firstNameTextBox.Focus(); 
     1026 
     1027            if (addClient.Reload) 
     1028                pokazKlienta(addClient.Client.CustomerID); 
    10781029        } 
    10791030 
  • branches/ReklamaReorganizacja/BazaReklam/Docs/versioninfo.html

    r613 r616  
    66<body> 
    77   <h1>Baza reklam - Informacje o wersji</h1> 
     8   <div> 
     9        <a id="1.1.7" /> 
     10        <h2>Wersja 1.1.7 (2009-04-28)</h2> 
     11        <p>Opis zmian wprowadzonych do wersji 1.1.7</p> 
     12        <ul> 
     13            <li>Zgłoszenie #160: Bieżące poprawki na podstawie logu błędów: 
     14                <ul> 
     15                    <li>- naprawiono błąd występujący przy usuwaniu klienta</li> 
     16                    <li>- poprawiono dodawanie nowego klienta oraz walidację danych</li> 
     17                </ul> 
     18            </li> 
     19        </ul> 
     20   </div> 
    821   <div> 
    922        <a id="1.1.6" /> 
  • branches/ReklamaReorganizacja/BazaReklam/Properties/AssemblyInfo.cs

    r613 r616  
    3030// 
    3131[assembly: AssemblyVersion("1.0.0.0")] 
    32 [assembly: AssemblyFileVersion("1.1.6")] 
     32[assembly: AssemblyFileVersion("1.1.7")] 
  • branches/ReklamaReorganizacja/BazaReklamSetup/BazaReklamSetup.vdproj

    r613 r616  
    725725        "Name" = "8:Microsoft Visual Studio" 
    726726        "ProductName" = "8:Baza Reklam" 
    727         "ProductCode" = "8:{E94CA729-B311-4DE5-BF21-DF116210CC02}" 
    728         "PackageCode" = "8:{724D56E2-C502-4EF3-9B3E-C5044DE7D117}" 
     727        "ProductCode" = "8:{BA6013D0-CAE4-43E4-9F97-7307F220E75E}" 
     728        "PackageCode" = "8:{E4AC78AD-7024-43AD-B570-FB80AF2E64DC}" 
    729729        "UpgradeCode" = "8:{4E2DBBA4-3139-4790-8DDB-7AADFC963A7D}" 
    730730        "RestartWWWService" = "11:FALSE" 
     
    732732        "DetectNewerInstalledVersion" = "11:TRUE" 
    733733        "InstallAllUsers" = "11:TRUE" 
    734         "ProductVersion" = "8:1.1.6" 
     734        "ProductVersion" = "8:1.1.7" 
    735735        "Manufacturer" = "8:AACT" 
    736736        "ARPHELPTELEPHONE" = "8:"