Zbiór zmian 298

Pokaż
Ignoruj:
Data:
2009-02-05 10:40:34 (17 years ago)
Autor:
marek
Opis:

fixes #77

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/BazaReklam/ReportsForm.cs

    r286 r298  
    11using System; 
    22using System.Collections.Generic; 
    3 using System.ComponentModel; 
    4 using System.Data; 
    5 using System.Drawing; 
    6 using System.Text; 
    73using System.Windows.Forms; 
    84using Microsoft.Reporting.WinForms; 
     
    1410        private static ReportsForm reportsForm; 
    1511 
    16         private string reportsCatalog = ""; 
     12        private readonly string reportsCatalog = ""; 
    1713 
    1814        public static ReportsForm getReportsForm(MDIBazaReklam parent) 
    1915        { 
    20             if (reportsForm == null) { 
    21                 reportsForm = new ReportsForm(parent); 
    22             } 
     16            if (reportsForm == null) reportsForm = new ReportsForm(parent); 
    2317            return reportsForm; 
    2418        } 
    2519 
    26         private ReportsForm(MDIBazaReklam parent) 
     20        private ReportsForm(Form parent) 
    2721        { 
    2822            InitializeComponent(); 
    2923 
    30             this.MdiParent = parent; 
     24            MdiParent = parent; 
    3125 
    3226            if (!ConnString.getConnString().Value.Contains("10.0.0.21")) 
    33             { 
    3427                reportViewer1.ServerReport.ReportServerUrl = new Uri(Properties.Settings.Default.reportsServer); 
    35             } 
    3628            else 
    37             { 
    3829                reportViewer1.ServerReport.ReportServerUrl = new Uri(Properties.Settings.Default.reportsServerLocal); 
    39             } 
    40             
    41             if (ConnString.getConnString().Value.Contains("truck")) 
    42             { 
    43                 reportsCatalog = "ZestawieniaEXPO"; 
    44             } 
    45             else 
    46             { 
    47                 reportsCatalog = "Zestawienia"; 
    48             } 
    49  
    50             initTreeView(stareRaportyTreeView); 
    51             initTreeView(raportyTreeView); 
     30 
     31            reportsCatalog = ConnString.getConnString().Value.Contains("truck") ? "ZestawieniaEXPO" : "Zestawienia"; 
     32 
     33            InitTreeView(stareRaportyTreeView); 
     34            InitTreeView(raportyTreeView); 
    5235             
    5336            wczytajRaporty(); 
     
    5740        private void ReportsForm_Load(object sender, EventArgs e) 
    5841        { 
    59             this.WindowState = FormWindowState.Maximized; 
     42            WindowState = FormWindowState.Maximized; 
    6043        } 
    6144 
     
    6447        /// </summary> 
    6548        private void wczytajRaporty() { 
    66              
    67             TreeNode node; 
    68             node = new TreeNode(); 
     49            TreeNode node = new TreeNode(); 
    6950            node.Name = "/" + reportsCatalog + "/ListaReklamNaWydanieNr"; 
    7051            node.Text = "Lista reklam na wydanie"; 
     
    336317        } 
    337318 
    338         private TreeNode initTreeView(TreeView treeView) 
     319        private static void InitTreeView(TreeView treeView) 
    339320        { 
    340             TreeNode node; 
    341  
    342             node = new TreeNode("Wp³ywy"); 
     321            TreeNode node = new TreeNode("Wp³ywy"); 
    343322            node.Name = "Wp³ywy"; 
    344323            treeView.Nodes.Add(node); 
     
    376355            treeView.Nodes.Add(node); 
    377356 
    378             return node; 
     357            return; 
    379358        } 
    380359 
    381360        private void wczytajNoweRaporty() 
    382361        { 
    383             TreeNode node; 
    384  
    385             node = new TreeNode(); 
     362            TreeNode node = new TreeNode(); 
    386363            node.Name = "/" + reportsCatalog + "/ReklamyBezZamowienia"; 
    387364            node.Text = "Reklamy bez zamowienia"; 
     
    730707                    break; 
    731708                case 1: 
    732                     this.Cursor = Cursors.WaitCursor; 
     709                    Cursor = Cursors.WaitCursor; 
    733710 
    734711                    reportViewer1.ServerReport.ReportPath = e.Node.Name; 
    735712 
    736713                    if (reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/ZestawienieMiesieczneFaktur" | 
     714                        reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/ZestawienieMiesieczneFaktur2009" | 
    737715                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/ZestawienieKontaktow" | 
    738716                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/RozliczenieWplywowWgDatyWplaty2" | 
    739                        reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/SzacowanieSprzedazy" | 
    740                        reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/RozliczenieProwizjiZaReklame") 
     717                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/RozliczenieWplywowWgDatyWplaty2009" | 
     718                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/RozliczenieProwizjiZaReklame" | 
     719                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/RozliczenieProwizjiZaReklame2009" | 
     720                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/SzacowanieSprzedazy" 
     721                       ) 
    741722                    { 
    742723                        if (!User.getUser().St_kierownik) 
     
    760741 
    761742                    if (reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/Zaleglosci" | 
     743                        reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/Zaleglosci2009" | 
    762744                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/WynikAgencji" | 
    763745                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/SprzedazReklam" | 
     746                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/SprzedazReklam2009" | 
    764747                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/RozliczenieProwizjiZaReklame" | 
     748                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/RozliczenieProwizjiZaReklame2009" | 
    765749                       reportViewer1.ServerReport.ReportPath == "/" + reportsCatalog + "/OcenaAgenta") 
    766750                    { 
     
    785769                    reportViewer1.RefreshReport(); 
    786770 
    787                     this.Cursor = Cursors.Default; 
     771                    Cursor = Cursors.Default; 
    788772                    break; 
    789773                default: