Pokaż
Ignoruj:
Pliki:
1 zmodyfikowane

Legenda:

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

    r23 r2  
    4141        short nowaEmisja; 
    4242 
     43        public short NowaEmisja 
     44        { 
     45            get { return nowaEmisja; } 
     46            set { nowaEmisja = value; } 
     47        } 
    4348        int iloscEmisji; 
    4449        int index = -1; 
    4550 
    46         public DateTime dataOstatatniejZafakturowanejEmisji = DateTime.Today; 
    47  
    4851        #region properties 
    49  
    50         public short NowaEmisja 
    51         { 
    52             get { return nowaEmisja; } 
    53             set { nowaEmisja = value; } 
    54         } 
    5552 
    5653        public string Tytul 
     
    6966            this.reklama = reklama; 
    7067            this.emisje = emisje; 
    71  
     68             
    7269            foreach (DataRow r in emisje.Rows) 
    7370            { 
     
    7774                } 
    7875            } 
    79  
     76             
    8077            label2.Text = iloscEmisji.ToString(); 
    8178 
     
    113110            } 
    114111 
    115             short nr = Emisje.MaxZafakturowanyNrWydania(); 
    116    
    117             if (nr != 0) 
    118             { 
    119                 dataOstatatniejZafakturowanejEmisji = this.sLOWNIKDataSet.NR.dataWydania(Tytul, nr); 
    120             } 
    121  
    122112            nRDataGridView.CellValueChanged += nRDataGridView_CellValueChanged; 
    123113            nRDataGridView.CellContentClick += nRDataGridView_CellContentClicked; 
    124  
    125             nRBindingSource.ResetBindings(false); 
    126114        } 
    127115 
     
    191179                            nRDataGridView.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.White; 
    192180                        } 
    193  
     181                        
    194182                    } 
    195183                } 
     
    221209                foreach (DataGridViewRow row in nRDataGridView.Rows) 
    222210                { 
     211 
    223212                    row.DefaultCellStyle.BackColor = Color.White; 
    224213 
     
    234223                            (REKLAMADataSet.UKAZE_SIE_W_NRRow)table[0]; 
    235224 
     225 
    236226                        if (Convert.ToDateTime(row.Cells[1].Value) < DateTime.Today) 
    237227                        { 
    238228                            row.DefaultCellStyle.BackColor = Color.MintCream; 
    239229                        } 
    240                         else 
    241                         { 
    242                             if (em.zafakturowana) 
    243                             { 
    244                                 row.DefaultCellStyle.BackColor = Color.LightGray; 
    245                             } 
    246  
    247                             //anulowana 
    248                             if (em.status == 2) 
    249                             { 
    250                                 row.DefaultCellStyle.ForeColor = Color.Red; 
    251                             } 
    252  
    253                             if (emisjaDoZmiany == (short)row.Cells[0].Value) 
    254                             { 
    255                                 row.DefaultCellStyle.BackColor = Color.MistyRose; 
    256                             } 
    257                         } 
    258                     } 
    259                     else if (emisjaDoZmiany == 0) 
    260                     { 
    261                         //emisja nie zosta³a wczeœniej wybrana, ale jej misi¹c ju¿ 
    262                         // jest zafakturowany 
    263                         DateTime dataWydania = (DateTime)row.Cells[1].Value; 
    264                         if (dataWydania.Year <= dataOstatatniejZafakturowanejEmisji.Year 
    265                             && 
    266                             dataWydania.Month <= dataOstatatniejZafakturowanejEmisji.Month) 
    267                         { 
    268                             row.ReadOnly = true; 
     230 
     231                        if (em.zafakturowana) 
     232                        { 
    269233                            row.DefaultCellStyle.BackColor = Color.LightGray; 
    270234                        } 
    271                     } 
    272                 } 
    273             } 
    274         } 
     235 
     236                        //anulowana 
     237                        if (em.status == 2) 
     238                        { 
     239                            row.DefaultCellStyle.ForeColor = Color.Red; 
     240                        } 
     241 
     242                        if (emisjaDoZmiany == (short)row.Cells[0].Value) 
     243                        { 
     244                            row.DefaultCellStyle.BackColor = Color.MistyRose; 
     245                        } 
     246                    } 
     247                } 
     248            } 
     249        } 
     250 
    275251    } 
    276252}