private void Apply() { bool includeManual = cbIncludeManual.Checked; if (!HyperCatalog.Business.Link.AddDelCrossSell(itemId, isCrossSell, includeManual)) { lbError.CssClass = "hc_error"; lbError.Text = HyperCatalog.Business.Link.LastError; lbError.Visible = false; } else { // Save flag IsCrossSell HyperCatalog.Business.Item item = HyperCatalog.Business.Item.GetByKey(itemId); item.IsCrossSell = isCrossSell; if (item.Save(HyperCatalog.Shared.SessionState.User.Id, true)) { lbError.CssClass = "hc_success"; lbError.Text = "All Cross Sell are removed!"; lbError.Visible = true; HyperCatalog.Shared.SessionState.CurrentItem = item; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "UpdateAndClose", "<script>UpdateAndClose();</script>"); } else { lbError.CssClass = "hc_error"; lbError.Text = HyperCatalog.Business.Item.LastError; lbError.Visible = false; } } }
protected void Page_Load(object sender, System.EventArgs e) { // Ensure that scope has not change during session QDEUtils.UpdateCultureCodeFromRequest(); frametv.Attributes["src"] = "QDE_TV.aspx"; frameitemscope.Attributes["src"] = "QDE_ItemScope.aspx"; using (HyperCatalog.Business.Item item = QDEUtils.GetItemIdFromRequest()) { System.Int64 itemId = item.Id; if (HyperCatalog.Business.Item.IsEligible(itemId, SessionState.Culture.CountryCode) && item != null && !item.IsExcludedByPublisher(SessionState.Culture.CountryCode) && (!SessionState.User.HasCultureInScope(SessionState.Culture.Code) && SessionState.Culture.Type != HyperCatalog.Business.CultureType.Master)) { // item is eligible in current country and it is not user scope SessionState.TVAllItems = true; SessionState.User.LastVisitedItemReadOnly = itemId; } else if (!HyperCatalog.Business.Item.IsEligible(itemId, SessionState.Culture.CountryCode) || item == null || (item != null && item.IsExcludedByPublisher(SessionState.Culture.CountryCode))) { // item is not eligible in current country if (SessionState.TVAllItems) { // 08/12/2009 QC 2692 - Modified by Sateesh -- The workflow Status 'R'/'C' only should be visible in locales itemId = SessionState.User.LastVisitedItemReadOnly = SessionState.User.GetFirstReadCountryItem(SessionState.Culture.CountryCode, SessionState.Culture.Code); } else { // 08/12/2009 QC 2692 - Modified by Sateesh -- The workflow Status 'R'/'C' only should be visible in locales itemId = SessionState.User.LastVisitedItemReadOnly = SessionState.User.LastVisitedItem = SessionState.User.GetFirstCountryItem(SessionState.Culture.CountryCode, SessionState.Culture.Code); } } else { // item is eligible in current country and it is in user scope SessionState.User.LastVisitedItemReadOnly = SessionState.User.LastVisitedItem = itemId; } if (SessionState.TVAllItems) { frametv.Attributes["src"] += "?all=1"; frameitemscope.Attributes["src"] += "?all=1"; } SessionState.User.QuickSave(); if (Request["g"] != null) // Translate { frametoolbar.Attributes["src"] = "QDE_ToolBar.aspx?g=" + Request["g"].ToString(); } framecontent.Attributes["src"] = "QDE_FormRoll.aspx?i=" + itemId.ToString() + "&l=" + SessionState.Culture.Code; } }
private void ShowUser() { if (_Chunk != null) { hlCreator.Text = UITools.GetDisplayName(_Chunk.User.FullName); HyperCatalog.Business.Item item = HyperCatalog.Business.Item.GetByKey(_Chunk.ItemId); hlCreator.NavigateUrl = "mailto:" + UITools.GetDisplayEmail(_Chunk.User.Email) + "?subject=" + Server.UrlEncode(((string)("Chunk \"" + _Chunk.ContainerName + "\" [" + _Chunk.ContainerId + "] for product {" + item.Name + " " + item.Sku + "}")).Replace(" ", "_")).Replace("_", "%20"); lbOrganization.Text = _Chunk.User.Organization.Name; lbOrganization.Visible = UITools.GetDisplayEmail(_Chunk.User.Email) == _Chunk.User.Email; if (SessionState.User != null) { lbCreatedOn.Text = SessionState.User.FormatUtcDate(_Chunk.ModifyDate.Value, true, SessionState.User.FormatDate + ' ' + SessionState.User.FormatTime); } else { lbCreatedOn.Text = _Chunk.ModifyDate.Value.ToLongDateString(); } } }