public static bool Validate(PageEnum page, RolEnum rol) { if (rol == RolEnum.Agent) { if (page == PageEnum.Agent) return true; else return false; } return true; }
public void NavigateTo(PageEnum pageKey, object parameter) { if (EnsureRootFrame()) { BaseViewModel vm = null; switch (pageKey) { case PageEnum.ViewImagePage: _rootFrame.Navigate(new ViewImagePage()); vm = SimpleIoc.Default.GetInstance<ViewImageViewModel>(); break; case PageEnum.MainPage: case PageEnum.None: default: _rootFrame.Navigate(new MainPage()); vm = SimpleIoc.Default.GetInstance<MainViewModel>(); break; } if (vm != null) vm.OnNavigating(parameter); } }
public void ChangePage(PageEnum e) { for (int i = 0; i < (int)PageEnum.COUNT_PAGE; ++i) { CurrentPageBase.IsCurrentPage = false; _page[i].IsCurrentPage = false; } CurrentPageBase = _page[(int)e]; _page[(int)e].IsCurrentPage = true; CurrentPageBase.OnChangeView(); OnPropertyChanged("CurrentPage"); }
public abstract IDataParameter[] GetPageParams(PageEnum sqlEnum);
public abstract string GetComandSqlStr(PageEnum sqlEnum);
public async Task<Counter> SubmitCounter(string champion, PageEnum.ClientChampionPage? page) { IsPending = true; ErrorMessage = null; //Convert the champion to a champion feedback var result = await champTable.Where(c => c.Name == champion).ToListAsync(); var submitChamp = result.FirstOrDefault(); // Create the new counter var counter = new Counter() { Score = 0, Id = Guid.NewGuid().ToString(), }; //Swap names around for easy matchup if (page == PageEnum.ClientChampionPage.EasyMatchup){ counter.ChampionFeedbackName = submitChamp.Name; counter.ChampionFeedbackId = submitChamp.Id; counter.Name = ChampionFeedback.Name; counter.Page = PageEnum.ChampionPage.Counter; this.ChampionFeedback.EasyMatchups.Add(counter); } //Handle the counter and synergy submissions normally else{ counter.ChampionFeedbackName = ChampionFeedback.Name; counter.ChampionFeedbackId = ChampionFeedback.Id; counter.Name = submitChamp.Name; if (page == PageEnum.ClientChampionPage.Counter) counter.Page = PageEnum.ChampionPage.Counter; else counter.Page = PageEnum.ChampionPage.Synergy; this.ChampionFeedback.Counters.Add(counter); } try { await counterTable.InsertAsync(counter); return counter; } catch (MobileServiceInvalidOperationException ex) { ErrorMessage = ex.Message; return null; } catch (HttpRequestException ex2) { ErrorMessage = ex2.Message; return null; } finally { IsPending = false; } }
public async Task<Comment> SubmitCommentAsync(String text, String name, PageEnum.CommentPage type) { IsPending = true; ErrorMessage = null; // Create the new comment var comment = new Comment() { Score = 0, Text = text, User = name, Page = type, ChampionFeedbackName = ChampionFeedback.Name, ChampionFeedbackId = ChampionFeedback.Id, Id = Guid.NewGuid().ToString(), }; try { this.ChampionFeedback.Comments.Add(comment); await commentTable.InsertAsync(comment); return comment; } catch (MobileServiceInvalidOperationException ex) { ErrorMessage = ex.Message; return null; } catch (HttpRequestException ex2) { ErrorMessage = ex2.Message; return null; } finally { IsPending = false; } }
public void NavigateTo(PageEnum pageKey) { NavigateTo(pageKey, null); }
public static void NavigateTo(PageEnum page) { _RootFrame.Navigate(_PageMapping[page]); }
public static void NavigateTo(PageEnum page, object param) { _RootFrame.Navigate(_PageMapping[page], param); }