// Interface IReloadable public void Reload() { if (!Helper.IsObjectTypeEnabled(QuickParameters.ObjectType)) { return; } if (!string.IsNullOrEmpty(Request.QueryString["Tag"])) { currentTagSrch = Request.QueryString["Tag"]; } UserDataContext udc = UserDataContext.GetUserDataContext(); QuickParameters.Udc = udc; QuickParameters.WithCopy = false; QuickParameters.OnlyConverted = true; QuickParameters.ShowState = ObjectShowState.Published; QuickParameters.TagID = DataObjectTag.GetTagID(currentTagSrch); this.OBJOVW.DataSource = DataObjects.Load <Business.DataObjectProduct>(QuickParameters); numberItems = ((DataObjectList <Business.DataObjectProduct>) this.OBJOVW.DataSource).ItemTotal; this.OBJOVW.DataBind(); this.PAGTOP.InitPager(QuickParameters.PageNumber, numberItems); this.PAGBOT.InitPager(QuickParameters.PageNumber, numberItems); if (numberItems > 0) { HasContent = true; this.NOITEMPH.Visible = false; } else { HasContent = false; } }
protected void OnSuggestionItemDataBound(object sender, RepeaterItemEventArgs e) { DataObjectTag tag = (DataObjectTag)e.Item.DataItem; HyperLink link = ((HyperLink)e.Item.FindControl("lnkSuggest")); link.Attributes.Add("onClick", "SelectTag('" + tag.Title + "', '" + tag.Title + "')"); link.Text = tag.Title; link.ID = null; }
private void RenderCloud(int tagWordCloudSize, int relvance, int relevanceType, int?relatedObjectType, Guid?relatedCommunityID, Guid?relatedUserID) { QuickTagCloudRelevanceGroup enuRepevance = (QuickTagCloudRelevanceGroup)relvance; QuickTagCloudRelevance enurelevanceType = (QuickTagCloudRelevance)relevanceType; int groupAmount = 24; if (relvance > 0) { if (relvance <= 3) { groupAmount = 60; } else if (relvance <= 5) { groupAmount = 24; } else { groupAmount = 16; } } QuickParametersTag quickParametersTag = new QuickParametersTag(); quickParametersTag.Udc = UserDataContext.GetUserDataContext(); quickParametersTag.IgnoreCache = false; quickParametersTag.Amount = tagWordCloudSize; quickParametersTag.RelevanceGroup = enuRepevance; quickParametersTag.RelevanceGroupAmount = groupAmount; quickParametersTag.Relevance = enurelevanceType; if (relatedObjectType.HasValue) { quickParametersTag.RelatedObjectType = relatedObjectType.Value; } if (relatedCommunityID.HasValue) { quickParametersTag.RelatedCommunityID = relatedCommunityID.Value; } if (relatedUserID.HasValue) { quickParametersTag.RelatedUserID = relatedUserID.Value; } List <TagCloudItem> tagCloud = DataObjectTag.GetTagCloud(5, quickParametersTag); hasContent = (tagCloud.Count > 0); StringBuilder sb = new StringBuilder(); foreach (TagCloudItem tagWord in tagCloud) { sb.AppendFormat("<span class=\"t{0}\">• <a href=\"/Tag/{1}\">{2}</a></span> ", tagWord.TagClass, tagWord.Tag.Title, tagWord.Tag.Title); } this.LitTags.Text = sb.ToString(); }
protected void rptTag_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataObjectTag qo = e.Item.DataItem as DataObjectTag; e.Item.ID = qo.ObjectID.Value.ToString(); Admin_UserControls_TagWordOutput userOutput = e.Item.FindControl("TOut") as Admin_UserControls_TagWordOutput; userOutput.Tag = qo; userOutput.RenderControls(); } }
private void InitializeTagFilter() { Guid?userId = null; if (showMyContentOnly) { userId = UserProfile.Current.UserId; } List <TagReferenceItem> tags = DataObjectTag.GetReferencedTags(Helper.GetObjectType(objectType).NumericId, userId, communityList); RlbTags.DataSource = tags; RlbTags.DataBind(); }
// Restore page state without using viewstates private void RestoreState() { string idPrefix = this.UniqueID + "$"; if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBPageNum"))) { QuickParameters.PageNumber = int.Parse(Request.Params.Get(idPrefix + "PBPageNum")); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBSortAttr"))) { QuickParameters.SortBy = (QuickSort)Enum.Parse(typeof(QuickSort), Request.Params.Get(idPrefix + "PBSortAttr")); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBObjectType"))) { QuickParameters.ObjectType = int.Parse(Request.Params.Get(idPrefix + "PBObjectType")); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBAscCtyID"))) { QuickParameters.CommunityID = Request.Params.Get(idPrefix + "PBAscCtyID").ToGuid(); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBAscUserID"))) { QuickParameters.UserID = Request.Params.Get(idPrefix + "PBAscUserID").ToGuid(); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBTagWord"))) { QuickParameters.TagID = DataObjectTag.GetTagID(Request.Params.Get(idPrefix + "PBTagWord")); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBSearchParam"))) { QuickParameters.GeneralSearch = Request.Params.Get(idPrefix + "PBSearchParam"); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBUserSearchParam"))) { QuickParameters.UserSearch = Request.Params.Get(idPrefix + "PBUserSearchParam"); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBGeoCoordsLat"))) { QuickParameters.GeoLat = float.Parse(Request.Params.Get(idPrefix + "PBGeoCoordsLat")); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBGeoCoordsLong"))) { QuickParameters.GeoLong = float.Parse(Request.Params.Get(idPrefix + "PBGeoCoordsLong")); } if (!string.IsNullOrEmpty(Request.Params.Get(idPrefix + "PBGeoRadius"))) { QuickParameters.DistanceKm = float.Parse(Request.Params.Get(idPrefix + "PBGeoRadius")); } }
protected void lbtnAdd_Click(object sender, EventArgs e) { if (txtSrchGnr.Text.Trim().Length > 0) { if (DataObjectTag.GetTagID(txtSrchGnr.Text.Trim()) == Guid.Empty) { DataObjectTag tag = new DataObjectTag(); tag.Title = txtSrchGnr.Text; tag.CommunityID = Constants.DEFAULT_COMMUNITY_ID.ToGuid(); tag.UserID = Constants.ANONYMOUS_USERID.ToGuid(); tag.ShowState = ObjectShowState.Published; tag.Status = ObjectStatus.Public; tag.Insert(UserDataContext.GetUserDataContext()); HttpRuntime.Cache.Remove("MainTagsAndSynonyms"); } } Search(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); _4screen.CSB.Extensions.Business.TrackingManager.TrackEventPage(null, null, IsPostBack, LogSitePageType.SiteAdmin); ObjectID = Request.QueryString["OID"].ToNullableGuid(); tag = DataObject.Load <DataObjectTag>(ObjectID, null, true); ctrl = LoadControl("~/UserControls/ObjectsToObjectRelator.ascx"); iOTOR = ctrl as IObjectsToObjectRelator; iOTOR.ParentObjectID = ObjectID; iOTOR.ExcludeSystemObjects = false; //iOTOR.LabelText = "Synonyme"; iOTOR.RelationType = "Synonym"; iOTOR.ChildObjectTypes = new List <string>() { "Tag" }; phOTOR.Controls.Add(ctrl); }
private void FillOffersByTagTabs() { /*if (Cache["ProductOffersByTag"] == null || (!string.IsNullOrEmpty(Request.QueryString["IC"]) && Convert.ToBoolean(Request.QueryString["IC"]))) * { * OffersByTag = new Dictionary<Guid, string> { { AllProductsGuid, "Alle Angebote" } }; * QuickParameters QuickParameters = new QuickParameters(); * QuickParameters.Udc = UserDataContext.GetUserDataContext(); * QuickParameters.ObjectType = 5; * QuickParameters.IgnoreCache = true; * QuickParameters.PageSize = 9999999; * QuickParameters.DisablePaging = true; * QuickParameters.SortBy = QuickSort.Title; * QuickParameters.Direction = QuickSortDirection.Asc; * QuickParameters.RelationParams = new RelationParams { ExcludeSystemObjects = false, ParentObjectType = Helper.GetObjectTypeNumericID("Product"), GroupSort = QuickSort.Title, GroupSortDirection = QuickSortDirection.Asc}; * DataObjectList<DataObjectTag> tags = DataObjects.Load<DataObjectTag>(QuickParameters); * var distinctTags = tags.Distinct(new TagEqualityComparer()); * foreach (var tag in distinctTags) * { * //check that it is not synonym of an other Tag * QuickParameters quickPar = new QuickParameters(); * quickPar.Udc = UserDataContext.GetUserDataContext(); * quickPar.ObjectType = 5; * quickPar.ObjectID = tag.ObjectID; * quickPar.IgnoreCache = false; * quickPar.PageSize = 1; * quickPar.PageNumber = 1; * quickPar.Amount = 1; * quickPar.DisablePaging = true; * quickPar.SortBy = QuickSort.NotSorted; * quickPar.RelationParams = new RelationParams { ExcludeSystemObjects = false, ParentObjectType = 5}; * DataObjectList<DataObjectTag> tagSynonymmOf = DataObjects.Load<DataObjectTag>(quickPar); * if (tagSynonymmOf.Count == 0) * OffersByTag.Add(tag.ObjectID.Value, tag.Title); * } * TimeSpan tisLifeTime = DataAccessConfiguration.GetDefaultCachingTime().ToTimeSpan(); * Cache.Insert("ProductOffersByTag", OffersByTag, null, DateTime.Now.Add(tisLifeTime), Cache.NoSlidingExpiration, CacheItemPriority.Default, null); * } * else * { * OffersByTag = (Dictionary<Guid, string>)Cache["ProductOffersByTag"]; * }*/ List <string> tags = ShopSection.CachedInstance.Tags.LINQEnumarable.Select(x => x.Value).ToList(); tags.Insert(0, "Alle Angebote"); List <string> TabNames = new List <string>(); List <string> QuerystringValues = new List <string>(); foreach (var tag in tags) { string filterTag = (tag == "Alle Angebote") ? string.Empty : tag; DataObjectList <DataObjectProduct> products = DataObjects.Load <DataObjectProduct>(new QuickParameters() { Udc = UserDataContext.GetUserDataContext(), Amount = 10000, DisablePaging = true, TagID = DataObjectTag.GetTagID(filterTag) }); if (products.Count > 0) { TabNames.Add(tag); QuerystringValues.Add(filterTag); } } }
private void PrintGlobalNotifications(PlaceHolder panel) { bool showAlertsPanel = false; panel.Controls.Clear(); PlaceHolder ph = new PlaceHolder(); ph.Controls.Add(new LiteralControl(@"<table class='dashboardAlertsSettings' border='0' cellpadding='5' cellspacing='0'> <tr> <th>Ereignis</th> <th>Bedingungen</th> <th>Typ / Wann</th> <th></th> </tr>")); foreach (Registration item in registrationListGlobal) { if (item.IsGlobal) { showAlertsPanel = true; ph.Controls.Add(new LiteralControl(string.Format("<tr>"))); ph.Controls.Add(new LiteralControl(string.Format("<td>{0}</td>", GetEventString(item.Identifier)))); ph.Controls.Add(new LiteralControl(string.Format("<td>"))); if (item.ObjectID.HasValue) { DataObject obj = DataObject.Load <DataObject>(item.ObjectID, ObjectShowState.Published, false); string userOrCommunityPrefix = obj.ObjectType == Helper.GetObjectTypeNumericID("User") ? string.Format("{0}: ", language.GetString("TextAlertsFromObjects")) : string.Format("{0}: ", language.GetString("TextAlertsFromCommunity")); ph.Controls.Add(new LiteralControl(string.Format("<div>{0} {1}</div>", userOrCommunityPrefix, CreateTitle(obj)))); } if (item.TagWords != null && item.TagWords.Count > 0) { List <string> tagWordList = new List <string>(); string[] tagWordStrings = new string[3]; foreach (TagWord tagWord in item.TagWords) { DataObjectTag dataObjectTag = DataObject.Load <DataObjectTag>(tagWord.TagID.ToGuid()); tagWordStrings[tagWord.GroupID - 1] += dataObjectTag.Title + ","; } foreach (string tagWordString in tagWordStrings) { if (!string.IsNullOrEmpty(tagWordString)) { tagWordList.Add(tagWordString.TrimEnd(',')); } } ph.Controls.Add(new LiteralControl(string.Format("<div>Tag Words: {0}</div>", Helper.GetTagWordString(tagWordList)))); } ph.Controls.Add(new LiteralControl(string.Format("<div style=\"margin-top:10px;\">{0}<div class=\"clearBoth\"></div></div>", CreateImageList(item.ObjectTypeList, false)))); ph.Controls.Add(new LiteralControl(string.Format("</td>"))); ph.Controls.Add(new LiteralControl(string.Format("<td><div>"))); DropDownList ddlCar = new DropDownList(); ddlCar.Width = 80; ddlCar.ID = string.Format("ddlCar{0}", item.ID); FillCarrierDDl(ddlCar, item.Carriers); ph.Controls.Add(ddlCar); ph.Controls.Add(new LiteralControl(string.Format("</div><div style=\"margin-top:5px;\">"))); DropDownList ddlCarCol = new DropDownList(); ddlCarCol.Width = 80; ddlCarCol.ID = string.Format("ddlCarCol{0}", item.ID); FillCarrierColDDl(ddlCarCol); ph.Controls.Add(ddlCarCol); ph.Controls.Add(new LiteralControl(string.Format("</div></td>"))); if (item.Carriers.CheckedCarrier() != null) { Carrier CheckedCar = item.Carriers.CheckedCarrier(); ddlCar.SelectedValue = Convert.ToString((int)CheckedCar.Type); ddlCarCol.SelectedValue = Convert.ToString((int)CheckedCar.Collect); } else { ddlCar.SelectedIndex = 0; ddlCarCol.SelectedIndex = 0; } HtmlGenericControl td = new HtmlGenericControl("td"); LinkButton linkButton = new LinkButton(); linkButton.Text = string.Format("<img src=\"/Library/Images/Layout/cmd_delete.png\" title=\"Löschen\">"); linkButton.Click += new EventHandler(OnGlobalDeleteClick); linkButton.CommandArgument = item.ID; linkButton.ID = item.ID; td.Controls.Add(linkButton); ph.Controls.Add(td); ph.Controls.Add(new LiteralControl(string.Format("</tr>"))); } } ph.Controls.Add(new LiteralControl("</table>")); if (showAlertsPanel) { panel.Controls.Add(ph); } else { panel.Controls.Add(new LiteralControl(language.GetString("MessageNoAlerts"))); } }
private void SetAutoTagFilter(int amount, int relvance) { QuickTagCloudRelevanceGroup enuRepevance = (QuickTagCloudRelevanceGroup)relvance; int groupAmount = 24; if (relvance > 0) { if (relvance <= 3) { groupAmount = 60; } else if (relvance <= 5) { groupAmount = 24; } else { groupAmount = 16; } } QuickParametersTag quickParametersTag = new QuickParametersTag(); quickParametersTag.Udc = UserDataContext.GetUserDataContext(); quickParametersTag.IgnoreCache = false; quickParametersTag.Amount = amount; quickParametersTag.RelevanceGroup = enuRepevance; quickParametersTag.RelevanceGroupAmount = groupAmount; quickParametersTag.Relevance = QuickTagCloudRelevance.ObjectView; if (this._Host.ParentObjectType == Helper.GetObjectTypeNumericID("ProfileCommunity")) { DataObject profileCommunity = DataObject.Load <DataObject>(this._Host.ParentCommunityID); quickParametersTag.RelatedUserID = profileCommunity.UserID.Value; } else if (this._Host.ParentObjectType == Helper.GetObjectTypeNumericID("Community")) { quickParametersTag.RelatedCommunityID = _Host.ParentCommunityID; } if (this._Host.ParentObjectType == Helper.GetObjectTypeNumericID("Page") && !string.IsNullOrEmpty(Request.QueryString["OT"])) { if (this._Host.ParentPageType == PageType.Overview) { quickParametersTag.RelatedObjectType = Helper.GetObjectTypeNumericID(Request.QueryString["OT"]); if (!string.IsNullOrEmpty(Request.QueryString["XUI"])) { quickParametersTag.RelatedUserID = Request.QueryString["XUI"].ToGuid(); } if (!string.IsNullOrEmpty(Request.QueryString["XCN"])) { quickParametersTag.RelatedCommunityID = Request.QueryString["XCN"].ToGuid(); } } else { return; } } else { return; } List <TagCloudItem> relatedTags = DataObjectTag.GetTagCloud(5, quickParametersTag); if (relatedTags.Count > 0) { hasContent = true; HtmlGenericControl div; HyperLink link; foreach (TagCloudItem tagWord in relatedTags) { div = new HtmlGenericControl("div"); link = new HyperLink(); link.Text = tagWord.Tag.Title; link.NavigateUrl = string.Format("{0}?TGL1={1}{2}", Request.CurrentExecutionFilePath, tagWord.Tag.Title, queryStringWithoutTag); if (!string.IsNullOrEmpty(Request.QueryString["TGL1"]) && Request.QueryString["TGL1"] == tagWord.Tag.Title) { link.CssClass = "CSB_admin_menu_i"; } else { link.CssClass = "CSB_admin_menu_a"; } div.Controls.Add(link); Ph.Controls.Add(div); } if (!string.IsNullOrEmpty(Request.QueryString["TGL1"])) { div = new HtmlGenericControl("div"); link = new HyperLink(); link.Text = GuiLanguage.GetGuiLanguage("WidgetFunctionsFilter").GetString("CommandFilterReset"); link.NavigateUrl = string.Format("{0}?{1}", Request.CurrentExecutionFilePath, queryStringWithoutTag.TrimStart('&')); link.CssClass = "CSB_admin_menu_a"; div.Controls.Add(link); Ph.Controls.Add(div); } } }
private void SetAutoTagFilter(int amount, int relvance) { QuickTagCloudRelevanceGroup enuRepevance = (QuickTagCloudRelevanceGroup)relvance; int groupAmount = 24; if (relvance > 0) { if (relvance <= 3) { groupAmount = 60; } else if (relvance <= 5) { groupAmount = 24; } else { groupAmount = 16; } } QuickParametersTag quickParametersTag = new QuickParametersTag(); quickParametersTag.Udc = UserDataContext.GetUserDataContext(); quickParametersTag.IgnoreCache = false; quickParametersTag.Amount = amount; quickParametersTag.RelevanceGroup = enuRepevance; quickParametersTag.RelevanceGroupAmount = groupAmount; quickParametersTag.Relevance = QuickTagCloudRelevance.ObjectView; if (this.WidgetHost.ParentObjectType == Helper.GetObjectTypeNumericID("ProfileCommunity")) { DataObject profileCommunity = DataObject.Load <DataObject>(this.WidgetHost.ParentCommunityID); quickParametersTag.RelatedUserID = profileCommunity.UserID.Value; } else if (this.WidgetHost.ParentObjectType == Helper.GetObjectTypeNumericID("Community")) { quickParametersTag.RelatedCommunityID = WidgetHost.ParentCommunityID; } if (this.WidgetHost.ParentObjectType == Helper.GetObjectTypeNumericID("Page") && !string.IsNullOrEmpty(Request.QueryString["OT"])) { if (this.WidgetHost.ParentPageType == PageType.Overview) { quickParametersTag.RelatedObjectType = Helper.GetObjectTypeNumericID(Request.QueryString["OT"]); if (!string.IsNullOrEmpty(Request.QueryString["XUI"])) { quickParametersTag.RelatedUserID = Request.QueryString["XUI"].ToGuid(); } if (!string.IsNullOrEmpty(Request.QueryString["XCN"])) { quickParametersTag.RelatedCommunityID = Request.QueryString["XCN"].ToGuid(); } } else { return; } } else { return; } List <TagCloudItem> relatedTags = DataObjectTag.GetTagCloud(5, quickParametersTag); if (relatedTags.Count > 0) { hasContent = true; HtmlGenericControl li; HyperLink link; foreach (TagCloudItem tagWord in relatedTags) { li = new HtmlGenericControl("li"); string tagClass = "tagClass" + tagWord.TagClass; link = new HyperLink(); link.Text = Helper.GetMappedTagWord(tagWord.Tag.Title); link.NavigateUrl = string.Format("{0}?TGL1={1}{2}", Request.GetRawPath(), tagWord.Tag.Title, queryStringWithoutTag); if (!string.IsNullOrEmpty(Request.QueryString["TGL1"]) && Request.QueryString["TGL1"] == tagWord.Tag.Title) { tagClass += " tagActive"; } li.Attributes.Add("class", tagClass); li.Controls.Add(link); Ph.Controls.Add(li); } RenderResetLink(); } }