forked from siteserver/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCountManager.cs
43 lines (37 loc) · 1.36 KB
/
CountManager.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
using BaiRong.Core.Model.Enumerations;
namespace BaiRong.Core
{
public class CountManager
{
private CountManager()
{
}
public static void AddCount(string relatedTableName, string relatedIdentity, ECountType countType)
{
if (BaiRongDataProvider.CountDao.IsExists(relatedTableName, relatedIdentity, countType))
{
BaiRongDataProvider.CountDao.AddCountNum(relatedTableName, relatedIdentity, countType);
}
else
{
BaiRongDataProvider.CountDao.Insert(relatedTableName, relatedIdentity, countType, 1);
}
}
public static void DeleteByRelatedTableName(string relatedTableName)
{
BaiRongDataProvider.CountDao.DeleteByRelatedTableName(relatedTableName);
}
public static void DeleteByIdentity(string relatedTableName, string relatedIdentity)
{
BaiRongDataProvider.CountDao.DeleteByIdentity(relatedTableName, relatedIdentity);
}
public static int GetCount(string relatedTableName, string relatedIdentity, ECountType countType)
{
return BaiRongDataProvider.CountDao.GetCountNum(relatedTableName, relatedIdentity, countType);
}
public static int GetCount(string relatedTableName, int publishmentSystemId, ECountType countType)
{
return BaiRongDataProvider.CountDao.GetCountNum(relatedTableName, publishmentSystemId, countType);
}
}
}