protected void ddlCategory_SelectedIndexChanged(object sender, EventArgs e) { //there is no parent category to display for Top Level items - BD if (ddlCategory.SelectedValue == "-1") { lblShowParent.Visible = false; chkShowParent.Visible = false; chkShowParentDescription.Visible = false; lblShowParentDescription.Visible = false; } else { lblShowParent.Visible = true; chkShowParent.Visible = true; chkShowParentDescription.Visible = true; lblShowParentDescription.Visible = true; } var qsp = new QueryStringParameters(); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categorysort"); qsp.Add("itemid", ddlCategory.SelectedValue); lnkSortCategory.NavigateUrl = BuildSortUrl(); }
public void BuildApiUrlTest() { ILinkedInAuthorization authorization = new LinkedInAuthorizationMock(); LinkedInService_Accessor target = new LinkedInService_Accessor(authorization); Collection <Resource> resources = new Collection <Resource>(); resources.Add(new Resource { Name = Constants.PeopleResourceName, Identifier = Constants.CurrentUserIdentifier }); resources.Add(new Resource { Name = Constants.ResourceName }); QueryStringParameters parameters = new QueryStringParameters(); parameters.Add(Constants.QueryStringParam1, Constants.QueryStringValue1); parameters.Add(Constants.QueryStringParam2, Constants.QueryStringValue2); UriBuilder expected = new UriBuilder("http://api.linkedin.com/v1/people/~/resource?param1=value1¶m2=value2"); UriBuilder actual = UriUtility.BuildApiUrl(resources, parameters); Assert.AreEqual(expected, actual); }
private string BuildSortUrl() { var qsp = new QueryStringParameters(); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categorysort"); qsp.Add("windowClose", "true"); qsp.Add("itemid", ddlCategory.SelectedValue); return(DotNetNuke.Common.Globals.NavigateURL(TabId, "", qsp.ToString())); }
public async Task <Annotation[]> FindAnnotationsAsync(long?from = null, long?to = null, int limit = 100, int?alertId = null, int?dashboardId = null, int?panelId = null, int?userId = null, AnnotationType?type = null, string[] tags = null) { var parameters = new QueryStringParameters(); if (from != null) { parameters.Add(nameof(from), from); } if (to != null) { parameters.Add(nameof(to), to); } parameters.Add(nameof(limit), limit); if (alertId != null) { parameters.Add(nameof(alertId), alertId); } if (dashboardId != null) { parameters.Add(nameof(dashboardId), dashboardId); } if (panelId != null) { parameters.Add(nameof(panelId), panelId); } if (userId != null) { parameters.Add(nameof(userId), userId); } if (type != null) { parameters.Add(nameof(type), type.ToString().ToLowerInvariant()); } if (tags != null && tags.Any()) { foreach (var tag in tags) { parameters.Add(nameof(tags), tag); } } var response = await ExecuteGetRequestAsync <Annotation[]>("/api/annotations", parameters, _authentication); return(response); }
protected string GetVersionEditUrl(object row) { var view = (DataRowView)row; var qsp = new QueryStringParameters(); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", view["adminType"]); qsp.Add("versionid", view["ItemVersionId"]); //todo: why would we need modid on the URL for editing a version? //qsp.Add("modid", view["ModuleId"]); return(BuildLinkUrl(qsp.ToString())); }
public void SetType(string filter) { if (filter != null) { QueryStringParameters.Add("type", filter.ToLower()); } }
public async Task <bool> CreateMasterZone(string zoneName, List <string> masterServers = null) { QueryStringParameters nvc = new QueryStringParameters(); nvc["domain-name"] = zoneName; nvc["zone-type"] = "master"; if (masterServers != null) { if (masterServers.Any()) { foreach (string ipAddress in masterServers) { nvc.Add("ns[]", ipAddress); } } else { nvc["ns[]"] = string.Empty; } } StatusMessage status = await ExecuteGet <StatusMessage>("/dns/register.json", nvc).ConfigureAwait(false); return(status.Status == "Success"); }
public void AddWhhenNameIsNull() { var queryStringParameters = new QueryStringParameters(); var exception = Assert.Throws <ArgumentNullException>(() => queryStringParameters.Add(null)); Assert.AreEqual("Value cannot be null.\r\nParameter name: name", exception.Message); }
public void AddSearchParam(string key, object value) { if (string.IsNullOrEmpty(key) || value == null) { return; } QueryStringParameters.Add(key, value); }
public void AddWhenValueAndValueIsNull() { const string NAME = "testName"; var queryStringParameters = new QueryStringParameters(); var exception = Assert.Throws <ArgumentNullException>(() => queryStringParameters.Add(NAME, null)); Assert.AreEqual("Value cannot be null.\r\nParameter name: value", exception.Message); }
public void Add_String_Test() { QueryStringParameters target = new QueryStringParameters(); string name = Constants.QueryStringParam1; string value = Constants.QueryStringValue1; target.Add(name, value); Assert.IsNotNull(target[name]); }
public void Add_InvalidInt_Test() { QueryStringParameters target = new QueryStringParameters(); string name = Constants.QueryStringParam1; int value = -1; target.Add(name, value); Assert.IsNull(target[name]); }
public void Add_Int_Test() { QueryStringParameters target = new QueryStringParameters(); string name = string.Empty; int value = 1; target.Add(name, value); Assert.IsNotNull(target[name]); }
public void Add_Boolean_Test() { QueryStringParameters target = new QueryStringParameters(); string name = string.Empty; bool value = false; target.Add(name, value); Assert.IsNotNull(target[name]); }
public void SetSortOrder(string sortBy, string sortOrder) { if (string.IsNullOrEmpty(sortBy) || string.IsNullOrEmpty(sortOrder)) { return; } QueryStringParameters.Add("sortby", sortBy.ToLower()); QueryStringParameters.Add("sortorder", sortOrder.ToLower()); }
public void Add_InvalidString_Test() { QueryStringParameters target = new QueryStringParameters(); string name = Constants.QueryStringParam1; string value = string.Empty; target.Add(name, value); Assert.IsNull(target[name]); }
public static string GetQueryString(this Dictionary <string, string> input) { var queryStringParameters = new QueryStringParameters(); foreach (var kvp in input) { queryStringParameters.Add(kvp.Key, kvp.Value); } return(queryStringParameters.GetQueryString()); }
public void BuildApiUrlTest() { ILinkedInAuthorization authorization = new LinkedInAuthorizationMock(); LinkedInService_Accessor target = new LinkedInService_Accessor(authorization); Collection<Resource> resources = new Collection<Resource>(); resources.Add(new Resource { Name = Constants.PeopleResourceName, Identifier = Constants.CurrentUserIdentifier }); resources.Add(new Resource {Name = Constants.ResourceName}); QueryStringParameters parameters = new QueryStringParameters(); parameters.Add(Constants.QueryStringParam1, Constants.QueryStringValue1); parameters.Add(Constants.QueryStringParam2, Constants.QueryStringValue2); UriBuilder expected = new UriBuilder("http://api.linkedin.com/v1/people/~/resource?param1=value1¶m2=value2"); UriBuilder actual = UriUtility.BuildApiUrl(resources, parameters); Assert.AreEqual(expected, actual); }
public void BuildApiUrlForCurrentUserTest() { ILinkedInAuthorization authorization = new LinkedInAuthorizationMock(); LinkedInService_Accessor target = new LinkedInService_Accessor(authorization); QueryStringParameters parameters = new QueryStringParameters(); parameters.Add(Constants.QueryStringParam1, Constants.QueryStringValue1); UriBuilder expected = new UriBuilder("http://api.linkedin.com/v1/people/~"); expected.Query = string.Format("{0}={1}", Constants.QueryStringParam1, Constants.QueryStringValue1); UriBuilder actual = UriUtility.BuildApiUrlForCurrentUser(parameters); Assert.AreEqual(expected, actual); }
public void AddQueryStringParameter(string key, object value) { string stringValue; if (value is string) { stringValue = value.ToString(); } else { stringValue = value.SerializeObjectToBase64(); } QueryStringParameters.Add(new KeyValuePair <string, string>(key, stringValue)); }
public void BuildApiUrlForCurrentUserTest() { ILinkedInAuthorization authorization = new LinkedInAuthorizationMock(); LinkedInService_Accessor target = new LinkedInService_Accessor(authorization); QueryStringParameters parameters = new QueryStringParameters(); parameters.Add(Constants.QueryStringParam1, Constants.QueryStringValue1); UriBuilder expected = new UriBuilder("http://api.linkedin.com/v1/people/~"); expected.Query = string.Format("{0}={1}", Constants.QueryStringParam1, Constants.QueryStringValue1); UriBuilder actual = UriUtility.BuildApiUrlForCurrentUser(parameters); Assert.AreEqual(expected, actual); }
private void BindData() { int itemId = Convert.ToInt32(this.cboItemType.SelectedValue, CultureInfo.InvariantCulture); if (this.CategoryId > -1) { // user clicked on a subcategory. itemId = this.CategoryId; } // set the approval status ID to approved by default, if we're using approvals look for the selected value int approvalStatusId = ApprovalStatus.Approved.GetId(); if (this.UseApprovals) { approvalStatusId = Convert.ToInt32(this.cboWorkflow.SelectedValue, CultureInfo.InvariantCulture); } var qsp = new QueryStringParameters(); DataSet ds; if (this.txtArticleSearch.Text.Trim() != string.Empty) { var objSecurity = new PortalSecurity(); string searchKey = objSecurity.InputFilter(this.txtArticleSearch.Text.Trim(), PortalSecurity.FilterFlag.NoSQL); ds = itemId == -1 ? DataProvider.Instance().GetAdminItemListingSearchKey( TopLevelCategoryItemType.Category.GetId(), ItemType.Category.GetId(), RelationshipType.CategoryToTopLevelCategory.GetId(), RelationshipType.ItemToRelatedCategory.GetId(), approvalStatusId, " vi.createddate desc ", searchKey, this.PortalId) : DataProvider.Instance().GetAdminItemListingSearchKey( itemId, ItemType.Category.GetId(), RelationshipType.ItemToParentCategory.GetId(), RelationshipType.ItemToRelatedCategory.GetId(), approvalStatusId, " vi.createddate desc ", searchKey, this.PortalId); } else { ds = itemId == -1 ? DataProvider.Instance().GetAdminItemListing( TopLevelCategoryItemType.Category.GetId(), ItemType.Category.GetId(), RelationshipType.CategoryToTopLevelCategory.GetId(), approvalStatusId, this.PortalId) : DataProvider.Instance().GetAdminItemListing( itemId, ItemType.Category.GetId(), RelationshipType.ItemToParentCategory.GetId(), RelationshipType.ItemToRelatedCategory.GetId(), approvalStatusId, this.PortalId); } DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0) { var t = new Table { Width = Unit.Percentage(100), CssClass = "Normal", CellPadding = 4, CellSpacing = 0, GridLines = GridLines.Horizontal, BorderColor = Color.Gray, BorderStyle = BorderStyle.Solid, BorderWidth = Unit.Pixel(1) }; var row = new TableRow { CssClass = "listing_table_head_row" }; t.Rows.Add(row); var cell = new TableCell(); row.Cells.Add(cell); cell.Text = Localization.GetString("ID", this.LocalResourceFile); cell = new TableCell(); row.Cells.Add(cell); cell.Text = Localization.GetString("Name", this.LocalResourceFile); cell = new TableCell(); row.Cells.Add(cell); cell.Text = Localization.GetString("Description", this.LocalResourceFile); cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; for (int i = 0; i < dt.Rows.Count; i++) { DataRow r = dt.Rows[i]; row = new TableRow { CssClass = i % 2 == 0 ? "adminItemSearchDarkRow" : "adminItemSearchLightRow", VerticalAlign = VerticalAlign.Top }; t.Rows.Add(row); cell = new TableCell(); row.Cells.Add(cell); cell.Text = r["ItemID"].ToString(); cell = new TableCell(); row.Cells.Add(cell); cell.Text = r["Name"].ToString(); cell = new TableCell(); row.Cells.Add(cell); cell.Text = HtmlUtils.Shorten(HtmlUtils.Clean(r["Description"].ToString(), true), 200, string.Empty) + " "; cell = new TableCell(); row.Cells.Add(cell); // check if the category has any sub categories, if not don't display link var hl = new HyperLink(); if (Convert.ToInt32(r["ChildCount"], CultureInfo.InvariantCulture) > 0) { cell.Controls.Add(hl); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", this.ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categorylist"); qsp.Add("itemId", r["ItemId"]); // qsp.Add("category", r["Name"]); qsp.Add("parentId", itemId); if (this.TopLevelId == -1) { qsp.Add("topLevelId", this.cboItemType.SelectedValue); } else { qsp.Add("topLevelId", this.TopLevelId); } hl.NavigateUrl = this.BuildLinkUrl(qsp.ToString()); hl.Text = Localization.GetString("SubCategories", this.LocalResourceFile); } else { var l1 = new Label { Text = " <br /> " }; cell.Controls.Add(l1); } // Add the CategorySort link cell = new TableCell(); row.Cells.Add(cell); hl = new HyperLink(); cell.Controls.Add(hl); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", this.ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categorysort"); qsp.Add("itemid", r["ItemId"]); hl.NavigateUrl = this.BuildLinkUrl(qsp.ToString()); hl.Text = Localization.GetString("CategorySort", this.LocalResourceFile); cell = new TableCell(); row.Cells.Add(cell); cell = new TableCell(); row.Cells.Add(cell); hl = new HyperLink(); cell.Controls.Add(hl); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", this.ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "versionslist"); qsp.Add("itemid", r["ItemId"]); hl.NavigateUrl = this.BuildLinkUrl(qsp.ToString()); hl.Text = Localization.GetString("Versions", this.LocalSharedResourceFile); cell = new TableCell(); row.Cells.Add(cell); hl = new HyperLink(); cell.Controls.Add(hl); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", this.ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categoryEdit"); qsp.Add("versionid", r["ItemVersionId"]); // qsp.Add("modid", r["ModuleId"]); qsp.Add("parentId", itemId); if (this.TopLevelId == -1) { qsp.Add("topLevelId", this.cboItemType.SelectedValue); } else { qsp.Add("topLevelId", this.TopLevelId); } hl.NavigateUrl = this.BuildLinkUrl(qsp.ToString()); hl.Text = Localization.GetString("Edit", this.LocalResourceFile); } this.phList.Controls.Add(t); if (!this.cboItemType.SelectedValue.Equals("-1")) { this.lblMessage.Text = Localization.GetString("SubCategoriesFor", this.LocalResourceFile) + " " + this.cboItemType.SelectedItem; } } else { if (!this.cboItemType.SelectedValue.Equals("-1")) { this.lblMessage.Text = Localization.GetString("NoSubcategoriesFor", this.LocalResourceFile) + " " + this.cboItemType.SelectedItem; } } }
public void SetPageAndLimit(int page, int limit) { QueryStringParameters.Add("page", page); QueryStringParameters.Add("limit", limit); }
private void BuildQueryStringAndBodyRouteParts() { var actionParameters = Method.Parameters .Where(p => Controller.RouteParts.All(brp => brp.ParameterName != p.Name) && RouteParts.All(rp => rp.ParameterName != p.Name)) .ToList(); var isBodyAllowed = Verbs.Contains(WebApiHttpVerb.Post) || Verbs.Contains(WebApiHttpVerb.Put); var fromBodyAttributeName = "FromBodyAttribute"; var fromUriAttributeName = "FromUriAttribute"; var isThereAnythingFromBody = actionParameters .Any(ap => Helpers.HasCustomAttribute(ap, fromBodyAttributeName)); foreach (var actionParameter in actionParameters) { var isFromBody = Helpers.HasCustomAttribute(actionParameter, fromBodyAttributeName); var isFromUri = Helpers.HasCustomAttribute(actionParameter, fromUriAttributeName); var isPrimitive = actionParameter.ParameterType.IsPrimitive; if (!isPrimitive) { var strippedType = TypeService.StripGenerics(actionParameter.ParameterType, actionParameter.Name, out bool isNullable, out int collectionLevel); isPrimitive = isNullable && TypeService.GetPrimitiveTypeScriptType(strippedType.FullName) != null; } if (isBodyAllowed && ((isThereAnythingFromBody && isFromBody) || (!isThereAnythingFromBody && !isFromUri && !isPrimitive))) { BodyParameters.Add(new WebApiRoutePart { Name = actionParameter.Name, ParameterName = actionParameter.Name, Parameter = actionParameter, CustomAttributes = new List <string> { fromBodyAttributeName }, IsOptional = false }); } else { var queryStringRoutePart = new WebApiRoutePart { Name = actionParameter.Name, ParameterName = actionParameter.Name, Parameter = actionParameter, IsOptional = true }; if (actionParameter.HasCustomAttributes) { queryStringRoutePart.CustomAttributes = actionParameter.CustomAttributes .Select(a => a.AttributeType.Name) .ToList(); } QueryStringParameters.Add(queryStringRoutePart); } } }
public async Task <Alert[]> GetAlertsAsync(int[] dashboardIds = null, int?panelId = null, string query = null, AlertState[] states = null, int?limit = null, int[] folderIds = null, string dashboardQuery = null, string[] dashboardTags = null) { var parameters = new QueryStringParameters(); if (dashboardIds != null && dashboardIds.Length > 0) { foreach (var dashboardId in dashboardIds) { parameters.Add("dashboardId", dashboardId); } } if (panelId != null) { parameters.Add(nameof(panelId), panelId); } if (string.IsNullOrWhiteSpace(query) == false) { parameters.Add(nameof(query), query); } if (states != null && states.Length > 0) { foreach (var state in states) { parameters.Add("state", state.ToString()); } } if (limit != null) { parameters.Add(nameof(limit), limit); } if (folderIds != null && folderIds.Length > 0) { foreach (var folderId in folderIds) { parameters.Add("folderId", folderId.ToString()); } } if (string.IsNullOrWhiteSpace(dashboardQuery) == false) { parameters.Add(nameof(dashboardQuery), dashboardQuery); } if (dashboardTags != null && dashboardTags.Length > 0) { foreach (var dashboardTag in dashboardTags) { parameters.Add("dashboardTag", dashboardTag); } } var response = await ExecuteGetRequestAsync <Alert[]>("/api/alerts", parameters, _authentication); return(response); }
protected string GetVersionEditUrl(object row) { var view = (DataRowView) row; var qsp = new QueryStringParameters(); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", view["adminType"]); qsp.Add("versionid", view["ItemVersionId"]); //todo: why would we need modid on the URL for editing a version? //qsp.Add("modid", view["ModuleId"]); return BuildLinkUrl(qsp.ToString()); }
private void BindData() { int itemId = Convert.ToInt32(cboItemType.SelectedValue, CultureInfo.InvariantCulture); if (CategoryId > -1) { //user clicked on a subcategory. itemId = CategoryId; } //set the approval status ID to approved by default, if we're using approvals look for the selected value int approvalStatusId = ApprovalStatus.Approved.GetId(); if (UseApprovals) { approvalStatusId = Convert.ToInt32(cboWorkflow.SelectedValue, CultureInfo.InvariantCulture); } var qsp = new QueryStringParameters(); DataSet ds; if (txtArticleSearch.Text.Trim() != string.Empty) { var objSecurity = new DotNetNuke.Security.PortalSecurity(); string searchKey = objSecurity.InputFilter(txtArticleSearch.Text.Trim(), DotNetNuke.Security.PortalSecurity.FilterFlag.NoSQL); // ds = itemId == -1 ? DataProvider.Instance().GetAdminItemListingSearchKey(TopLevelCategoryItemType.Category.GetId(), ItemType.Category.GetId(), Util.RelationshipType.CategoryToTopLevelCategory.GetId(), Util.RelationshipType.ItemToRelatedCategory.GetId(), approvalStatusId, " vi.createddate desc ", searchKey, PortalId) : DataProvider.Instance().GetAdminItemListingSearchKey(itemId, ItemType.Category.GetId(), Util.RelationshipType.ItemToParentCategory.GetId(), Util.RelationshipType.ItemToRelatedCategory.GetId(), approvalStatusId, " vi.createddate desc ", searchKey, PortalId); } else { ds = itemId == -1 ? DataProvider.Instance().GetAdminItemListing(TopLevelCategoryItemType.Category.GetId(), ItemType.Category.GetId(), Util.RelationshipType.CategoryToTopLevelCategory.GetId(), approvalStatusId, PortalId) : DataProvider.Instance().GetAdminItemListing(itemId, ItemType.Category.GetId(), Util.RelationshipType.ItemToParentCategory.GetId(), Util.RelationshipType.ItemToRelatedCategory.GetId(), approvalStatusId, PortalId); } DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0) { var t = new Table { Width = Unit.Percentage(100), CssClass = "Normal", CellPadding = 4, CellSpacing = 0, GridLines = GridLines.Horizontal, BorderColor = System.Drawing.Color.Gray, BorderStyle = BorderStyle.Solid, BorderWidth = Unit.Pixel(1) }; var row = new TableRow { CssClass = "listing_table_head_row" }; t.Rows.Add(row); var cell = new TableCell(); row.Cells.Add(cell); cell.Text = Localization.GetString("ID", LocalResourceFile); cell = new TableCell(); row.Cells.Add(cell); cell.Text = Localization.GetString("Name", LocalResourceFile); cell = new TableCell(); row.Cells.Add(cell); cell.Text = Localization.GetString("Description", LocalResourceFile); cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; cell = new TableCell(); row.Cells.Add(cell); cell.Text = " "; for (int i = 0; i < dt.Rows.Count; i++) { DataRow r = dt.Rows[i]; row = new TableRow { CssClass = i % 2 == 0 ? "adminItemSearchDarkRow" : "adminItemSearchLightRow", VerticalAlign = VerticalAlign.Top }; t.Rows.Add(row); cell = new TableCell(); row.Cells.Add(cell); cell.Text = r["ItemID"].ToString(); cell = new TableCell(); row.Cells.Add(cell); cell.Text = r["Name"].ToString(); cell = new TableCell(); row.Cells.Add(cell); cell.Text = HtmlUtils.Shorten(HtmlUtils.Clean(r["Description"].ToString(), true), 200, string.Empty) + " "; cell = new TableCell(); row.Cells.Add(cell); //check if the category has any sub categories, if not don't display link var hl = new HyperLink(); if (Convert.ToInt32(r["ChildCount"], CultureInfo.InvariantCulture) > 0) { cell.Controls.Add(hl); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categorylist"); qsp.Add("itemId", r["ItemId"]); //qsp.Add("category", r["Name"]); qsp.Add("parentId", itemId); if (TopLevelId == -1) { qsp.Add("topLevelId", cboItemType.SelectedValue); } else { qsp.Add("topLevelId", TopLevelId); } hl.NavigateUrl = BuildLinkUrl(qsp.ToString()); hl.Text = Localization.GetString("SubCategories", LocalResourceFile); } else { var l1 = new Label { Text = " <br /> " }; cell.Controls.Add(l1); } //Add the CategorySort link cell = new TableCell(); row.Cells.Add(cell); hl = new HyperLink(); cell.Controls.Add(hl); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categorysort"); qsp.Add("itemid", r["ItemId"]); hl.NavigateUrl = BuildLinkUrl(qsp.ToString()); hl.Text = Localization.GetString("CategorySort", LocalResourceFile); cell = new TableCell(); row.Cells.Add(cell); cell = new TableCell(); row.Cells.Add(cell); hl = new HyperLink(); cell.Controls.Add(hl); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "versionslist"); qsp.Add("itemid", r["ItemId"]); hl.NavigateUrl = BuildLinkUrl(qsp.ToString()); hl.Text = Localization.GetString("Versions", LocalSharedResourceFile); cell = new TableCell(); row.Cells.Add(cell); hl = new HyperLink(); cell.Controls.Add(hl); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categoryEdit"); qsp.Add("versionid", r["ItemVersionId"]); //qsp.Add("modid", r["ModuleId"]); qsp.Add("parentId", itemId); if (TopLevelId == -1) { qsp.Add("topLevelId", cboItemType.SelectedValue); } else { qsp.Add("topLevelId", TopLevelId); } hl.NavigateUrl = BuildLinkUrl(qsp.ToString()); hl.Text = Localization.GetString("Edit", LocalResourceFile); } phList.Controls.Add(t); if (!cboItemType.SelectedValue.Equals("-1")) { lblMessage.Text = Localization.GetString("SubCategoriesFor", LocalResourceFile) + " " + cboItemType.SelectedItem; } } else { if (!cboItemType.SelectedValue.Equals("-1")) { lblMessage.Text = Localization.GetString("NoSubcategoriesFor", LocalResourceFile) + " " + cboItemType.SelectedItem; } } }
private string BuildSortUrl() { var qsp = new QueryStringParameters(); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categorysort"); qsp.Add("windowClose", "true"); qsp.Add("itemid", ddlCategory.SelectedValue); return DotNetNuke.Common.Globals.NavigateURL(TabId, "", qsp.ToString()); }
protected void ddlCategory_SelectedIndexChanged(object sender, EventArgs e) { //there is no parent category to display for Top Level items - BD if (ddlCategory.SelectedValue == "-1") { lblShowParent.Visible = false; chkShowParent.Visible = false; chkShowParentDescription.Visible = false; lblShowParentDescription.Visible = false; } else { lblShowParent.Visible = true; chkShowParent.Visible = true; chkShowParentDescription.Visible = true; lblShowParentDescription.Visible = true; } var qsp = new QueryStringParameters(); qsp.ClearKeys(); qsp.Add("ctl", Utility.AdminContainer); qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture)); qsp.Add("adminType", "categorysort"); qsp.Add("itemid", ddlCategory.SelectedValue); lnkSortCategory.NavigateUrl = BuildSortUrl(); }