forked from dnnsoftware/Dnn.Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataProvider.cs
82 lines (67 loc) · 3.27 KB
/
DataProvider.cs
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Modules.Html.Components
{
using System.Data;
/// <summary> The DataProvider is an abstract class that provides the Data Access Layer for the HtmlText module.</summary>
public class DataProvider
{
// singleton reference to the instantiated object
private static readonly DataProvider Provider;
// constructor
static DataProvider()
{
Provider = new DataProvider();
}
// return the provider
public static DataProvider Instance()
{
return Provider;
}
public virtual IDataReader GetHtmlText(int moduleID, int itemID)
{
return DotNetNuke.Data.DataProvider.Instance().ExecuteReader("GetHtmlText", moduleID, itemID);
}
public virtual IDataReader GetTopHtmlText(int moduleID, bool isPublished)
{
return DotNetNuke.Data.DataProvider.Instance().ExecuteReader("GetTopHtmlText", moduleID, isPublished);
}
public virtual IDataReader GetAllHtmlText(int moduleID)
{
return DotNetNuke.Data.DataProvider.Instance().ExecuteReader("GetAllHtmlText", moduleID);
}
public virtual int AddHtmlText(int moduleID, string content, string summary, int stateID, bool isPublished, int createdByUserID, int history)
{
return DotNetNuke.Data.DataProvider.Instance().ExecuteScalar<int>("AddHtmlText", moduleID, content, summary, stateID, isPublished, createdByUserID, history);
}
public virtual void UpdateHtmlText(int itemID, string content, string summary, int stateID, bool isPublished, int lastModifiedByUserID)
{
DotNetNuke.Data.DataProvider.Instance().ExecuteNonQuery("UpdateHtmlText", itemID, content, summary, stateID, isPublished, lastModifiedByUserID);
}
public virtual void DeleteHtmlText(int moduleID, int itemID)
{
DotNetNuke.Data.DataProvider.Instance().ExecuteNonQuery("DeleteHtmlText", moduleID, itemID);
}
public virtual IDataReader GetHtmlTextLog(int itemID)
{
return DotNetNuke.Data.DataProvider.Instance().ExecuteReader("GetHtmlTextLog", itemID);
}
public virtual void AddHtmlTextLog(int itemID, int stateID, string comment, bool approved, int createdByUserID)
{
DotNetNuke.Data.DataProvider.Instance().ExecuteNonQuery("AddHtmlTextLog", itemID, stateID, comment, approved, createdByUserID);
}
public virtual IDataReader GetHtmlTextUser(int userID)
{
return DotNetNuke.Data.DataProvider.Instance().ExecuteReader("GetHtmlTextUser", userID);
}
public virtual void AddHtmlTextUser(int itemID, int stateID, int moduleID, int tabID, int userID)
{
DotNetNuke.Data.DataProvider.Instance().ExecuteNonQuery("AddHtmlTextUser", itemID, stateID, moduleID, tabID, userID);
}
public virtual void DeleteHtmlTextUsers()
{
DotNetNuke.Data.DataProvider.Instance().ExecuteNonQuery("DeleteHtmlTextUsers");
}
}
}