Hi,
I have a IF-Else statement, seems not getting the values populated for the first 4 of my cases, the values from 0-3.
the following is my code.
int MST = Convert.ToInt32(Convert.ToInt32(DetailsView3.Rows[0].Cells[1].Text));
if (MST == 0)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 1)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Green;
DetailsView2.Rows[3].Cells[1].Text = "Order";
}
else if (MST == 2)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Green;
DetailsView2.Rows[3].Cells[1].Text = "Order";
}
else if (MST == 3)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Green;
DetailsView2.Rows[3].Cells[1].Text = "Open";
}
else if (MST == 4)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Green;
DetailsView2.Rows[3].Cells[1].Text = "Open";
}
else if (MST == 5)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 6)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 7)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 8)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 9)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
I have also tried to catch the values in MST using :
Respnose.Write(MST.ToString());
Thanks all.