wsp-10078 Space searching
This commit is contained in:
parent
5bebce9e60
commit
169b0496aa
3 changed files with 68 additions and 4 deletions
|
@ -17,7 +17,16 @@
|
|||
EmptyDataText="gvPackages" CssSelectorClass="NormalGridView"
|
||||
AllowSorting="True" DataSourceID="odsItemsPaged" AllowPaging="True">
|
||||
<Columns>
|
||||
<asp:BoundField SortExpression="ItemName" DataField="ItemName" HeaderText="gvPackagesItemName" ></asp:BoundField>
|
||||
<asp:TemplateField SortExpression="ItemName" HeaderText="gvPackagesItemName">
|
||||
<ItemTemplate>
|
||||
<asp:hyperlink ID="lnkItem" runat="server" NavigateUrl='<%# GetItemPageUrl((int)Eval("ItemID"), (int)Eval("PackageID")) %>' Visible="<%# AllowItemLink() %>">
|
||||
<%# Eval("ItemName") %>
|
||||
</asp:hyperlink>
|
||||
<asp:Label ID="itemName" runat="server" Visible="<%# !AllowItemLink() %>">
|
||||
<%# Eval("ItemName") %>
|
||||
</asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField SortExpression="PackageName" HeaderText="gvPackagesName">
|
||||
<ItemTemplate>
|
||||
<asp:hyperlink id=lnkSpace runat="server" NavigateUrl='<%# GetSpaceHomePageUrl((int)Eval("PackageID")) %>'>
|
||||
|
|
|
@ -30,6 +30,7 @@ using System;
|
|||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
|
@ -37,10 +38,26 @@ using System.Web.UI.WebControls;
|
|||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
using WebsitePanel.WebPortal;
|
||||
using WebsitePanel.Portal.UserControls;
|
||||
|
||||
namespace WebsitePanel.Portal
|
||||
{
|
||||
public partial class SearchSpaces : WebsitePanelModuleBase
|
||||
{
|
||||
|
||||
string ItemTypeName;
|
||||
|
||||
const string type_WebSite = "WebSite";
|
||||
const string type_Domain = "Domain";
|
||||
const string type_Organization = "Organization";
|
||||
|
||||
List<string> linkTypes = new List<string>(new string[] {type_WebSite, type_Domain, type_Organization});
|
||||
|
||||
const string PID_SPACE_WEBSITES = "SpaceWebSites";
|
||||
const string PID_SPACE_DIMAINS = "SpaceDomains";
|
||||
const string PID_SPACE_EXCHANGESERVER = "SpaceExchangeServer";
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
|
@ -48,10 +65,16 @@ namespace WebsitePanel.Portal
|
|||
// bind item types
|
||||
DataTable dtItemTypes = ES.Services.Packages.GetSearchableServiceItemTypes().Tables[0];
|
||||
foreach (DataRow dr in dtItemTypes.Rows)
|
||||
{
|
||||
string displayName = dr["DisplayName"].ToString();
|
||||
ddlItemType.Items.Add(new ListItem(
|
||||
GetSharedLocalizedString("ServiceItemType." + dr["DisplayName"].ToString()),
|
||||
GetSharedLocalizedString("ServiceItemType." + displayName),
|
||||
dr["ItemTypeID"].ToString()));
|
||||
|
||||
if (Request["ItemTypeID"] == dr["ItemTypeID"].ToString())
|
||||
ItemTypeName = displayName;
|
||||
}
|
||||
|
||||
// bind filter
|
||||
Utils.SelectListItem(ddlItemType, Request["ItemTypeID"]);
|
||||
txtFilterValue.Text = Request["Query"];
|
||||
|
@ -68,6 +91,32 @@ namespace WebsitePanel.Portal
|
|||
return PortalUtils.GetSpaceHomePageUrl(spaceId);
|
||||
}
|
||||
|
||||
public string GetItemPageUrl(int itemId, int spaceId)
|
||||
{
|
||||
string res = "";
|
||||
|
||||
switch(ItemTypeName)
|
||||
{
|
||||
case type_WebSite:
|
||||
res = PortalUtils.NavigatePageURL(PID_SPACE_WEBSITES, "ItemID", itemId.ToString(),
|
||||
PortalUtils.SPACE_ID_PARAM + "=" + spaceId, DefaultPage.CONTROL_ID_PARAM + "=" + "edit_item",
|
||||
"moduleDefId=websites");
|
||||
break;
|
||||
case type_Domain:
|
||||
res = PortalUtils.NavigatePageURL(PID_SPACE_DIMAINS, "DomainID", itemId.ToString(),
|
||||
PortalUtils.SPACE_ID_PARAM + "=" + spaceId, DefaultPage.CONTROL_ID_PARAM + "=" + "edit_item",
|
||||
"moduleDefId=domains");
|
||||
break;
|
||||
case type_Organization:
|
||||
res = PortalUtils.NavigatePageURL(PID_SPACE_EXCHANGESERVER, "ItemID", itemId.ToString(),
|
||||
PortalUtils.SPACE_ID_PARAM + "=" + spaceId, DefaultPage.CONTROL_ID_PARAM + "=" + "organization_home",
|
||||
"moduleDefId=ExchangeServer");
|
||||
break;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
protected void cmdSearch_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
string query = txtFilterValue.Text.Trim().Replace("%", "");
|
||||
|
@ -86,5 +135,12 @@ namespace WebsitePanel.Portal
|
|||
e.ExceptionHandled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool AllowItemLink()
|
||||
{
|
||||
bool res = linkTypes.Exists(x => x == ItemTypeName);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,9 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.3074
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue