i want to create a system that will trigger alert based on few condition, my condition is:
the alert will trigger if there is a negative value for 2 consecutive years.
example:
1)negative amount for 2005
2)negative amount for 2006
here is the code that i have for now
and the result only can trigger alert for one year only.... .
<code>
Protected Sub GridViewYCR_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridViewYCR.RowDataBound
' Check if row is data row
If e.Row.RowType = DataControlRowType.DataRow Then
Dim CellValue As Decimal = Convert.ToDecimal(e.Row.Cells(2).Text)
Dim CellValue2 As String = Convert.ToString(e.Row.Cells(3).Text) = "2005"
Dim CellValue3 As String = Convert.ToString(e.Row.Cells(3).Text) = "2006"
If ((CellValue2 AndAlso (CellValue < 0.0))) Then
e.Row.Cells(2).BackColor = Drawing.Color.Red
Else
e.Row.Cells(2).BackColor = Drawing.Color.Empty
End If
End If
End Sub
</code>