Beispiel #1
0
        public bool IsExists(int publishmentSystemId, int cardId, string userName)
        {
            var isExist = false;

            string sqlWhere = $"WHERE PublishmentSystemID = {publishmentSystemId}";

            if (cardId > 0)
            {
                sqlWhere += $" AND CardID={cardId}";
            }
            if (!string.IsNullOrEmpty(userName))
            {
                sqlWhere += $" AND UserName='******'";
            }
            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, null);

            using (var rdr = ExecuteReader(sqlSelect))
            {
                if (rdr.Read())
                {
                    isExist = true;
                }
                rdr.Close();
            }
            return(isExist);
        }
Beispiel #2
0
        public List <string> GetUserNameList(string searchWord, int dayOfCreation, int dayOfLastActivity, bool isChecked)
        {
            var arraylist = new List <string>();

            var whereString = string.Empty;

            if (dayOfCreation > 0)
            {
                var dateTime = DateTime.Now.AddDays(-dayOfCreation);
                whereString += $" AND (CreationDate >= '{dateTime:yyyy-MM-dd}') ";
            }
            if (dayOfLastActivity > 0)
            {
                var dateTime = DateTime.Now.AddDays(-dayOfLastActivity);
                whereString += $" AND (LastActivityDate >= '{dateTime:yyyy-MM-dd}') ";
            }
            if (!string.IsNullOrEmpty(searchWord))
            {
                var word = PageUtils.FilterSql(searchWord);
                whereString += $" AND (UserName LIKE '%{word}%' OR EMAIL LIKE '%{word}%') ";
            }

            string sqlString =
                $"SELECT * FROM bairong_Administrator WHERE IsChecked = '{isChecked}' {whereString}";

            using (var rdr = ExecuteReader(sqlString))
            {
                while (rdr.Read())
                {
                    arraylist.Add(GetString(rdr, 0));
                }
                rdr.Close();
            }
            return(arraylist);
        }
Beispiel #3
0
        public CardSnInfo GetCardSnInfo(int publishmentSystemId, int cardId, string cardSn, string userName)
        {
            CardSnInfo cardSnInfo = null;

            string sqlWhere = $"WHERE {CardSnAttribute.PublishmentSystemId} = {publishmentSystemId} ";

            if (cardId > 0)
            {
                sqlWhere += $" AND {CardSnAttribute.CardId}='{cardId}'";
            }
            if (!string.IsNullOrEmpty(cardSn))
            {
                sqlWhere += $" AND {CardSnAttribute.Sn}='{PageUtils.FilterSql(cardSn)}'";
            }
            if (!string.IsNullOrEmpty(userName))
            {
                sqlWhere += $" AND {CardSnAttribute.UserName}='{PageUtils.FilterSql(userName)}'";
            }
            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, null);

            using (var rdr = ExecuteReader(sqlSelect))
            {
                if (rdr.Read())
                {
                    cardSnInfo = new CardSnInfo(rdr);
                }
                rdr.Close();
            }
            return(cardSnInfo);
        }
Beispiel #4
0
        public IDataReader GetDataSource(int siteId, string searchText, string templateTypeString)
        {
            if (string.IsNullOrEmpty(searchText) && string.IsNullOrEmpty(templateTypeString))
            {
                var parms = new IDataParameter[]
                {
                    GetParameter(ParmSiteId, DataType.Integer, siteId)
                };

                var enumerable = ExecuteReader(SqlSelectAllTemplateBySiteId, parms);
                return(enumerable);
            }
            if (!string.IsNullOrEmpty(searchText))
            {
                var whereString = (string.IsNullOrEmpty(templateTypeString)) ? string.Empty :
                                  $"AND TemplateType = '{templateTypeString}' ";
                searchText   = PageUtils.FilterSql(searchText);
                whereString +=
                    $"AND (TemplateName LIKE '%{searchText}%' OR RelatedFileName LIKE '%{searchText}%' OR CreatedFileFullName LIKE '%{searchText}%' OR CreatedFileExtName LIKE '%{searchText}%')";
                string sqlString =
                    $"SELECT Id, SiteId, TemplateName, TemplateType, RelatedFileName, CreatedFileFullName, CreatedFileExtName, Charset, IsDefault FROM siteserver_Template WHERE SiteId = {siteId} {whereString} ORDER BY TemplateType, RelatedFileName";

                var enumerable = ExecuteReader(sqlString);
                return(enumerable);
            }

            return(GetDataSourceByType(siteId, TemplateTypeUtils.GetEnumType(templateTypeString)));
        }
Beispiel #5
0
        public List <string> GetUserNameList(int publishmentSystemId, int cardId, string cardSn, string userName)
        {
            var userNameList = new List <string>();

            string sqlWhere = $"WHERE {CardSnAttribute.PublishmentSystemId} = {publishmentSystemId} ";

            if (cardId > 0)
            {
                sqlWhere += $" AND CardID = {cardId}";
            }
            if (!string.IsNullOrEmpty(cardSn))
            {
                sqlWhere += $" AND {CardSnAttribute.Sn}='{PageUtils.FilterSql(cardSn)}'";
            }
            if (!string.IsNullOrEmpty(userName))
            {
                sqlWhere += $" AND {CardSnAttribute.UserName} ='{PageUtils.FilterSql(userName)}'";
            }
            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, null);

            using (var rdr = ExecuteReader(sqlSelect))
            {
                while (rdr.Read())
                {
                    var cardSnInfo = new CardSnInfo(rdr);
                    if (!userNameList.Contains(cardSnInfo.UserName))
                    {
                        userNameList.Add(cardSnInfo.UserName);
                    }
                }
                rdr.Close();
            }
            return(userNameList);
        }
Beispiel #6
0
        public AppointmentContentInfo GetLatestContentInfo(int itemID, string cookieSN, string wxOpenID, string userName)
        {
            AppointmentContentInfo contentInfo = null;

            string SQL_WHERE = $"WHERE {AppointmentContentAttribute.AppointmentItemID} = {itemID}";

            SQL_WHERE += $" AND ({AppointmentContentAttribute.CookieSN} = '{PageUtils.FilterSql(cookieSN)}'";

            if (!string.IsNullOrEmpty(wxOpenID))
            {
                SQL_WHERE += $" AND {AppointmentContentAttribute.WXOpenID} = '{PageUtils.FilterSql(wxOpenID)}'";
            }
            else if (!string.IsNullOrEmpty(userName))
            {
                SQL_WHERE += $" AND {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'";
            }

            SQL_WHERE += ")";

            var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, "ORDER BY ID DESC");

            using (var rdr = ExecuteReader(SQL_SELECT))
            {
                if (rdr.Read())
                {
                    contentInfo = new AppointmentContentInfo(rdr);
                }
                rdr.Close();
            }

            return(contentInfo);
        }
Beispiel #7
0
        public List <int> GetContentIdListWithChecked(int inputId, List <string> searchFields, string keyword)
        {
            var contentIdList      = new List <int>();
            var taxisString        = ETaxisTypeUtils.GetInputContentOrderByString(ETaxisType.OrderByTaxisDesc);
            var whereStringBuilder = new StringBuilder();

            foreach (var field in searchFields)
            {
                if (!string.IsNullOrEmpty(field))
                {
                    whereStringBuilder.Append($" {field} LIKE '%{PageUtils.FilterSql(keyword)}%' OR");
                }
            }
            if (whereStringBuilder.Length > 0)
            {
                whereStringBuilder.Remove(whereStringBuilder.Length - 3, 3);
            }

            string sqlString =
                $"SELECT ID FROM {TableName} WHERE (InputID = {inputId} AND IsChecked = '{true}' AND ({whereStringBuilder})) {taxisString}";

            using (var rdr = ExecuteReader(sqlString))
            {
                while (rdr.Read())
                {
                    contentIdList.Add(GetInt(rdr, 0));
                }
                rdr.Close();
            }
            return(contentIdList);
        }
Beispiel #8
0
        public AppointmentContentInfo GetLatestContentInfo(int itemId, string cookieSn, string wxOpenId, string userName)
        {
            AppointmentContentInfo contentInfo = null;

            string sqlWhere = $"WHERE {AppointmentContentAttribute.AppointmentItemId} = {itemId}";

            sqlWhere += $" AND ({AppointmentContentAttribute.CookieSn} = '{PageUtils.FilterSql(cookieSn)}'";

            if (!string.IsNullOrEmpty(wxOpenId))
            {
                sqlWhere += $" AND {AppointmentContentAttribute.WxOpenId} = '{PageUtils.FilterSql(wxOpenId)}'";
            }
            else if (!string.IsNullOrEmpty(userName))
            {
                sqlWhere += $" AND {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'";
            }

            sqlWhere += ")";

            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, "ORDER BY ID DESC");

            using (var rdr = ExecuteReader(sqlSelect))
            {
                if (rdr.Read())
                {
                    contentInfo = new AppointmentContentInfo(rdr);
                }
                rdr.Close();
            }

            return(contentInfo);
        }
Beispiel #9
0
        public string GetSelectCommend(ETriState successState, string keyword, string dateFrom, string dateTo)
        {
            var whereString = new StringBuilder("WHERE ");

            if (successState != ETriState.All)
            {
                whereString.AppendFormat("IsSuccess = '{0}'", ETriStateUtils.GetValue(successState));
            }
            else
            {
                whereString.Append("1 = 1");
            }

            if (!string.IsNullOrEmpty(keyword))
            {
                whereString.Append(" AND ");
                whereString.AppendFormat("(ErrorMessage LIKE '%{0}%')", PageUtils.FilterSql(keyword));
            }

            if (!string.IsNullOrEmpty(dateFrom))
            {
                whereString.Append(" AND ");
                whereString.AppendFormat("(AddDate >= '{0}')", dateFrom);
            }
            if (!string.IsNullOrEmpty(dateTo))
            {
                whereString.Append(" AND ");
                whereString.AppendFormat("(AddDate <= '{0}')", dateTo);
            }

            return("SELECT ID, CreateType, PublishmentSystemID, TaskName, TimeSpan, IsSuccess, ErrorMessage, AddDate FROM siteserver_CreateTaskLog " + whereString);
        }
Beispiel #10
0
        public string GetSelectCommendByContentGroup(string tableName, string contentGroupName, int publishmentSystemId)
        {
            contentGroupName = PageUtils.FilterSql(contentGroupName);
            string sqlString =
                $"SELECT * FROM {tableName} WHERE PublishmentSystemID={publishmentSystemId} AND NodeID>0 AND (ContentGroupNameCollection LIKE '{contentGroupName},%' OR ContentGroupNameCollection LIKE '%,{contentGroupName}' OR ContentGroupNameCollection  LIKE '%,{contentGroupName},%'  OR ContentGroupNameCollection='{contentGroupName}')";

            return(sqlString);
        }
Beispiel #11
0
        //得到属于此发布系统和栏目组的所有栏目
        public List <NodeInfo> GetNodeInfoListChecked(int publishmentSystemId, string nodeGroupName)
        {
            nodeGroupName = PageUtils.FilterSql(nodeGroupName);

            string whereString =
                $" AND (siteserver_Node.NodeGroupNameCollection = '{nodeGroupName}' OR siteserver_Node.NodeGroupNameCollection LIKE '{nodeGroupName},%' OR siteserver_Node.NodeGroupNameCollection LIKE '%,{nodeGroupName},%' OR siteserver_Node.NodeGroupNameCollection LIKE '%,{nodeGroupName}')";

            return(DataProvider.NodeDao.GetNodeInfoListByPublishmentSystemId(publishmentSystemId, whereString));
        }
Beispiel #12
0
        private void SetTaxisSubtract(int areaId, string parentsPath, int subtractNum)
        {
            var    path      = PageUtils.FilterSql(parentsPath);
            string sqlString =
                $"UPDATE bairong_Area SET Taxis = Taxis - {subtractNum} WHERE  AreaID = {areaId} OR ParentsPath = '{path}' OR ParentsPath LIKE '{path},%'";

            ExecuteNonQuery(sqlString);

            AreaManager.ClearCache();
        }
Beispiel #13
0
        public List <string> GetKeywordListByContent(string content)
        {
            //string sqlString =
            //    $"SELECT Keyword FROM siteserver_Keyword WHERE CHARINDEX(Keyword, '{PageUtils.FilterSql(content)}') > 0";

            var inStr     = WebConfigUtils.IsMySql ? $"INSTR('{PageUtils.FilterSql(content)}', Keyword) > 0" : $"CHARINDEX(Keyword, '{PageUtils.FilterSql(content)}') > 0";
            var sqlString = $"SELECT Keyword FROM siteserver_Keyword WHERE {inStr}";

            return(BaiRongDataProvider.DatabaseDao.GetStringList(sqlString));
        }
Beispiel #14
0
        private void SetTaxisAdd(int areaId, string parentsPath, int addNum)
        {
            var    path      = PageUtils.FilterSql(parentsPath);
            string sqlString =
                $"UPDATE siteserver_Area SET Taxis = Taxis + {addNum} WHERE Id = {areaId} OR ParentsPath = '{path}' OR ParentsPath LIKE '{path},%'";

            ExecuteNonQuery(sqlString);

            AreaManager.ClearCache();
        }
Beispiel #15
0
        private void SetTaxisSubtract(int id, string parentsPath, int subtractNum)
        {
            var    path      = PageUtils.FilterSql(parentsPath);
            string sqlString =
                $"UPDATE siteserver_Department SET Taxis = Taxis - {subtractNum} WHERE  Id = {id} OR ParentsPath = '{path}' OR ParentsPath LIKE '{path},%'";

            ExecuteNonQuery(sqlString);

            DepartmentManager.ClearCache();
        }
Beispiel #16
0
        private void SetTaxisAdd(int departmentId, string parentsPath, int addNum)
        {
            var    path      = PageUtils.FilterSql(parentsPath);
            string sqlString =
                $"UPDATE bairong_Department SET Taxis = Taxis + {addNum} WHERE DepartmentID = {departmentId} OR ParentsPath = '{path}' OR ParentsPath LIKE '{path},%'";

            ExecuteNonQuery(sqlString);

            DepartmentManager.ClearCache();
        }
Beispiel #17
0
        public void Page_Load(object sender, EventArgs e)
        {
            var type = PageUtils.FilterSql(Request.QueryString["type"]);

            if (string.IsNullOrEmpty(type))
            {
                type = TypeRedirect;
            }

            if (StringUtils.EqualsIgnoreCase(type, TypeRedirect))
            {
                Redirect();
            }
        }
Beispiel #18
0
        public IEnumerable GetDataSourceByName(string adAreaName, int publishmentSystemId)
        {
            var strSql = new StringBuilder();

            strSql.AppendFormat("SELECT AdAreaID, PublishmentSystemID,AdAreaName, Width, Height, Summary, IsEnabled,AddDate FROM siteserver_AdArea WHERE PublishmentSystemID ={0}", publishmentSystemId);
            if (!string.IsNullOrEmpty(adAreaName))
            {
                strSql.AppendFormat(" AND AdAreaName LIKE '%{0}%'", PageUtils.FilterSql(adAreaName));
            }
            strSql.Append("ORDER BY AddDate DESC");

            var enumerable = (IEnumerable)ExecuteReader(strSql.ToString());

            return(enumerable);
        }
Beispiel #19
0
        public string GetSelectCommend(string userName, string keyword, string dateFrom, string dateTo)
        {
            if (string.IsNullOrEmpty(userName) && string.IsNullOrEmpty(keyword) && string.IsNullOrEmpty(dateFrom) && string.IsNullOrEmpty(dateTo))
            {
                return(GetSelectCommend());
            }

            var whereString = new StringBuilder("WHERE ");

            var isWhere = false;

            if (!string.IsNullOrEmpty(userName))
            {
                isWhere = true;
                whereString.AppendFormat("(UserName = '******')", PageUtils.FilterSql(userName));
            }

            if (!string.IsNullOrEmpty(keyword))
            {
                if (isWhere)
                {
                    whereString.Append(" AND ");
                }
                isWhere = true;
                whereString.AppendFormat("(Action LIKE '%{0}%' OR Summary LIKE '%{0}%')", PageUtils.FilterSql(keyword));
            }

            if (!string.IsNullOrEmpty(dateFrom))
            {
                if (isWhere)
                {
                    whereString.Append(" AND ");
                }
                isWhere = true;
                whereString.Append($"(AddDate >= {SqlUtils.GetComparableDate(TranslateUtils.ToDateTime(dateFrom))})");
            }
            if (!string.IsNullOrEmpty(dateTo))
            {
                if (isWhere)
                {
                    whereString.Append(" AND ");
                }
                whereString.Append($"(AddDate <= {SqlUtils.GetComparableDate(TranslateUtils.ToDateTime(dateTo))})");
            }

            return("SELECT ID, UserName, IPAddress, AddDate, Action, Summary FROM siteserver_Log " + whereString);
        }
Beispiel #20
0
        public List <AppointmentContentInfo> GetLatestContentInfoList(int appointmentId, string cookieSn, string wxOpenId, string userName)
        {
            var list = new List <AppointmentContentInfo>();

            string sqlWhere = $"WHERE {AppointmentContentAttribute.AppointmentId} = {appointmentId}";

            sqlWhere += $" AND ({AppointmentContentAttribute.CookieSn} = '{PageUtils.FilterSql(cookieSn)}'";

            if (!string.IsNullOrEmpty(wxOpenId))
            {
                sqlWhere += $" AND {AppointmentContentAttribute.WxOpenId} = '{PageUtils.FilterSql(wxOpenId)}'";
            }
            else if (!string.IsNullOrEmpty(userName))
            {
                sqlWhere += $" AND {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'";
            }

            sqlWhere += ")";

            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, "ORDER BY ID DESC");

            using (var rdr = ExecuteReader(sqlSelect))
            {
                while (rdr.Read())
                {
                    var contentInfo = new AppointmentContentInfo(rdr);

                    var isExists = false;
                    foreach (var theContentInfo in list)
                    {
                        if (theContentInfo.AppointmentItemId == contentInfo.AppointmentItemId)
                        {
                            isExists = true;
                        }
                    }

                    if (!isExists)
                    {
                        list.Add(contentInfo);
                    }
                }
                rdr.Close();
            }

            return(list);
        }
Beispiel #21
0
        public List <AppointmentContentInfo> GetLatestContentInfoList(int appointmentID, string cookieSN, string wxOpenID, string userName)
        {
            var list = new List <AppointmentContentInfo>();

            string SQL_WHERE = $"WHERE {AppointmentContentAttribute.AppointmentID} = {appointmentID}";

            SQL_WHERE += $" AND ({AppointmentContentAttribute.CookieSN} = '{PageUtils.FilterSql(cookieSN)}'";

            if (!string.IsNullOrEmpty(wxOpenID))
            {
                SQL_WHERE += $" AND {AppointmentContentAttribute.WXOpenID} = '{PageUtils.FilterSql(wxOpenID)}'";
            }
            else if (!string.IsNullOrEmpty(userName))
            {
                SQL_WHERE += $" AND {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'";
            }

            SQL_WHERE += ")";

            var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, "ORDER BY ID DESC");

            using (var rdr = ExecuteReader(SQL_SELECT))
            {
                while (rdr.Read())
                {
                    var contentInfo = new AppointmentContentInfo(rdr);

                    var isExists = false;
                    foreach (var theContentInfo in list)
                    {
                        if (theContentInfo.AppointmentItemID == contentInfo.AppointmentItemID)
                        {
                            isExists = true;
                        }
                    }

                    if (!isExists)
                    {
                        list.Add(contentInfo);
                    }
                }
                rdr.Close();
            }

            return(list);
        }
Beispiel #22
0
        private string GetWhereString(string tag, int siteId, int contentId)
        {
            var builder = new StringBuilder();

            builder.Append($" WHERE SiteId = {siteId} ");
            if (!string.IsNullOrEmpty(tag))
            {
                builder.Append($"AND Tag = '{PageUtils.FilterSql(tag)}' ");
            }
            if (contentId > 0)
            {
                builder.Append(
                    $"AND (ContentIdCollection = '{contentId}' OR ContentIdCollection LIKE '{contentId},%' OR ContentIdCollection LIKE '%,{contentId},%' OR ContentIdCollection LIKE '%,{contentId}')");
            }

            return(builder.ToString());
        }
Beispiel #23
0
        public decimal GetAmount(int cardSnid, string userName)
        {
            decimal amount = 0;

            string sqlWhere  = $"WHERE ID = {cardSnid} AND userName='******'";
            var    sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, null);

            using (var rdr = ExecuteReader(sqlSelect))
            {
                if (rdr.Read())
                {
                    var cardSnInfo = new CardSnInfo(rdr);
                    amount = cardSnInfo.Amount;
                }
                rdr.Close();
            }
            return(amount);
        }
Beispiel #24
0
        public bool IsExists(string tableName)
        {
            var isExists = false;

            string sqlString =
                $"SELECT TableName FROM siteserver_Table WHERE TableName = '{PageUtils.FilterSql(tableName)}'";

            using (var rdr = ExecuteReader(sqlString))
            {
                if (rdr.Read() && !rdr.IsDBNull(0))
                {
                    isExists = true;
                }
                rdr.Close();
            }

            return(isExists);
        }
Beispiel #25
0
        public decimal GetAmount(int cardSNID, string userName)
        {
            decimal amount = 0;

            string SQL_WHERE  = $"WHERE ID = {cardSNID} AND userName='******'";
            var    SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, null);

            using (var rdr = ExecuteReader(SQL_SELECT))
            {
                if (rdr.Read())
                {
                    var cardSNInfo = new CardSNInfo(rdr);
                    amount = cardSNInfo.Amount;
                }
                rdr.Close();
            }
            return(amount);
        }
Beispiel #26
0
        public bool IsSign(int publishmentSystemId, string userName)
        {
            var isSign = false;

            string sqlWhere =
                $"WHERE PublishmentSystemID ={publishmentSystemId} AND UserName = '******' AND SignDate > '{DateTime.Now.Year}-{DateTime.Now.Month}-{DateTime.Now.Day}'";
            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, null);

            using (var rdr = ExecuteReader(sqlSelect))
            {
                if (rdr.Read())
                {
                    isSign = true;
                }
                rdr.Close();
            }

            return(isSign);
        }
Beispiel #27
0
        public string GetSelectString(int publishmentSystemID, int cardID, string cardSN, string userName, string mobile)
        {
            string whereString =
                $"WHERE {CardEntitySNAttribute.PublishmentSystemID} = {publishmentSystemID} AND {CardEntitySNAttribute.CardID} = {cardID}";

            if (!string.IsNullOrEmpty(cardSN))
            {
                whereString += $" AND {CardEntitySNAttribute.SN} ='{PageUtils.FilterSql(cardSN)}')";
            }
            if (!string.IsNullOrEmpty(userName))
            {
                whereString += $" AND {CardEntitySNAttribute.UserName}='{PageUtils.FilterSql(userName)}'";
            }
            if (!string.IsNullOrEmpty(mobile))
            {
                whereString += $" AND {CardEntitySNAttribute.Mobile} ='{PageUtils.FilterSql(mobile)}')";
            }
            return(BaiRongDataProvider.TableStructureDao.GetSelectSqlString(TABLE_NAME, SqlUtils.Asterisk, whereString));
        }
Beispiel #28
0
        public bool IsSign(int publishmentSystemID, string userName)
        {
            var isSign = false;

            string SQL_WHERE =
                $"WHERE PublishmentSystemID ={publishmentSystemID} AND UserName = '******' AND SignDate > '{DateTime.Now.Year}-{DateTime.Now.Month}-{DateTime.Now.Day}'";
            var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, null);

            using (var rdr = ExecuteReader(SQL_SELECT))
            {
                if (rdr.Read())
                {
                    isSign = true;
                }
                rdr.Close();
            }

            return(isSign);
        }
Beispiel #29
0
        public string GetSelectCommend(string pluginId, string keyword, string dateFrom, string dateTo)
        {
            var whereString = new StringBuilder();

            if (!string.IsNullOrEmpty(pluginId))
            {
                whereString.Append($"PluginId = '{PageUtils.FilterSql(pluginId)}'");
            }

            if (!string.IsNullOrEmpty(keyword))
            {
                if (whereString.Length > 0)
                {
                    whereString.Append(" AND ");
                }
                var filterKeyword = PageUtils.FilterSql(keyword);
                var keywordId     = TranslateUtils.ToInt(keyword);
                whereString.Append(keywordId > 0
                    ? $"Id = {keywordId}"
                    : $"(Message LIKE '%{filterKeyword}%' OR Stacktrace LIKE '%{filterKeyword}%' OR Summary LIKE '%{filterKeyword}%')");
            }
            if (!string.IsNullOrEmpty(dateFrom))
            {
                if (whereString.Length > 0)
                {
                    whereString.Append(" AND ");
                }
                whereString.Append($"AddDate >= {SqlUtils.GetComparableDate(TranslateUtils.ToDateTime(dateFrom))}");
            }
            if (!string.IsNullOrEmpty(dateTo))
            {
                if (whereString.Length > 0)
                {
                    whereString.Append(" AND ");
                }
                whereString.Append($"AddDate <= {SqlUtils.GetComparableDate(TranslateUtils.ToDateTime(dateTo))}");
            }

            return(whereString.Length > 0
                ? $"SELECT Id, PluginId, Message, Stacktrace, Summary, AddDate FROM {TableName} WHERE {whereString}"
                : $"SELECT Id, PluginId, Message, Stacktrace, Summary, AddDate FROM {TableName}");
        }
Beispiel #30
0
        public List <DateTime> GetSignDateList(int publishmentSystemId, string userName)
        {
            var signDateList = new List <DateTime>();

            string sqlWhere =
                $"WHERE PublishmentSystemID = {publishmentSystemId} AND UserName='******'";
            var sqlOrder  = " ORDER BY SignDate DESC ";
            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, CardSignLogAttribute.SignDate, sqlWhere, sqlOrder);

            using (var rdr = ExecuteReader(sqlSelect))
            {
                while (rdr.Read())
                {
                    signDateList.Add(ConvertHelper.GetDateTime(rdr.GetValue(0)));
                }
                rdr.Close();
            }

            return(signDateList);
        }