コード例 #1
0
        public ActionResult DrawEmailDomainsGraph(GraphViewModel graphViewModel)
        {
            try
            {
                DateTime fromDate = DateTime.ParseExact(graphViewModel.FromDate, "MM/dd/yyyy", null);
                DateTime toDate   = DateTime.ParseExact(graphViewModel.ToDate, "MM/dd/yyyy", null);

                string connectionString = graphViewModel.FileImported == false?GetConnectionStringBasedOnSelectedMember(graphViewModel.SelectedTeamMemberId.ToString()) : _importConnectionString;

                FetchListServiceResponse <DataPoint> mostUsedEmailDomains = _graphService.FetchMostUsedEmailDomains(connectionString, fromDate, toDate);
                if (mostUsedEmailDomains.Succeeded)
                {
                    graphViewModel.EmailDomains = mostUsedEmailDomains.Items;
                }
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeResult(500, e.Message));
            }
            return(View("GraphPie2d_partial", graphViewModel));
        }