-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCategory.cs
More file actions
61 lines (54 loc) · 1.76 KB
/
Category.cs
File metadata and controls
61 lines (54 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace RustyLogic.RedDotNet
{
public class Category : RedDotObject
{
private string _value;
public string Value
{
get { return _value; }
set { _value = value; }
}
protected Category(XmlNode xmlNode) : base(xmlNode) { }
protected Category(Guid guid) : base(guid) { }
protected override void LoadBasics(XmlNode xmlNode)
{
_value = xmlNode.Attributes.GetNamedItem("value").Value;
}
protected override XmlNode LoadXml()
{
string rqlStatement =
"<IODATA>" +
"<PROJECT>" +
"<CATEGORY action=\"load\" guid=\"" + GuidString + "\"/>" +
"</PROJECT>" +
"</IODATA>";
xmlDoc.LoadXml(Session.Execute(rqlStatement));
return xmlDoc.GetElementsByTagName("CATEGORY")[0];
}
public List<Keyword> Keywords()
{
return Keyword.Get(this);
}
public static List<Category> List()
{
List<Category> categories = new List<Category>();
string rqlStatement =
"<IODATA>" +
"<PROJECT>" +
"<CATEGORIES action=\"list\" />" +
"</PROJECT>" +
"</IODATA>";
xmlDoc.LoadXml(Session.Execute(rqlStatement,Session.Info.SessionKey));
XmlNodeList xmlNodes = xmlDoc.GetElementsByTagName("CATEGORY");
foreach (XmlNode xmlNode in xmlNodes)
{
categories.Add(new Category(xmlNode));
}
return categories;
}
}
}