public void JS_ThumbsVote(string voteType, string chartTitle, string typeString, string dateString)
        {
            try
            {
                var type = (VisType)Enum.Parse(typeof(VisType), typeString);
                var date = DateTimeOffset.Parse(dateString, CultureInfo.InvariantCulture);

                var up   = (voteType == "up") ? 1 : 0;
                var down = (voteType == "down") ? 1 : 0;

                FeedbackThumbs.GetInstance().SetFeedback(type, date, chartTitle, up, down);
            }
            catch { }
        }
Exemple #2
0
        private string CreateDashboardItem(IVisualization vis, DateTimeOffset date)
        {
            try
            {
                var feedbackButtons = FeedbackThumbs.GetInstance().GetFeedbackThumbsUpDown(vis, date);
                var chartTitle      = VisHelper.FormatChartTitle(vis.Title);
                var html            = vis.GetHtml();

                var itemTemplate = "<div class='item {3}'>{0}{1}{2}</div>";
                return(string.Format(CultureInfo.InvariantCulture, itemTemplate, feedbackButtons, chartTitle, html, vis.Size));
            }
            catch (Exception e)
            {
                Logger.WriteToLogFile(e);
                return(VisHelper.Error(string.Format(CultureInfo.InvariantCulture, "<div id='item {2}'>An error occurred when creating the visualization: '{0}'.</div>", vis.Title, vis.Size)));
            }
        }