private void LoadCustomReports() { customReportTreeView.Nodes.Clear(); MyParent.LoadUserDefinedReports(false);//RALLY DE 6239 m_userReportDictionary = MyParent.UserReportTypesDictionary; if (m_userReportDictionary == null || m_userReportDictionary.Count == 0) { m_customReportCounter = 0; return; } m_customReportCounter = m_userReportDictionary.Count; //we will limit 10 types only UserReportGroupTreeNode tempGroup; UserReportTypeTreeNode tempType; foreach (KeyValuePair <int, UserReportType> type in m_userReportDictionary) { tempType = new UserReportTypeTreeNode(type.Value, false); foreach (KeyValuePair <int, UserReportGroup> group in type.Value.UserReportGroups) { tempGroup = new UserReportGroupTreeNode(group.Value, false); for (int iReport = 0; iReport < group.Value.ReportsArray.Count; iReport++) { // determine report set to use ReportInfo info = (ReportInfo)group.Value.ReportsArray[iReport]; ReportTypes reportTypeID = (ReportTypes)info.TypeID; // START RALLY DE4505 - Do NOT show bingoCard reports if PWP is on. if ((info.ID == BingoCardSalesDetailReport || info.ID == BingoCardSummaryReport) && Configuration.m_playWithPaper && reportTypeID == ReportTypes.Sales) { continue; } //END RALLY DE4505 ReportSetTreeNode setTreeNode = null; foreach (ReportSetTreeNode setNode in tempGroup.Nodes) { if (setNode.ReportType == reportTypeID) { setTreeNode = setNode; break; } } if (setTreeNode == null) { setTreeNode = CreateReportSetTreeNode(reportTypeID); tempGroup.Nodes.Add(setTreeNode); } setTreeNode.Nodes.Add(new ReportTreeNode((ReportInfo)group.Value.ReportsArray[iReport], false)); } tempType.Nodes.Add(tempGroup); } customReportTreeView.Nodes.Add(tempType); } }
private void LoadPredefinedReports() { predefinedReportTreeView.Nodes.Clear(); m_reportsDictionary = MyParent.ReportsDictionary; ReportSetTreeNode salesTreeNode = CreateReportSetTreeNode(ReportTypes.Sales); ReportSetTreeNode playerTreeNode = CreateReportSetTreeNode(ReportTypes.Player); ReportSetTreeNode miscTreeNode = CreateReportSetTreeNode(ReportTypes.Misc); ReportSetTreeNode staffTreeNode = CreateReportSetTreeNode(ReportTypes.Staff); ReportSetTreeNode bingoTreeNode = CreateReportSetTreeNode(ReportTypes.Bingo); ReportSetTreeNode electronicTreeNode = CreateReportSetTreeNode(ReportTypes.Electronics); ReportSetTreeNode exceptionsTreeNode = CreateReportSetTreeNode(ReportTypes.Exceptions); // Rally US1492 ReportSetTreeNode paperTreeNode = CreateReportSetTreeNode(ReportTypes.Paper); ReportSetTreeNode inventoryTreeNode = CreateReportSetTreeNode(ReportTypes.Inventory); ReportSetTreeNode gamingTreeNode = CreateReportSetTreeNode(ReportTypes.Gaming); // US1831, US1844, US1845 ReportSetTreeNode accrualsTreeNode = CreateReportSetTreeNode(ReportTypes.Accruals); ReportSetTreeNode payoutsTreeNode = CreateReportSetTreeNode(ReportTypes.Payouts); ReportSetTreeNode texasTreeNode = CreateReportSetTreeNode(ReportTypes.Texas); ReportSetTreeNode couponTreeNode = CreateReportSetTreeNode(ReportTypes.Coupon); predefinedReportTreeView.Nodes.Add(bingoTreeNode); predefinedReportTreeView.Nodes.Add(electronicTreeNode); predefinedReportTreeView.Nodes.Add(exceptionsTreeNode); predefinedReportTreeView.Nodes.Add(miscTreeNode); predefinedReportTreeView.Nodes.Add(playerTreeNode); predefinedReportTreeView.Nodes.Add(salesTreeNode); predefinedReportTreeView.Nodes.Add(staffTreeNode); predefinedReportTreeView.Nodes.Add(gamingTreeNode); predefinedReportTreeView.Nodes.Add(paperTreeNode); predefinedReportTreeView.Nodes.Add(inventoryTreeNode); // END: US1492 predefinedReportTreeView.Nodes.Add(accrualsTreeNode); // US1831 predefinedReportTreeView.Nodes.Add(payoutsTreeNode); // US1844 predefinedReportTreeView.Nodes.Add(couponTreeNode); if (Configuration.m_txPayoutsEnabled) // DE10904 only add the Texas node if TX payouts are enabled { predefinedReportTreeView.Nodes.Add(texasTreeNode); } foreach (KeyValuePair <int, ReportInfo> report in m_reportsDictionary) { switch ((ReportTypes)report.Value.TypeID) { case ReportTypes.Bingo: bingoTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; case ReportTypes.Electronics: electronicTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; case ReportTypes.Exceptions: exceptionsTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; case ReportTypes.Misc: miscTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; case ReportTypes.Player: playerTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; case ReportTypes.Sales: // START RALLY DE4505 - Do NOT show bingoCard reports if PWP is on. if ((report.Value.ID == BingoCardSalesDetailReport || report.Value.ID == BingoCardSummaryReport) && Configuration.m_playWithPaper) { continue; } salesTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; //END RALLY DE 4505 case ReportTypes.Staff: staffTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; // Rally US1492 case ReportTypes.Paper: paperTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; case ReportTypes.Gaming: gamingTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; case ReportTypes.Inventory: inventoryTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; // END: US1492 // US1831, 1844 case ReportTypes.Accruals: accrualsTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; case ReportTypes.Payouts: payoutsTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; case ReportTypes.Texas: if (Configuration.m_txPayoutsEnabled) // only add the Texas reports { texasTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); } break; case ReportTypes.Coupon: couponTreeNode.Nodes.Add(new ReportTreeNode(report.Value, false)); break; } } }
/// <summary> /// Adds the checked report(s) to the Customize Report list /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void addCheckedReportClick(object sender, EventArgs e) { //START RALLY DE 6919 error when deleting a group if (customReportTreeView.Nodes.Count == 0 || customReportTreeView.SelectedNode == null) { return; } //END RALLY DE 6919 foreach (TreeNode node in predefinedReportTreeView.Nodes) { foreach (ReportTreeNode report in node.Nodes) { if (report.Checked) { ReportTypes reportType = (ReportTypes)report.ReportInfo.TypeID; bool setFound = false; bool reportFound = false; // Starting with the selected Group Node, see if the ReportSet Node is available foreach (ReportSetTreeNode setNode in customReportTreeView.SelectedNode.Nodes) { if (setNode.ReportType == reportType) { // If present, we need to add the Report node if it is not in the ReportSet node. setFound = true; foreach (ReportTreeNode reportNode in setNode.Nodes) { if (reportNode.ReportInfo.ID == report.ReportInfo.ID) { reportFound = true; break; } } if (!reportFound) { saveButton.Enabled = true; ReportTreeNode tempReport = new ReportTreeNode(report.ReportInfo, true); setNode.Nodes.Add(tempReport); setNode.Expand(); } break; } } // If ReportSet is not in group, we need to create and add it to the group node // then create and add the Report Node to the ReportSet. if (!setFound) { saveButton.Enabled = true; ReportSetTreeNode setTreeNode = CreateReportSetTreeNode(reportType); setTreeNode.Nodes.Add(new ReportTreeNode(report.ReportInfo, true)); customReportTreeView.SelectedNode.Nodes.Add(setTreeNode); setTreeNode.Expand(); } } } customReportTreeView.SelectedNode.Expand(); } // Uncheck all boxes foreach (TreeNode node in predefinedReportTreeView.Nodes) { if (node.Checked) { node.Checked = false; } else { foreach (TreeNode treeNode in node.Nodes) { if (treeNode.Checked) { treeNode.Checked = false; } } } } }
//RALLY DE 4505 END private static ReportSetTreeNode CreateReportSetTreeNode(ReportTypes reportTypeID) { ReportSetTreeNode setTreeNode; switch (reportTypeID) { case ReportTypes.Bingo: setTreeNode = new ReportSetTreeNode(Resources.reportType_Bingo, ReportTypes.Bingo); break; case ReportTypes.Electronics: setTreeNode = new ReportSetTreeNode(Resources.reportType_Electronics, ReportTypes.Electronics); break; case ReportTypes.Exceptions: setTreeNode = new ReportSetTreeNode(Resources.reportType_Exceptions, ReportTypes.Exceptions); break; case ReportTypes.Misc: setTreeNode = new ReportSetTreeNode(Resources.reportType_Misc, ReportTypes.Misc); break; case ReportTypes.Player: setTreeNode = Configuration.mMachineAccounts ? new ReportSetTreeNode(Resources.reportTypePlayersMachine, ReportTypes.Player) : new ReportSetTreeNode(Resources.reportType_Players, ReportTypes.Player); break; case ReportTypes.Sales: setTreeNode = new ReportSetTreeNode(Resources.reportType_Sales, ReportTypes.Sales); break; case ReportTypes.Staff: setTreeNode = new ReportSetTreeNode(Resources.reportType_Staff, ReportTypes.Staff); break; // Rally US1492 case ReportTypes.Paper: setTreeNode = new ReportSetTreeNode(Resources.reportType_Paper, ReportTypes.Paper); break; case ReportTypes.Gaming: setTreeNode = new ReportSetTreeNode(Resources.reportType_Gaming, ReportTypes.Gaming); break; case ReportTypes.Inventory: setTreeNode = new ReportSetTreeNode(Resources.reportType_Inventory, ReportTypes.Inventory); break; // END: US1492 // US1831, US1844 case ReportTypes.Accruals: setTreeNode = new ReportSetTreeNode(Resources.reportType_Accruals, ReportTypes.Accruals); break; case ReportTypes.Payouts: setTreeNode = new ReportSetTreeNode(Resources.reportType_Payouts, ReportTypes.Payouts); break; // END US1831, 1844 //DE10904 case ReportTypes.Texas: setTreeNode = new ReportSetTreeNode(Resources.reportType_Texas, ReportTypes.Texas); break; case ReportTypes.Coupon: setTreeNode = new ReportSetTreeNode(Resources.reportType_Coupon, ReportTypes.Coupon); break; default: throw new NullReferenceException("Report Type not found"); } return(setTreeNode); }