public ActionResult ClicksJson(Models.PeriodModel model) { using (var db = new Db.TipTraceEntities()) { return(Json((from item in FillDateGaps(db.StatsClicksPerDay(CurrentClientId, model.StartDate, model.EndDate).ToList(), model.StartDate, model.EndDate) orderby item.Date select new { Year = item.Date.Value.Year, Month = item.Date.Value.Month, Day = item.Date.Value.Day, Count = item.Count }))); } }
public ActionResult IndexOutput(Models.PeriodModel model) { using (var db = new Db.TipTraceEntities()) { ViewBag.ViewsTotal = db.StatsViewsTotal(CurrentClientId, model.StartDate, model.EndDate, 0).FirstOrDefault(); ViewBag.SharesTotal = db.StatsSharesTotal(CurrentClientId, model.StartDate, model.EndDate, 0).FirstOrDefault(); ViewBag.ClicksTotal = db.StatsClicksTotal(CurrentClientId, model.StartDate, model.EndDate, 0).FirstOrDefault(); ViewBag.ViewsTop = db.StatsViewsTop(10, CurrentClientId, model.StartDate, model.EndDate).ToList(); ViewBag.SharesTop = db.StatsSharesTop(10, CurrentClientId, model.StartDate, model.EndDate).ToList(); ViewBag.ClicksTop = db.StatsClicksTop(10, CurrentClientId, model.StartDate, model.EndDate).ToList(); } return(View(model)); }
public ActionResult Index(Models.PeriodModel model) { return(IndexOutput(model)); }