Zbiór zmian 611
- Data:
- 2009-04-27 10:19:42 (17 years ago)
- Lokalizacja:
- trunk
- Pliki:
-
- 1 dodane
- 12 zmodyfikowane
-
BazaReklam.Updater/FormUpdate.cs (zmodyfikowane) (1 diff)
-
BazaReklam/AddClient.Designer.cs (zmodyfikowane) (1 diff)
-
BazaReklam/AddClient.cs (zmodyfikowane) (1 diff)
-
BazaReklam/Baza Reklam.csproj (zmodyfikowane) (1 diff)
-
BazaReklam/Classes/Helpers/PdfHelper.cs (zmodyfikowane) (1 diff)
-
BazaReklam/Classes/Interfaces/IInvoiceProvider.cs (dodane)
-
BazaReklam/Classes/InvoiceProvider.cs (zmodyfikowane) (1 diff)
-
BazaReklam/Classes/InvoiceProviderFactory.cs (zmodyfikowane) (3 diffs)
-
BazaReklam/Docs/versioninfo.html (zmodyfikowane) (1 diff)
-
BazaReklam/FakturowaniePoznanKatowice.cs (zmodyfikowane) (1 diff)
-
BazaReklam/Properties/AssemblyInfo.cs (zmodyfikowane) (1 diff)
-
BazaReklam/ZamowieniaForm.cs (zmodyfikowane) (11 diffs)
-
BazaReklamSetup/BazaReklamSetup.vdproj (zmodyfikowane) (2 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/BazaReklam.Updater/FormUpdate.cs
r597 r611 99 99 { 100 100 if (_args.Length < 2) 101 throw new Exception("B³êdne wywo³anie programu!");101 throw new ApplicationException("B³êdne wywo³anie programu!"); 102 102 103 103 _isBusy = true; -
trunk/BazaReklam/AddClient.Designer.cs
r597 r611 1050 1050 this.Text = "Dodaj/modyfikuj klienta"; 1051 1051 this.Load += new System.EventHandler(this.AddClient_Load); 1052 this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AddClient_FormClosing); 1052 1053 this.gbAddress.ResumeLayout(false); 1053 1054 this.gbAddress.PerformLayout(); -
trunk/BazaReklam/AddClient.cs
r597 r611 246 246 errorProvider.SetError(txtClientCode, sb.ToString()); 247 247 } 248 249 private void AddClient_FormClosing(object sender, FormClosingEventArgs e) 250 { 251 rEKLAMADataSet.KLIENCI.RejectChanges(); 252 } 248 253 } 249 254 } -
trunk/BazaReklam/Baza Reklam.csproj
r602 r611 114 114 <Compile Include="Classes\Helpers\StringHelper.cs" /> 115 115 <Compile Include="Classes\Helpers\WebRequestHelper.cs" /> 116 <Compile Include="Classes\Interfaces\IInvoiceProvider.cs" /> 116 117 <Compile Include="Classes\Interfaces\IForm.cs" /> 117 118 <Compile Include="Classes\Model\Invoice.cs" /> -
trunk/BazaReklam/Classes/Helpers/PdfHelper.cs
r607 r611 24 24 public bool DisplayPdf() 25 25 { 26 throw new System.Net.WebException("test");27 28 29 26 string url = ConfigurationHelper.GetSettingByKey("Application.Pdf.Date") ?? 30 27 "http://truck.pl/ogloszenia/_getFile.asp?pdfdate,{0},,"; -
trunk/BazaReklam/Classes/InvoiceProvider.cs
r539 r611 1 using Baza_Reklam.Classes.Interfaces; 2 1 3 namespace Baza_Reklam 2 4 { 3 public class InvoiceProvider 5 public class InvoiceProvider : IInvoiceProvider 4 6 { 5 7 private string _city; -
trunk/BazaReklam/Classes/InvoiceProviderFactory.cs
r539 r611 3 3 using System.Data; 4 4 using System.Data.SqlClient; 5 using Baza_Reklam.Classes.Interfaces; 5 6 6 7 namespace Baza_Reklam … … 9 10 { 10 11 private static InvoiceProviderFactory _instance; 11 private readonly List<I nvoiceProvider> _invoiceProviders = new List<InvoiceProvider>();12 private readonly List<IInvoiceProvider> _invoiceProviders = new List<IInvoiceProvider>(); 12 13 13 14 private InvoiceProviderFactory() … … 80 81 } 81 82 82 public static List<I nvoiceProvider> GetInvoiceProviders()83 public static List<IInvoiceProvider> GetInvoiceProviders() 83 84 { 84 85 return Instance._invoiceProviders; 85 86 } 86 87 87 public static I nvoiceProvider GetInvoiceProviderById(int invoiceProviderId)88 public static IInvoiceProvider GetInvoiceProviderById(int invoiceProviderId) 88 89 { 89 90 return 90 91 Instance._invoiceProviders.Find( 91 delegate(I nvoiceProvider invoiceProvider) { return invoiceProvider.Id == invoiceProviderId; });92 delegate(IInvoiceProvider invoiceProvider) { return invoiceProvider.Id == invoiceProviderId; }); 92 93 } 93 94 94 public static List<I nvoiceProvider> GetInvoiceProvidersById(int invoiceProviderId)95 public static List<IInvoiceProvider> GetInvoiceProvidersById(int invoiceProviderId) 95 96 { 96 97 return 97 98 Instance._invoiceProviders.FindAll( 98 delegate(I nvoiceProvider invoiceProvider) { return invoiceProvider.Id == invoiceProviderId; });99 delegate(IInvoiceProvider invoiceProvider) { return invoiceProvider.Id == invoiceProviderId; }); 99 100 } 100 101 } -
trunk/BazaReklam/Docs/versioninfo.html
r604 r611 6 6 <body> 7 7 <h1>Baza reklam - Informacje o wersji</h1> 8 <div> 9 <a id="1.1.6" /> 10 <h2>Wersja 1.1.6 (2009-04-27)</h2> 11 <p>Opis zmian wprowadzonych do wersji 1.1.6</p> 12 <ul> 13 <li>Zgłoszenie #160: Bieżące poprawki na podstawie logu błędów</li> 14 <li>Zgłoszenie #165: Naprawa błędów występujących podczas aktualizacji</li> 15 </ul> 16 </div> 8 17 <div> 9 18 <a id="1.1.5" /> -
trunk/BazaReklam/FakturowaniePoznanKatowice.cs
r602 r611 594 594 if (pozycjeFakturDlaKlientow.Rows.Count == 0 || naglowkiFakturDlaKlientow.Rows.Count == 0) 595 595 { 596 throw new Exception("Nie ma co fakturowaæ"); 596 //TODO: check is there is anythig to invoice before callind that method 597 throw new ApplicationException("Nie ma co fakturowaæ - Poznañ | Katowice"); 597 598 } 598 599 -
trunk/BazaReklam/Properties/AssemblyInfo.cs
r604 r611 30 30 // 31 31 [assembly: AssemblyVersion("1.0.0.0")] 32 [assembly: AssemblyFileVersion("1.1. 5")]32 [assembly: AssemblyFileVersion("1.1.6")] -
trunk/BazaReklam/ZamowieniaForm.cs
r603 r611 6 6 using System.Windows.Forms; 7 7 using Baza_Reklam.Classes.Helpers; 8 using Baza_Reklam.Classes.Interfaces; 8 9 9 10 namespace Baza_Reklam … … 294 295 if (zamowieniaBindingSource.Current == null) return; 295 296 296 if (rEKLAMADataSet.REKLAMA.Rows.Count <= 0) 297 { 298 MessageBox.Show("Proszê dodaæ przynajmniej jedn¹ reklamê do zamówienia.", "Faktura"); 299 return; 300 } 301 302 Cursor = Cursors.WaitCursor; 303 304 DataRowView z = (DataRowView) zamowieniaBindingSource.Current; 305 REKLAMADataSet.zamowieniaRow zamowienie = (REKLAMADataSet.zamowieniaRow) z.Row; 306 307 REKLAMADataSet.KLIENCIRow _klient = 308 (REKLAMADataSet.KLIENCIRow) klienciTableAdapter.GetDataByCustomerId(zamowienie.idKlienta).Rows[0]; 309 string errorMessage = czyMoznaZafakturowac(zamowienie, _klient); 310 311 if (errorMessage != string.Empty) 312 { 313 MessageBox.Show(errorMessage); 297 try 298 { 299 Cursor = Cursors.WaitCursor; 300 301 DataRowView z = (DataRowView) zamowieniaBindingSource.Current; 302 REKLAMADataSet.zamowieniaRow zamowienie = (REKLAMADataSet.zamowieniaRow) z.Row; 303 304 REKLAMADataSet.KLIENCIRow klientRow = 305 (REKLAMADataSet.KLIENCIRow) klienciTableAdapter.GetDataByCustomerId(zamowienie.idKlienta).Rows[0]; 306 307 InitIssueTables(zamowienie); 308 309 string errorMessage = CzyMoznaZafakturowac(zamowienie, klientRow); 310 311 if (errorMessage != string.Empty) 312 { 313 MessageBox.Show(errorMessage, "Fakturowanie"); 314 Cursor = Cursors.Default; 315 return; 316 } 317 318 WystawFakture(zamowienie, klientRow, false); 319 320 RestoreConnections(); 321 322 zamowieniaBindingSource.ResetBindings(false); 323 324 fAKTURYBindingSource.MoveLast(); 325 } 326 finally 327 { 314 328 Cursor = Cursors.Default; 315 return; 316 } 317 318 WystawFakture(zamowienie, _klient, false); 319 320 RestoreConnections(); 321 322 zamowieniaBindingSource.ResetBindings(false); 323 324 fAKTURYBindingSource.MoveLast(); 325 326 Cursor = Cursors.Default; 329 } 327 330 } 328 331 … … 523 526 } 524 527 525 private void PobierzOznaczEmisje(REKLAMADataSet.zamowieniaRow zamowienie, REKLAMADataSet.FAKTURYRow naglowekFaktury) 528 529 private void InitIssueTables(REKLAMADataSet.zamowieniaRow zamowienie) 526 530 { 527 531 emisjeTableAdapter.ClearBeforeFill = false; 528 532 datyWydanTableAdapter.ClearBeforeFill = false; 533 rEKLAMADataSet.UKAZE_SIE_W_NR.Clear(); 534 rEKLAMADataSet.DatyWydan.Clear(); 529 535 530 536 REKLAMADataSet.DatyWydanDataTable t = datyWydanTableAdapter.GetDataByPierwszaEmisjaWZamowieniu(zamowienie.idZamowienia); 531 532 if (t.Rows.Count == 0) 533 { 534 //TODO: moze lepiej uzyc MessageBox'a i return niz wywalac wyjatek...? 535 // wyjatki sa dosc kosztowne dla aplikacji 536 throw new Exception("Nie ma co fakturowaæ!"); 537 } 537 if (t.Rows.Count <= 0) return; 538 538 539 539 DateTime d = t[0].DATA_W; … … 575 575 reklama.EndEdit(); 576 576 } 577 578 if (rEKLAMADataSet.UKAZE_SIE_W_NR.Rows.Count <= 0) 579 throw new ApplicationException("Nie znaleziono ¿adnych emisji do zafakturowania! (" + 580 zamowienie.idZamowienia + ": " + StringHelper.ListToString(adIds, ",") + ")"); 581 577 } 578 579 580 private void PobierzOznaczEmisje(REKLAMADataSet.zamowieniaRow zamowienie, REKLAMADataSet.FAKTURYRow naglowekFaktury) 581 { 582 //InitIssueTables(zamowienie); 582 583 583 584 if (zamowienie.IsdataOstatniejZafakturowanejEmisjiNull()) … … 635 636 { 636 637 SLOWNIKDataSet.AGENCIRow agent = (SLOWNIKDataSet.AGENCIRow)agenciTableAdapter.GetDataByKodAgenta(zamowienie.kodAgenta).Rows[0]; 637 I nvoiceProvider invoiceProvider = InvoiceProviderFactory.GetInvoiceProviderById(agent.InvoiceProviderId);638 IInvoiceProvider invoiceProvider = InvoiceProviderFactory.GetInvoiceProviderById(agent.InvoiceProviderId); 638 639 639 640 … … 709 710 if (kurs.Count == 0) 710 711 { 711 throw new Exception("B³¹d przy pobieraniu kursu waluty.");712 throw new ApplicationException("B³¹d przy pobieraniu kursu waluty."); 712 713 } 713 714 … … 730 731 731 732 732 private string czyMoznaZafakturowac(REKLAMADataSet.zamowieniaRow zamowienie, REKLAMADataSet.KLIENCIRow klientRow)733 private string CzyMoznaZafakturowac(REKLAMADataSet.zamowieniaRow zamowienie, REKLAMADataSet.KLIENCIRow klientRow) 733 734 { 734 735 string errorMessage = string.Empty; … … 738 739 errorMessage += zamowienie.IsidKontaNull() ? "Nie wybrano konta. \n" : ""; 739 740 errorMessage += zamowienie.IssposobZaplatyNull() ? "Nie wybrano sposobu zap³aty. \n" : ""; 740 errorMessage += klientRow.IsCountryNull() || klientRow.Country == string.Empty? "Brak pañstwa klienta. \n" : "";741 errorMessage += klientRow.IsAdres_FkaturaNull() || klientRow.Adres_Fkatura == string.Empty? "Brak adresu faktury klienta. \n" : "";742 errorMessage += klientRow.IsNipNull() || klientRow.Nip == string.Empty? "Brak nipu klienta. \n" : "";741 errorMessage += string.IsNullOrEmpty(klientRow.Country) ? "Brak pañstwa klienta. \n" : ""; 742 errorMessage += string.IsNullOrEmpty(klientRow.Adres_Fkatura) ? "Brak adresu faktury klienta. \n" : ""; 743 errorMessage += string.IsNullOrEmpty(klientRow.Nip) ? "Brak nipu klienta. \n" : ""; 743 744 744 745 if (klientRow.Country != "Polska") 745 { 746 errorMessage += klientRow.IsnipKrajNull() || klientRow.nipKraj == string.Empty ? "Brak symbolu kraju w nipie klienta. \n" : ""; 746 errorMessage += string.IsNullOrEmpty(klientRow.nipKraj) ? "Brak symbolu kraju w nipie klienta. \n" : ""; 747 748 if (rEKLAMADataSet.REKLAMA.Rows.Count <= 0) 749 { 750 // try to load the ads once again in case something went wrong before... 751 rEKLAMATableAdapter.FillByIdZamowienia(rEKLAMADataSet.REKLAMA, zamowienie.idZamowienia); 752 753 if (rEKLAMADataSet.REKLAMA.Rows.Count <= 0) 754 errorMessage += "Proszê dodaæ przynajmniej jedn¹ reklamê do zamówienia \n"; 747 755 } 748 756 749 757 if (rEKLAMADataSet.REKLAMA.Select("[ZATWIERDZONO DO DRUKU] = 0").Length > 0) 750 {751 758 errorMessage += "W zamówieniu s¹ reklamy niezatwierdzone do druku \n"; 752 } 759 760 if (errorMessage.Length > 0) 761 return errorMessage; 762 763 if (rEKLAMADataSet.UKAZE_SIE_W_NR.Rows.Count <= 0) 764 { 765 errorMessage += "Nie znaleziono ¿adnych emisji do zafakturowania \n"; 766 return errorMessage; 767 } 768 769 REKLAMADataSet.DatyWydanDataTable t = datyWydanTableAdapter.GetDataByPierwszaEmisjaWZamowieniu(zamowienie.idZamowienia); 770 if (t.Rows.Count == 0) 771 errorMessage += "Nie znaleziono ¿adnych emisji do zafakturowania \n"; 753 772 754 773 return errorMessage; … … 1359 1378 if (zamowieniaBindingSource.Current == null) return; 1360 1379 1361 if (rEKLAMADataSet.REKLAMA.Rows.Count <= 0)1362 {1363 MessageBox.Show("Proszê dodaæ przynajmniej jedn¹ reklamê do zamówienia.", "Faktura proforma");1364 return;1365 }1366 1367 1380 Cursor = Cursors.WaitCursor; 1368 1381 … … 1372 1385 REKLAMADataSet.KLIENCIRow _klient = 1373 1386 (REKLAMADataSet.KLIENCIRow) klienciTableAdapter.GetDataByCustomerId(zamowienie.idKlienta).Rows[0]; 1374 string errorMessage = czyMoznaZafakturowac(zamowienie, _klient); 1387 1388 InitIssueTables(zamowienie); 1389 1390 string errorMessage = CzyMoznaZafakturowac(zamowienie, _klient); 1375 1391 1376 1392 if (errorMessage != string.Empty) 1377 1393 { 1378 MessageBox.Show(errorMessage );1394 MessageBox.Show(errorMessage, "Fakturowanie - Proforma"); 1379 1395 Cursor = Cursors.Default; 1380 1396 return; … … 1391 1407 { 1392 1408 DataRow[] rows = rEKLAMADataSet.FAKTURY.Select("id_faktury=" + id); 1393 usunFakture((REKLAMADataSet.FAKTURYRow) rows[0]); 1409 if (rows.Length > 0) 1410 usunFakture((REKLAMADataSet.FAKTURYRow) rows[0]); 1411 1394 1412 RestoreConnections(); 1395 1413 Cursor = Cursors.Default; -
trunk/BazaReklamSetup/BazaReklamSetup.vdproj
r609 r611 725 725 "Name" = "8:Microsoft Visual Studio" 726 726 "ProductName" = "8:Baza Reklam" 727 "ProductCode" = "8:{ DE903920-0572-4BA7-8623-E07D2868A25C}"728 "PackageCode" = "8:{ 0E35FC2A-8DC5-4E25-8EF4-041C314C5E0B}"727 "ProductCode" = "8:{E94CA729-B311-4DE5-BF21-DF116210CC02}" 728 "PackageCode" = "8:{724D56E2-C502-4EF3-9B3E-C5044DE7D117}" 729 729 "UpgradeCode" = "8:{4E2DBBA4-3139-4790-8DDB-7AADFC963A7D}" 730 730 "RestartWWWService" = "11:FALSE" … … 732 732 "DetectNewerInstalledVersion" = "11:TRUE" 733 733 "InstallAllUsers" = "11:TRUE" 734 "ProductVersion" = "8:1.1. 5"734 "ProductVersion" = "8:1.1.6" 735 735 "Manufacturer" = "8:AACT" 736 736 "ARPHELPTELEPHONE" = "8:"
