DO NOT DOWNLOAD. DOWNLOAT LATEST STABLE FROM RELEASE TAB
Created 4.1.0 branch [TFS Changeset #55082]
This commit is contained in:
39
components/editorControls/DefaultDataKeyValue.cs
Normal file
39
components/editorControls/DefaultDataKeyValue.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using umbraco.DataLayer;
|
||||
|
||||
namespace umbraco.editorControls
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for cms.businesslogic.datatype.DefaultDataKeyValue.
|
||||
/// </summary>
|
||||
public class DefaultDataKeyValue : cms.businesslogic.datatype.DefaultData
|
||||
{
|
||||
public DefaultDataKeyValue(cms.businesslogic.datatype.BaseDataType DataType) : base(DataType)
|
||||
{}
|
||||
/// <summary>
|
||||
/// Ov
|
||||
/// </summary>
|
||||
/// <param name="d"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public override System.Xml.XmlNode ToXMl(System.Xml.XmlDocument d)
|
||||
{
|
||||
// Get the value from
|
||||
string v = "";
|
||||
try
|
||||
{
|
||||
IRecordsReader dr = SqlHelper.ExecuteReader("Select [value] from cmsDataTypeprevalues where id in (" + Value.ToString() +")");
|
||||
|
||||
while (dr.Read()) {
|
||||
if (v.Length == 0)
|
||||
v += dr.GetString("value");
|
||||
else
|
||||
v += "," + dr.GetString("value");
|
||||
}
|
||||
dr.Close();
|
||||
}
|
||||
catch {}
|
||||
return d.CreateCDataSection(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user