Zbiór zmian 613 dla branches/ReklamaReorganizacja
- Data:
- 2009-04-27 11:12:42 (17 years ago)
- Lokalizacja:
- branches/ReklamaReorganizacja
- Pliki:
-
- 7 usunięte
- 28 zmodyfikowane
- 9 skopiowane
-
BazaReklam.Updater (skopiowane) (skopiowane from trunk/BazaReklam.Updater)
-
BazaReklam.sln (zmodyfikowane) (1 diff)
-
BazaReklam/AddClient.Designer.cs (zmodyfikowane) (1 diff)
-
BazaReklam/AddClient.cs (zmodyfikowane) (1 diff)
-
BazaReklam/AddZamowienieForm.cs (zmodyfikowane) (1 diff)
-
BazaReklam/Baza Reklam.csproj (zmodyfikowane) (2 diffs)
-
BazaReklam/Classes/DbUtils.cs (zmodyfikowane) (3 diffs)
-
BazaReklam/Classes/ExcelHelper.cs (usunięte)
-
BazaReklam/Classes/FakturaHelper.cs (usunięte)
-
BazaReklam/Classes/Helpers/ExcelHelper.cs (skopiowane) (skopiowane from trunk/BazaReklam/Classes/Helpers/ExcelHelper.cs)
-
BazaReklam/Classes/Helpers/FakturaHelper.cs (skopiowane) (skopiowane from trunk/BazaReklam/Classes/Helpers/FakturaHelper.cs)
-
BazaReklam/Classes/Helpers/PdfHelper.cs (zmodyfikowane) (3 diffs)
-
BazaReklam/Classes/Helpers/ReklamaHelper.cs (skopiowane) (skopiowane from trunk/BazaReklam/Classes/Helpers/ReklamaHelper.cs)
-
BazaReklam/Classes/Helpers/VatHelper.cs (skopiowane) (skopiowane from trunk/BazaReklam/Classes/Helpers/VatHelper.cs)
-
BazaReklam/Classes/Helpers/WordHelper.cs (skopiowane) (skopiowane from trunk/BazaReklam/Classes/Helpers/WordHelper.cs)
-
BazaReklam/Classes/Helpers/ZamowienieHelper.cs (skopiowane) (skopiowane from trunk/BazaReklam/Classes/Helpers/ZamowienieHelper.cs)
-
BazaReklam/Classes/Interfaces/IInvoiceProvider.cs (skopiowane) (skopiowane from trunk/BazaReklam/Classes/Interfaces/IInvoiceProvider.cs)
-
BazaReklam/Classes/InvoiceProvider.cs (zmodyfikowane) (1 diff)
-
BazaReklam/Classes/InvoiceProviderFactory.cs (zmodyfikowane) (3 diffs)
-
BazaReklam/Classes/ReklamaHelper.cs (usunięte)
-
BazaReklam/Classes/VatHelper.cs (usunięte)
-
BazaReklam/Classes/WordHandler.cs (usunięte)
-
BazaReklam/Classes/ZamowienieHelper.cs (usunięte)
-
BazaReklam/ClientsForm.cs (zmodyfikowane) (2 diffs)
-
BazaReklam/Docs/versioninfo.html (zmodyfikowane) (1 diff)
-
BazaReklam/Facturer.cs (zmodyfikowane) (2 diffs)
-
BazaReklam/FacturesForm.cs (zmodyfikowane) (1 diff)
-
BazaReklam/FacturesFormNEW.cs (zmodyfikowane) (1 diff)
-
BazaReklam/FakturowaniePoznanKatowice.cs (zmodyfikowane) (4 diffs)
-
BazaReklam/FormBadVer.cs (zmodyfikowane) (3 diffs)
-
BazaReklam/InfoForm.cs (zmodyfikowane) (1 diff)
-
BazaReklam/KorektyForm.cs (zmodyfikowane) (1 diff)
-
BazaReklam/ListaReklamNaWydanieForm.cs (zmodyfikowane) (2 diffs)
-
BazaReklam/OferForm.cs (zmodyfikowane) (2 diffs)
-
BazaReklam/OrderDetails.cs (zmodyfikowane) (1 diff)
-
BazaReklam/OrdersForm.cs (zmodyfikowane) (2 diffs)
-
BazaReklam/ProductionForm.cs (zmodyfikowane) (1 diff)
-
BazaReklam/Properties/AssemblyInfo.cs (zmodyfikowane) (1 diff)
-
BazaReklam/ZamowieniaForm.cs (zmodyfikowane) (15 diffs)
-
BazaReklam/ZestawienieZamowienForm.cs (zmodyfikowane) (1 diff)
-
BazaReklam/app.config (zmodyfikowane) (1 diff)
-
BazaReklamSetup/BazaReklamSetup.vdproj (zmodyfikowane) (3 diffs)
-
SQL/StoredProcedures/sp_FixExpoInvoices.txt (skopiowane) (skopiowane from trunk/SQL/StoredProcedures/sp_FixExpoInvoices.txt)
-
Updater (usunięte)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
branches/ReklamaReorganizacja/BazaReklam.sln
r601 r613 10 10 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExportToCDN", "TruckExpoCDN\ExportToCDN.csproj", "{E06D8F95-3C3F-4369-A60C-9DFF6703E8A0}" 11 11 EndProject 12 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = " Updater", "Updater\Updater.csproj", "{D79A9AD4-2E15-4A9B-98C9-467B25D47FEA}"12 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BazaReklam.Updater", "BazaReklam.Updater\BazaReklam.Updater.csproj", "{D79A9AD4-2E15-4A9B-98C9-467B25D47FEA}" 13 13 EndProject 14 14 Global -
branches/ReklamaReorganizacja/BazaReklam/AddClient.Designer.cs
r601 r613 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(); -
branches/ReklamaReorganizacja/BazaReklam/AddClient.cs
r601 r613 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 } -
branches/ReklamaReorganizacja/BazaReklam/AddZamowienieForm.cs
r593 r613 38 38 row = (REKLAMADataSet.zamowieniaRow)r.Row; 39 39 40 row.nrZamowienia = DbUtils.numerNowegoZamowienia(idKlienta, DateTime. Today.Year, User.Instance().Kod_agenta);41 row.rokZamowienia = DateTime. Today.Year;40 row.nrZamowienia = DbUtils.numerNowegoZamowienia(idKlienta, DateTime.Now.Year, User.Instance().Kod_agenta); 41 row.rokZamowienia = DateTime.Now.Year; 42 42 row.kodAgenta = User.Instance().Kod_agenta; 43 43 row.idKlienta = idKlienta; -
branches/ReklamaReorganizacja/BazaReklam/Baza Reklam.csproj
r593 r613 108 108 <Compile Include="Classes\DBBindings.cs" /> 109 109 <Compile Include="Classes\EmailSender.cs" /> 110 <Compile Include="Classes\ ExcelHelper.cs" />111 <Compile Include="Classes\ FakturaHelper.cs" />110 <Compile Include="Classes\Helpers\ExcelHelper.cs" /> 111 <Compile Include="Classes\Helpers\FakturaHelper.cs" /> 112 112 <Compile Include="Classes\Helpers\ConfigurationHelper.cs" /> 113 113 <Compile Include="Classes\Helpers\PdfHelper.cs" /> 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" /> … … 124 125 <Compile Include="Classes\PrintDGV.cs" /> 125 126 <Compile Include="Classes\Produkcja.cs" /> 126 <Compile Include="Classes\ ReklamaHelper.cs" />127 <Compile Include="Classes\Helpers\ReklamaHelper.cs" /> 127 128 <Compile Include="Classes\Repositories\UserAgencyRepository.cs" /> 128 129 <Compile Include="Classes\User.cs" /> 129 130 <Compile Include="Classes\DbUtils.cs" /> 130 131 <Compile Include="Classes\Helpers\ValidationHelper.cs" /> 131 <Compile Include="Classes\ VatHelper.cs" />132 <Compile Include="Classes\ WordHandler.cs" />132 <Compile Include="Classes\Helpers\VatHelper.cs" /> 133 <Compile Include="Classes\Helpers\WordHelper.cs" /> 133 134 <Compile Include="Classes\XTGFile.cs" /> 134 <Compile Include="Classes\ ZamowienieHelper.cs" />135 <Compile Include="Classes\Helpers\ZamowienieHelper.cs" /> 135 136 <Compile Include="ClientsForm.cs"> 136 137 <SubType>Form</SubType> -
branches/ReklamaReorganizacja/BazaReklam/Classes/DbUtils.cs
r593 r613 195 195 } 196 196 197 /// <summary> 198 /// Zwraca numer nastêpnej faktury danego agenta. 199 /// </summary> 200 public static int numerNowejFaktury(string tagAgenta, int year) 201 { 202 string query = "SELECT MAX(Numer) FROM Faktury WHERE Korekta=0 AND [Numer_Roz]='" + tagAgenta + "' AND [Numer_Rok]=" + year; 203 204 object nr = ExecuteQuery(query); 205 if (nr is DBNull) return 1; 206 return ((int)nr + 1); 207 } 197 208 198 209 199 … … 273 263 274 264 /// <summary> 275 /// Zwraca numer n owego zamówienia276 /// </summary> 277 public static int numerNowe goZamowienia(int idKlienta, int year, string kodAgenta)278 { 279 string query = "SELECT MAX( nrZamowienia) FROM Zamowienia WHERE idKlienta=" + idKlienta + " AND rokZamowienia=" + year + " AND kodAgenta='" + kodAgenta + "'";265 /// Zwraca numer nastêpnej faktury danego agenta. 266 /// </summary> 267 public static int numerNowejFaktury(string tagAgenta, int year) 268 { 269 string query = "SELECT MAX(Numer) FROM Faktury WHERE Korekta=0 AND [Numer_Roz]='" + tagAgenta + "' AND [Numer_Rok]=" + year; 280 270 281 271 object nr = ExecuteQuery(query); … … 284 274 } 285 275 286 /// <summary> 287 /// Zwraca numer nastêpnej faktury korekty dla danego agenta. 288 /// </summary> 289 public static int numerNowejFakturyKorekty(int year) 290 { 291 string query = "SELECT MAX(Numer) FROM Faktury WHERE Korekta=1 AND [Numer_Rok]=" + year; 276 277 /// <summary> 278 /// Zwraca numer nowego zamówienia 279 /// </summary> 280 public static int numerNowegoZamowienia(int idKlienta, int year, string kodAgenta) 281 { 282 string query = "SELECT MAX(nrZamowienia) FROM Zamowienia WHERE idKlienta=" + idKlienta + " AND rokZamowienia=" + year + " AND kodAgenta='" + kodAgenta + "'"; 292 283 293 284 object nr = ExecuteQuery(query); -
branches/ReklamaReorganizacja/BazaReklam/Classes/Helpers/PdfHelper.cs
r593 r613 3 3 using System.Globalization; 4 4 using System.IO; 5 using System.Windows.Forms; 5 6 6 7 namespace Baza_Reklam.Classes.Helpers … … 33 34 if (!DateTime.TryParse(pdfDate, null, DateTimeStyles.None, out pdfDateTime)) 34 35 { 35 //MessageBox.Show("Nie znaleziono pliku PDF dla wybranej reklamy");36 36 _errorMessage = "Nie znaleziono pliku PDF dla wybranej reklamy"; 37 37 return false; … … 84 84 } 85 85 } 86 87 public static void HandleWebException(Exception exception) 88 { 89 string errorMsg = string.Format("{0}\n\n{1}\n{2}", 90 "Problem z serwerem który dostarcza pliki PDF", 91 "Szczegó³y wyj¹tku:", 92 exception); 93 MessageBox.Show(errorMsg, "Baza Reklam - Podgl¹d PDF", MessageBoxButtons.OK, MessageBoxIcon.Warning); 94 Logger.LogException(exception, User.Instance().Login, DateTime.Now); 95 } 86 96 } 87 97 } -
branches/ReklamaReorganizacja/BazaReklam/Classes/InvoiceProvider.cs
r539 r613 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; -
branches/ReklamaReorganizacja/BazaReklam/Classes/InvoiceProviderFactory.cs
r539 r613 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 } -
branches/ReklamaReorganizacja/BazaReklam/ClientsForm.cs
r601 r613 7 7 using System.IO; 8 8 using System.Text.RegularExpressions; 9 using Baza_Reklam.Classes; 9 10 using Baza_Reklam.Classes.Helpers; 10 11 using Baza_Reklam.Classes.Interfaces; … … 1217 1218 if (!pdfHelper.DisplayPdf()) 1218 1219 MessageBox.Show(pdfHelper.ErrorMessage); 1220 } 1221 catch (System.Net.WebException exception) 1222 { 1223 PdfHelper.HandleWebException(exception); 1219 1224 } 1220 1225 finally -
branches/ReklamaReorganizacja/BazaReklam/Docs/versioninfo.html
r601 r613 5 5 </head> 6 6 <body> 7 <h1>Baza reklam - Informacje o wersji</h1> 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> 17 <div> 18 <a id="1.1.5" /> 19 <h2>Wersja 1.1.5 (2009-04-23)</h2> 20 <p>Opis zmian wprowadzonych do wersji 1.1.5</p> 21 <ul> 22 <li>Zgłoszenie #166: Umożliwić wystawianie korekt do faktur Sam Press</li> 23 </ul> 24 </div> 8 25 <div> 9 26 <a id="1.1.4" /> -
branches/ReklamaReorganizacja/BazaReklam/Facturer.cs
r593 r613 3 3 using System.Data.SqlClient; 4 4 using System.Windows.Forms; 5 using Baza_Reklam.Classes.Helpers; 5 6 6 7 namespace Baza_Reklam … … 764 765 765 766 naglowekKorekty.NUMER_ROZ = faktura.NUMER_ROZ; 766 naglowekKorekty.NUMER = DbUtils.numerNowejFakturyKorekty(DateTime.Today.Year);767 naglowekKorekty.NUMER = FakturaHelper.GetNewCorrectionInvoiceNumber(DateTime.Today.Year, faktura.SystemKsiegowyId); 767 768 naglowekKorekty.NUMER_ROK = DateTime.Today.Year; 768 769 naglowekKorekty.DATA_WYSTAWIENIA = DateTime.Today; -
branches/ReklamaReorganizacja/BazaReklam/FacturesForm.cs
r593 r613 4 4 using System.Data.SqlClient; 5 5 using System.Windows.Forms; 6 using Baza_Reklam.Classes.Helpers; 6 7 using Baza_Reklam.Classes.Interfaces; 7 8 -
branches/ReklamaReorganizacja/BazaReklam/FacturesFormNEW.cs
r593 r613 5 5 using System.Drawing; 6 6 using System.Windows.Forms; 7 using Baza_Reklam.Classes.Helpers; 7 8 using Baza_Reklam.Classes.Interfaces; 8 9 -
branches/ReklamaReorganizacja/BazaReklam/FakturowaniePoznanKatowice.cs
r593 r613 6 6 using System.Globalization; 7 7 using System.Data.SqlClient; 8 using Baza_Reklam.Classes.Helpers; 8 9 using Baza_Reklam.Classes.Model; 9 10 … … 48 49 _agencjaRedakcja = agencjeTableAdapter.GetDataByIdAgencji((int)FakturaHelper.OfficeId.Redakcja)[0]; 49 50 50 _konto = kontaTableAdapter.GetDataById((int)FakturaHelper.BankAccount.CentralaP LN)[0];51 _konto = kontaTableAdapter.GetDataById((int)FakturaHelper.BankAccount.CentralaPln)[0]; 51 52 } 52 53 … … 542 543 543 544 naglowekKorekty.NUMER_ROZ = faktura.NUMER_ROZ; 544 naglowekKorekty.NUMER = DbUtils.numerNowejFakturyKorekty(DateTime.Today.Year);545 naglowekKorekty.NUMER = FakturaHelper.GetNewCorrectionInvoiceNumber(DateTime.Today.Year, faktura.SystemKsiegowyId); 545 546 naglowekKorekty.NUMER_ROK = DateTime.Today.Year; 546 547 naglowekKorekty.DATA_WYSTAWIENIA = DateTime.Today; … … 593 594 if (pozycjeFakturDlaKlientow.Rows.Count == 0 || naglowkiFakturDlaKlientow.Rows.Count == 0) 594 595 { 595 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"); 596 598 } 597 599 -
branches/ReklamaReorganizacja/BazaReklam/FormBadVer.cs
r601 r613 12 12 public partial class FormBadVer : Form 13 13 { 14 readonly string _updaterUrl = ConfigurationHelper.GetSettingByKey("Application.Update.Exe") ?? "http://www.infocity.pl/baza_reklam/update/ updater.exe";14 readonly string _updaterUrl = ConfigurationHelper.GetSettingByKey("Application.Update.Exe") ?? "http://www.infocity.pl/baza_reklam/update/BazaReklam.Updater.exe"; 15 15 readonly string _zipUrl = ConfigurationHelper.GetSettingByKey("Application.Update.Zip") ?? "http://www.infocity.pl/baza_reklam/update/BazaReklam.zip"; 16 16 … … 28 28 { 29 29 button1.Enabled = false; 30 Cursor = Cursors.WaitCursor; 31 button1.Cursor = Cursors.WaitCursor; 32 webClient.DownloadFileAsync(new Uri(_updaterUrl), Environment.CurrentDirectory + "\\Updater.exe"); 33 return; 30 31 string updater = Environment.CurrentDirectory + "\\BazaReklam.Updater.exe"; 34 32 35 //TODO: Uncomment after every user will get updated version of the Updater 36 //string updater = Environment.CurrentDirectory + "\\Updater.exe"; 37 38 //if (System.IO.File.Exists(updater)) 39 // StartUpdater(); 40 //else 41 // webClient.DownloadFileAsync(new Uri(_updaterUrl), Environment.CurrentDirectory + "\\Updater.exe"); 33 if (System.IO.File.Exists(updater)) 34 StartUpdater(); 35 else 36 webClient.DownloadFileAsync(new Uri(_updaterUrl), Environment.CurrentDirectory + "\\BazaReklam.Updater.exe"); 42 37 } 43 38 … … 58 53 private void StartUpdater() 59 54 { 60 string updater = Environment.CurrentDirectory + "\\ Updater.exe";55 string updater = Environment.CurrentDirectory + "\\BazaReklam.Updater.exe"; 61 56 Cursor = Cursors.Default; 62 57 button1.Cursor = Cursors.Default; -
branches/ReklamaReorganizacja/BazaReklam/InfoForm.cs
r593 r613 5 5 using System.Windows.Forms; 6 6 using System.Globalization; 7 using Baza_Reklam.Classes.Helpers; 7 8 using Baza_Reklam.Classes.Interfaces; 8 9 -
branches/ReklamaReorganizacja/BazaReklam/KorektyForm.cs
r593 r613 7 7 using System.Text; 8 8 using System.Windows.Forms; 9 using Baza_Reklam.Classes.Helpers; 9 10 using Baza_Reklam.Classes.Interfaces; 10 11 -
branches/ReklamaReorganizacja/BazaReklam/ListaReklamNaWydanieForm.cs
r593 r613 5 5 using System.Drawing; 6 6 using System.Windows.Forms; 7 using Baza_Reklam.Classes; 7 8 using Baza_Reklam.Classes.Helpers; 8 9 using Baza_Reklam.Classes.Interfaces; … … 350 351 MessageBox.Show(pdfHelper.ErrorMessage); 351 352 } 353 catch (System.Net.WebException exception) 354 { 355 PdfHelper.HandleWebException(exception); 356 } 352 357 finally 353 358 { -
branches/ReklamaReorganizacja/BazaReklam/OferForm.cs
r593 r613 7 7 using System.Windows.Forms; 8 8 using System.IO; 9 using Baza_Reklam.Classes.Helpers; 9 10 10 11 … … 139 140 private static void OpenOfer(string filename) 140 141 { 141 WordH andler wh = new WordHandler();142 143 wh. openFile(filename);144 wh. setWordVisible();142 WordHelper wh = new WordHelper(); 143 144 wh.OpenFile(filename); 145 wh.SetWordVisible(); 145 146 } 146 147 147 148 private void CreateNewOfer(string filename, string newFileName) 148 149 { 149 WordH andler wh = new WordHandler();150 151 wh. openFile(filename);152 153 wh. findAndReplace("<<Oferta_Numer>>", id_ofertyTextBox.Text + "/" + User.Instance().Kod_agenta.ToUpper() + "/" + DateTime.Today.Year);154 wh. findAndReplace("<<Osoba_Do_Kontaktu>>", id_klienci_os_kontaktComboBox.Text);155 wh. findAndReplace("<<Nazwa_i_Adres_Klienta>>", adres_KorTextBox.Text);156 wh. findAndReplace("<<Miasto>>", User.Instance().Miasto);157 wh. findAndReplace("<<Data_Oferty>>", data_OfertyDateTimePicker.Value.ToShortDateString());158 wh. findAndReplace("<<Podpis_Agenta>>", User.Instance().Imie + " " + User.Instance().Nazwisko);159 wh. findAndReplace("<<Email_Agenta>>", User.Instance().Email);160 wh. findAndReplace("<<tel_wew_Agenta>>", User.Instance().TelWewnetrzny);161 wh. findAndReplace("<<tel_mobile_Agenta>>", User.Instance().KomSluzbowa);162 wh. findAndReplace("<<Adres_Biura>>", User.Instance().AdresBiura);163 wh. findAndReplace("<<Tel_Biura>>", User.Instance().TelSekretariat);164 wh. findAndReplace("<<Fax_Biura>>", User.Instance().FaxSekretariat);165 wh. findAndReplace("<<Oferta_Opis_Dod>>", opis_DolTextBox.Text);166 wh. findAndReplace("<<Stanowisko_Agenta>>", User.Instance().Stanowisko);167 168 wh. saveAs(newFileName);169 170 wh. setWordVisible();150 WordHelper wh = new WordHelper(); 151 152 wh.OpenFile(filename); 153 154 wh.FindAndReplace("<<Oferta_Numer>>", id_ofertyTextBox.Text + "/" + User.Instance().Kod_agenta.ToUpper() + "/" + DateTime.Today.Year); 155 wh.FindAndReplace("<<Osoba_Do_Kontaktu>>", id_klienci_os_kontaktComboBox.Text); 156 wh.FindAndReplace("<<Nazwa_i_Adres_Klienta>>", adres_KorTextBox.Text); 157 wh.FindAndReplace("<<Miasto>>", User.Instance().Miasto); 158 wh.FindAndReplace("<<Data_Oferty>>", data_OfertyDateTimePicker.Value.ToShortDateString()); 159 wh.FindAndReplace("<<Podpis_Agenta>>", User.Instance().Imie + " " + User.Instance().Nazwisko); 160 wh.FindAndReplace("<<Email_Agenta>>", User.Instance().Email); 161 wh.FindAndReplace("<<tel_wew_Agenta>>", User.Instance().TelWewnetrzny); 162 wh.FindAndReplace("<<tel_mobile_Agenta>>", User.Instance().KomSluzbowa); 163 wh.FindAndReplace("<<Adres_Biura>>", User.Instance().AdresBiura); 164 wh.FindAndReplace("<<Tel_Biura>>", User.Instance().TelSekretariat); 165 wh.FindAndReplace("<<Fax_Biura>>", User.Instance().FaxSekretariat); 166 wh.FindAndReplace("<<Oferta_Opis_Dod>>", opis_DolTextBox.Text); 167 wh.FindAndReplace("<<Stanowisko_Agenta>>", User.Instance().Stanowisko); 168 169 wh.SaveAs(newFileName); 170 171 wh.SetWordVisible(); 171 172 } 172 173 -
branches/ReklamaReorganizacja/BazaReklam/OrderDetails.cs
r593 r613 7 7 using System.Windows.Forms; 8 8 using System.Text.RegularExpressions; 9 using Baza_Reklam.Classes ;9 using Baza_Reklam.Classes.Helpers; 10 10 using Baza_Reklam.Classes.Helpers; 11 11 -
branches/ReklamaReorganizacja/BazaReklam/OrdersForm.cs
r593 r613 4 4 using System.Data.SqlClient; 5 5 using System.Windows.Forms; 6 using Baza_Reklam.Classes; 6 7 using Baza_Reklam.Classes.Helpers; 7 8 using Baza_Reklam.Classes.Interfaces; … … 1204 1205 if (!pdfHelper.DisplayPdf()) 1205 1206 MessageBox.Show(pdfHelper.ErrorMessage); 1207 } 1208 catch (System.Net.WebException exception) 1209 { 1210 PdfHelper.HandleWebException(exception); 1206 1211 } 1207 1212 finally -
branches/ReklamaReorganizacja/BazaReklam/ProductionForm.cs
r601 r613 907 907 MessageBox.Show(pdfHelper.ErrorMessage); 908 908 } 909 catch (System.Net.WebException exception) 910 { 911 PdfHelper.HandleWebException(exception); 912 } 909 913 finally 910 914 { -
branches/ReklamaReorganizacja/BazaReklam/Properties/AssemblyInfo.cs
r601 r613 30 30 // 31 31 [assembly: AssemblyVersion("1.0.0.0")] 32 [assembly: AssemblyFileVersion("1.1. 4")]32 [assembly: AssemblyFileVersion("1.1.6")] -
branches/ReklamaReorganizacja/BazaReklam/ZamowieniaForm.cs
r593 r613 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; … … 893 912 private REKLAMADataSet.FAKTURYRow utworzNaglowekKorekty(REKLAMADataSet.FAKTURYRow faktura) 894 913 { 895 SLOWNIKDataSet.AGENCIRow agent = (SLOWNIKDataSet.AGENCIRow)agenciTableAdapter.GetDataByKodAgenta(faktura.NUMER_ROZ).Rows[0];896 InvoiceProvider invoiceProvider = InvoiceProviderFactory.GetInvoiceProviderById(agent.InvoiceProviderId);897 898 899 914 REKLAMADataSet.FAKTURYRow naglowekKorekty = rEKLAMADataSet.FAKTURY.NewFAKTURYRow(); 900 915 naglowekKorekty.KOREKTA = true; … … 906 921 907 922 naglowekKorekty.NUMER_ROZ = faktura.NUMER_ROZ; 908 naglowekKorekty.NUMER = DbUtils.numerNowejFakturyKorekty(DateTime.Today.Year);923 naglowekKorekty.NUMER = FakturaHelper.GetNewCorrectionInvoiceNumber(DateTime.Today.Year, faktura.SystemKsiegowyId); 909 924 naglowekKorekty.NUMER_ROK = DateTime.Today.Year; 910 925 naglowekKorekty.DATA_WYSTAWIENIA = DateTime.Today; … … 919 934 920 935 naglowekKorekty.MIEJSCOWOSC_WYSTAWIENIA = faktura.MIEJSCOWOSC_WYSTAWIENIA; 921 naglowekKorekty.SPRZEDAWCA_ADRES = invoiceProvider.GetAddress();922 naglowekKorekty.SPRZEDAWCA_NIP = invoiceProvider.TaxNumber;936 naglowekKorekty.SPRZEDAWCA_ADRES = faktura.SPRZEDAWCA_ADRES; 937 naglowekKorekty.SPRZEDAWCA_NIP = faktura.SPRZEDAWCA_NIP; 923 938 naglowekKorekty.SystemKsiegowyId = faktura.SystemKsiegowyId; 924 939 … … 944 959 if (!faktura.Iswaluta_mianoNull()) 945 960 { 946 naglowekKorekty.SPRZEDAWCA_NIP = invoiceProvider.TaxCountryPrefix + " " + invoiceProvider.TaxNumber;961 naglowekKorekty.SPRZEDAWCA_NIP = faktura.SPRZEDAWCA_NIP; 947 962 naglowekKorekty.NABYWCA_NIP = faktura.NABYWCA_NIP; 948 963 naglowekKorekty.waluta_miano = faktura.waluta_miano; … … 1363 1378 if (zamowieniaBindingSource.Current == null) return; 1364 1379 1365 if (rEKLAMADataSet.REKLAMA.Rows.Count <= 0)1366 {1367 MessageBox.Show("Proszê dodaæ przynajmniej jedn¹ reklamê do zamówienia.", "Faktura proforma");1368 return;1369 }1370 1371 1380 Cursor = Cursors.WaitCursor; 1372 1381 … … 1376 1385 REKLAMADataSet.KLIENCIRow _klient = 1377 1386 (REKLAMADataSet.KLIENCIRow) klienciTableAdapter.GetDataByCustomerId(zamowienie.idKlienta).Rows[0]; 1378 string errorMessage = czyMoznaZafakturowac(zamowienie, _klient); 1387 1388 InitIssueTables(zamowienie); 1389 1390 string errorMessage = CzyMoznaZafakturowac(zamowienie, _klient); 1379 1391 1380 1392 if (errorMessage != string.Empty) 1381 1393 { 1382 MessageBox.Show(errorMessage );1394 MessageBox.Show(errorMessage, "Fakturowanie - Proforma"); 1383 1395 Cursor = Cursors.Default; 1384 1396 return; … … 1395 1407 { 1396 1408 DataRow[] rows = rEKLAMADataSet.FAKTURY.Select("id_faktury=" + id); 1397 usunFakture((REKLAMADataSet.FAKTURYRow) rows[0]); 1409 if (rows.Length > 0) 1410 usunFakture((REKLAMADataSet.FAKTURYRow) rows[0]); 1411 1398 1412 RestoreConnections(); 1399 1413 Cursor = Cursors.Default; -
branches/ReklamaReorganizacja/BazaReklam/ZestawienieZamowienForm.cs
r593 r613 5 5 using System.Drawing; 6 6 using System.Windows.Forms; 7 using Baza_Reklam.Classes.Helpers; 7 8 using Baza_Reklam.Classes.Interfaces; 8 9 -
branches/ReklamaReorganizacja/BazaReklam/app.config
r601 r613 36 36 <add key="Application.Pdf.Date" value="http://truck.pl/ogloszenia/_getFile.asp?pdfdate,{0},," /> 37 37 38 <add key="Application.Update.Exe" value="http://www.infocity.pl/baza_reklam/update/ updater.exe" />38 <add key="Application.Update.Exe" value="http://www.infocity.pl/baza_reklam/update/BazaReklam.Updater.exe" /> 39 39 <add key="Application.Update.Zip" value="http://www.infocity.pl/baza_reklam/update/BazaReklam.zip" /> 40 40 </appSettings> -
branches/ReklamaReorganizacja/BazaReklamSetup/BazaReklamSetup.vdproj
r601 r613 725 725 "Name" = "8:Microsoft Visual Studio" 726 726 "ProductName" = "8:Baza Reklam" 727 "ProductCode" = "8:{ F6601D04-8574-4347-9F7A-5B57FD3E63AD}"728 "PackageCode" = "8:{ 232E4671-6E2D-40C9-B63E-EFEC643B3CAE}"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. 4"734 "ProductVersion" = "8:1.1.6" 735 735 "Manufacturer" = "8:AACT" 736 736 "ARPHELPTELEPHONE" = "8:" … … 1274 1274 "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_65508AB999A44FC7909AAE84E5BD5F45" 1275 1275 { 1276 "SourcePath" = "8:..\\ Updater\\obj\\Debug\\Updater.exe"1276 "SourcePath" = "8:..\\BazaReklam.Updater\\obj\\Debug\\BazaReklam.Updater.exe" 1277 1277 "TargetName" = "8:" 1278 1278 "Tag" = "8:"
