public ActionResult Data(SearchPackage searchPackage) { var query = _queries.GetGameProviderDtos(); var dataBuilder = new SearchPackageDataBuilder <GameProviderDTO>(searchPackage, query.AsQueryable()); dataBuilder .Map(gameProvider => gameProvider.Id, gameProvider => new[] { gameProvider.Name, gameProvider.Code, gameProvider.Category.ToString(), gameProvider.IsActive ? "Active" : "Inactive", gameProvider.CreatedBy, Format.FormatDate(gameProvider.CreatedDate, false), gameProvider.UpdatedBy, Format.FormatDate(gameProvider.UpdatedDate, false), } ); var data = dataBuilder.GetPageData(gameProvider => gameProvider.Id); return(new JsonResult { Data = data, MaxJsonLength = int.MaxValue, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public object GetViewData(Guid id) { var licensee = _queries.GetLicensee(id); if (licensee == null) { return(SerializeJson(new { result = "failed" })); } var data = new { name = licensee.Name, companyName = licensee.CompanyName, affiliateSystem = licensee.AffiliateSystem, contractStartDate = Format.FormatDate(licensee.ContractStart, false), contractEndDate = licensee.ContractEnd.HasValue ? Format.FormatDate(licensee.ContractEnd, false) : null, email = licensee.Email, timezone = TimeZoneInfo.FindSystemTimeZoneById(licensee.TimezoneId).DisplayName, status = Enum.GetName(typeof(LicenseeStatus), licensee.Status), allowedBrands = licensee.AllowedBrandCount, allowedWebsites = licensee.AllowedWebsiteCount, currencies = licensee.Currencies.OrderBy(x => x.Code).Select(x => x.Code), countries = licensee.Countries.OrderBy(x => x.Name).Select(x => x.Name), cultures = licensee.Cultures.OrderBy(x => x.Code).Select(x => x.Code), products = _gameQueries.GetGameProviderDtos() .Where(x => licensee.Products.Any(y => y.ProductId == x.Id)) .Select(x => x.Name) }; return(SerializeJson(new { result = "success", data })); }
public string GameProviders() { var gameProviders = _gameQueries.GetGameProviderDtos(); return(SerializeJson(new { GameProviders = gameProviders })); }
public string Products() { var products = _gameQueries.GetGameProviderDtos(); return(SerializeJson(products.Select(x => new { x.Id, x.Name, x.Code }))); }
public JsonResult GameProviderList() { var gameProviders = _gameQueries.GetGameProviderDtos().OrderBy(gs => gs.Name).Select(gs => gs.Name); return(Json(gameProviders, JsonRequestBehavior.AllowGet)); }