public static void SetLabels(DataTable dtTool, BillingReportLabel labelTool, BillingReportLabel labelRoomSum, BillingReportLabel labelResFee) { decimal subTotalActivated = 0; labelRoomSum.Text = string.Empty; labelResFee.Text = string.Empty; if (dtTool.Rows.Count > 0) { subTotalActivated = Convert.ToDecimal(dtTool.Compute("SUM(LineCost)", string.Empty)); labelResFee.Text = string.Format("| Sub Total: {0:$#,##0.00}", subTotalActivated); labelResFee.Visible = true; UpdateRoomSums(dtTool, labelRoomSum); } if (subTotalActivated == 0) { labelTool.Text = "No tool usage fees in this period"; } else { labelTool.Text = string.Format("Total tool usage fees: {0:$#,##0.00}", subTotalActivated); } labelTool.Visible = true; }
private static void UpdateRoomSums(DataTable dt, BillingReportLabel lbl) { //2009-12-11 Used to calculate differen room charges, because users want to see those differentiated GetRoomSums(dt, out object lnfSum, out object cleanRoomSum, out object wetChemSum, out object testLabSum); UpdateSumLabel(lnfSum, lbl, "LNF"); UpdateSumLabel(cleanRoomSum, lbl, "Clean Room"); UpdateSumLabel(wetChemSum, lbl, "ROBIN"); UpdateSumLabel(testLabSum, lbl, "DC Lab"); }
private static void UpdateSumLabel(object sum, BillingReportLabel lbl, string roomName) { if (Utility.TryConvertTo(sum, out double temp, 0.0)) { if (!string.IsNullOrEmpty(lbl.Text)) { lbl.Text += " | "; } lbl.Text += string.Format("{0}: {1:$#,##0.00}", roomName, temp); lbl.Visible = true; } }
public ToolDetailResult() { LabelRoomSum = new BillingReportLabel(); LabelResFee = new BillingReportLabel(); LabelTool = new BillingReportLabel(); }