Ejemplo n.º 1
0
        public ActionResult VersionTracking(int?companyId, string appVersion, string serverName, string searchKeyword, int?DaysOld, bool includeDemo = false)
        {
            ViewBag.CompanyId = new SelectList(db.tblCompanies.Where(c => c.isActive && !c.isDeleted)
                                               .Select(ccc => new { ccc.CompanyId, ccc.Name, ccc.CompanyCode }).ToList()
                                               .Select(cc => new { cc.CompanyId, Name = cc.Name + " (" + cc.CompanyCode + ")" }),
                                               "CompanyId", "Name");
            ViewBag.DaysOld = new List <SelectListItem>
            {
                new SelectListItem()
                {
                    Text = "Today", Value = "0"
                },
                new SelectListItem()
                {
                    Text = "30 Days", Value = "30"
                },
                new SelectListItem()
                {
                    Text = "90 Days", Value = "90"
                },
                new SelectListItem()
                {
                    Text = "180 Days", Value = "180"
                },
            };

            ViewBag.searchKeyword = searchKeyword;
            ViewBag.appVersion    = appVersion;
            ViewBag.serverName    = serverName;

            searchKeyword = string.IsNullOrEmpty(searchKeyword) ? null : searchKeyword.Trim();
            var dayTill = DaysOld == null ? DateTime.Now : DateTime.Now.Date.AddDays((-1 * DaysOld.Value));
            var res     = db.GetUserDeviceDetail(companyId, null, includeDemo)
                          .Where(u => (searchKeyword == null || u.LicenseKey == searchKeyword) &&
                                 (DaysOld == null || u.CreatedOn > dayTill))
                          .ToList();

            return(View(res));
        }
Ejemplo n.º 2
0
        public JsonResult versionWiseDevice()
        {
            var groups = db.GetUserDeviceDetail(null, null, false).GroupBy(d => d.AppVersion).Select(g => new { g.Key, Count = g.Count() }).OrderByDescending(o => o.Key).ToList();

            return(Json(groups, JsonRequestBehavior.AllowGet));
        }