Exemplo n.º 1
0
 private void GetCateNav(HttpContext context)
 {
     JsonObject json = new JsonObject();
     string strId = context.Request.Params["cateID"];
     int cateId = Common.Globals.SafeInt(strId, 0);
     BLL.Tao.Categories categoriesBLL = new BLL.Tao.Categories();
     System.Text.StringBuilder str = new System.Text.StringBuilder();
     Maticsoft.Model.Tao.Categories model = categoriesBLL.GetModelByCache(cateId);
     if (null != model)
     {
         string[] strPath = model.Path.Split('|');
         str.Append(" 全部分类 ");
         foreach (string s in strPath)
         {
             if (Maticsoft.Common.PageValidate.IsNumber(s))
             {
                 Maticsoft.Model.Tao.Categories categoriesModel = categoriesBLL.GetModelByCache(int.Parse(s));
                 if (null != categoriesModel)
                 {
                     str.Append(" > " + categoriesModel.Name);
                 }
             }
         }
         json.Put(TAO_KEY_STATUS, TAO_STATUS_SUCCESS);
         json.Put("NAV", str.ToString());
     }
     else
     {
         json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED);
     }
     context.Response.Write(json.ToString());
 }
Exemplo n.º 2
0
 public string NavInfo(object cid)
 {
     if (cid != null)
     {
         if (!string.IsNullOrEmpty(cid.ToString()))
         {
             int cateId = Common.Globals.SafeInt(cid.ToString(), 0);
             BLL.Tao.Categories categoriesBLL = new BLL.Tao.Categories();
             System.Text.StringBuilder str = new System.Text.StringBuilder();
             Maticsoft.Model.Tao.Categories model = categoriesBLL.GetModelByCache(cateId);
             if (null != model)
             {
                 string[] strPath = model.Path.Split('|');
                 str.Append(" 全部分类 ");
                 foreach (string s in strPath)
                 {
                     if (Maticsoft.Common.PageValidate.IsNumber(s))
                     {
                         Maticsoft.Model.Tao.Categories categoriesModel = categoriesBLL.GetModelByCache(int.Parse(s));
                         if (null != categoriesModel)
                         {
                             str.Append(" > " + categoriesModel.Name);
                         }
                     }
                 }
                 return str.ToString();
             }
             else
             {
                 return "";
             }
         }
         else
         {
             return "";
         }
     }
     else
     {
         return "";
     }
 }