- Data:
- 2009-07-28 13:02:14 (17 years ago)
- Lokalizacja:
- branches/Emisje/BazaReklam
- Pliki:
-
- 1 dodane
- 17 zmodyfikowane
-
Baza Reklam.csproj (zmodyfikowane) (1 diff)
-
Classes/Helpers/ComboBoxHelper.cs (zmodyfikowane) (2 diffs)
-
Classes/Interfaces/IEntity.cs (dodane)
-
Classes/Model/AdIssue.cs (zmodyfikowane) (1 diff)
-
Classes/Model/AdLocation.cs (zmodyfikowane) (1 diff)
-
Classes/Model/Bargain.cs (zmodyfikowane) (1 diff)
-
Classes/Model/Dzial.cs (zmodyfikowane) (1 diff)
-
Classes/Model/Invoice.cs (zmodyfikowane) (1 diff)
-
Classes/Model/Module.cs (zmodyfikowane) (1 diff)
-
Classes/Model/Rozdzial.cs (zmodyfikowane) (1 diff)
-
Classes/Model/Section.cs (zmodyfikowane) (1 diff)
-
Classes/Model/Title.cs (zmodyfikowane) (1 diff)
-
Classes/Repositories/NavigationColumnRepository.cs (zmodyfikowane) (1 diff)
-
Classes/Repositories/NavigationSubColumnRepository.cs (zmodyfikowane) (2 diffs)
-
EditAdIssue.Designer.cs (zmodyfikowane) (6 diffs)
-
EditAdIssue.cs (zmodyfikowane) (5 diffs)
-
OrderDetails.Designer.cs (zmodyfikowane) (5 diffs)
-
OrderDetails.cs (zmodyfikowane) (9 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
branches/Emisje/BazaReklam/Baza Reklam.csproj
r783 r784 131 131 <Compile Include="Classes\Interfaces\IInvoiceProvider.cs" /> 132 132 <Compile Include="Classes\Interfaces\IForm.cs" /> 133 <Compile Include="Classes\Interfaces\IEntity.cs" /> 133 134 <Compile Include="Classes\Model\AdIssue.cs" /> 134 135 <Compile Include="Classes\Model\AdLocation.cs" /> -
branches/Emisje/BazaReklam/Classes/Helpers/ComboBoxHelper.cs
r732 r784 1 1 using System.Collections.Generic; 2 2 using System.Windows.Forms; 3 using Baza_Reklam.Classes.Interfaces; 3 4 4 5 namespace Baza_Reklam.Classes.Helpers … … 22 23 } 23 24 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 } 34 33 } 35 34 } -
branches/Emisje/BazaReklam/Classes/Model/AdIssue.cs
r777 r784 1 1 using System; 2 using Baza_Reklam.Classes.Interfaces; 2 3 3 4 namespace Baza_Reklam.Classes.Model 4 5 { 5 public class AdIssue 6 public class AdIssue : IEntity 6 7 { 7 8 private int _id; -
branches/Emisje/BazaReklam/Classes/Model/AdLocation.cs
r732 r784 1 using Baza_Reklam.Classes.Interfaces; 2 1 3 namespace Baza_Reklam.Classes.Model 2 4 { 3 public class AdLocation 5 public class AdLocation : IEntity 4 6 { 5 7 private int _id; -
branches/Emisje/BazaReklam/Classes/Model/Bargain.cs
r778 r784 1 using Baza_Reklam.Classes.Interfaces; 2 1 3 namespace Baza_Reklam.Classes.Model 2 4 { 3 public class Bargain 5 public class Bargain : IEntity 4 6 { 5 7 private int _id; -
branches/Emisje/BazaReklam/Classes/Model/Dzial.cs
r732 r784 1 using Baza_Reklam.Classes.Interfaces; 2 1 3 namespace Baza_Reklam.Classes.Model 2 4 { 3 public class NavigationColumn 5 public class NavigationColumn : IEntity 4 6 { 5 7 private int _id; -
branches/Emisje/BazaReklam/Classes/Model/Invoice.cs
r588 r784 1 1 using System; 2 using Baza_Reklam.Classes.Interfaces; 2 3 3 4 namespace Baza_Reklam.Classes.Model 4 5 { 5 public class Invoice 6 public class Invoice : IEntity 6 7 { 7 8 private int _id; -
branches/Emisje/BazaReklam/Classes/Model/Module.cs
r732 r784 1 using Baza_Reklam.Classes.Interfaces; 2 1 3 namespace Baza_Reklam.Classes.Model 2 4 { 3 public class Module 5 public class Module : IEntity 4 6 { 5 7 private int _id; -
branches/Emisje/BazaReklam/Classes/Model/Rozdzial.cs
r732 r784 1 using Baza_Reklam.Classes.Interfaces; 2 1 3 namespace Baza_Reklam.Classes.Model 2 4 { 3 public class NavigationSubColumn 5 public class NavigationSubColumn : IEntity 4 6 { 5 7 private int _id; -
branches/Emisje/BazaReklam/Classes/Model/Section.cs
r732 r784 1 1 using System.Collections.Generic; 2 using Baza_Reklam.Classes.Interfaces; 2 3 using Baza_Reklam.Classes.Repositories; 3 4 4 5 namespace Baza_Reklam.Classes.Model 5 6 { 6 public class Section 7 public class Section : IEntity 7 8 { 8 9 private int _id; -
branches/Emisje/BazaReklam/Classes/Model/Title.cs
r732 r784 1 1 using System.Collections.Generic; 2 using Baza_Reklam.Classes.Interfaces; 2 3 using Baza_Reklam.Classes.Repositories; 3 4 4 5 namespace Baza_Reklam.Classes.Model 5 6 { 6 public class Title 7 public class Title : IEntity 7 8 { 8 9 private int _id; -
branches/Emisje/BazaReklam/Classes/Repositories/NavigationColumnRepository.cs
r779 r784 97 97 return navigationSubColumnRepository.FindAllActiveByNavigationColumn(navigationColumn); 98 98 } 99 100 public List<NavigationSubColumn> FindActiveNavigationSubColumnsByNavigationColumnId(int navigationColumnId) 101 { 102 NavigationSubColumnRepository navigationSubColumnRepository = new NavigationSubColumnRepository(_connectionString); 103 return navigationSubColumnRepository.FindAllActiveByNavigationColumnId(navigationColumnId, null); 104 } 99 105 } 100 106 } -
branches/Emisje/BazaReklam/Classes/Repositories/NavigationSubColumnRepository.cs
r779 r784 58 58 public List<NavigationSubColumn> FindAllActiveByNavigationColumn(NavigationColumn navigationColumn) 59 59 { 60 return FindAllActiveByNavigationColumnId(navigationColumn.Id, navigationColumn); 61 } 62 63 public List<NavigationSubColumn> FindAllActiveByNavigationColumnId(int navigationColumnId, NavigationColumn navigationColumn) 64 { 60 65 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); 62 67 63 68 List<NavigationSubColumn> navigationSubColumns = new List<NavigationSubColumn>(); … … 77 82 { 78 83 NavigationSubColumn navigationSubColumn = new NavigationSubColumn(reader.GetInt32(0), reader.GetString(1)); 79 navigationSubColumn.NavigationColumn = navigationColumn; 84 if (navigationColumn != null) 85 navigationSubColumn.NavigationColumn = navigationColumn; 80 86 81 87 navigationSubColumns.Add(navigationSubColumn); -
branches/Emisje/BazaReklam/EditAdIssue.Designer.cs
r783 r784 33 33 this.cbNavigationSubColumn = new System.Windows.Forms.ComboBox(); 34 34 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(); 35 39 this.SuspendLayout(); 36 40 // … … 38 42 // 39 43 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); 41 45 this.button1.Name = "button1"; 42 46 this.button1.Size = new System.Drawing.Size(75, 23); … … 48 52 // 49 53 this.cbNavigationColumn.FormattingEnabled = true; 50 this.cbNavigationColumn.Location = new System.Drawing.Point( 79, 12);54 this.cbNavigationColumn.Location = new System.Drawing.Point(92, 28); 51 55 this.cbNavigationColumn.Name = "cbNavigationColumn"; 52 56 this.cbNavigationColumn.Size = new System.Drawing.Size(121, 21); 53 57 this.cbNavigationColumn.TabIndex = 1; 58 this.cbNavigationColumn.SelectedIndexChanged += new System.EventHandler(this.cbNavigationColumn_SelectedIndexChanged); 54 59 // 55 60 // cbNavigationSubColumn 56 61 // 57 62 this.cbNavigationSubColumn.FormattingEnabled = true; 58 this.cbNavigationSubColumn.Location = new System.Drawing.Point( 79, 54);63 this.cbNavigationSubColumn.Location = new System.Drawing.Point(92, 64); 59 64 this.cbNavigationSubColumn.Name = "cbNavigationSubColumn"; 60 65 this.cbNavigationSubColumn.Size = new System.Drawing.Size(121, 21); … … 64 69 // 65 70 this.cbAdLocation.FormattingEnabled = true; 66 this.cbAdLocation.Location = new System.Drawing.Point( 79, 101);71 this.cbAdLocation.Location = new System.Drawing.Point(92, 100); 67 72 this.cbAdLocation.Name = "cbAdLocation"; 68 73 this.cbAdLocation.Size = new System.Drawing.Size(121, 21); 69 74 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); 70 113 // 71 114 // EditAdIssue … … 73 116 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 74 117 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); 76 124 this.Controls.Add(this.cbAdLocation); 77 125 this.Controls.Add(this.cbNavigationSubColumn); 78 126 this.Controls.Add(this.cbNavigationColumn); 79 127 this.Controls.Add(this.button1); 128 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 80 129 this.Name = "EditAdIssue"; 81 this.Text = "EditAdIssue"; 130 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 131 this.Text = "Edytuj emisjê"; 82 132 this.Load += new System.EventHandler(this.EditAdIssue_Load); 83 133 this.ResumeLayout(false); 134 this.PerformLayout(); 84 135 85 136 } … … 91 142 private System.Windows.Forms.ComboBox cbNavigationSubColumn; 92 143 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; 93 148 } 94 149 } -
branches/Emisje/BazaReklam/EditAdIssue.cs
r783 r784 1 1 using System; 2 using System.Collections.Generic;3 using System.ComponentModel;4 using System.Data;5 using System.Drawing;6 using System.Text;7 2 using System.Windows.Forms; 8 3 using Baza_Reklam.Classes.Helpers; … … 28 23 get 29 24 { 30 if (cbNavigationColumn.SelectedI tem != null)25 if (cbNavigationColumn.SelectedIndex > 0 && cbNavigationColumn.SelectedItem != null) 31 26 return (NavigationColumn)cbNavigationColumn.SelectedItem; 32 27 return null; … … 39 34 get 40 35 { 41 if (cbNavigationSubColumn.SelectedI tem != null)36 if (cbNavigationSubColumn.SelectedIndex > 0 && cbNavigationSubColumn.SelectedItem != null) 42 37 return (NavigationSubColumn)cbNavigationSubColumn.SelectedItem; 43 38 return null; … … 45 40 } 46 41 47 public EditAdIssue( )42 public EditAdIssue(Title title, int? dzialId, int? rozdzialId, int lokalizacjaId) 48 43 { 49 44 InitializeComponent(); 50 45 51 AdLocationRepository ad PlacementRepository = new AdLocationRepository(ConnString.getConnString().Value);52 ComboBoxHelper.Bind(ad PlacementRepository.FindAll(), cbAdLocation);46 AdLocationRepository adLocationRepository = new AdLocationRepository(ConnString.getConnString().Value); 47 ComboBoxHelper.Bind(adLocationRepository.FindAll(), cbAdLocation); 53 48 cbAdLocation.DisplayMember = "Text"; 54 49 cbAdLocation.ValueMember = "Id"; 55 cbAdLocation.SelectedIndex = 0;50 cbAdLocation.SelectedIndex = ComboBoxHelper.GetItemIndex(lokalizacjaId, cbAdLocation); 56 51 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; 62 61 62 cbNavigationColumn.SelectedIndex = ComboBoxHelper.GetItemIndex(dzialId.Value, cbNavigationColumn); 63 63 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 } 70 68 } 71 69 … … 74 72 75 73 } 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 } 76 91 } 77 92 } -
branches/Emisje/BazaReklam/OrderDetails.Designer.cs
r783 r784 189 189 this.usunToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 190 190 this.anulujToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 191 this.editMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 191 192 this.advertSiteContext = new System.Windows.Forms.ContextMenuStrip(this.components); 192 193 this.deleteItem = new System.Windows.Forms.ToolStripMenuItem(); … … 194 195 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 195 196 this.btnSaveClose = new System.Windows.Forms.Button(); 196 this.editMenuItem = new System.Windows.Forms.ToolStripMenuItem();197 197 sYMBOL_AKWIZYTORALabel = new System.Windows.Forms.Label(); 198 198 tYTULLabel = new System.Windows.Forms.Label(); … … 1802 1802 // 1803 1803 this.emisjeContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 1804 this.editMenuItem, 1804 1805 this.zmienToolStripMenuItem, 1805 this.usunToolStripMenuItem,1806 1806 this.anulujToolStripMenuItem, 1807 this. editMenuItem});1807 this.usunToolStripMenuItem}); 1808 1808 this.emisjeContextMenuStrip.Name = "emisjeContextMenuStrip"; 1809 1809 this.emisjeContextMenuStrip.Size = new System.Drawing.Size(153, 114); … … 1826 1826 this.anulujToolStripMenuItem.Size = new System.Drawing.Size(152, 22); 1827 1827 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"; 1828 1834 // 1829 1835 // advertSiteContext … … 1864 1870 this.btnSaveClose.UseVisualStyleBackColor = true; 1865 1871 this.btnSaveClose.Click += new System.EventHandler(this.btnSaveClose_Click); 1866 //1867 // editMenuItem1868 //1869 this.editMenuItem.Name = "editMenuItem";1870 this.editMenuItem.Size = new System.Drawing.Size(152, 22);1871 this.editMenuItem.Text = "Edytuj";1872 1872 // 1873 1873 // OrderDetails -
branches/Emisje/BazaReklam/OrderDetails.cs
r783 r784 171 171 rEKLAMADataSet.UKAZE_SIE_W_NR.TableNewRow += nowaEmisja; 172 172 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 183 173 pROMOCJETableAdapter.Fill(sLOWNIKDataSet.PROMOCJE); 184 174 … … 912 902 obslugaZdarzen = true; 913 903 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); 916 906 mOD_TYPComboBox.SelectedIndex = mOD_TYPComboBox.FindString(Reklama.MOD_TYP); 917 907 … … 919 909 promocjaComboBox.SelectedIndex = -1; 920 910 else 921 promocjaComboBox.SelectedIndex = GetPromotionIndex(Reklama.PROMOCJA);911 promocjaComboBox.SelectedIndex = ComboBoxHelper.GetItemIndex(Reklama.PROMOCJA, promocjaComboBox); 922 912 923 913 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;973 914 } 974 915 … … 1051 992 obslugaZdarzen = true; 1052 993 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); 1054 995 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); 1056 997 1057 998 if (SelectedModule != null) … … 1332 1273 public void UsunEmisje(object sender, EventArgs e) 1333 1274 { 1275 DialogResult dialogResult = MessageBox.Show("Usun¹æ emisjê?", "Baza Reklam - usuñ emisjê", 1276 MessageBoxButtons.YesNo); 1277 1278 if (dialogResult != DialogResult.Yes) return; 1279 1280 1334 1281 foreach (DataGridViewRow r in ukazeSieDataGridView.SelectedRows) 1335 1282 { … … 1353 1300 if (ukazeSieDataGridView.CurrentCell == null) return; 1354 1301 1302 DialogResult dialogResult = MessageBox.Show("Anulowaæ emisjê?", "Baza Reklam - anuluj emisjê", 1303 MessageBoxButtons.YesNo); 1304 1305 if (dialogResult != DialogResult.Yes) return; 1306 1355 1307 DataGridViewRow r1 = ukazeSieDataGridView.CurrentCell.OwningRow; 1356 1308 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); 1358 1311 1359 1312 row.status = 2; … … 1391 1344 private void EdytujEmisje(object sender, EventArgs e) 1392 1345 { 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); 1394 1358 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 { 1399 1361 issue.Lokalizacja = editAdIssue.Lokalizacja.Text; 1400 1362 issue.LokalizacjaId = editAdIssue.Lokalizacja.Id; 1401 if (editAdIssue.Dzial !=null)1363 if (editAdIssue.Dzial != null) 1402 1364 { 1403 1365 issue.DzialId = editAdIssue.Dzial.Id; 1404 issue.Dzial = editAdIssue.Dzial.Name; 1366 issue.Dzial = editAdIssue.Dzial.Name; 1405 1367 } 1406 1368 … … 1408 1370 { 1409 1371 issue.RozdzialId = editAdIssue.Rozdzial.Id; 1410 issue.Rozdzial = editAdIssue.Rozdzial.Name; 1411 } 1412 1413 } 1414 1372 issue.Rozdzial = editAdIssue.Rozdzial.Name; 1373 } 1374 } 1415 1375 } 1416 1376 … … 1730 1690 } 1731 1691 1732 ogl_dzialComboBox.SelectedIndex = GetNavigationColumnIndex(Reklama.ogl_dzial);1692 ogl_dzialComboBox.SelectedIndex = ComboBoxHelper.GetItemIndex(Reklama.ogl_dzial, ogl_dzialComboBox); 1733 1693 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); 1735 1695 1736 1696 if (!isEventHandlingEnabled)
