Пример #1
0
        public static IList <ContFieldInfo> GetFieldListWithValue(int intContID, int intModelID, string strTableName)
        {
            IList <ContFieldInfo> fieldListByModelID = ContField.GetFieldListByModelID(intModelID, true);
            IList <ContFieldInfo> usingFieldList     = ContField.GetUsingFieldList(intModelID);
            DataTable             contentById        = Content.GetContentById(intContID, strTableName, (List <ContFieldInfo>)usingFieldList);

            if (contentById.Rows.Count == 1)
            {
                foreach (ContFieldInfo current in fieldListByModelID)
                {
                    if (contentById.Columns.Contains(current.FieldName))
                    {
                        current.Value = contentById.Rows[0][current.FieldName].ToString();
                    }
                    else
                    {
                        current.Value = current.DefaultValue;
                    }
                }
            }
            return(fieldListByModelID);
        }
Пример #2
0
        public static bool DeleteByModelID(int modelID)
        {
            bool result;

            if (modelID <= 0)
            {
                result = false;
            }
            else
            {
                IList <ContFieldInfo> fieldListByModelID = ContField.GetFieldListByModelID(modelID);
                bool flag = BizBase.dbo.ExecSQL(" DELETE FROM cms_ContField WHERE ModelID=" + modelID);
                if (flag)
                {
                    CacheUtils.Del("JsonLeeCMS_CacheForGetContModel");
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }
Пример #3
0
 public static IList <ContFieldInfo> GetUsingFieldList(int modelID)
 {
     return(ContField.GetFieldListByModelID(modelID, true));
 }