Zbiór zmian 778 dla branches/Emisje

Pokaż
Ignoruj:
Data:
2009-07-24 16:34:06 (17 years ago)
Autor:
marek
Opis:

re #195 - poprawiono liste promocji

Lokalizacja:
branches/Emisje/BazaReklam
Pliki:
2 dodane
3 zmodyfikowane

Legenda:

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

    r777 r778  
    134134    <Compile Include="Classes\Model\AdLocation.cs" /> 
    135135    <Compile Include="Classes\Model\Agent.cs" /> 
     136    <Compile Include="Classes\Model\Bargain.cs" /> 
    136137    <Compile Include="Classes\Model\Country.cs" /> 
    137138    <Compile Include="Classes\Model\Dzial.cs" /> 
     
    153154    <Compile Include="Classes\Repositories\AdLocationRepository.cs" /> 
    154155    <Compile Include="Classes\Repositories\AgentRepository.cs" /> 
     156    <Compile Include="Classes\Repositories\BargainRepository.cs" /> 
    155157    <Compile Include="Classes\Repositories\CountryRepository.cs" /> 
    156158    <Compile Include="Classes\Repositories\IRepository.cs" /> 
  • branches/Emisje/BazaReklam/OrderDetails.Designer.cs

    r776 r778  
    12381238            // promocjaComboBox 
    12391239            //  
    1240             this.promocjaComboBox.DataSource = this.pROMOCJEBindingSource; 
    1241             this.promocjaComboBox.DisplayMember = "Nazwa"; 
    12421240            this.promocjaComboBox.Location = new System.Drawing.Point(286, 185); 
    12431241            this.promocjaComboBox.Name = "promocjaComboBox"; 
    12441242            this.promocjaComboBox.Size = new System.Drawing.Size(124, 21); 
    12451243            this.promocjaComboBox.TabIndex = 14; 
    1246             this.promocjaComboBox.ValueMember = "id"; 
    12471244            //  
    12481245            // button3 
  • branches/Emisje/BazaReklam/OrderDetails.cs

    r777 r778  
    9696        } 
    9797 
     98        private Bargain SelectedBargain 
     99        { 
     100            get 
     101            { 
     102                if (promocjaComboBox.SelectedItem == null) return null; 
     103                return (Bargain)promocjaComboBox.SelectedItem; 
     104            } 
     105        } 
     106 
    98107        protected REKLAMADataSet.REKLAMARow Reklama 
    99108        { 
     
    127136            cbLocation.ValueMember = "Id"; 
    128137            cbLocation.SelectedIndex = 0; 
     138 
     139            BargainRepository bargainRepository = new BargainRepository(ConnString.getConnString().Value); 
     140            ComboBoxHelper.Bind(bargainRepository.FindAllActive(), promocjaComboBox); 
     141            promocjaComboBox.DisplayMember = "Name"; 
     142            promocjaComboBox.ValueMember = "Id"; 
     143            promocjaComboBox.SelectedIndex = -1; 
    129144 
    130145            ComboBoxHelper.Bind(_titles, tYTULComboBox); 
     
    345360            } 
    346361 
    347             if (string.IsNullOrEmpty(promocjaComboBox.Text)) 
     362            if (SelectedBargain == null) 
    348363            { 
    349364                DataRowView row = (DataRowView)rEKLAMABindingSource.Current; 
     
    351366            } 
    352367            else 
    353                 Reklama.PROMOCJA = Convert.ToInt32(((DataRowView)promocjaComboBox.SelectedItem).Row[0]); 
     368                Reklama.PROMOCJA = SelectedBargain.Id; 
    354369 
    355370            if (nowyRekord) 
     
    638653            } 
    639654 
    640             ////lokalizacja 
    641             //if (sTRONATextBox.Text == "") 
    642             //{ 
    643             //    MessageBox.Show("Podaj lokalizacjê."); 
    644             //    zATWIERDZONO_DO_DRUKUCheckBox.CheckState = CheckState.Unchecked; 
    645             //    return; 
    646             //} 
    647  
    648655            if (rEKLAMAUKAZESIEWNRBindingSource.List.Count != 0) return; 
    649656 
     
    836843            bylyZmiany = false; 
    837844 
     845            promocjaComboBox.SelectedIndex = -1; 
     846 
    838847            numeryReklam.Clear(); 
    839848 
     
    954963            { 
    955964                index++; 
    956                 if (item is DataRowView && Convert.ToInt32(((DataRowView)item).Row[0]) == value) 
     965                if (item is Bargain && Convert.ToInt32(((Bargain)item).Id) == value) 
    957966                    return index;                 
    958967            } 
     
    17241733 
    17251734            if (Validate()) 
    1726             { 
    17271735                RecalculateAdSize(); 
    1728  
    1729                 //txtTotalModuleAmount.Text = 
    1730                 //    ReCaluculateModuleAmount(txtHorizontal.Text, txtVertical.Text).ToString(); 
    1731  
    1732                 //int horizontal, vertical; 
    1733                 //if (int.TryParse(txtHorizontal.Text, out horizontal) && int.TryParse(txtVertical.Text, out vertical)) 
    1734                 //{ 
    1735                 //    AdSize adSize = AdHelper.GetAdSize(horizontal, vertical, SelectedModule); 
    1736  
    1737                 //    sZERTextBox.Text = adSize.Width.ToString(); 
    1738                 //    wYSTextBox.Text = adSize.Height.ToString(); 
    1739                 //} 
    1740             } 
    17411736        } 
    17421737 
     
    17461741 
    17471742            if (Validate()) 
    1748             { 
    1749  
    17501743                RecalculateAdSize(); 
    1751                  
    1752                 //txtTotalModuleAmount.Text = 
    1753                 //    ReCaluculateModuleAmount(txtHorizontal.Text, txtVertical.Text).ToString(); 
    1754  
    1755                 //int horizontal, vertical; 
    1756                 //if (int.TryParse(txtHorizontal.Text, out horizontal) && int.TryParse(txtVertical.Text, out vertical)) 
    1757                 //{ 
    1758                 //    AdSize adSize = AdHelper.GetAdSize(horizontal, vertical, SelectedModule); 
    1759  
    1760                 //    sZERTextBox.Text = adSize.Width.ToString(); 
    1761                 //    wYSTextBox.Text = adSize.Height.ToString(); 
    1762                 //} 
    1763             } 
    17641744        } 
    17651745