Pokaż
Ignoruj:
Data:
2008-12-21 14:48:25 (17 years ago)
Autor:
dorota
Opis:
 
Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • Baza Reklam 2 - Faktury/OrderDetails.cs

    r2 r10  
    278278        } 
    279279 
    280         private void button2_Click(object sender, EventArgs e) 
    281         { 
    282             if (rEKLAMABindingSource.Current != null) 
    283             { 
    284                 rEKLAMABindingSource.EndEdit(); 
    285                 przelicz(); 
    286             } 
    287         } 
    288  
    289280        /// <summary> 
    290281        /// formatowanie do decimal -> % 
     
    292283        private void DecimalToProcent(object sender, ConvertEventArgs cevent) 
    293284        { 
    294  
    295285            if (Convert.ToDecimal(cevent.Value) > 1) 
    296286            { 
     
    298288            } 
    299289            cevent.Value = String.Format("{0:P}", cevent.Value); 
    300  
    301290        } 
    302291 
     
    390379            ogl_dzialComboBox.SelectedIndex = -1; 
    391380            ogl_rozdzialComboBox.SelectedIndex = -1; 
    392  
     381           // walutyComboBox.SelectedIndex = 0; 
    393382            kurs = null; 
    394             walutyComboBox.SelectedIndex = 0; 
    395  
    396383            obslugaZdarzen = true; 
    397384          
     
    901888            this.nowyRekord = false; 
    902889            this.bylyZmiany = false; 
    903  
    904890            this.reklamaId = rekId; 
    905891 
     
    907893            this.rEKLAMATableAdapter.FillByReklamaId(this.rEKLAMADataSet.REKLAMA, reklamaId); 
    908894            this.reklama_Info_DodTableAdapter.FillByReklamaId(this.rEKLAMADataSet.Reklama_Info_Dod, reklamaId); 
    909  
    910             rEKLAMABindingSource.MoveFirst(); 
    911             DataRowView row = (DataRowView)rEKLAMABindingSource.Current; 
    912  
    913             //wyliczona cena modulu 
    914             int szer = Convert.ToInt32(row["SZER"]); 
    915             int wys = Convert.ToInt32(row["WYS"]); 
    916             int krotnosc = Convert.ToInt32(row["KROTNOŒÆ"]); 
    917             decimal cenaJednostkowa = Convert.ToDecimal(row["CENA JEDN"]); 
    918             decimal vatProcent = Convert.ToDecimal(row["VAT"]); 
    919             decimal prowizjaProcent = Convert.ToDecimal(row["PROCENT PROWIZJI"]); 
    920             decimal rabatProcent = Convert.ToDecimal(row["RABAT"]); 
    921             decimal rabatWartosc = rabatProcent * cenaJednostkowa; 
    922             decimal netto = (cenaJednostkowa - rabatWartosc) * krotnosc; 
    923             decimal cenaModulu; 
    924             if ((szer * wys * krotnosc) != 0) 
    925             { 
    926                 cenaModulu = netto / (szer * wys * krotnosc); 
    927                 cenaModuluLabel.Text = String.Format("{0:C}", cenaModulu); 
    928             } 
    929             else 
    930             { 
    931                 cenaModuluLabel.Text = "---"; 
    932             } 
    933  
    934895            this.rEKLAMA_STRONATableAdapter.FillByReklamaId(this.rEKLAMADataSet.REKLAMA_STRONA, this.reklamaId); 
    935896            this.uKAZE_SIE_W_NRTableAdapter.FillByReklamaId(this.rEKLAMADataSet.UKAZE_SIE_W_NR, this.reklamaId); 
    936  
    937             this.rEKLAMABindingSource.ResetBindings(false); 
    938  
    939             liczbaEmisjiLabel.Text = this.rEKLAMADataSet.UKAZE_SIE_W_NR.Rows.Count.ToString(); 
    940  
    941897        } 
    942898 
     
    15961552        } 
    15971553 
     1554        private void rEKLAMABindingSource_BindingComplete(object sender, BindingCompleteEventArgs e) 
     1555        { 
     1556            if (rEKLAMABindingSource.Current != null) 
     1557            { 
     1558                DataRowView row = (DataRowView)rEKLAMABindingSource.Current; 
     1559                REKLAMADataSet.REKLAMARow reklama = (REKLAMADataSet.REKLAMARow)row.Row; 
     1560                //wyliczona cena modulu 
     1561                double szer = reklama.SZER; 
     1562                double wys = reklama.WYS; 
     1563                int krotnosc = reklama.KROTNOŒÆ; 
     1564                double cenaJednostkowa = reklama.CENA_JEDN; 
     1565                double vatProcent = reklama.VAT; 
     1566                double prowizjaProcent = reklama.PROCENT_PROWIZJI; 
     1567                double rabatProcent = reklama.RABAT; 
     1568                double rabatWartosc = rabatProcent * cenaJednostkowa; 
     1569                double netto = (cenaJednostkowa - rabatWartosc) * krotnosc; 
     1570                double cenaModulu; 
     1571                if ((szer * wys * krotnosc) != 0) 
     1572                { 
     1573                    cenaModulu = netto / (szer * wys * krotnosc); 
     1574                    cenaModuluLabel.Text = String.Format("{0:C}", cenaModulu); 
     1575                } 
     1576                else 
     1577                { 
     1578                    cenaModuluLabel.Text = "---"; 
     1579                } 
     1580 
     1581                liczbaEmisjiLabel.Text = this.rEKLAMADataSet.UKAZE_SIE_W_NR.Rows.Count.ToString(); 
     1582 
     1583                this.obslugaZdarzen = false; 
     1584                if (!reklama.IsBrutto_Euro_MianoNull()) 
     1585                { 
     1586                    walutyComboBox.SelectedItem = reklama.Brutto_Euro_Miano; 
     1587                } 
     1588                else 
     1589                { 
     1590                    walutyComboBox.SelectedIndex = 0; //PLN 
     1591                } 
     1592                this.obslugaZdarzen = true; 
     1593            } 
     1594        } 
    15981595    } 
    15991596}