public bool IsExists(string relatedTableName, string relatedIdentity, ECountType countType) { if (GetCountNum(relatedTableName, relatedIdentity, countType) == 0) { return(false); } return(true); }
public CountInfo() { countID = 0; publishmentSystemID = 0; countYear = 0; countMonth = 0; countDay = 0; countType = ECountType.UserSubscribe; count = 0; }
public CountInfo(int countId, int publishmentSystemId, int countYear, int countMonth, int countDay, ECountType countType, int count) { CountId = countId; PublishmentSystemId = publishmentSystemId; CountYear = countYear; CountMonth = countMonth; CountDay = countDay; CountType = countType; Count = count; }
public CountInfo(int countID, int publishmentSystemID, int countYear, int countMonth, int countDay, ECountType countType, int count) { this.countID = countID; this.publishmentSystemID = publishmentSystemID; this.countYear = countYear; this.countMonth = countMonth; this.countDay = countDay; this.countType = countType; this.count = count; }
public static ListItem GetListItem(ECountType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public static void AddCount(string relatedTableName, string relatedIdentity, ECountType countType) { if (DataProvider.CountDao.IsExists(relatedTableName, relatedIdentity, countType)) { DataProvider.CountDao.AddCountNum(relatedTableName, relatedIdentity, countType); } else { DataProvider.CountDao.Insert(relatedTableName, relatedIdentity, countType, 1); } }
public static string GetValue(ECountType type) { if (type == ECountType.View) { return("View"); } if (type == ECountType.Download) { return("Download"); } throw new Exception(); }
public static bool Equals(ECountType type, string typeStr) { if (string.IsNullOrEmpty(typeStr)) { return(false); } if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower())) { return(true); } return(false); }
public void AddCountNum(string relatedTableName, string relatedIdentity, ECountType countType) { var sqlString = $"UPDATE siteserver_Count SET {SqlUtils.ToPlusSqlString("CountNum")} WHERE RelatedTableName = @RelatedTableName AND RelatedIdentity = @RelatedIdentity AND CountType = @CountType"; var insertParms = new IDataParameter[] { GetParameter(ParmRelatedTableName, DataType.VarChar, 255, relatedTableName), GetParameter(ParmRelatedIdentity, DataType.VarChar, 255, relatedIdentity), GetParameter(ParmCountType, DataType.VarChar, 50, ECountTypeUtils.GetValue(countType)), }; ExecuteNonQuery(sqlString, insertParms); }
public void Insert(string relatedTableName, string relatedIdentity, ECountType countType, int countNum) { const string sqlString = "INSERT INTO siteserver_Count (RelatedTableName, RelatedIdentity, CountType, CountNum) VALUES (@RelatedTableName, @RelatedIdentity, @CountType, @CountNum)"; var insertParms = new IDataParameter[] { GetParameter(ParmRelatedTableName, DataType.VarChar, 255, relatedTableName), GetParameter(ParmRelatedIdentity, DataType.VarChar, 255, relatedIdentity), GetParameter(ParmCountType, DataType.VarChar, 50, ECountTypeUtils.GetValue(countType)), GetParameter(ParmCountNum, DataType.Integer, countNum) }; ExecuteNonQuery(sqlString, insertParms); }
/// <summary> /// 获取站点的统计数据 /// </summary> /// <param name="relatedTableName"></param> /// <param name="siteId"></param> /// <param name="countType"></param> /// <returns></returns> public int GetCountNum(string relatedTableName, int siteId, ECountType countType) { var countNum = 0; string sqlString = $@"select sum(cou.CountNum) from siteserver_Count cou left join {relatedTableName} con on cou.RelatedIdentity = con.ID where cou.RelatedTableName = '{relatedTableName}' and con.SiteId = {siteId} and cou.CountType = '{ECountTypeUtils.GetValue(countType)}'"; using (var rdr = ExecuteReader(sqlString)) { if (rdr.Read()) { countNum = GetInt(rdr, 0); } rdr.Close(); } return(countNum); }
public int GetCountNum(string relatedTableName, string relatedIdentity, ECountType countType) { var countNum = 0; var parms = new IDataParameter[] { GetParameter(ParmRelatedTableName, DataType.VarChar, 255, relatedTableName), GetParameter(ParmRelatedIdentity, DataType.VarChar, 255, relatedIdentity), GetParameter(ParmCountType, DataType.VarChar, 50, ECountTypeUtils.GetValue(countType)) }; using (var rdr = ExecuteReader(SqlSelectCountNum, parms)) { if (rdr.Read()) { countNum = GetInt(rdr, 0); } rdr.Close(); } return(countNum); }
public static string GetText(ECountType type) { if (type == ECountType.UserSubscribe) { return("用户关注"); } else if (type == ECountType.UserUnsubscribe) { return("用户取消关注"); } else if (type == ECountType.RequestText) { return("文本回复"); } else if (type == ECountType.RequestNews) { return("图文回复"); } else { throw new Exception(); } }
public static string GetText(ECountType type) { if (type == ECountType.UserSubscribe) { return("�û���ע"); } else if (type == ECountType.UserUnsubscribe) { return("�û�ȡ����ע"); } else if (type == ECountType.RequestText) { return("�ı��ظ�"); } else if (type == ECountType.RequestNews) { return("ͼ�Ļظ�"); } else { throw new Exception(); } }
public static string GetValue(ECountType type) { if (type == ECountType.UserSubscribe) { return("UserSubscribe"); } else if (type == ECountType.UserUnsubscribe) { return("UserUnsubscribe"); } else if (type == ECountType.RequestText) { return("RequestText"); } else if (type == ECountType.RequestNews) { return("RequestNews"); } else { throw new Exception(); } }
public static int GetCount(string relatedTableName, int siteId, ECountType countType) { return(DataProvider.CountDao.GetCountNum(relatedTableName, siteId, countType)); }
public static int GetCount(string relatedTableName, string relatedIdentity, ECountType countType) { return(DataProvider.CountDao.GetCountNum(relatedTableName, relatedIdentity, countType)); }
public static int GetCount(string relatedTableName, int publishmentSystemId, ECountType countType) { return(BaiRongDataProvider.CountDao.GetCountNum(relatedTableName, publishmentSystemId, countType)); }
public static bool Equals(string typeStr, ECountType type) { return(Equals(type, typeStr)); }