#
proweb2
Hi I develop a test module that I call Event Calendar. I need to access of the bbdd for extract the events.
I make this:
I make the class ( I try to post it but the server return a 500 error of security). I post the head of file
And call of Nhibernate
I follow this steps:
1º Create the module and xml and class file.
2º Install the module ( correct without errors).
I need Help.
Thanks.
I make this:
using System.Xml;
namespace Cuyahoga.Modules.EventCalendarModule
{
public class XmlBuilder {
public static XmlElement AppendElement(XmlNode node, string name) {
return AppendElement(node, name, null);
}
public static XmlElement AppendElement(XmlNode node, string name, object value) {
XmlDocument parent = node.OwnerDocument;
//Something went wrong - assume this is a document
if (parent == null) {
parent = node as XmlDocument;
}
XmlElement newElement = null;
if (parent != null) {
newElement = parent.CreateElement(name);
node.AppendChild(newElement);
//Append value if it is supplied
if (value != null) {
string stringValue = value.ToString();
if (stringValue.Length > 0) {
newElement.AppendChild(parent.CreateTextNode(stringValue));
}
}
}
return newElement;
}
public static XmlAttribute AppendAttribute(XmlElement node, string name, object value) {
XmlAttribute newAttribute = node.OwnerDocument.CreateAttribute(name);
node.SetAttribute(newAttribute.Name, value.ToString());
return newAttribute;
}
}
}I make the class ( I try to post it but the server return a 500 error of security). I post the head of file
namespace Cuyahoga.Modules.EventCalendar
{
public class EventCalendarEvents
{And call of Nhibernate
public class EventCalendarModule : ModuleBase, INHibernateModule {
public IList GetEvents()
{
string hql = "from EventCalendarEvents order by E.EventDate desc";
IQuery q = this.NHSession.CreateQuery(hql);
//q.SetInt32("sectionId", base.Section.Id);
return q.List();
}
}I follow this steps:
1º Create the module and xml and class file.
2º Install the module ( correct without errors).
I need Help.
Thanks.