Beispiel #1
0
    private PXPager CreatePager(string query)
    {
        PXPager pager = new PXPager();

        pager.NavigateUrl = Request.RawUrl;
        pager.Width       = Unit.Percentage(100);
        pager.Style[HtmlTextWriterStyle.TextAlign]    = "center";
        pager.Style[HtmlTextWriterStyle.MarginBottom] = "5px";
        pager.Mode = this.pagerMode;
        if (Page.IsPostBack)
        {
            pager.NavigateUrl += "&adv=1";             // paging for full-text search
        }
        if (!string.IsNullOrEmpty(Request.QueryString[pager.ParameterName]))
        {
            try
            {
                pager.CurrentPage = Convert.ToInt32(Request.QueryString[pager.ParameterName]);
            }
            catch
            {
                pager.CurrentPage = 0;
            }
        }
        return(pager);
    }
Beispiel #2
0
    protected void Page_Init(object sender, EventArgs e)
    {
        string query = Request.QueryString["query"];

        WikiID                = Request.QueryString["wikiid"];
        WikiNumber            = Request.QueryString["wikinumber"];
        CategoryID            = Request.QueryString["categoryID"];
        ProductID             = Request.QueryString["productID"];
        OrderID               = Request.QueryString["orderID"];
        imgMessage            = PXFormView1.FindControl("imgMessage") as Image;
        lblMessage            = PXFormView1.FindControl("lblMessage") as Label;
        lblResults            = PXFormView1.FindControl("lblResults") as Label;
        txtSearch             = PXFormView1.FindControl("txtSearch") as PXTextEdit;
        chkSearchReplace      = PXFormView1.FindControl("chkSearchReplace") as PXCheckBox;
        txtReplace            = PXFormView1.FindControl("txtReplace") as PXTextEdit;
        SearchCaption         = PXFormView1.FindControl("SearchCaption") as PXDropDown;
        SearchCaptionCategory = PXFormView1.FindControl("SearchCaptionCategory") as PXDropDown;
        SearchCaptionProduct  = PXFormView1.FindControl("SearchCaptionProduct") as PXDropDown;
        OrderCaption          = PXFormView1.FindControl("OrderCaption") as PXDropDown;
        Go = PXFormView1.FindControl("btnSearch") as PXButton;

        mainContentTable = CreateMainTable();
        pager            = CreatePager(query);
        PXFormView1.TemplateContainer.Controls.Add(MainContentTable);
        SetEditBoxAttrributes();
        FullText = true;

        if (this.searchType == SearchType.Wiki)
        {
            this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipHelpSearch);
        }
        else if (this.searchType == SearchType.Files)
        {
            this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipFileSearch);
        }
        else if (this.searchType == SearchType.Entity)
        {
            this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipEntitySearch);
        }
        else if (this.searchType == SearchType.Notes)
        {
            this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipNoteSearch);
        }
        FormatSearchCaption();
        RegisterThisId();
        imgMessage.ImageUrl = ResolveUrl("~/App_Themes/Default/Images/Message/information.gif");

        if (query == null || string.IsNullOrEmpty(query.Trim()))
        {
            imgMessage.Visible = true;
            lblMessage.Visible = true;
            lblResults.Visible = false;
            lblMessage.Text    = PXMessages.LocalizeNoPrefix(Messages.SpecifySearchRequest);
            return;
        }

        imgMessage.Visible = false;
        lblMessage.Visible = false;
        lblResults.Visible = true;
    }
	protected void Page_Init(object sender, EventArgs e)
	{
		string query = Request.QueryString["query"];
		WikiID = Request.QueryString["wikiid"];
		WikiNumber = Request.QueryString["wikinumber"];
		CategoryID = Request.QueryString["categoryID"];
		ProductID = Request.QueryString["productID"];
		OrderID = Request.QueryString["orderID"];
		imgMessage = PXFormView1.FindControl("imgMessage") as Image;
		lblMessage = PXFormView1.FindControl("lblMessage") as Label;
		lblResults = PXFormView1.FindControl("lblResults") as Label;
		txtSearch = PXFormView1.FindControl("txtSearch") as PXTextEdit;
		chkSearchReplace = PXFormView1.FindControl("chkSearchReplace") as PXCheckBox;
		txtReplace = PXFormView1.FindControl("txtReplace") as PXTextEdit;
		SearchCaption = PXFormView1.FindControl("SearchCaption") as PXDropDown;
		SearchCaptionCategory = PXFormView1.FindControl("SearchCaptionCategory") as PXDropDown;		
		SearchCaptionProduct = PXFormView1.FindControl("SearchCaptionProduct") as PXDropDown;
		OrderCaption = PXFormView1.FindControl("OrderCaption") as PXDropDown;
		Go = PXFormView1.FindControl("btnSearch") as PXButton;

		mainContentTable = CreateMainTable();
		pager = CreatePager(query);
		PXFormView1.TemplateContainer.Controls.Add(MainContentTable);
		SetEditBoxAttrributes();
		FullText = true;

		if (this.searchType == SearchType.Wiki)
		{
			this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipHelpSearch);
		}
		else if (this.searchType == SearchType.Files)
		{
			this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipFileSearch);
		}
		else if (this.searchType == SearchType.Entity)
		{
			this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipEntitySearch);
		}
		else if (this.searchType == SearchType.Notes)
		{
			this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipNoteSearch);
		}
		FormatSearchCaption();
		RegisterThisId();
		imgMessage.ImageUrl = ResolveUrl("~/App_Themes/Default/Images/Message/information.gif");

		if (query == null || string.IsNullOrEmpty(query.Trim()))
		{
			imgMessage.Visible = true;
			lblMessage.Visible = true;
			lblResults.Visible = false;
			lblMessage.Text = PXMessages.LocalizeNoPrefix(Messages.SpecifySearchRequest);
			return;
		}

		imgMessage.Visible = false;
		lblMessage.Visible = false;
		lblResults.Visible = true;
	}
	private PXPager CreatePager(string query)
	{
		PXPager pager = new PXPager();
		pager.NavigateUrl = Request.RawUrl;
		pager.Width = Unit.Percentage(100);
		pager.Style[HtmlTextWriterStyle.TextAlign] = "center";
		pager.Style[HtmlTextWriterStyle.MarginBottom] = "5px";
		pager.Mode = this.pagerMode;
		if (Page.IsPostBack)
		{
			pager.NavigateUrl += "&adv=1"; // paging for full-text search
		}
		if (!string.IsNullOrEmpty(Request.QueryString[pager.ParameterName]))
		{
			try
			{
				pager.CurrentPage = Convert.ToInt32(Request.QueryString[pager.ParameterName]);
			}
			catch
			{
				pager.CurrentPage = 0;
			}
		}
		return pager;
	}