Esempio n. 1
0
        public void MonthlyFinanceReport()
        {
            try
            {
                //Call common function for login
                var IsLogin = ObjCommonFunctions.CheckLogin();
                if (IsLogin != null)
                {
                    Assert.AreEqual("Index", IsLogin.RouteValues["Action"]);
                    Console.WriteLine("LoginController - Index With Parameters \n The assert value of Action : " + IsLogin.RouteValues["Action"]);
                    ReportController          objReportController          = new ReportController();
                    ReportModel               objReportModel               = new ReportModel();
                    BudgetDHTMLXGridDataModel objBudgetDHTMLXGridDataModel = new BudgetDHTMLXGridDataModel();
                    BudgetDHTMLXGridModel     objBudgetDHTMLXGridModel     = new BudgetDHTMLXGridModel();
                    ObjPlanCommonFunctions.SetSessionData();
                    DataTable dt     = ObjCommonFunctions.GetExcelData("GamePlanExcelConn", "[MonthlyFinance$]").Tables[0];
                    var       result = objReportController.GetReportBudgetData(currentYear, "months", "Plan", "") as PartialViewResult;

                    string      MainTotalAllocated = result.ViewBag.MainTotalAllocated.ToString();
                    string      MainTotalActual    = result.ViewBag.MainTotalActual.ToString();
                    BudgetMonth PercAllocated      = result.ViewBag.PercAllocated;

                    objBudgetDHTMLXGridModel = (BudgetDHTMLXGridModel)result.Model;
                    List <Budgetdataobj> PlanData  = objBudgetDHTMLXGridModel.Grid.rows[1].data;
                    List <string>        subHeader = objBudgetDHTMLXGridModel.AttachHeader;
                    string   mainHeaderString      = objBudgetDHTMLXGridModel.SetHeader;
                    string[] mainHeader            = mainHeaderString.Split(',').ToArray();
                    VerifyHeaderValue(dt, MainTotalAllocated, MainTotalActual);
                    VerifyMonthlyData(dt, PlanData, mainHeader, subHeader, PercAllocated);
                    if (objBudgetDHTMLXGridModel.Grid.rows[1].rows != null && objBudgetDHTMLXGridModel.Grid.rows[1].rows.Count > 0)
                    {
                        var Campaign = objBudgetDHTMLXGridModel.Grid.rows[1].rows[0];
                        List <Budgetdataobj> CampaignData = Campaign.data;
                        VerifyMonthlyData(dt, CampaignData, mainHeader, subHeader);
                        if (Campaign.rows != null && Campaign.rows.Count > 0)
                        {
                            var program = Campaign.rows[0];
                            List <Budgetdataobj> programData = program.data;
                            VerifyMonthlyData(dt, programData, mainHeader, subHeader);
                            if (program.rows != null && program.rows.Count > 0)
                            {
                                var tactic = program.rows[0];
                                List <Budgetdataobj> tacticData = tactic.data;
                                VerifyMonthlyData(dt, tacticData, mainHeader, subHeader);
                                if (tactic.rows != null && tactic.rows.Count > 0)
                                {
                                    var lineItem = tactic.rows[0];
                                    List <Budgetdataobj> lineItemData = lineItem.data;
                                    VerifyMonthlyData(dt, lineItemData, mainHeader, subHeader);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 2
0
 public void MonthlyRevenueReport()
 {
     try
     {
         //Call common function for login
         var IsLogin = ObjCommonFunctions.CheckLogin();
         if (IsLogin != null)
         {
             Assert.AreEqual("Index", IsLogin.RouteValues["Action"]);
             Console.WriteLine("LoginController - Index With Parameters \n The assert value of Action : " + IsLogin.RouteValues["Action"]);
             SetValuesForReport(currentyear, "Monthly");
             DataTable dt = ObjCommonFunctions.GetExcelData("GamePlanExcelConn", "[Actual Data$]").Tables[0];
             if (dt != null && dt.Rows.Count > 0)
             {
                 VerifyReport_Actual(dt, ActualList);
                 VerifyReport_ActualCost(dt, ActualCostList);
                 VerifyReport_Goal(GoalList);
                 VerifyReport_ProjectedRevenue(ProjectedList, GoalList, ActualList);
                 VerifyReport_Performance(ActualList, PerformanceList);
                 VerifyReport_ROI(ActualList, ActualCostList, ROIList);
                 VerifyReport_TotalRevenue(ActualList, TotalRevenueList);
                 VerifyHeaderValue(objProjected_Goal, ActualList, GoalList, ProjectedList);
                 VerifyCardSectionValue(objCardSection, ActualCostList);
                 VerifyMonthlyGraphValue(objlineChartData, dt, ProjectedList);
             }
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 3
0
        public async Task INQSummaryReport()
        {
            try
            {
                //Call common function for login
                var IsLogin = ObjCommonFunctions.CheckLogin();
                if (IsLogin != null)
                {
                    Assert.AreEqual("Index", IsLogin.RouteValues["Action"]);
                    Console.WriteLine("LoginController - Index With Parameters \n The assert value of Action : " + IsLogin.RouteValues["Action"]);
                    ObjPlanCommonFunctions.SetSessionData();
                    SetValuesForReport(currentYear, "Monthly", "ProjectedStageValue");
                    decimal sumOfActual = 0; decimal sumOfProjected = 0;

                    Sessions.PlanExchangeRate = 1.0;
                    var result = await objReportController.GetOverviewData(currentYear, "Quarterly") as PartialViewResult;

                    objReportOverviewModel = new ReportOverviewModel();
                    objReportOverviewModel = (ReportOverviewModel)result.Model;
                    if (objReportOverviewModel != null)
                    {
                        objProjected_Goal = new Projected_Goal();
                        objProjected_Goal = objReportOverviewModel.conversionOverviewModel.Projected_LineChartList[0].projected_goal;

                        #region Actual Projected
                        foreach (double actual in ActualList)
                        {
                            sumOfActual = sumOfActual + Convert.ToDecimal(actual);
                        }
                        foreach (double projected in ProjectedList)
                        {
                            sumOfProjected = sumOfProjected + Convert.ToDecimal(projected);
                        }
                        INQTotalProjected = sumOfActual + sumOfProjected;

                        Assert.AreEqual(Math.Round(Convert.ToDecimal(objProjected_Goal.Actual_Projected), 2), Math.Round(INQTotalProjected, 2));
                        Console.WriteLine("ReportController -> GetOverviewData \n Report - Waterfall Summary Report \n The assert value of projected INQ in volume section " + objProjected_Goal.Actual_Projected + ".");
                        #endregion

                        #region Actual Goal
                        DataTable dtModel = ObjCommonFunctions.GetExcelData("GamePlanExcelConn", "[Model$]").Tables[0];
                        DataRow   drModel = dtModel.Rows[0];

                        INQGoal = Convert.ToDecimal(drModel["TACTIC_PROJECTED_STAGE"].ToString());

                        Assert.AreEqual(Math.Round(Convert.ToDecimal(objProjected_Goal.Goal), 2), Math.Round(INQGoal, 2));
                        Console.WriteLine("ReportController -> GetOverviewData \n Report - Waterfall Summary Report \n The assert value of projected INQ goal in volume section " + objProjected_Goal.Goal + ".");

                        #endregion

                        #region Actual Percentage

                        INQPercentage = ((INQTotalProjected - INQGoal) / INQGoal) * 100;

                        Assert.AreEqual(Math.Round(Convert.ToDecimal(objProjected_Goal.Percentage), 2), Math.Round(INQPercentage, 2));
                        Console.WriteLine("ReportController -> GetOverviewData \n Report - Waterfall Summary Report \n The assert value of projected INQ percentage in volume section " + objProjected_Goal.Percentage + ".");

                        #endregion
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }