Exemplo n.º 1
0
 /// <summary>
 /// parent category
 /// </summary>
 public Category Parent(CategoriesManager man)
 {
     if (parent == null)
     {
         parent = new Category();
         if (this.ParentId > 0)
             parent = man.GetByKey(this.ParentId);
     }
     return parent;
 }
Exemplo n.º 2
0
        protected string GetLinkAddress(Category item)
        {
            string res = "javascript:void(0);";

            if (this.ItemsListTarget > 0)
            {
                if (menuTarget == null)
                {
                    menuTarget = new MenuManager().GetByKey(this.ItemsListTarget);
                }

                try
                {
                    if (menuTarget.RoutePattern.Contains("categoryname"))
                    {
                        string name = item.Alias;
                        if (string.IsNullOrEmpty(name))
                            item.TitleTranslations.TryGetValue(Config.CultureDefault, out name);
                        res = Utility.GetRoutedUrl(
                        menuTarget, new RouteValueDictionary { { "categoryname", name } }, "", Config.AddPageSuffix);
                    }
                    else
                    {
                        res = Utility.GetRoutedUrl(
                        menuTarget, new RouteValueDictionary { { "categoryid", item.Id } }, "", Config.AddPageSuffix);
                    }
                }
                catch (Exception ex)
                {
                    Tracer.Log("GetLinkAddress(): " + ex.ToString(), TracerItemType.Error);
                }
            }
            return res;
        }