Zbiór zmian 784 dla branches

Pokaż
Ignoruj:
Data:
2009-07-28 13:02:14 (17 years ago)
Autor:
marek
Opis:

re #195 - edycja emisji zakonczona...

Lokalizacja:
branches/Emisje/BazaReklam
Pliki:
1 dodane
17 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • branches/Emisje/BazaReklam/Baza Reklam.csproj

    r783 r784  
    131131    <Compile Include="Classes\Interfaces\IInvoiceProvider.cs" /> 
    132132    <Compile Include="Classes\Interfaces\IForm.cs" /> 
     133    <Compile Include="Classes\Interfaces\IEntity.cs" /> 
    133134    <Compile Include="Classes\Model\AdIssue.cs" /> 
    134135    <Compile Include="Classes\Model\AdLocation.cs" /> 
  • branches/Emisje/BazaReklam/Classes/Helpers/ComboBoxHelper.cs

    r732 r784  
    11using System.Collections.Generic; 
    22using System.Windows.Forms; 
     3using Baza_Reklam.Classes.Interfaces; 
    34 
    45namespace Baza_Reklam.Classes.Helpers 
     
    2223        } 
    2324 
    24         //public static int GetItemIndex<T>(T type, int value, ComboBox comboBox) 
    25         //{ 
    26         //    foreach (object item in comboBox.Items) 
    27         //    { 
    28         //        if(((T)item)) 
    29         //        { 
    30                      
    31         //        } 
    32         //    } 
    33         //} 
     25        public static int GetItemIndex(int value, ComboBox comboBox) 
     26        { 
     27            foreach (object item in comboBox.Items) 
     28                if (item is IEntity && ((IEntity)item).Id == value) 
     29                    return comboBox.Items.IndexOf(item); 
     30 
     31            return -1; 
     32        } 
    3433    } 
    3534} 
  • branches/Emisje/BazaReklam/Classes/Model/AdIssue.cs

    r777 r784  
    11using System; 
     2using Baza_Reklam.Classes.Interfaces; 
    23 
    34namespace Baza_Reklam.Classes.Model 
    45{ 
    5     public class AdIssue 
     6    public class AdIssue : IEntity 
    67    { 
    78        private int _id; 
  • branches/Emisje/BazaReklam/Classes/Model/AdLocation.cs

    r732 r784  
     1using Baza_Reklam.Classes.Interfaces; 
     2 
    13namespace Baza_Reklam.Classes.Model 
    24{ 
    3     public class AdLocation 
     5    public class AdLocation : IEntity 
    46    { 
    57        private int _id; 
  • branches/Emisje/BazaReklam/Classes/Model/Bargain.cs

    r778 r784  
     1using Baza_Reklam.Classes.Interfaces; 
     2 
    13namespace Baza_Reklam.Classes.Model 
    24{ 
    3     public class Bargain 
     5    public class Bargain : IEntity 
    46    { 
    57        private int _id; 
  • branches/Emisje/BazaReklam/Classes/Model/Dzial.cs

    r732 r784  
     1using Baza_Reklam.Classes.Interfaces; 
     2 
    13namespace Baza_Reklam.Classes.Model 
    24{ 
    3     public class NavigationColumn 
     5    public class NavigationColumn : IEntity 
    46    { 
    57        private int _id; 
  • branches/Emisje/BazaReklam/Classes/Model/Invoice.cs

    r588 r784  
    11using System; 
     2using Baza_Reklam.Classes.Interfaces; 
    23 
    34namespace Baza_Reklam.Classes.Model 
    45{ 
    5     public class Invoice 
     6    public class Invoice : IEntity 
    67    { 
    78        private int _id; 
  • branches/Emisje/BazaReklam/Classes/Model/Module.cs

    r732 r784  
     1using Baza_Reklam.Classes.Interfaces; 
     2 
    13namespace Baza_Reklam.Classes.Model 
    24{ 
    3     public class Module 
     5    public class Module : IEntity 
    46    { 
    57        private int _id; 
  • branches/Emisje/BazaReklam/Classes/Model/Rozdzial.cs

    r732 r784  
     1using Baza_Reklam.Classes.Interfaces; 
     2 
    13namespace Baza_Reklam.Classes.Model 
    24{ 
    3     public class NavigationSubColumn 
     5    public class NavigationSubColumn : IEntity 
    46    { 
    57        private int _id; 
  • branches/Emisje/BazaReklam/Classes/Model/Section.cs

    r732 r784  
    11using System.Collections.Generic; 
     2using Baza_Reklam.Classes.Interfaces; 
    23using Baza_Reklam.Classes.Repositories; 
    34 
    45namespace Baza_Reklam.Classes.Model 
    56{ 
    6     public class Section 
     7    public class Section : IEntity 
    78    { 
    89        private int _id; 
  • branches/Emisje/BazaReklam/Classes/Model/Title.cs

    r732 r784  
    11using System.Collections.Generic; 
     2using Baza_Reklam.Classes.Interfaces; 
    23using Baza_Reklam.Classes.Repositories; 
    34 
    45namespace Baza_Reklam.Classes.Model 
    56{ 
    6     public class Title 
     7    public class Title : IEntity 
    78    { 
    89        private int _id; 
  • branches/Emisje/BazaReklam/Classes/Repositories/NavigationColumnRepository.cs

    r779 r784  
    9797            return navigationSubColumnRepository.FindAllActiveByNavigationColumn(navigationColumn); 
    9898        } 
     99 
     100        public List<NavigationSubColumn> FindActiveNavigationSubColumnsByNavigationColumnId(int navigationColumnId) 
     101        { 
     102            NavigationSubColumnRepository navigationSubColumnRepository = new NavigationSubColumnRepository(_connectionString); 
     103            return navigationSubColumnRepository.FindAllActiveByNavigationColumnId(navigationColumnId, null); 
     104        } 
    99105    } 
    100106} 
  • branches/Emisje/BazaReklam/Classes/Repositories/NavigationSubColumnRepository.cs

    r779 r784  
    5858        public List<NavigationSubColumn> FindAllActiveByNavigationColumn(NavigationColumn navigationColumn) 
    5959        { 
     60            return FindAllActiveByNavigationColumnId(navigationColumn.Id, navigationColumn); 
     61        } 
     62 
     63        public List<NavigationSubColumn> FindAllActiveByNavigationColumnId(int navigationColumnId, NavigationColumn navigationColumn) 
     64        { 
    6065            string query = "SELECT Id, Name FROM Rozdzial WHERE Active=1 AND DzialId={0} ORDER BY SortOrder"; 
    61             query = string.Format(query, navigationColumn.Id); 
     66            query = string.Format(query, navigationColumnId); 
    6267 
    6368            List<NavigationSubColumn> navigationSubColumns = new List<NavigationSubColumn>(); 
     
    7782                    { 
    7883                        NavigationSubColumn navigationSubColumn = new NavigationSubColumn(reader.GetInt32(0), reader.GetString(1)); 
    79                         navigationSubColumn.NavigationColumn = navigationColumn; 
     84                        if (navigationColumn != null) 
     85                            navigationSubColumn.NavigationColumn = navigationColumn; 
    8086 
    8187                        navigationSubColumns.Add(navigationSubColumn); 
  • branches/Emisje/BazaReklam/EditAdIssue.Designer.cs

    r783 r784  
    3333            this.cbNavigationSubColumn = new System.Windows.Forms.ComboBox(); 
    3434            this.cbAdLocation = new System.Windows.Forms.ComboBox(); 
     35            this.label1 = new System.Windows.Forms.Label(); 
     36            this.label2 = new System.Windows.Forms.Label(); 
     37            this.label3 = new System.Windows.Forms.Label(); 
     38            this.btnCancel = new System.Windows.Forms.Button(); 
    3539            this.SuspendLayout(); 
    3640            //  
     
    3842            //  
    3943            this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; 
    40             this.button1.Location = new System.Drawing.Point(205, 238); 
     44            this.button1.Location = new System.Drawing.Point(159, 148); 
    4145            this.button1.Name = "button1"; 
    4246            this.button1.Size = new System.Drawing.Size(75, 23); 
     
    4852            //  
    4953            this.cbNavigationColumn.FormattingEnabled = true; 
    50             this.cbNavigationColumn.Location = new System.Drawing.Point(79, 12); 
     54            this.cbNavigationColumn.Location = new System.Drawing.Point(92, 28); 
    5155            this.cbNavigationColumn.Name = "cbNavigationColumn"; 
    5256            this.cbNavigationColumn.Size = new System.Drawing.Size(121, 21); 
    5357            this.cbNavigationColumn.TabIndex = 1; 
     58            this.cbNavigationColumn.SelectedIndexChanged += new System.EventHandler(this.cbNavigationColumn_SelectedIndexChanged); 
    5459            //  
    5560            // cbNavigationSubColumn 
    5661            //  
    5762            this.cbNavigationSubColumn.FormattingEnabled = true; 
    58             this.cbNavigationSubColumn.Location = new System.Drawing.Point(79, 54); 
     63            this.cbNavigationSubColumn.Location = new System.Drawing.Point(92, 64); 
    5964            this.cbNavigationSubColumn.Name = "cbNavigationSubColumn"; 
    6065            this.cbNavigationSubColumn.Size = new System.Drawing.Size(121, 21); 
     
    6469            //  
    6570            this.cbAdLocation.FormattingEnabled = true; 
    66             this.cbAdLocation.Location = new System.Drawing.Point(79, 101); 
     71            this.cbAdLocation.Location = new System.Drawing.Point(92, 100); 
    6772            this.cbAdLocation.Name = "cbAdLocation"; 
    6873            this.cbAdLocation.Size = new System.Drawing.Size(121, 21); 
    6974            this.cbAdLocation.TabIndex = 3; 
     75            //  
     76            // label1 
     77            //  
     78            this.label1.AutoSize = true; 
     79            this.label1.Location = new System.Drawing.Point(12, 32); 
     80            this.label1.Name = "label1"; 
     81            this.label1.Size = new System.Drawing.Size(35, 13); 
     82            this.label1.TabIndex = 4; 
     83            this.label1.Text = "Dzia³:"; 
     84            //  
     85            // label2 
     86            //  
     87            this.label2.AutoSize = true; 
     88            this.label2.Location = new System.Drawing.Point(12, 68); 
     89            this.label2.Name = "label2"; 
     90            this.label2.Size = new System.Drawing.Size(52, 13); 
     91            this.label2.TabIndex = 5; 
     92            this.label2.Text = "Rozdzia³:"; 
     93            //  
     94            // label3 
     95            //  
     96            this.label3.AutoSize = true; 
     97            this.label3.Location = new System.Drawing.Point(12, 104); 
     98            this.label3.Name = "label3"; 
     99            this.label3.Size = new System.Drawing.Size(63, 13); 
     100            this.label3.TabIndex = 6; 
     101            this.label3.Text = "Lokalizacja:"; 
     102            //  
     103            // btnCancel 
     104            //  
     105            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 
     106            this.btnCancel.Location = new System.Drawing.Point(15, 148); 
     107            this.btnCancel.Name = "btnCancel"; 
     108            this.btnCancel.Size = new System.Drawing.Size(75, 23); 
     109            this.btnCancel.TabIndex = 7; 
     110            this.btnCancel.Text = "Anuluj"; 
     111            this.btnCancel.UseVisualStyleBackColor = true; 
     112            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); 
    70113            //  
    71114            // EditAdIssue 
     
    73116            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 
    74117            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 
    75             this.ClientSize = new System.Drawing.Size(292, 273); 
     118            this.ClientSize = new System.Drawing.Size(249, 186); 
     119            this.ControlBox = false; 
     120            this.Controls.Add(this.btnCancel); 
     121            this.Controls.Add(this.label3); 
     122            this.Controls.Add(this.label2); 
     123            this.Controls.Add(this.label1); 
    76124            this.Controls.Add(this.cbAdLocation); 
    77125            this.Controls.Add(this.cbNavigationSubColumn); 
    78126            this.Controls.Add(this.cbNavigationColumn); 
    79127            this.Controls.Add(this.button1); 
     128            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 
    80129            this.Name = "EditAdIssue"; 
    81             this.Text = "EditAdIssue"; 
     130            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 
     131            this.Text = "Edytuj emisjê"; 
    82132            this.Load += new System.EventHandler(this.EditAdIssue_Load); 
    83133            this.ResumeLayout(false); 
     134            this.PerformLayout(); 
    84135 
    85136        } 
     
    91142        private System.Windows.Forms.ComboBox cbNavigationSubColumn; 
    92143        private System.Windows.Forms.ComboBox cbAdLocation; 
     144        private System.Windows.Forms.Label label1; 
     145        private System.Windows.Forms.Label label2; 
     146        private System.Windows.Forms.Label label3; 
     147        private System.Windows.Forms.Button btnCancel; 
    93148    } 
    94149} 
  • branches/Emisje/BazaReklam/EditAdIssue.cs

    r783 r784  
    11using System; 
    2 using System.Collections.Generic; 
    3 using System.ComponentModel; 
    4 using System.Data; 
    5 using System.Drawing; 
    6 using System.Text; 
    72using System.Windows.Forms; 
    83using Baza_Reklam.Classes.Helpers; 
     
    2823            get 
    2924            { 
    30                 if (cbNavigationColumn.SelectedItem != null) 
     25                if (cbNavigationColumn.SelectedIndex > 0 && cbNavigationColumn.SelectedItem != null) 
    3126                    return (NavigationColumn)cbNavigationColumn.SelectedItem; 
    3227                return null; 
     
    3934            get 
    4035            { 
    41                 if (cbNavigationSubColumn.SelectedItem != null) 
     36                if (cbNavigationSubColumn.SelectedIndex > 0 && cbNavigationSubColumn.SelectedItem != null) 
    4237                    return (NavigationSubColumn)cbNavigationSubColumn.SelectedItem; 
    4338                return null; 
     
    4540        } 
    4641 
    47         public EditAdIssue() 
     42        public EditAdIssue(Title title, int? dzialId, int? rozdzialId, int lokalizacjaId) 
    4843        { 
    4944            InitializeComponent(); 
    5045 
    51             AdLocationRepository adPlacementRepository = new AdLocationRepository(ConnString.getConnString().Value); 
    52             ComboBoxHelper.Bind(adPlacementRepository.FindAll(), cbAdLocation); 
     46            AdLocationRepository adLocationRepository = new AdLocationRepository(ConnString.getConnString().Value); 
     47            ComboBoxHelper.Bind(adLocationRepository.FindAll(), cbAdLocation); 
    5348            cbAdLocation.DisplayMember = "Text"; 
    5449            cbAdLocation.ValueMember = "Id"; 
    55             cbAdLocation.SelectedIndex = 0; 
     50            cbAdLocation.SelectedIndex = ComboBoxHelper.GetItemIndex(lokalizacjaId, cbAdLocation); 
    5651 
    57             NavigationColumnRepository navigationColumnRepository = new NavigationColumnRepository(ConnString.getConnString().Value); 
    58             ComboBoxHelper.Bind(navigationColumnRepository.FindAll(), cbNavigationColumn); 
    59             cbNavigationColumn.DisplayMember = "Name"; 
    60             cbNavigationColumn.ValueMember = "Id"; 
    61             cbNavigationColumn.SelectedIndex = 0; 
     52            if (dzialId.HasValue) 
     53            { 
     54                NavigationColumnRepository navigationColumnRepository = 
     55                    new NavigationColumnRepository(ConnString.getConnString().Value); 
     56                ComboBoxHelper.Bind(navigationColumnRepository.FindAllActiveByTitle(title), cbNavigationColumn); 
     57                cbNavigationColumn.Items.Insert(0, "-- proszê wybraæ --"); 
     58                cbNavigationColumn.DisplayMember = "Name"; 
     59                cbNavigationColumn.ValueMember = "Id"; 
     60                cbNavigationColumn.SelectedIndex = 0; 
    6261 
     62                cbNavigationColumn.SelectedIndex = ComboBoxHelper.GetItemIndex(dzialId.Value, cbNavigationColumn); 
    6363 
    64             NavigationSubColumnRepository navigationSubColumnRepository = new NavigationSubColumnRepository(ConnString.getConnString().Value); 
    65             ComboBoxHelper.Bind(navigationSubColumnRepository.FindAll(), cbNavigationSubColumn); 
    66             cbNavigationSubColumn.DisplayMember = "Name"; 
    67             cbNavigationSubColumn.ValueMember = "Id"; 
    68             cbNavigationSubColumn.SelectedIndex = 0; 
    69  
     64                if (rozdzialId.HasValue) 
     65                    cbNavigationSubColumn.SelectedIndex = ComboBoxHelper.GetItemIndex(rozdzialId.Value, 
     66                                                                                      cbNavigationSubColumn); 
     67            } 
    7068        } 
    7169 
     
    7472 
    7573        } 
     74 
     75        private void btnCancel_Click(object sender, EventArgs e) 
     76        { 
     77            Close(); 
     78        } 
     79 
     80        private void cbNavigationColumn_SelectedIndexChanged(object sender, EventArgs e) 
     81        { 
     82            if(Dzial==null) return; 
     83 
     84            NavigationColumnRepository navigationColumnRepository = new NavigationColumnRepository(ConnString.getConnString().Value); 
     85            ComboBoxHelper.Bind(navigationColumnRepository.FindActiveNavigationSubColumnsByNavigationColumn(Dzial), cbNavigationSubColumn); 
     86            cbNavigationSubColumn.Items.Insert(0, "-- proszê wybraæ --"); 
     87            cbNavigationSubColumn.DisplayMember = "Name"; 
     88            cbNavigationSubColumn.ValueMember = "Id"; 
     89            cbNavigationSubColumn.SelectedIndex = 0; 
     90        } 
    7691    } 
    7792} 
  • branches/Emisje/BazaReklam/OrderDetails.Designer.cs

    r783 r784  
    189189            this.usunToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
    190190            this.anulujToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
     191            this.editMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
    191192            this.advertSiteContext = new System.Windows.Forms.ContextMenuStrip(this.components); 
    192193            this.deleteItem = new System.Windows.Forms.ToolStripMenuItem(); 
     
    194195            this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 
    195196            this.btnSaveClose = new System.Windows.Forms.Button(); 
    196             this.editMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
    197197            sYMBOL_AKWIZYTORALabel = new System.Windows.Forms.Label(); 
    198198            tYTULLabel = new System.Windows.Forms.Label(); 
     
    18021802            //  
    18031803            this.emisjeContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 
     1804            this.editMenuItem, 
    18041805            this.zmienToolStripMenuItem, 
    1805             this.usunToolStripMenuItem, 
    18061806            this.anulujToolStripMenuItem, 
    1807             this.editMenuItem}); 
     1807            this.usunToolStripMenuItem}); 
    18081808            this.emisjeContextMenuStrip.Name = "emisjeContextMenuStrip"; 
    18091809            this.emisjeContextMenuStrip.Size = new System.Drawing.Size(153, 114); 
     
    18261826            this.anulujToolStripMenuItem.Size = new System.Drawing.Size(152, 22); 
    18271827            this.anulujToolStripMenuItem.Text = "Anuluj"; 
     1828            //  
     1829            // editMenuItem 
     1830            //  
     1831            this.editMenuItem.Name = "editMenuItem"; 
     1832            this.editMenuItem.Size = new System.Drawing.Size(152, 22); 
     1833            this.editMenuItem.Text = "Edytuj"; 
    18281834            //  
    18291835            // advertSiteContext 
     
    18641870            this.btnSaveClose.UseVisualStyleBackColor = true; 
    18651871            this.btnSaveClose.Click += new System.EventHandler(this.btnSaveClose_Click); 
    1866             //  
    1867             // editMenuItem 
    1868             //  
    1869             this.editMenuItem.Name = "editMenuItem"; 
    1870             this.editMenuItem.Size = new System.Drawing.Size(152, 22); 
    1871             this.editMenuItem.Text = "Edytuj"; 
    18721872            //  
    18731873            // OrderDetails 
  • branches/Emisje/BazaReklam/OrderDetails.cs

    r783 r784  
    171171            rEKLAMADataSet.UKAZE_SIE_W_NR.TableNewRow += nowaEmisja; 
    172172 
    173             //pROMOCJETableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    174             //lISTA_TYPOW_REKLAMYTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    175             //kursy_WalutTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    176             //rEKLAMATableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    177             //uKAZE_SIE_W_NRTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    178             //rEKLAMA_STRONATableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    179             //reklama_Info_DodTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    180             //aGENCITableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    181             //zmianyEmisjiTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value; 
    182  
    183173            pROMOCJETableAdapter.Fill(sLOWNIKDataSet.PROMOCJE); 
    184174 
     
    912902            obslugaZdarzen = true; 
    913903            tYTULComboBox.SelectedIndex = tYTULComboBox.FindString(Reklama.TYTU£); 
    914             cbLocation.SelectedIndex = GetAdLocationIndex(Reklama.AdLocationId); 
    915             grzbietComboBox.SelectedIndex = GetSectionIndex(Reklama.GRZBIET); 
     904            cbLocation.SelectedIndex = ComboBoxHelper.GetItemIndex(Reklama.AdLocationId, cbLocation); 
     905            grzbietComboBox.SelectedIndex = ComboBoxHelper.GetItemIndex(Reklama.GRZBIET, grzbietComboBox); 
    916906            mOD_TYPComboBox.SelectedIndex = mOD_TYPComboBox.FindString(Reklama.MOD_TYP); 
    917907 
     
    919909                promocjaComboBox.SelectedIndex = -1; 
    920910            else 
    921                 promocjaComboBox.SelectedIndex = GetPromotionIndex(Reklama.PROMOCJA); 
     911                promocjaComboBox.SelectedIndex = ComboBoxHelper.GetItemIndex(Reklama.PROMOCJA, promocjaComboBox); 
    922912 
    923913            obslugaZdarzen = false; 
    924         } 
    925  
    926         private int GetSectionIndex(int value) 
    927         { 
    928             foreach (object item in grzbietComboBox.Items) 
    929                 if (item is Section && ((Section)item).Id == value) 
    930                     return grzbietComboBox.Items.IndexOf(item); 
    931  
    932             return -1; 
    933         } 
    934  
    935         private int GetAdLocationIndex(int value) 
    936         { 
    937             foreach (object item in cbLocation.Items) 
    938                 if (item is AdLocation && ((AdLocation)item).Id == value) 
    939                     return cbLocation.Items.IndexOf(item); 
    940  
    941             return -1; 
    942         } 
    943  
    944         private int GetNavigationColumnIndex(int value) 
    945         { 
    946             foreach (object item in ogl_dzialComboBox.Items) 
    947                 if (item is NavigationColumn && ((NavigationColumn)item).Id == value) 
    948                     return ogl_dzialComboBox.Items.IndexOf(item); 
    949  
    950             return -1; 
    951         } 
    952  
    953         private int GetNavigationSubColumnIndex(int value) 
    954         { 
    955             foreach (object item in ogl_rozdzialComboBox.Items) 
    956                 if (item is NavigationSubColumn && ((NavigationSubColumn)item).Id == value) 
    957                     return ogl_rozdzialComboBox.Items.IndexOf(item); 
    958  
    959             return -1; 
    960         } 
    961  
    962         private int GetPromotionIndex(int value) 
    963         { 
    964             int index = -1; 
    965             foreach (object item in promocjaComboBox.Items) 
    966             { 
    967                 index++; 
    968                 if (item is Bargain && Convert.ToInt32(((Bargain)item).Id) == value) 
    969                     return index;                 
    970             } 
    971  
    972             return -1; 
    973914        } 
    974915 
     
    1051992            obslugaZdarzen = true; 
    1052993            tYTULComboBox.SelectedIndex = tYTULComboBox.FindString(newRow["TYTU£"].ToString()); 
    1053             grzbietComboBox.SelectedIndex = GetSectionIndex(Convert.ToInt32(newRow["GRZBIET"])); 
     994            grzbietComboBox.SelectedIndex = ComboBoxHelper.GetItemIndex(Convert.ToInt32(newRow["GRZBIET"]), grzbietComboBox); 
    1054995            mOD_TYPComboBox.SelectedIndex = mOD_TYPComboBox.FindString(newRow["MOD_TYP"].ToString()); 
    1055             cbLocation.SelectedIndex = GetAdLocationIndex(Convert.ToInt32(newRow["AdLocationId"])); 
     996            cbLocation.SelectedIndex = ComboBoxHelper.GetItemIndex(Convert.ToInt32(newRow["AdLocationId"]), cbLocation); 
    1056997 
    1057998            if (SelectedModule != null) 
     
    13321273        public void UsunEmisje(object sender, EventArgs e) 
    13331274        { 
     1275            DialogResult dialogResult = MessageBox.Show("Usun¹æ emisjê?", "Baza Reklam - usuñ emisjê", 
     1276                                            MessageBoxButtons.YesNo); 
     1277 
     1278            if (dialogResult != DialogResult.Yes) return; 
     1279 
     1280 
    13341281            foreach (DataGridViewRow r in ukazeSieDataGridView.SelectedRows) 
    13351282            { 
     
    13531300            if (ukazeSieDataGridView.CurrentCell == null) return; 
    13541301 
     1302            DialogResult dialogResult = MessageBox.Show("Anulowaæ emisjê?", "Baza Reklam - anuluj emisjê", 
     1303                                                        MessageBoxButtons.YesNo); 
     1304             
     1305            if (dialogResult != DialogResult.Yes) return; 
     1306 
    13551307            DataGridViewRow r1 = ukazeSieDataGridView.CurrentCell.OwningRow; 
    13561308 
    1357             REKLAMADataSet.UKAZE_SIE_W_NRRow row = (REKLAMADataSet.UKAZE_SIE_W_NRRow)(((DataRowView)r1.DataBoundItem).Row); 
     1309            REKLAMADataSet.UKAZE_SIE_W_NRRow row = 
     1310                (REKLAMADataSet.UKAZE_SIE_W_NRRow) (((DataRowView) r1.DataBoundItem).Row); 
    13581311 
    13591312            row.status = 2; 
     
    13911344        private void EdytujEmisje(object sender, EventArgs e) 
    13921345        { 
    1393             EditAdIssue editAdIssue = new EditAdIssue(); 
     1346            REKLAMADataSet.UKAZE_SIE_W_NRRow issue = 
     1347                (REKLAMADataSet.UKAZE_SIE_W_NRRow) ((DataRowView) rEKLAMAUKAZESIEWNRBindingSource.Current).Row; 
     1348 
     1349            int? dzial = null; 
     1350            if (!issue.IsDzialIdNull()) 
     1351                dzial = issue.DzialId; 
     1352 
     1353            int? rozdzial = null; 
     1354            if (!issue.IsRozdzialIdNull()) 
     1355                rozdzial = issue.RozdzialId; 
     1356 
     1357            EditAdIssue editAdIssue = new EditAdIssue(SelectedTitle, dzial, rozdzial, issue.LokalizacjaId); 
    13941358            DialogResult dialogResult = editAdIssue.ShowDialog(); 
    1395             if(dialogResult == DialogResult.OK) 
    1396             { 
    1397                 REKLAMADataSet.UKAZE_SIE_W_NRRow issue = (REKLAMADataSet.UKAZE_SIE_W_NRRow)((DataRowView)rEKLAMAUKAZESIEWNRBindingSource.Current).Row; 
    1398                  
     1359            if (dialogResult == DialogResult.OK) 
     1360            { 
    13991361                issue.Lokalizacja = editAdIssue.Lokalizacja.Text; 
    14001362                issue.LokalizacjaId = editAdIssue.Lokalizacja.Id; 
    1401                 if (editAdIssue.Dzial!=null) 
     1363                if (editAdIssue.Dzial != null) 
    14021364                { 
    14031365                    issue.DzialId = editAdIssue.Dzial.Id; 
    1404                     issue.Dzial = editAdIssue.Dzial.Name;                     
     1366                    issue.Dzial = editAdIssue.Dzial.Name; 
    14051367                } 
    14061368 
     
    14081370                { 
    14091371                    issue.RozdzialId = editAdIssue.Rozdzial.Id; 
    1410                     issue.Rozdzial = editAdIssue.Rozdzial.Name;                     
    1411                 } 
    1412  
    1413             } 
    1414  
     1372                    issue.Rozdzial = editAdIssue.Rozdzial.Name; 
     1373                } 
     1374            } 
    14151375        } 
    14161376 
     
    17301690                    } 
    17311691 
    1732                     ogl_dzialComboBox.SelectedIndex = GetNavigationColumnIndex(Reklama.ogl_dzial); 
     1692                    ogl_dzialComboBox.SelectedIndex = ComboBoxHelper.GetItemIndex(Reklama.ogl_dzial, ogl_dzialComboBox); 
    17331693                    if (!Reklama.Isogl_rozdzialNull() && Reklama.ogl_rozdzial > 0) 
    1734                         ogl_rozdzialComboBox.SelectedIndex = GetNavigationSubColumnIndex(Reklama.ogl_rozdzial); 
     1694                        ogl_rozdzialComboBox.SelectedIndex = ComboBoxHelper.GetItemIndex(Reklama.ogl_rozdzial, ogl_rozdzialComboBox); 
    17351695 
    17361696                    if (!isEventHandlingEnabled)