private void buttonBack_Click(object sender, EventArgs e) { if (m_currentPage == CurrentPage.FromFile) { wizardFromFile.Visible = false; } else if (m_currentPage == CurrentPage.FromString) { wizardFromString.Visible = false; } m_currentPage = CurrentPage.Intro; wizardIntroduction.Visible = true; buttonNext.Text = Properties.Resources.Next; buttonBack.Enabled = false; }
public void WhenIPostANewJobWithoutEnteringAnyData() { CurrentPage = GetInstance <PostJob>(Driver); CurrentPage.As <PostJob>().SaveWithoutMandatoryField(); }
public void UpdateBrowseQuery(UrlQuery urlQuery) { urlQuery.AddQuery("Page", CurrentPage.ToString()); urlQuery.AddQuery("ItemsPerPage", ItemsPerPages.ToString()); }
public void WhenTheUserEntersAsPasswordOnSignUpPage(string password) { CurrentPage.As <SignUpPage>().EnterPassword(password); }
public void WhenTheUserEntersAsUsernameOnSignUpPage(string username) { CurrentPage.As <SignUpPage>().EnterUserName(username); }
public void WhenTheUserClicksOnTheSignUpLink() { NextPage = CurrentPage.As <HomePageOffline>().ClickSignUpLink(); }
public void ThenTheArticleSectionIsDisplayedWithTheArticleInformation() { Assert.True(CurrentPage.As <ArticlePage>().GetArticleTitleDisplayed()); Assert.True(CurrentPage.As <ArticlePage>().GetArticleContentDisplayed()); }
public void ThenTheYourFeedsSectionShouldBeDisplayedByDefault() { Assert.True(CurrentPage.As <HomePageOnline>().GetYourFeedLinkDisplayed()); }
private XElement GetRelatedLinks() { var sr = new StringReader(CurrentPage.GetProperty("relatedLinks").Value.ToString()); // using this method for when Umbraco Core Property Value Converters installed return(XElement.Load(sr)); }
public void ThenTheRecordShouldNotBeAddedToTheList() { CurrentPage.As <ArticleShedulerPage>().CheckAddTemplate(); }
public void ThenISavedTheTemplate() { CurrentPage.As <ArticleShedulerPage>().SaveTemplate(); }
public void ThenIAddedRulesToTheTemplate() { CurrentPage.As <ArticleShedulerPage>().AddRulesToArticle(); }
public void ThenISearchForAnArticleAndChoosedIt() { CurrentPage.As <ArticleShedulerPage>().SearchForArticle(); }
public void ThenIEnteredTemplateNameAndDescription() { CurrentPage.As <ArticleShedulerPage>().TemplateNameAndDescription(); }
/// <summary> /// Adds a javascript reference to the head section of the current page. /// </summary> /// <param name="scriptFile">The javascript file including the relative folder within the theme.</param> public static void AddScriptReference(string scriptFile) { if (CurrentPage != null) { var scriptTag = new HtmlGenericControl("script"); scriptTag.Attributes.Add("src", string.Format(SCRIPT_SOURCE_TEMPLATE, CurrentPage.ResolveUrl("~/"), CurrentPage.ResolveUrl("~/"), BlogSettings.Instance.Theme, scriptFile)); scriptTag.Attributes.Add("type", "text/javascript"); CurrentPage.Header.Controls.Add(scriptTag); } }
public void ThenIClickedOnAddTemplateButton() { CurrentPage.As <ArticleShedulerPage>().ClickOnAddTemplateBtn(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); _isAuthorizedToConfigure = CurrentPage.IsAuthorized("Administrate", CurrentPerson); // wire up page naviagte RockPage page = Page as RockPage; if (page != null) { page.PageNavigate += page_PageNavigate; } Type containerType = Type.GetType(GetAttributeValue("ComponentContainer")); if (containerType != null) { PropertyInfo instanceProperty = containerType.GetProperty("Instance"); if (instanceProperty != null) { _container = instanceProperty.GetValue(null, null) as IContainer; if (_container != null) { BindFilter(); rFilter.ApplyFilterClick += rFilter_ApplyFilterClick; if (!Page.IsPostBack) { _container.Refresh(); } rGrid.DataKeyNames = new string[] { "id" }; if (_isAuthorizedToConfigure) { rGrid.GridReorder += rGrid_GridReorder; } rGrid.Columns[0].Visible = _isAuthorizedToConfigure; // Reorder rGrid.GridRebind += rGrid_GridRebind; rGrid.RowDataBound += rGrid_RowDataBound; if (containerType.BaseType.GenericTypeArguments.Length > 0) { rGrid.RowItemText = containerType.BaseType.GenericTypeArguments[0].Name.SplitCase(); } } else { DisplayError("Could not get ContainerManaged instance from Instance property"); } } else { DisplayError("ContainerManaged class does not have an 'Instance' property"); } } else { DisplayError("Could not get the type of the specified Manged Component Container"); } }
public void ThenTheYourFeedsSectionShouldBeEmpty() { Assert.True(CurrentPage.As <HomePageOnline>().GetNoFeedsDisplayed()); }
/// /// </summary> private void LoadPage(ApiMenuItem menuItem) { if (CurrentPage != null) { bool unloadCurrent = CurrentPage.Unload(); // Cancel if (!unloadCurrent) { return; } } // Kill all async wait handles foreach (System.Threading.AutoResetEvent handle in _asyncHandles.Values) { handle.Set(); } _asyncHandles.Clear(); DataRow[] permissions = _userPermissions.Select(String.Format("PermissionType = '{0}' and (AccountID = -1 or AccountID = {1})", menuItem.Path, CurrentAccount.ID)); if (permissions.Length < 1) { HidePageContents("You don't have permission to view this page for the current account."); return; } string className; if (!menuItem.Metadata.TryGetValue("WpfClass", out className)) { HidePageContents("This menu item cannot be loaded in WPF."); return; } // Try to get the class Type newPageType = Type.GetType(className, false); if (newPageType == null) { try { newPageType = Type.GetType(className, true); } catch (Exception ex) { HidePageContents("Could not load the requested page.", ex); return; } } // Try loading the class try { CurrentPage = (PageBase)Activator.CreateInstance(newPageType); } catch (Exception ex) { CurrentPage = null; HidePageContents("Failed to load page.", ex); } CurrentPage.PageData = menuItem; _currentPageViewer.Content = CurrentPage; if (newPageType.GetCustomAttributes(typeof(AccountDependentPageAttribute), false).Length > 0) { if (CurrentAccount != null) { // Tell the page to load the account CurrentPage.OnAccountChanged(); } else { // Tell the page to hide the account HidePageContents("You do not have permission to view this page for the selected account."); } } // Force garbage collection this.FloatingDialogContainer.Children.Clear(); GC.Collect(); }
public void ThenTheCommentSectionIsDisplayed() { Assert.True(CurrentPage.As <ArticlePage>().GetCommentDisplayed()); }
protected void btnSearch_Click(object sender, EventArgs e) { Hits = CurrentPage.Search(txtQuery.Text); DataBind(); }
public void ThenTheUserSNameIsDisplayed() { Assert.True(CurrentPage.As <HomePageOnline>().GetUserNameDisplayed()); //Reporter.Pass(); }
public bool HandleKeyPress(Key key) { return(CurrentPage.HandleKeyPress(key)); }
public void WhenTheUserEntersAsEmailOnSignUpPage(string email) { CurrentPage.As <SignUpPage>().EnterEmailAddress(email); }
public void WhenTheUserClicksOnTheSignUpButton() { CurrentPage.As <SignUpPage>().ClickSignUpWithInvalid(); }
protected void DataBind_DL(string ReqPage, string beginDate, string endDate, string keywords) { string strSql = string.Format("select * from v_Y_Article_TryReport (nolock) "); strSql += " where 1=1 and BoardName='tryUseReport' "; strSql += " order by 1 desc"; DataSet ds = SqlHelper.ExecuteDataset(System.Data.CommandType.Text, strSql); PagedDataSource Pgds = new PagedDataSource(); Pgds.DataSource = ds.Tables[0].DefaultView; Pgds.AllowPaging = true; Pgds.PageSize = 5; lblTotalPage.Text = Pgds.PageCount.ToString(); //显示总共页数 int CurrentPage; if (ReqPage != null) { CurrentPage = Convert.ToInt32(ReqPage); } else { CurrentPage = 1; } // 当前页所引为页码-1 Pgds.CurrentPageIndex = CurrentPage - 1; // 显示当前页码 lblCurrentPage.Text = CurrentPage.ToString(); // 如果不是第一页,通过参数Page设置上一页为当前页-1,否则不显示连接 LinkButtonPrev.Enabled = true; LinkButtonNext.Enabled = true; if (Pgds.IsFirstPage) { LinkButtonPrev.Enabled = false; } // 如果不是最后一页,通过参数Page设置下一页为当前页+1,否则不显示连接 if (Pgds.IsLastPage) { LinkButtonNext.Enabled = false; } ////==========绑定下拉框页数 ddlPageCount.Items.Clear(); for (int i = 1; i < Pgds.PageCount + 1; i++) { ddlPageCount.Items.Add(i.ToString()); if (CurrentPage == Convert.ToInt32(ddlPageCount.Items[i - 1].Value)) { ddlPageCount.Items[i - 1].Selected = true; } } // 模板绑定数据源 //recordCount = ds.Tables[0].Rows.Count.ToString(); this.Repeater1.DataSource = Pgds; //new person6BLL.Admin.UserLoginLog().GetDs_UserLoginLog(beginDate, endDate, keywords); this.Repeater1.DataBind(); }
public void ThenTheGlobalFeedsAndPopularTagsAreDisplayed() { Assert.True(CurrentPage.As <HomePageOffline>().GetResultGlobalFeedDisplayed()); Assert.True(CurrentPage.As <HomePageOffline>().GetResultGlobalFeedDisplayed()); }
public void ThenTheYearsOfExperienceIsConvertedTo(string SavedYearsOfExperience) { Assert.AreEqual(SavedYearsOfExperience, CurrentPage.As <PostJob>().GetYears()); }
public void WhenAUserTriesToLikeAnArticle() { NextPage = CurrentPage.As <HomePageOffline>().ClickLikeOnArticle(); }
public void ThenAllTheMandatoryFieldsAreHighlightedInRedWithAppropriateErrorMessages() { CurrentPage = GetInstance <PostJob>(Driver); // CurrentPage.As<PostJob>().AsserttMandatoryField(); Assert.True(CurrentPage.As <PostJob>().AssertMandatoryField()); }
public void ThenAValidationErrorIsDisplayed() { Assert.True(CurrentPage.As <SignUpPage>().ErrorMessageForInvalidDisplayed()); }
private void buttonNext_Click(object sender, EventArgs e) { if (m_currentPage == CurrentPage.Intro) { switch (wizardIntroduction.UserChoice) { case WizardIntroduction.RadioSelection.FromFile: wizardFromFile.Visible = true; m_currentPage = CurrentPage.FromFile; break; case WizardIntroduction.RadioSelection.FromString: wizardFromString.Visible = true; m_currentPage = CurrentPage.FromString; wizardFromString.SetFocus(); break; default: break; } wizardIntroduction.Visible = false; buttonBack.Enabled = true; buttonNext.Text = Properties.Resources.Finish; } else { //finish up if (m_currentPage == CurrentPage.FromFile) { //validate file //make sure file actually exists before continuing if (!File.Exists(wizardFromFile.FilePath)) { ControlBase.ShowErrorMessage(this, Properties.Resources.FileNotFound); return; } //verify that the file contains valid xml, if not, tell them XmlDocument xdoc = new XmlDocument(); xdoc.XmlResolver = null; try { xdoc.Load(wizardFromFile.FilePath); } catch (XmlException ex) { ControlBase.ShowErrorMessage(this, string.Format(CultureInfo.CurrentCulture, Properties.Resources.FileNotValidXml, ex.Message)); return; } //send back the choice and file contents m_strXml = xdoc.OuterXml; this.DialogResult = DialogResult.OK; this.Close(); } else if (m_currentPage == CurrentPage.FromString) { //validate string //strip tabs and carriage returns from the string string strTempXMLString = wizardFromString.XmlString; strTempXMLString = strTempXMLString.Replace(Environment.NewLine, ""); strTempXMLString = strTempXMLString.Replace("\t", ""); //make sure XML is well formed XmlDocument xdoc = new XmlDocument(); try { xdoc.LoadXml(strTempXMLString); } catch (XmlException ex) { ControlBase.ShowErrorMessage(this, string.Format(CultureInfo.CurrentCulture, Properties.Resources.StringNotValidXml, ex.Message)); return; } //send back the choice and the XML m_strXml = xdoc.OuterXml; xdoc = null; this.DialogResult = DialogResult.OK; this.Close(); } } }
public void ClickNextPage() { int numPages = System.Enum.GetNames(typeof(CurrentPage)).Length; int curPage = (int)currentPage; int newPage = curPage + 1; if (newPage >= numPages) { newPage = 0; } currentPage = (CurrentPage)newPage; //textPageTitle.text = currentPage.ToString(); UpdateDataText(); }