Exemplo n.º 1
0
 private void dgvRecalcPeriod_CellFormatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
 {
     if ((this.dgvRecalcPeriod.Columns.get_Item(e.get_ColumnIndex()) == this.DiffChargeSummPeriod) || (this.dgvRecalcPeriod.Columns.get_Item(e.get_ColumnIndex()) == this.DiffBenefitSummPeriod))
     {
         decimal num = System.Convert.ToDecimal(e.get_Value());
         if (num > 0M)
         {
             e.CellStyle.set_BackColor(PositiveRecalcColor);
         }
         if (num < 0M)
         {
             e.CellStyle.set_BackColor(NegativeRecalcColor);
         }
         if (num == 0M)
         {
             e.CellStyle.set_BackColor(NormalRecalcColor);
         }
     }
 }
Exemplo n.º 2
0
 private void dgvAccountServices_CellFormatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
 {
     if (((this.dgvAccountServices.Columns.get_Item(e.get_ColumnIndex()) == this.serviceCodeDataGridViewTextBoxColumn) || (this.dgvAccountServices.Columns.get_Item(e.get_ColumnIndex()) == this.serviceShortName)) && (this.dgvAccountServices.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("serviceShortName").get_Value().ToString() == "ИТОГО:"))
     {
         e.CellStyle.set_BackColor(RecalcTotalsColor);
     }
     else if ((this.dgvAccountServices.Columns.get_Item(e.get_ColumnIndex()) == this.diffChargeSumm) || (this.dgvAccountServices.Columns.get_Item(e.get_ColumnIndex()) == this.diffBenefitSumm))
     {
         decimal num = System.Convert.ToDecimal(e.get_Value());
         if (num > 0M)
         {
             e.CellStyle.set_BackColor(PositiveRecalcColor);
         }
         if (num < 0M)
         {
             e.CellStyle.set_BackColor(NegativeRecalcColor);
         }
         if (num == 0M)
         {
             e.CellStyle.set_BackColor(NormalRecalcColor);
         }
     }
     else
     {
         e.CellStyle.set_BackColor(NormalRecalcColor);
     }
 }