public Int64 Insert(PortalArticleList item, out ErrorEntity ErrInfo)
 {
     if(string.IsNullOrEmpty(item.FListName))
     {
         ErrInfo = new ErrorEntity("999999","目录名称不能为空!");
         return -1;
     }
     if(item.FListOrder == 0)
     {
         ErrInfo = new ErrorEntity("999999","目录顺序不能为空!");
         return -1;
     }
     if (ChkNameExist(item.FListId, item.FParentListId, item.FListName))
     {
         NameValueCollection parameters = new NameValueCollection();
         parameters.Add("FListName", item.FListName);
         parameters.Add("FListOrder", item.FListOrder.ToString());
         if (item.FParentListId > 0)
         {
             parameters.Add("FParentListId", item.FParentListId.ToString());
         }
         Int64 result = Insert(parameters, out ErrInfo);
         return result;
     }
     else
     {
         ErrInfo = new ErrorEntity("999999", "目录名称重复,无法保存!");
         return -1;
     }
 }
 public void GetListName(string _id,ref string _titlename)
 {
     PortalArticleList item = new PortalArticleList();
     item = Select(_id);
     if (string.IsNullOrEmpty(_titlename))
     {
         _titlename = item.FListName  + _titlename;
     }
     else
     {
         _titlename = item.FListName + " > " + _titlename;
     }
     if (item.FParentListId != 0)
     {
         GetListName(item.FParentListId.ToString(), ref _titlename);
     }
 }
Example #3
0
 public void SaveItem()
 {
     string _id = Parameters["plistid"];
     string _name = Parameters["plistname"];
     string _parentid = Parameters["pparentid"];
     string _order = Parameters["porder"];
     PortalArticleList item = new PortalArticleList();
     item.FListId = Convert.ToInt64(_id);
     item.FListName = _name;
     item.FListOrder = Convert.ToInt32(_order);
     item.FParentListId = Convert.ToInt64(_parentid);
     PortalArticleListBiz biz = new PortalArticleListBiz();
     ErrorEntity ErrInfo = new ErrorEntity();
     if (item.FListId == 0)
     {
         biz.Insert(item, out ErrInfo);
     }
     else
     {
         biz.Update(item, out ErrInfo);
     }
     Response.Write(ErrInfo.ToJson());
 }
Example #4
0
 public void GetListItem()
 {
     string id = Parameters["pid"];
     PortalArticleListBiz biz = new PortalArticleListBiz();
     PortalArticleList item = new PortalArticleList();
     item = biz.Select(id);
     Response.Write(item.ToJson());
 }
Example #5
0
 public void GetParentId()
 {
     string id = Parameters["pchildid"];
     PortalArticleListBiz biz = new PortalArticleListBiz();
     PortalArticleList item = new PortalArticleList();
     item = biz.Select(id);
     if (item == null)
     {
         Response.Write("0");
     }
     else
     {
         if (string.IsNullOrEmpty(item.FParentListId.ToString()))
         {
             Response.Write("0");
         }
         else
         {
             Response.Write(item.FParentListId.ToString());
         }
     }
 }