public void ChannelADispatcherReport_Test() { DateTime beginDate = DateTime.Now.AddMonths(-3); DateTime endDate = DateTime.Now; PrimaryIncidentDispatcherReport incident = new PrimaryIncidentDispatcherReport(); incident = Provider.GetPrimaryIncidentDispatcherReport(beginDate, endDate); }
private static void BuildReport(PrimaryIncidentDispatcherReport returnValue, DataSet reportDataSet, DateTime beginDate, DateTime endDate) { foreach (DataRow row in reportDataSet.Tables[0].Rows) { PrimaryIncidentReportTotals incident = new PrimaryIncidentReportTotals(); incident.Dispatcher = new Dispatcher(); incident.Dispatcher.DispatcherId = row["DispatcherId"].ToString(); incident.Dispatcher.FirstName = row["FirstName"].ToString(); incident.Dispatcher.LastName = row["LastName"].ToString(); incident.ToneAlertUsed = 100 * (decimal.Parse(row["ToneAlertUsed"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.ToneAlertUsed += incident.ToneAlertUsed; incident.Priority = 100 * (decimal.Parse(row["Priority"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.Priority += incident.Priority; incident.Sunstar3DigitUnit = 100 * (decimal.Parse(row["Sunstar3DigitNumber"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.Sunstar3DigitUnit += incident.Sunstar3DigitUnit; incident.Location = 100 * (decimal.Parse(row["Location"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.Location += incident.Location; incident.MapGrid = 100 * (decimal.Parse(row["MapGrid"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.MapGrid += incident.MapGrid; incident.NatureOfCall = 100 * (decimal.Parse(row["NatureOfCall"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.NatureOfCall += incident.NatureOfCall; incident.SsTacChannel = 100 * (decimal.Parse(row["SsTacChannel"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.SsTacChannel += incident.SsTacChannel; incident.PertinentIntRouting = 100 * (decimal.Parse(row["PertinentIntRouting"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.PertinentIntRouting += incident.PertinentIntRouting; incident.InfoGivenOutOfOrder = 100 * (decimal.Parse(row["InfoGivenOutOfOrder"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.InfoGivenOutOfOrder += incident.InfoGivenOutOfOrder; incident.UsedProhibitedBehavior = 100 * (decimal.Parse(row["UsedProhibitedBehavior"].ToString()) / decimal.Parse(row["CallCount"].ToString())); returnValue.DispatcherBottomLineTotals.UsedProhibitedBehavior += incident.UsedProhibitedBehavior; incident.DisplayedServiceAttitude = 100 * TertiaryReceptor( int.Parse(row["DisplayedServiceAttitude_Correct"].ToString()), int.Parse(row["DisplayedServiceAttitude_Incorrect"].ToString()), int.Parse(row["DisplayedServiceAttitude_Minor"].ToString()), 25, 10, 0, false); returnValue.DispatcherBottomLineTotals.DisplayedServiceAttitude += incident.DisplayedServiceAttitude; incident.UsedCorrectVolumeTone = 100 * TertiaryReceptor( int.Parse(row["UsedCorrectVolumeTone_Correct"].ToString()), int.Parse(row["UsedCorrectVolumeTone_Incorrect"].ToString()), int.Parse(row["UsedCorrectVolumeTone_Minor"].ToString()), 25, 10, 0, false); returnValue.DispatcherBottomLineTotals.UsedCorrectVolumeTone += incident.UsedCorrectVolumeTone; incident.CallCount = int.Parse(row["CallCount"].ToString()); returnValue.DispatcherBottomLineTotals.CallCount += incident.CallCount; incident.TotalScore = decimal.Parse(row["TotalScore"].ToString()) / decimal.Parse(row["CallCount"].ToString()); returnValue.DispatcherBottomLineTotals.TotalScore += incident.TotalScore; returnValue.DispatcherTotals.Add(incident); } if (reportDataSet.Tables[0].Rows.Count > 0) { returnValue.DispatcherBottomLineTotals.DisplayedServiceAttitude /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.InfoGivenOutOfOrder /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.Location /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.MapGrid /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.NatureOfCall /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.PertinentIntRouting /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.Priority /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.SsTacChannel /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.Sunstar3DigitUnit /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.ToneAlertUsed /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.TotalScore /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.UsedCorrectVolumeTone /= returnValue.DispatcherTotals.Count; returnValue.DispatcherBottomLineTotals.UsedProhibitedBehavior /= returnValue.DispatcherTotals.Count; } returnValue.BeginDate = beginDate; returnValue.EndDate = endDate; }
public static PrimaryIncidentDispatcherReport GetPrimaryIncidentEvaluatorReport(DateTime beginDate, DateTime endDate) { PrimaryIncidentDispatcherReport returnValue = new PrimaryIncidentDispatcherReport(); returnValue.DispatcherTotals = new List<PrimaryIncidentReportTotals>(); returnValue.DispatcherBottomLineTotals = new PrimaryIncidentReportTotals(); DataSet reportDataSet = Data.Provider.PrimaryIncidentReport_Evaluator_SelectByDateRange(beginDate, endDate); BuildReport(returnValue, reportDataSet, beginDate, endDate); returnValue.ReportName = "Protocol Compliance Report (Evaluators)"; returnValue.ScriptInfo = "Channel A Script"; return returnValue; }