public void CheckValueForCard(string Stage) { objReportModel = new ReportModel(); var result1 = objReportController.GetWaterFallData(currentYear, "false") as PartialViewResult; objReportModel = (ReportModel)(result1.ViewData.Model); objCardSection = objReportModel.CardSectionModel; var Card = objCardSection.CardSectionListModel[0]; if (objCardSection != null) { if (Stage == "ProjectedStageValue") { CardINQActual = Convert.ToDecimal(Card.INQCardValues.Actual_Projected); CardINQPercentage = Convert.ToDecimal(Card.INQCardValues.Percentage); CardINQGoal = Convert.ToDecimal(Card.INQCardValues.Goal); } else if (Stage == "MQL") { CardMQLActual = Convert.ToDecimal(Card.TQLCardValues.Actual_Projected); CardMQLPercentage = Convert.ToDecimal(Card.TQLCardValues.Percentage); CardMQLGoal = Convert.ToDecimal(Card.TQLCardValues.Goal); } else { CardCWActual = Convert.ToDecimal(Card.CWCardValues.Actual_Projected); CardCWPercentage = Convert.ToDecimal(Card.CWCardValues.Percentage); CardCWGoal = Convert.ToDecimal(Card.CWCardValues.Goal); } } }
public void SetValuesForReport(string Year, string isQuarterly, string Stage) { objReportController = new ReportController(); objReportModel = new ReportModel(); objConversionToPlanModel = new ConversionToPlanModel(); SubDataTableModel = new ConversionSubDataTableModel(); objProjected_Goal = new Projected_Goal(); objCardSection = new CardSectionModel(); ObjPlanCommonFunctions.SetSessionData(); var result1 = objReportController.GetTopConversionToPlanByCustomFilter("Campaign", "", "", currentYear, isQuarterly, Stage) as PartialViewResult; objConversionToPlanModel = (ConversionToPlanModel)(result1.ViewData.Model); objConversionDataTable = objConversionToPlanModel.ConversionToPlanDataTableModel; SubDataTableModel = objConversionDataTable.SubDataModel; objProjected_Goal = objConversionToPlanModel.RevenueHeaderModel; if (isQuarterly == "Monthly") { ActualList = objConversionDataTable.ActualList; ProjectedList = objConversionDataTable.ProjectedList; GoalList = objConversionDataTable.GoalList; } }
public void SetValuesForCardReport() { objReportModel = new ReportModel(); var result1 = objReportController.GetWaterFallData(currentYear, "false") as PartialViewResult; objReportModel = (ReportModel)(result1.ViewData.Model); objCardSection = objReportModel.CardSectionModel; }
public void VerifyCardSectionValue(CardSectionModel objCardSection, List <string> ActualCostList) { var Card = objCardSection.CardSectionListModel[0]; #region Actual Assert.AreEqual(Math.Round(actualProjected, 2), Math.Round(Convert.ToDecimal(Card.RevenueCardValues.Actual_Projected), 2)); Console.WriteLine("ReportController - GetRevenueData \n The assert value of actual projected in card section is " + Math.Round(Card.RevenueCardValues.Actual_Projected, 2).ToString() + " ."); Assert.AreEqual(Math.Round(TacticRevenueAmount, 2), Math.Round(Convert.ToDecimal(Card.RevenueCardValues.Goal), 2)); Console.WriteLine("ReportController - GetRevenueData \n The assert value of actual goal in card section is " + Math.Round(Card.RevenueCardValues.Goal, 2).ToString() + " ."); var actualPercentage = ((actualProjected - TacticRevenueAmount) / TacticRevenueAmount) * 100; Assert.AreEqual(Math.Round(actualPercentage, 2), Math.Round(Convert.ToDecimal(Card.RevenueCardValues.Percentage), 2)); Console.WriteLine("ReportController - GetRevenueData \n The assert value of actual perecentage in card section is " + Math.Round(Card.RevenueCardValues.Percentage, 2).ToString() + " ."); #endregion #region Cost decimal tacticCost = 0; foreach (var actualCost in ActualCostList) { tacticCost = tacticCost + Convert.ToDecimal(actualCost); } Assert.AreEqual(Math.Round(tacticCost, 2), Math.Round(Convert.ToDecimal(Card.CostCardValues.Actual_Projected), 2)); Console.WriteLine("ReportController - GetRevenueData \n The assert value of tactic cost in card section is " + Math.Round(Card.CostCardValues.Actual_Projected, 2).ToString() + " ."); Assert.AreEqual(Math.Round(TacticProjectedCost, 2), Math.Round(Convert.ToDecimal(Card.CostCardValues.Goal), 2)); Console.WriteLine("ReportController - GetRevenueData \n The assert value of tactic projected in card section is " + Math.Round(Card.CostCardValues.Goal, 2).ToString() + " ."); decimal costPercentage = ((tacticCost - TacticProjectedCost) / TacticProjectedCost) * 100; Assert.AreEqual(Math.Round(costPercentage, 2), Math.Round(Convert.ToDecimal(Card.CostCardValues.Percentage), 2)); Console.WriteLine("ReportController - GetRevenueData \n The assert value of tactic perecentage in card section is " + Math.Round(Card.CostCardValues.Percentage, 2).ToString() + " ."); #endregion #region ROI var ROIActual_Projected = ((actualProjected - tacticCost) / tacticCost) * 100; Assert.AreEqual(Math.Round(ROIActual_Projected, 2), Math.Round(Convert.ToDecimal(Card.ROICardValues.Actual_Projected), 2)); Console.WriteLine("ReportController - GetRevenueData \n The assert value of ROI projected in card section is " + Math.Round(Card.ROICardValues.Actual_Projected, 2).ToString() + " ."); var ROIActual_Goal = ((TacticRevenueAmount - TacticProjectedCost) / TacticProjectedCost) * 100; Assert.AreEqual(Math.Round(ROIActual_Goal, 2), Math.Round(Convert.ToDecimal(Card.ROICardValues.Goal), 2)); Console.WriteLine("ReportController - GetRevenueData \n The assert value of ROI goal in card section is " + Math.Round(Card.ROICardValues.Goal, 2).ToString() + " ."); var ROIActual_Percentage = ((ROIActual_Projected - ROIActual_Goal) / ROIActual_Goal) * 100; Assert.AreEqual(Math.Round(ROIActual_Percentage, 2), Math.Round(Convert.ToDecimal(Card.ROICardValues.Percentage), 2)); Console.WriteLine("ReportController - GetRevenueData \n The assert value of ROI perecentage in card section is " + Math.Round(Card.RevenueCardValues.Percentage, 2).ToString() + " ."); #endregion }
public void SetValuesForReport(string Year, string isQuarterly) { objReportController = new ReportController(); objReportModel = new ReportModel(); objReportDataTable = new RevenueDataTable(); subModelList = new RevenueSubDataTableModel(); objRevenueToPlanModel = new RevenueToPlanModel(); objProjected_Goal = new Projected_Goal(); objCardSection = new CardSectionModel(); objlineChartData = new lineChartData(); objCardSectionListModel = new CardSectionListModel(); ObjPlanCommonFunctions.SetSessionData(); var result1 = objReportController.GetRevenueData(Year, isQuarterly) as PartialViewResult; objReportModel = (ReportModel)(result1.ViewData.Model); objRevenueToPlanModel = objReportModel.RevenueToPlanModel; objReportDataTable = objRevenueToPlanModel.RevenueToPlanDataModel; subModelList = objReportDataTable.SubDataModel; objlineChartData = objRevenueToPlanModel.LineChartModel; objProjected_Goal = objReportModel.RevenueHeaderModel; objCardSection = objReportModel.CardSectionModel; objCardSectionListModel = objCardSection.CardSectionListModel[0]; if (isQuarterly == "Monthly") { ActualList = objReportDataTable.ActualList; ProjectedList = objReportDataTable.ProjectedList; GoalList = objReportDataTable.GoalList; PerformanceList = subModelList.PerformanceList; ActualCostList = subModelList.CostList; ROIList = subModelList.ROIList; TotalRevenueList = subModelList.RevenueList; } else { QuaterlyActualList = objReportDataTable.ActualList; QuaterlyProjectedList = objReportDataTable.ProjectedList; QuaterlyGoalList = objReportDataTable.GoalList; QuaterlyPerformanceList = subModelList.PerformanceList; QuaterlyActualCostList = subModelList.CostList; QuaterlyROIList = subModelList.ROIList; QuaterlyTotalRevenueList = subModelList.RevenueList; } }