public Cell(NameFunc text, EventSelect onClick, SpriteFont font, Color colorNormal, Color colorSelected) { OnClick = onClick ?? (( a, b,c) => true); Text = text; Font = font; ColorNormal = colorNormal; ColorSelected = colorSelected; _oldMilliSeconds = -1; }
protected void compute() { DataView dv3 = (DataView)EventSelect.Select(DataSourceSelectArguments.Empty); string evnttype = (string)dv3.Table.Rows[0][1]; Label2.Text = (string)dv3.Table.Rows[0][0]; if (dv3.Table.Rows[0][3] is DBNull) { evnttype = "Small Event"; } else { evnttype = "Big Event"; } Double crph = (Double)dv3.Table.Rows[0][2]; Double amount = 0, oe = 0, pb = 0; int hours = Convert.ToInt32(Session["NoofHours"].ToString()); if (evnttype == "Big Event") { Double cffhr = (Double)dv3.Table.Rows[0][3]; if (hours <= 3) { amount = cffhr; } else { hours = hours - 3; amount = cffhr + (hours * crph); } } else if (evnttype == "Small Event") { amount = crph * hours; } Label7.Text = amount.ToString("N2"); oe = (Double)dv3.Table.Rows[0][5]; Label8.Text = oe.ToString("n2"); if (dv3.Table.Rows[0][6] is DBNull) { Label9.Text = "0"; pb = 0; } else { pb = (Double)dv3.Table.Rows[0][6]; Label9.Text = pb.ToString("n2"); } Double total = amount + oe + pb; era.Text = amount.ToString(); gt.Text = total.ToString(); Label10.Text = "<strong>" + total.ToString("n2") + "</strong>"; if (dv3.Table.Rows[0][4] is DBNull) { Label11.Text = "0"; } else { Double rf = (Double)dv3.Table.Rows[0][4]; Label11.Text = rf.ToString("n2"); } }