示例#1
0
 public Int32 Update(OEContentClass item, out ErrorEntity ErrInfo)
 {
     //Error Judge Define
     if (string.IsNullOrEmpty(item.FContentClassCode))
     {
         ErrInfo = new ErrorEntity("CC010001", "内容类别编号为空!");
         return -1;
     }
     if (string.IsNullOrEmpty(item.FContentClassName))
     {
         ErrInfo = new ErrorEntity("CC010002", "内容类别名称不能为空!");
         return -1;
     }
     if (!ChkCodeDuplicate(item.FContentClassId.ToString(), item.FContentClassCode))
     {
         ErrInfo = new ErrorEntity("CC010003", "内容类别编号不能为空!");
         return -1;
     }
     NameValueCollection parameters = new NameValueCollection();
     parameters.Add("FContentClassCode", item.FContentClassCode);
     parameters.Add("FContentClassName", item.FContentClassName);
     parameters.Add("FContentClassContent", item.FContentClassContent);
     parameters.Add("FParentId", item.FParentId.ToString());
     parameters.Add("FIconPath", item.FIconPath);
     NameValueCollection where = new NameValueCollection();
     where.Add("FContentClassId", item.FContentClassId.ToString());
     return Update(parameters, where, out ErrInfo);
 }
示例#2
0
 public void GetChildrenIdList(string _id,ref string _idlist)
 {
     if (string.IsNullOrEmpty(_idlist))
     {
         _idlist += _id;
     }
     else
     {
         _idlist += "," + _id;
     }
     OEContentClass item = new OEContentClass();
     item = Select(_id);
     List<OEContentClass> lists = new List<OEContentClass>();
     NameValueCollection where = new NameValueCollection();
     where.Add("FParentId", _id);
     lists = Select(where);
     foreach (OEContentClass newitem in lists)
     {
         GetChildrenIdList(newitem.FContentClassId.ToString(), ref _idlist);
     }
 }
示例#3
0
        public void SaveItem()
        {
            string _FContentClassId = Parameters["pFContentClassId"];
            // other paramters fill here
            string _FContentClassCode = Parameters["pFContentClassCode"];
            string _FContentClassName = Parameters["pFContentClassName"];
            string _FContentClassContent = Parameters["pFContentClassContent"];
            string _FIconPath = Parameters["pFIconPath"];
            string _FParentId = Parameters["pFParentId"];

            OEContentClass item = new OEContentClass();
            item.FContentClassId = string.IsNullOrEmpty(_FContentClassId) ? 0 : Convert.ToInt64(_FContentClassId);
            item.FContentClassCode = _FContentClassCode;
            item.FContentClassName = _FContentClassName;
            item.FContentClassContent = _FContentClassContent;
            item.FIconPath = _FIconPath;
            item.FParentId = string.IsNullOrEmpty(_FParentId) ? 0 : Convert.ToInt64(_FParentId);
            OEContentClassBiz biz = new OEContentClassBiz();
            ErrorEntity ErrInfo = new ErrorEntity();
            if (item.FContentClassId == 0)
            {
                biz.Insert(item, out ErrInfo);
            }
            else
            {
                biz.Update(item, out ErrInfo);
            }
            Response.Write(ErrInfo.ToJson());
        }
示例#4
0
 public void GetItem()
 {
     string _id = Parameters["pid"];
     OEContentClass item = new OEContentClass();
     OEContentClassBiz biz = new OEContentClassBiz();
     item = biz.Select(_id);
     if (item == null)
     {
         Response.Write("");
     }
     else
     {
         Response.Write(item.ToJson());
     }
 }
示例#5
0
 public void GetNowParent()
 {
     string _id = Parameters["pid"];
     OEContentClass item = new OEContentClass();
     OEContentClassBiz biz = new OEContentClassBiz();
     item = biz.Select(_id);
     Response.Write(item.FParentId.ToString());
 }