Example #1
0
        public List <ShoppingProgram> Build(ShoppingAnalysisViewModel shoppingAnalysisViewModel)
        {
            var ds = GetTopProgramList(
                shoppingAnalysisViewModel.ShopStartDate,
                shoppingAnalysisViewModel.ShopEndDate,
                shoppingAnalysisViewModel.MaxNoOfProgramsToReportOn,
                shoppingAnalysisViewModel.Threshold);

            var shoppingProgramList = new List <ShoppingProgram>();
            var dataTable           = ds.Tables[0];

            foreach (DataRow row in dataTable.Rows)
            {
                var shoppingProgram = new ShoppingProgram
                {
                    AttributeValue = Convert.ToString(row["attributevalue"]),
                    ProgramName    = Convert.ToString(row["programname"]),
                    TotalCount     = Convert.ToInt32(row["totalcount"]),
                    PackageName    = Convert.ToString(row["packagename"])
                };

                shoppingProgramList.Add(shoppingProgram);
            }

            return(shoppingProgramList);
        }
        public List<ShoppingProgram> Build(ShoppingAnalysisViewModel shoppingAnalysisViewModel)
        {
            var ds = GetTopProgramList(
                shoppingAnalysisViewModel.ShopStartDate,
                shoppingAnalysisViewModel.ShopEndDate,
                shoppingAnalysisViewModel.MaxNoOfProgramsToReportOn,
                shoppingAnalysisViewModel.Threshold);

            var shoppingProgramList = new List<ShoppingProgram>();
            var dataTable = ds.Tables[0];
            foreach (DataRow row in dataTable.Rows)
            {
                var shoppingProgram = new ShoppingProgram
                    {
                        AttributeValue = Convert.ToString(row["attributevalue"]),
                        ProgramName = Convert.ToString(row["programname"]),
                        TotalCount = Convert.ToInt32(row["totalcount"]),
                        PackageName = Convert.ToString(row["packagename"])
                    };

                shoppingProgramList.Add(shoppingProgram);
            }

            return shoppingProgramList;
        }