/// <summary> /// Team Site All reports /// </summary> /// <param name="userAlias"></param> /// <param name="teamSiteGuid"></param> /// <param name="isAdmin"></param> /// <param name="sortField"></param> /// <param name="sortOrder"></param> /// <returns></returns> public IEnumerable <AppReport> GetAllReportsOfTeamSite(string userAlias, string teamSiteGuid, bool isAdmin, SortField sortField, SortOrder sortOrder) { TileServices tService = new TileServices(_tileRepository, _teamRepository, _reportRepository, null, null, null, null); int teamId = _teamRepository.GetFiltered(_ => _.TeamGuid == new Guid(teamSiteGuid)).FirstOrDefault().Id; ParameterProvider pp = new ParameterProvider(); pp.AddParameter(ContextVariable.CurrentTeamSiteGuid.ToString(), new Guid(teamSiteGuid)); //if (userAlias != "") //{ //pp.AddParameter(ContextVariable.CurrentUser.ToString(), userAlias); //} pp.AddParameter(ContextVariable.TeamSiteGuidUnderControl.ToString(), new List <Guid> { new Guid(teamSiteGuid) }); int allreportsTileId = _tileRepository.GetAllReportsTileId(teamId); return(_reportRepository. GetReportsByExpression( tService.GetTeamSite_AllReportsTile() .GetCombinedLogic(isAdmin, allreportsTileId) .GetExpression(pp)).ToArray() .Select(_ => _.ToAppReport())); }
private string LoadTeamTiles() { var teamGuid = Request.Params["SiteGUID"].ToString(); string userAlias = Session["UserName"].ToString(); // tile data JavaScriptSerializer jss = new JavaScriptSerializer(); // Save the tile data into our database using (MainDBUnitWorkContext context = new MainDBUnitWorkContext()) { TileRepository repository = new TileRepository(context); // Get the team id by its team guid value TeamRepository tRepository = new TeamRepository(context); TeamAppService teamService = new TeamAppService(tRepository); TileQueryLogicRepository tileQueryRepository = new TileQueryLogicRepository(context); ReportRepository reportRepository = new ReportRepository(context); int teamId = teamService.GetAllTeamSites().First(_ => _.TeamGuid == Guid.Parse(teamGuid)).Id.Value; TileServices tService = new TileServices(repository, tRepository, reportRepository, null, null, null, tileQueryRepository); List <TileViewModel> tiles = tService.GetCustomerizeTilesWithCountByTeamId(teamId, userAlias, true, teamGuid).Select(_ => _.ToTileViewModel()).ToList <TileViewModel>(); return(jss.Serialize(tiles)); } }
private void UpdateAppTiles() { var init = ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized]; if (init == null || (init is bool && !(bool)init)) { TileServices.CreateFlipTile(@"Crypto2k16", @"Innovate Explore Experience!"); ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized] = true; } }
private void UpdateAppTiles() { var init = ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized]; if (init == null || (init is bool && !(bool)init)) { TileServices.CreateFlipTile(@"App Studio", @"Your apps, your way!"); ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized] = true; } }
private void UpdateAppTiles() { var init = ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized]; if (init == null || (init is bool && !(bool)init)) { TileServices.CreateFlipTile(@"FIXING", @"SECURE YOUR KNOWLEDGE!!"); ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized] = true; } }
private void UpdateAppTiles() { var init = ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized]; if (init == null || (init is bool && !(bool)init)) { TileServices.CreateFlipTile(@"VSauce Supreme", @"All the VSauces in one app!"); ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized] = true; } }
private static async Task InitializeTilesAsync() { if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily.ToLower() != "windows.iot") { var init = ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized]; if (init == null || (init is bool && !(bool)init)) { await TileServices.CreateLiveTile(@"Assets\Tiles\tiles.xml"); ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized] = true; } } }
private void UpdateAppTiles() { var init = ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized]; if (init == null || (init is bool && !(bool)init)) { Dictionary <string, string> tiles = new Dictionary <string, string>(); tiles.Add("2f829599e0301ff8", "DataImages/Tile1.jpg"); tiles.Add("2f829599e0301ff9", "DataImages/Tile2.jpg"); tiles.Add("2f829599e0301ffa", "DataImages/Tile3.jpg"); tiles.Add("2f829599e0301ffb", "DataImages/Tile4.jpg"); TileServices.CreateCycleTile(tiles); ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized] = true; } }
private void UpdateAppTiles() { var init = ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized]; if (init == null || (init is bool && !(bool)init)) { Dictionary <string, string> tiles = new Dictionary <string, string>(); tiles.Add("9f187f0a90da337f", "DataImages/Tile1.jpg"); tiles.Add("9f187f0a90da3380", "DataImages/Tile2.jpg"); tiles.Add("9f187f0a90da3381", "DataImages/Tile3.jpg"); tiles.Add("9f187f0a90da3382", "DataImages/Tile4.jpg"); tiles.Add("9f187f0a90da3383", "DataImages/Tile5.jpg"); TileServices.CreateCycleTile(tiles); ApplicationData.Current.LocalSettings.Values[LocalSettingNames.TilesInitialized] = true; } }
private void SetBadgeCountOnTileandSim() { // Get the toast history from Notification Center var toasts = ToastNotificationManager.History.GetHistory(); if (toasts != null) { var count = toasts.Count(); // Sync up the count on the tile TileServices.SetBadgeCountOnTile(count); //...and on our simulation on the UI this.TileSimulationBadgeCount = count; } }
public ICollection <Statistics> GetTeamSiteReportsStatistics(Int32 tileId, String userAlias, String teamSiteGuid, Boolean isCurrentSiteAdmin) { bool hasAdminSite = isCurrentSiteAdmin; TileServices tService = new TileServices(_tileRepository, _teamRepository, _reportRepository, _userRepository, _tagRepository, _categoryRepository, _tileQueryRepository); AppTile at = tService.GetTileById(tileId); ParameterProvider pp = new ParameterProvider(); //if (userAlias != "") //{ //pp.AddParameter(ContextVariable.CurrentUser.ToString(), userAlias); //} pp.AddParameter(ContextVariable.CurrentTeamSiteGuid.ToString(), new Guid(teamSiteGuid)); //pp.AddParameter(ContextVariable.CurrentUserGroup.ToString(), appUserGroupList); //if (hasAdminSite) //{ pp.AddParameter(ContextVariable.TeamSiteGuidUnderControl.ToString(), new List <Guid>() { new Guid(teamSiteGuid) }); //} Logic logic = at.GetCombinedLogic(hasAdminSite, tileId).And((new TeamSiteGUID()).Equal(Guid.Parse(teamSiteGuid))); var reports = _reportRepository.GetReportByLogic(logic, pp).ToArray().Select(_ => _.ToAppReport()).ToList(); foreach (var report in reports) { foreach (var cat in report.Categories) { if (cat.ParentId != null) { cat.ParentCategory = _categoryRepository.Get(cat.ParentId.GetValueOrDefault()).ToAppCategory(); //cat.Reports.Add(report); } } } return(GetStatistics(reports)); }
private List <AppReport> GetReportsByTeam(Guid teamSiteGuid, Int32 tileId, ReportFilter filter, Boolean isCurrentUserTeamSiteAdmin, String userAlias, Int32 pageNum, Int32 pageSize, SortField sortField, SortOrder sortOrder) { #region Get the logic TileServices tService = new TileServices(_tileRepository, _teamRepository, _reportRepository, null, null, null, _tileQueryRepository); AppTile ap = null; bool hasAdminTeamSite = isCurrentUserTeamSiteAdmin; ap = tService.GetTileById(tileId); #endregion #region Combine the logic var topLevelLogic = (new TeamSiteGUID()).Equal(teamSiteGuid).And(ap.GetCombinedLogic(hasAdminTeamSite, tileId)); var logic = GenerateLogicByFilter(filter); if (logic != null) { topLevelLogic.AddElement(logic); } #endregion #region Compose the logic parameter ParameterProvider pp = new ParameterProvider(); //if (userAlias != "") //{ //pp.AddParameter(ContextVariable.CurrentUser.ToString(), userAlias); //} pp.AddParameter(ContextVariable.CurrentTeamSiteGuid.ToString(), teamSiteGuid); //if (isCurrentUserTeamSiteAdmin) //{ pp.AddParameter(ContextVariable.TeamSiteGuidUnderControl.ToString(), (new List <Guid>() { teamSiteGuid })); //} #endregion #region generate the result return(GetReportsByLogic(topLevelLogic, sortField, sortOrder, pp, pageNum, pageSize).ToArray().Select(_ => _.ToAppReport()).ToList()); #endregion }
public override async void OnNavigatedTo(string parameter, NavigationMode mode, Dictionary <string, object> state) { Debug.WriteLine("In DetailPageViewModel OnNavigatedTo"); _repository = Repositories.MessageItemRepository.GetInstance(); await LoadRuntimeDataAsync(parameter); // Since we are viewing this item, set its status to 'Read' this.MessageItem.IsRead = true; await _repository.UpdateAsync(this.MessageItem); // Also remove it from the Action Center if it is there ToastNotificationManager.History.Remove(parameter); // Set the Badge count on the tile var toasts = ToastNotificationManager.History.GetHistory(); if (toasts != null) { var count = toasts.Count(); // Sync up the count on the tile TileServices.SetBadgeCountOnTile(count); } }
private string GetAdminTileFilterInfo(string userName, string teamGuid, bool isAdmin) { JavaScriptSerializer jss = new JavaScriptSerializer(); // TileManager tm = new TileManager(); TileFilterListViewModel filterViewModel = new TileFilterListViewModel(); using (MainDBUnitWorkContext context = new MainDBUnitWorkContext()) { ICategoryRepository _categoryRepository = new CategoryRepository(context); ITagRepository _tagRepository = new TeamTagRepository(context); ITileRepository _tileRepository = new TileRepository(context); ITeamRepository _teamRepository = new TeamRepository(context); IReportRepository _reportRepository = new ReportRepository(context); IUserRepository _userRepository = new UserRepository(context); TileServices tileService = new TileServices(_tileRepository, _teamRepository, _reportRepository, _userRepository, _tagRepository, _categoryRepository, null); //Owner IEnumerable <UserLoginApp> userList = tileService.GetOwnerList(userName, teamGuid, isAdmin); filterViewModel.Owner = userList.OrderBy(_ => _.UserName).Distinct <UserLoginApp>(new UserComparer()); //Category IEnumerable <AppCategory> categoryList = tileService.GetCategoryList(); filterViewModel.SubCategory = categoryList.OrderBy(_ => _.CategoryName).Distinct <AppCategory>(new CategoryComparer()); //Tag IEnumerable <AppTeamTag> tagList = tileService.GetTagListByTeam(teamGuid).Distinct <AppTeamTag>(new TagComparer()); filterViewModel.Tag = tagList; } return(jss.Serialize(filterViewModel)); }
private void UpdateTileInformation() { // Update team site dashboard settings var tileData = Request.Params["TilesData"]; var teamGuid = Request.Params["SiteGUID"].ToString(); // tile data JavaScriptSerializer jss = new JavaScriptSerializer(); List <TileViewModel> paraTileList = jss.Deserialize <List <TileViewModel> >(tileData); // Save the tile data into our database using (MainDBUnitWorkContext context = new MainDBUnitWorkContext()) { TileRepository repository = new TileRepository(context); // Get the team id by its team guid value TeamRepository tRepository = new TeamRepository(context); TeamAppService teamService = new TeamAppService(tRepository); TileQueryLogicRepository tileQueryRepository = new TileQueryLogicRepository(context); int teamId = teamService.GetAllTeamSites().First(_ => _.TeamGuid == Guid.Parse(teamGuid)).Id.Value; //validate the data if (paraTileList.Count() > 24) { throw new ArgumentException("the count of the tile is more than 24"); } foreach (var item in paraTileList) { if (item.coordinateX < 0 || item.coordinateX > 7) { throw new ArgumentException("coordinateX must be between 0 and 7"); } if (item.coordinateY < 0 || item.coordinateY > 2) { throw new ArgumentException("coordinateY must be between 0 and 2"); } if (item.demensionX < 1 || item.demensionX > 8) { throw new ArgumentException("demensionX must be between 1 and 8"); } if (item.demensionY < 1 || item.demensionY > 3) { throw new ArgumentException("demensionY must be between 1 and 3"); } } TileServices tService = new TileServices(repository, null, null, null, null, null, tileQueryRepository); List <AppTile> tiles = new List <AppTile>(); List <AppTile> orignalTiles = tService.GetTilesByTeamId(teamId).ToList(); //tiles will be remove foreach (var item in orignalTiles) { if (!paraTileList.Any(_ => _.id == item.Id)) { if (item.logicType == LogicType.AllReports) { continue; } AppTile appTile = tService.GetTileById(item.Id.Value); appTile.Status = ChangeStatus.Delete; tiles.Add(appTile); } } foreach (var para in paraTileList) { //tiles will be Added if (para.id < 0) { AppTile appTile = new AppTeamSiteCustomizedTile(); appTile.TileType = TileType.TeamSite; appTile.Status = ChangeStatus.Add; appTile.Title = para.title; appTile.Top = para.coordinateY; appTile.Left = para.coordinateX; appTile.Width = para.demensionX; appTile.Height = para.demensionY; appTile.BackgroundColor = para.backgroundColor; appTile.Icon = para.icon; appTile.BackgroundImage = para.backgroundImage; appTile.ImageOverlayColor = para.overlayColor; appTile.ReportCountStyle = para.shownCount; appTile.OwnerTeamSiteId = teamId; appTile.IsCustomized = true; appTile.logicType = (LogicType)Enum.Parse(typeof(LogicType), para.LogicType); SetAppTitleLogic(para.LogicString, appTile); tiles.Add(appTile); } //tiles will be Updated if (para.id > 0) { AppTile appTile = tService.GetTileById(para.id); if (appTile == null) { continue; } appTile.Status = ChangeStatus.Change; appTile.Top = para.coordinateY; appTile.Left = para.coordinateX; appTile.Width = para.demensionX; appTile.Height = para.demensionY; appTile.BackgroundColor = para.backgroundColor; appTile.Icon = para.icon; appTile.BackgroundImage = para.backgroundImage; appTile.ImageOverlayColor = para.overlayColor; appTile.ReportCountStyle = para.shownCount; appTile.IsCustomized = true; if (appTile.logicType != LogicType.AllReports) { appTile.Title = para.title; appTile.logicType = (LogicType)Enum.Parse(typeof(LogicType), para.LogicType); SetAppTitleLogic(para.LogicString, appTile); } tiles.Add(appTile); } } tService.ModifyTile(tiles); } }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"My App", @"All About ME", @"DataImages/FlipSquareTile.jpg", "DataImages/FlipWideTile.jpg"); }
private void UpdateAppTiles() { TileServices.CreateIconicTile(@"Blog's Of .Net Experts", @"", @""); }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"App Studio", @"Your apps, your way!", @"DataImages/FlipSquareTile.jpg", "DataImages/FlipWideTile.jpg"); }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"CoMicry-2", @"", @"DataImages/FlipSquareTile.jpg", "DataImages/FlipWideTile.jpg"); }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"App Studio", @"Your apps, your way!"); }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"dz-news", @"dz-news"); }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"oi, bem vindo", @"sua oferta", @"DataImages/FlipSquareTile.jpg", "DataImages/FlipWideTile.jpg"); }
private void UpdateAppTiles() { TileServices.CreateCycleTile("DataImages/Tile1.jpg", "DataImages/Tile2.jpg", "DataImages/Tile3.jpg", "DataImages/Tile4.jpg", "DataImages/Tile5.jpg"); }
private void UpdateAppTiles() { TileServices.CreateFlipTile("", "GoPro, be a HERO!", "DataImages/FlipSquareTile.jpg", "DataImages/FlipWideTile.jpg"); }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"Science News", @"", @"DataImages/FlipSquareTile.jpg", "DataImages/FlipWideTile.jpg"); }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"Parekh's", @"For Engineers , By Engineers !", @"DataImages/FlipSquareTile.jpg", "DataImages/FlipWideTile.jpg"); }
private void UpdateAppTiles() { TileServices.CreateIconicTile(@"", @"", @""); }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"By Vishal Parekh", @"Your apps, your way!"); }
private void UpdateAppTiles() { TileServices.CreateFlipTile(@"Olha o Pão de Queijo!", @"Vamos Viajar"); }
private string GetReports() { string userName = Session["UserName"] == null ? "" : Session["UserName"].ToString(); string output; string siteType = Request["siteType"]; string teamGuid = Request["SiteGuid"]; JavaScriptSerializer jss = new JavaScriptSerializer(); var paramDes = jss.Deserialize <WebApplication1.Models.QueryParameterViewModel>(Request["queryParam"]); int tileId = int.Parse(paramDes.TileId); // Get the reports from the reports list using (MainDBUnitWorkContext context = new MainDBUnitWorkContext()) { ReportRepository rep = new ReportRepository(context); TileRepository tileRep = new TileRepository(context); TileQueryLogicRepository tileQuery = new TileQueryLogicRepository(context); TileServices tService = new TileServices(tileRep, null, null, null, null, null, tileQuery); var tile = tService.GetTileById(tileId); EditReportService editReport = new EditReportService(rep, null, null, null, null, tileRep, tileQuery); #region Get ReportFilter ReportFilter filer = new ReportFilter(); foreach (WebApplication1.Models.FilterModel vm in paramDes.FilterEntityList) { switch (vm.FilterType) { case "Tag": filer.TagsIdCollection = (from fl in vm.FilterItemList select int.Parse(fl.Value)).ToList(); break; case "Owner": filer.OwnerIdCollection = (from fl in vm.FilterItemList select fl.Value).ToList(); break; case "Sub Category": filer.SubCategoryIdCollection = (from fl in vm.FilterItemList select int.Parse(fl.Value)).ToList(); break; default: break; } } #endregion // TO-DO: Team admin is set to true var reports = editReport.GetReportsByTeamWithReportsRequire(teamGuid, tileId, filer, true, userName, paramDes.CurrentPage, paramDes.PageSize, SortField.ReportTitle, (paramDes.SortAscending ? SortOrder.ASC : SortOrder.DESC)).ToArray(); ReportListModel rptList = GetReportList(reports, Convert.ToInt32(paramDes.TileId)); output = jss.Serialize(rptList); return(output); } }