Exemplo n.º 1
0
        public int GetCount(int publishmentSystemID, EKeywordType keywordType)
        {
            string sqlString =
                $"SELECT COUNT(*) FROM wx_Keyword WHERE PublishmentSystemID = {publishmentSystemID} AND KeywordType = '{EKeywordTypeUtils.GetValue(keywordType)}'";

            return(BaiRongDataProvider.DatabaseDao.GetIntResult(sqlString));
        }
Exemplo n.º 2
0
        private int GetMaxTaxis(int publishmentSystemID, EKeywordType keywordType)
        {
            string sqlString =
                $"SELECT MAX(Taxis) FROM wx_Keyword WHERE PublishmentSystemID = {publishmentSystemID} AND KeywordType = '{EKeywordTypeUtils.GetValue(keywordType)}'";

            return(BaiRongDataProvider.DatabaseDao.GetIntResult(sqlString));
        }
Exemplo n.º 3
0
        public bool UpdateTaxisToDown(int publishmentSystemID, EKeywordType keywordType, int keywordID)
        {
            string sqlString =
                $"SELECT TOP 1 KeywordID, Taxis FROM wx_Keyword WHERE (Taxis < (SELECT Taxis FROM wx_Keyword WHERE KeywordID = {keywordID})) AND PublishmentSystemID = {publishmentSystemID} AND KeywordType = '{EKeywordTypeUtils.GetValue(keywordType)}' ORDER BY Taxis DESC";
            var lowerID    = 0;
            var lowerTaxis = 0;

            using (var rdr = ExecuteReader(sqlString))
            {
                if (rdr.Read())
                {
                    lowerID    = rdr.GetInt32(0);
                    lowerTaxis = rdr.GetInt32(1);
                }
                rdr.Close();
            }

            var selectedTaxis = GetTaxis(keywordID);

            if (lowerID > 0)
            {
                SetTaxis(keywordID, lowerTaxis);
                SetTaxis(lowerID, selectedTaxis);
                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
        public bool UpdateTaxisToUp(int publishmentSystemId, EKeywordType keywordType, int keywordId)
        {
            string sqlString =
                $"SELECT TOP 1 KeywordID, Taxis FROM wx_Keyword WHERE (Taxis > (SELECT Taxis FROM wx_Keyword WHERE KeywordID = {keywordId})) AND PublishmentSystemID = {publishmentSystemId} AND KeywordType = '{EKeywordTypeUtils.GetValue(keywordType)}' ORDER BY Taxis";
            var higherId    = 0;
            var higherTaxis = 0;

            using (var rdr = ExecuteReader(sqlString))
            {
                if (rdr.Read())
                {
                    higherId    = rdr.GetInt32(0);
                    higherTaxis = rdr.GetInt32(1);
                }
                rdr.Close();
            }

            var selectedTaxis = GetTaxis(keywordId);

            if (higherId > 0)
            {
                SetTaxis(keywordId, higherTaxis);
                SetTaxis(higherId, selectedTaxis);
                return(true);
            }
            return(false);
        }
Exemplo n.º 5
0
 public KeywordMatchInfo(int matchId, int publishmentSystemId, string keyword, int keywordId, bool isDisabled, EKeywordType keywordType, EMatchType matchType)
 {
     MatchId             = matchId;
     PublishmentSystemId = publishmentSystemId;
     Keyword             = keyword;
     KeywordId           = keywordId;
     IsDisabled          = isDisabled;
     KeywordType         = keywordType;
     MatchType           = matchType;
 }
Exemplo n.º 6
0
 public KeywordMatchInfo()
 {
     matchID             = 0;
     publishmentSystemID = 0;
     keyword             = string.Empty;
     keywordID           = 0;
     isDisabled          = false;
     keywordType         = EKeywordType.Text;
     matchType           = EMatchType.Exact;
 }
Exemplo n.º 7
0
 public KeywordMatchInfo(int matchID, int publishmentSystemID, string keyword, int keywordID, bool isDisabled, EKeywordType keywordType, EMatchType matchType)
 {
     this.matchID             = matchID;
     this.publishmentSystemID = publishmentSystemID;
     this.keyword             = keyword;
     this.keywordID           = keywordID;
     this.isDisabled          = isDisabled;
     this.keywordType         = keywordType;
     this.matchType           = matchType;
 }
Exemplo n.º 8
0
        public static ListItem GetListItem(EKeywordType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Exemplo n.º 9
0
        public IEnumerable GetDataSource(int publishmentSystemId, EKeywordType keywordType)
        {
            var parms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentSystemId, EDataType.Integer, publishmentSystemId),
                GetParameter(ParmKeywordType, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType))
            };

            var enumerable = (IEnumerable)ExecuteReader(SqlSelectAllByType, parms);

            return(enumerable);
        }
Exemplo n.º 10
0
        public IEnumerable GetDataSource(int publishmentSystemID, EKeywordType keywordType)
        {
            var parms = new IDataParameter[]
            {
                GetParameter(PARM_PUBLISHMENT_SYSTEM_ID, EDataType.Integer, publishmentSystemID),
                GetParameter(PARM_KEYWORD_TYPE, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType))
            };

            var enumerable = (IEnumerable)ExecuteReader(SQL_SELECT_ALL_BY_TYPE, parms);

            return(enumerable);
        }
Exemplo n.º 11
0
 public KeywordInfo(int keywordId, int publishmentSystemId, string keywords, bool isDisabled, EKeywordType keywordType, EMatchType matchType, string reply, DateTime addDate, int taxis)
 {
     KeywordId           = keywordId;
     PublishmentSystemId = publishmentSystemId;
     Keywords            = keywords;
     IsDisabled          = isDisabled;
     KeywordType         = keywordType;
     MatchType           = matchType;
     Reply   = reply;
     AddDate = addDate;
     Taxis   = taxis;
 }
Exemplo n.º 12
0
 public static bool Equals(EKeywordType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 13
0
 public KeywordInfo()
 {
     keywordID           = 0;
     publishmentSystemID = 0;
     keywords            = string.Empty;
     isDisabled          = false;
     keywordType         = EKeywordType.Text;
     matchType           = EMatchType.Exact;
     reply   = string.Empty;
     addDate = DateTime.Now;
     taxis   = 0;
 }
Exemplo n.º 14
0
 public KeywordInfo(int keywordID, int publishmentSystemID, string keywords, bool isDisabled, EKeywordType keywordType, EMatchType matchType, string reply, DateTime addDate, int taxis)
 {
     this.keywordID           = keywordID;
     this.publishmentSystemID = publishmentSystemID;
     this.keywords            = keywords;
     this.isDisabled          = isDisabled;
     this.keywordType         = keywordType;
     this.matchType           = matchType;
     this.reply   = reply;
     this.addDate = addDate;
     this.taxis   = taxis;
 }
Exemplo n.º 15
0
        public List <string> GetKeywordList(int publishmentSystemId, EKeywordType keywordType)
        {
            var list = new List <string>();

            var parms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentSystemId, EDataType.Integer, publishmentSystemId),
                GetParameter(ParmKeywordType, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType))
            };

            using (var rdr = ExecuteReader(SqlSelectKeyowrdByType, parms))
            {
                while (rdr.Read())
                {
                    list.Add(rdr.GetValue(0).ToString());
                }
                rdr.Close();
            }

            return(list);
        }
Exemplo n.º 16
0
        public List <string> GetKeywordList(int publishmentSystemID, EKeywordType keywordType)
        {
            var list = new List <string>();

            var parms = new IDataParameter[]
            {
                GetParameter(PARM_PUBLISHMENT_SYSTEM_ID, EDataType.Integer, publishmentSystemID),
                GetParameter(PARM_KEYWORD_TYPE, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType))
            };

            using (var rdr = ExecuteReader(SQL_SELECT_KEYOWRD_BY_TYPE, parms))
            {
                while (rdr.Read())
                {
                    list.Add(rdr.GetValue(0).ToString());
                }
                rdr.Close();
            }

            return(list);
        }
Exemplo n.º 17
0
        public void Update(int publishmentSystemId, int keywordId, EKeywordType keywordType, EMatchType matchType, string keywords)
        {
            var parms = new IDataParameter[]
            {
                GetParameter(ParmKeywords, EDataType.NVarChar, 255, keywords),
                GetParameter(ParmKeywordType, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType)),
                GetParameter(ParmKeywordId, EDataType.Integer, keywordId)
            };

            ExecuteNonQuery(SqlUpdateKeywrods, parms);

            DataProviderWx.KeywordMatchDao.DeleteByKeywordId(keywordId);

            foreach (var str in TranslateUtils.StringCollectionToStringList(keywords, ' '))
            {
                var keyword = str.Trim();
                if (!string.IsNullOrEmpty(keyword))
                {
                    DataProviderWx.KeywordMatchDao.Insert(new KeywordMatchInfo(0, publishmentSystemId, keyword, keywordId, false, keywordType, matchType));
                }
            }
        }
Exemplo n.º 18
0
        public void Update(int publishmentSystemID, int keywordID, EKeywordType keywordType, EMatchType matchType, string keywords)
        {
            var parms = new IDataParameter[]
            {
                GetParameter(PARM_KEYWORDS, EDataType.NVarChar, 255, keywords),
                GetParameter(PARM_KEYWORD_TYPE, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType)),
                GetParameter(PARM_KEYWORD_ID, EDataType.Integer, keywordID)
            };

            ExecuteNonQuery(SQL_UPDATE_KEYWRODS, parms);

            DataProviderWX.KeywordMatchDAO.DeleteByKeywordID(keywordID);

            foreach (var str in TranslateUtils.StringCollectionToStringList(keywords, ' '))
            {
                var keyword = str.Trim();
                if (!string.IsNullOrEmpty(keyword))
                {
                    DataProviderWX.KeywordMatchDAO.Insert(new KeywordMatchInfo(0, publishmentSystemID, keyword, keywordID, false, keywordType, matchType));
                }
            }
        }
Exemplo n.º 19
0
        public List <KeywordInfo> GetKeywordInfoList(int publishmentSystemId, EKeywordType keywordType)
        {
            var list = new List <KeywordInfo>();

            var parms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentSystemId, EDataType.Integer, publishmentSystemId),
                GetParameter(ParmKeywordType, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType))
            };

            using (var rdr = ExecuteReader(SqlSelectAllByType, parms))
            {
                while (rdr.Read())
                {
                    var keywordInfo = new KeywordInfo(rdr.GetInt32(0), rdr.GetInt32(1), rdr.GetValue(2).ToString(), TranslateUtils.ToBool(rdr.GetValue(3).ToString()), EKeywordTypeUtils.GetEnumType(rdr.GetValue(4).ToString()), EMatchTypeUtils.GetEnumType(rdr.GetValue(5).ToString()), rdr.GetValue(6).ToString(), rdr.GetDateTime(7), rdr.GetInt32(8));
                    list.Add(keywordInfo);
                }
                rdr.Close();
            }

            return(list);
        }
Exemplo n.º 20
0
        public KeywordInfo GetAvaliableKeywordInfo(int publishmentSystemId, EKeywordType keywordType)
        {
            KeywordInfo keywordInfo = null;

            var parms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentSystemId, EDataType.Integer, publishmentSystemId),
                GetParameter(ParmIsDisabled, EDataType.VarChar, 18, false.ToString()),
                GetParameter(ParmKeywordType, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType))
            };

            using (var rdr = ExecuteReader(SqlSelectAvaliable, parms))
            {
                if (rdr.Read())
                {
                    keywordInfo = new KeywordInfo(rdr.GetInt32(0), rdr.GetInt32(1), rdr.GetValue(2).ToString(), TranslateUtils.ToBool(rdr.GetValue(3).ToString()), EKeywordTypeUtils.GetEnumType(rdr.GetValue(4).ToString()), EMatchTypeUtils.GetEnumType(rdr.GetValue(5).ToString()), rdr.GetValue(6).ToString(), rdr.GetDateTime(7), rdr.GetInt32(8));
                }
                rdr.Close();
            }

            return(keywordInfo);
        }
Exemplo n.º 21
0
        public KeywordInfo GetAvaliableKeywordInfo(int publishmentSystemID, EKeywordType keywordType)
        {
            KeywordInfo keywordInfo = null;

            var parms = new IDataParameter[]
            {
                GetParameter(PARM_PUBLISHMENT_SYSTEM_ID, EDataType.Integer, publishmentSystemID),
                GetParameter(PARM_IS_DISABLED, EDataType.VarChar, 18, false.ToString()),
                GetParameter(PARM_KEYWORD_TYPE, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType))
            };

            using (var rdr = ExecuteReader(SQL_SELECT_AVALIABLE, parms))
            {
                if (rdr.Read())
                {
                    keywordInfo = new KeywordInfo(rdr.GetInt32(0), rdr.GetInt32(1), rdr.GetValue(2).ToString(), TranslateUtils.ToBool(rdr.GetValue(3).ToString()), EKeywordTypeUtils.GetEnumType(rdr.GetValue(4).ToString()), EMatchTypeUtils.GetEnumType(rdr.GetValue(5).ToString()), rdr.GetValue(6).ToString(), rdr.GetDateTime(7), rdr.GetInt32(8));
                }
                rdr.Close();
            }

            return(keywordInfo);
        }
Exemplo n.º 22
0
        public List <KeywordInfo> GetKeywordInfoList(int publishmentSystemID, EKeywordType keywordType)
        {
            var list = new List <KeywordInfo>();

            var parms = new IDataParameter[]
            {
                GetParameter(PARM_PUBLISHMENT_SYSTEM_ID, EDataType.Integer, publishmentSystemID),
                GetParameter(PARM_KEYWORD_TYPE, EDataType.VarChar, 50, EKeywordTypeUtils.GetValue(keywordType))
            };

            using (var rdr = ExecuteReader(SQL_SELECT_ALL_BY_TYPE, parms))
            {
                while (rdr.Read())
                {
                    var keywordInfo = new KeywordInfo(rdr.GetInt32(0), rdr.GetInt32(1), rdr.GetValue(2).ToString(), TranslateUtils.ToBool(rdr.GetValue(3).ToString()), EKeywordTypeUtils.GetEnumType(rdr.GetValue(4).ToString()), EMatchTypeUtils.GetEnumType(rdr.GetValue(5).ToString()), rdr.GetValue(6).ToString(), rdr.GetDateTime(7), rdr.GetInt32(8));
                    list.Add(keywordInfo);
                }
                rdr.Close();
            }

            return(list);
        }
Exemplo n.º 23
0
 public static string GetValue(EKeywordType type)
 {
     if (type == EKeywordType.Text)
     {
         return("Text");
     }
     else if (type == EKeywordType.News)
     {
         return("News");
     }
     else if (type == EKeywordType.Coupon)
     {
         return("Coupon");
     }
     else if (type == EKeywordType.Vote)
     {
         return("Vote");
     }
     else if (type == EKeywordType.Collect)
     {
         return("Collect");
     }
     else if (type == EKeywordType.Message)
     {
         return("Message");
     }
     else if (type == EKeywordType.Appointment)
     {
         return("Appointment");
     }
     else if (type == EKeywordType.View360)
     {
         return("View360");
     }
     else if (type == EKeywordType.Map)
     {
         return("Map");
     }
     else if (type == EKeywordType.Conference)
     {
         return("Conference");
     }
     else if (type == EKeywordType.Album)
     {
         return("Album");
     }
     else if (type == EKeywordType.Scratch)
     {
         return("Scratch");
     }
     else if (type == EKeywordType.BigWheel)
     {
         return("BigWheel");
     }
     else if (type == EKeywordType.GoldEgg)
     {
         return("GoldEgg");
     }
     else if (type == EKeywordType.Flap)
     {
         return("Flap");
     }
     else if (type == EKeywordType.YaoYao)
     {
         return("YaoYao");
     }
     else if (type == EKeywordType.Search)
     {
         return("Search");
     }
     else if (type == EKeywordType.Store)
     {
         return("Store");
     }
     else if (type == EKeywordType.Card)
     {
         return("Card");
     }
     else
     {
         throw new Exception();
     }
 }
Exemplo n.º 24
0
 public static bool Equals(string typeStr, EKeywordType type)
 {
     return(Equals(type, typeStr));
 }
Exemplo n.º 25
0
        public int GetKeywordID(int publishmentSystemID, bool isExists, string keywords, EKeywordType keywordType, int existKeywordID)
        {
            var keywordID = existKeywordID;

            if (isExists)
            {
                if (!string.IsNullOrEmpty(keywords))
                {
                    if (existKeywordID > 0)
                    {
                        DataProviderWX.KeywordDAO.Update(publishmentSystemID, existKeywordID, keywordType, EMatchType.Exact, keywords);
                    }
                    else
                    {
                        var keywordInfo = new KeywordInfo(0, publishmentSystemID, keywords, false, keywordType, EMatchType.Exact, string.Empty, DateTime.Now, 0);
                        keywordID = DataProviderWX.KeywordDAO.Insert(keywordInfo);
                    }
                }
                else
                {
                    if (existKeywordID > 0)
                    {
                        DataProviderWX.KeywordDAO.Delete(existKeywordID);
                        keywordID = 0;
                    }
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(keywords))
                {
                    var keywordInfo = new KeywordInfo(0, publishmentSystemID, keywords, false, keywordType, EMatchType.Exact, string.Empty, DateTime.Now, 0);
                    keywordID = DataProviderWX.KeywordDAO.Insert(keywordInfo);
                }
            }

            return(keywordID);
        }
Exemplo n.º 26
0
 public static string GetText(EKeywordType type)
 {
     if (type == EKeywordType.Text)
     {
         return("文本回复");
     }
     else if (type == EKeywordType.News)
     {
         return("图文回复");
     }
     else if (type == EKeywordType.Coupon)
     {
         return("优惠劵");
     }
     else if (type == EKeywordType.Vote)
     {
         return("微投票");
     }
     else if (type == EKeywordType.Collect)
     {
         return("征集投票");
     }
     else if (type == EKeywordType.Message)
     {
         return("微留言");
     }
     else if (type == EKeywordType.Appointment)
     {
         return("微预约");
     }
     else if (type == EKeywordType.View360)
     {
         return("360全景");
     }
     else if (type == EKeywordType.Map)
     {
         return("微导航");
     }
     else if (type == EKeywordType.Conference)
     {
         return("微会议");
     }
     else if (type == EKeywordType.Album)
     {
         return("微相册");
     }
     else if (type == EKeywordType.Scratch)
     {
         return("刮刮卡");
     }
     else if (type == EKeywordType.BigWheel)
     {
         return("大转盘");
     }
     else if (type == EKeywordType.GoldEgg)
     {
         return("砸金蛋");
     }
     else if (type == EKeywordType.Flap)
     {
         return("大翻牌");
     }
     else if (type == EKeywordType.YaoYao)
     {
         return("摇摇乐");
     }
     else if (type == EKeywordType.Search)
     {
         return("微搜索");
     }
     else if (type == EKeywordType.Store)
     {
         return("微门店");
     }
     else if (type == EKeywordType.Card)
     {
         return("会员卡");
     }
     else
     {
         throw new Exception();
     }
 }
Exemplo n.º 27
0
        public static string GetFunctionName(EKeywordType keywordType, int functionID)
        {
            var functionName = string.Empty;

            if (functionID > 0)
            {
                if (keywordType == EKeywordType.Album)
                {
                    var albumInfo = DataProviderWx.AlbumDao.GetAlbumInfo(functionID);
                    if (albumInfo != null)
                    {
                        functionName = albumInfo.Title;
                    }
                }
                else if (keywordType == EKeywordType.Appointment)
                {
                    var appointmentInfo = DataProviderWx.AppointmentDao.GetAppointmentInfo(functionID);
                    if (appointmentInfo != null)
                    {
                        functionName = appointmentInfo.Title;
                    }
                }
                else if (keywordType == EKeywordType.Conference)
                {
                    var conferenceInfo = DataProviderWx.ConferenceDao.GetConferenceInfo(functionID);
                    if (conferenceInfo != null)
                    {
                        functionName = conferenceInfo.Title;
                    }
                }
                else if (keywordType == EKeywordType.Coupon)
                {
                    var couponActInfo = DataProviderWx.CouponActDao.GetActInfo(functionID);
                    if (couponActInfo != null)
                    {
                        functionName = couponActInfo.Title;
                    }
                }

                else if (keywordType == EKeywordType.Scratch || keywordType == EKeywordType.BigWheel || keywordType == EKeywordType.GoldEgg || keywordType == EKeywordType.Flap || keywordType == EKeywordType.YaoYao)
                {
                    var lotteryInfo = DataProviderWx.LotteryDao.GetLotteryInfo(functionID);
                    if (lotteryInfo != null)
                    {
                        functionName = lotteryInfo.Title;
                    }
                }

                else if (keywordType == EKeywordType.Map)
                {
                    var mapInfo = DataProviderWx.MapDao.GetMapInfo(functionID);
                    if (mapInfo != null)
                    {
                        functionName = mapInfo.Title;
                    }
                }
                else if (keywordType == EKeywordType.Message)
                {
                    var messageInfo = DataProviderWx.MessageDao.GetMessageInfo(functionID);
                    if (messageInfo != null)
                    {
                        functionName = messageInfo.Title;
                    }
                }
                else if (keywordType == EKeywordType.Search)
                {
                    var searchInfo = DataProviderWx.SearchDao.GetSearchInfo(functionID);
                    if (searchInfo != null)
                    {
                        functionName = searchInfo.Title;
                    }
                }
                else if (keywordType == EKeywordType.Store)
                {
                    var storeInfo = DataProviderWx.StoreDao.GetStoreInfo(functionID);
                    if (storeInfo != null)
                    {
                        functionName = storeInfo.Title;
                    }
                }
                else if (keywordType == EKeywordType.View360)
                {
                    var view360Info = DataProviderWx.View360Dao.GetView360Info(functionID);
                    if (view360Info != null)
                    {
                        functionName = view360Info.Title;
                    }
                }
                else if (keywordType == EKeywordType.Vote)
                {
                    var voteInfo = DataProviderWx.VoteDao.GetVoteInfo(functionID);
                    if (voteInfo != null)
                    {
                        functionName = voteInfo.Title;
                    }
                }
                else if (keywordType == EKeywordType.Card)
                {
                    var cardInfo = DataProviderWx.CardDao.GetCardInfo(functionID);
                    if (cardInfo != null)
                    {
                        functionName = cardInfo.Title;
                    }
                }

                if (!string.IsNullOrEmpty(functionName))
                {
                    functionName = $@"{functionName}({EKeywordTypeUtils.GetText(keywordType)})";
                }
            }

            return functionName;
        }
Exemplo n.º 28
0
        public static string GetFunctionUrl(PublishmentSystemInfo publishmentSystemInfo, EKeywordType keywordType, int functionID)
        {
            var functionUrl = string.Empty;

            if (functionID > 0)
            {
                if (keywordType == EKeywordType.Album)
                {
                    var albumInfo = DataProviderWx.AlbumDao.GetAlbumInfo(functionID);
                    if (albumInfo != null)
                    {
                        functionUrl = AlbumManager.GetAlbumUrl(publishmentSystemInfo, albumInfo, string.Empty);
                    }
                }
                else if (keywordType == EKeywordType.Appointment)
                {
                    functionUrl = AppointmentManager.GetIndexUrl(publishmentSystemInfo, functionID, string.Empty);
                }
                else if (keywordType == EKeywordType.Conference)
                {
                    var conferenceInfo = DataProviderWx.ConferenceDao.GetConferenceInfo(functionID);
                    if (conferenceInfo != null)
                    {
                        functionUrl = ConferenceManager.GetConferenceUrl(publishmentSystemInfo, conferenceInfo, string.Empty);
                    }
                }
                else if (keywordType == EKeywordType.Scratch || keywordType == EKeywordType.BigWheel || keywordType == EKeywordType.GoldEgg || keywordType == EKeywordType.Flap || keywordType == EKeywordType.YaoYao)
                {
                    var lotteryInfo = DataProviderWx.LotteryDao.GetLotteryInfo(functionID);
                    if (lotteryInfo != null)
                    {
                        functionUrl = LotteryManager.GetLotteryUrl(publishmentSystemInfo, lotteryInfo, string.Empty);
                    }
                }
                else if (keywordType == EKeywordType.Map)
                {
                    var mapInfo = DataProviderWx.MapDao.GetMapInfo(functionID);
                    if (mapInfo != null)
                    {
                        functionUrl = MapManager.GetMapUrl(publishmentSystemInfo, mapInfo.MapWd);
                    }
                }
                else if (keywordType == EKeywordType.Message)
                {
                    var messageInfo = DataProviderWx.MessageDao.GetMessageInfo(functionID);
                    if (messageInfo != null)
                    {
                        functionUrl = MessageManager.GetMessageUrl(publishmentSystemInfo, messageInfo, string.Empty);
                    }
                }
                else if (keywordType == EKeywordType.Search)
                {
                    var searchInfo = DataProviderWx.SearchDao.GetSearchInfo(functionID);
                    if (searchInfo != null)
                    {
                        functionUrl = SearchManager.GetSearchUrl(publishmentSystemInfo, searchInfo);
                    }
                }
                else if (keywordType == EKeywordType.Store)
                {
                    var storeInfo = DataProviderWx.StoreDao.GetStoreInfo(functionID);
                    if (storeInfo != null)
                    {
                        functionUrl = StoreManager.GetStoreUrl(publishmentSystemInfo, storeInfo, string.Empty);
                    }
                }
                else if (keywordType == EKeywordType.View360)
                {
                    var view360Info = DataProviderWx.View360Dao.GetView360Info(functionID);
                    if (view360Info != null)
                    {
                        functionUrl = View360Manager.GetView360Url(publishmentSystemInfo, view360Info, string.Empty);
                    }
                }
                else if (keywordType == EKeywordType.Vote)
                {
                    var voteInfo = DataProviderWx.VoteDao.GetVoteInfo(functionID);
                    if (voteInfo != null)
                    {
                        functionUrl = VoteManager.GetVoteUrl(publishmentSystemInfo, voteInfo, string.Empty);
                    }
                }                
                else if (keywordType == EKeywordType.Card)
                {
                    var cardInfo = DataProviderWx.CardDao.GetCardInfo(functionID);
                    if (cardInfo != null)
                    {
                        functionUrl = CardManager.GetCardUrl(publishmentSystemInfo, cardInfo, string.Empty);
                    }
                }
            }
            
            return functionUrl;
        }
Exemplo n.º 29
0
        public static string GetFunctionSqlString(int publishmentSystemID, EKeywordType keywordType)
        {
            var sqlString = string.Empty;

            if (keywordType == EKeywordType.Album)
            {
                sqlString = DataProviderWx.AlbumDao.GetSelectString(publishmentSystemID);
            }
            else if (keywordType == EKeywordType.Appointment)
            {
                sqlString = DataProviderWx.AppointmentDao.GetSelectString(publishmentSystemID);
            }
            else if (keywordType == EKeywordType.Conference)
            {
                sqlString = DataProviderWx.ConferenceDao.GetSelectString(publishmentSystemID);
            }
            else if (keywordType == EKeywordType.Coupon)
            {
                sqlString = DataProviderWx.CouponActDao.GetSelectString(publishmentSystemID);
            }

            else if (keywordType == EKeywordType.Scratch)
            {
                sqlString = DataProviderWx.LotteryDao.GetSelectString(publishmentSystemID, ELotteryType.Scratch);
            }
            else if (keywordType == EKeywordType.BigWheel)
            {
                sqlString = DataProviderWx.LotteryDao.GetSelectString(publishmentSystemID, ELotteryType.BigWheel);
            }
            else if (keywordType == EKeywordType.GoldEgg)
            {
                sqlString = DataProviderWx.LotteryDao.GetSelectString(publishmentSystemID, ELotteryType.GoldEgg);
            }
            else if (keywordType == EKeywordType.Flap)
            {
                sqlString = DataProviderWx.LotteryDao.GetSelectString(publishmentSystemID, ELotteryType.Flap);
            }
            else if (keywordType == EKeywordType.YaoYao)
            {
                sqlString = DataProviderWx.LotteryDao.GetSelectString(publishmentSystemID, ELotteryType.YaoYao);
            }
            
            else if (keywordType == EKeywordType.Map)
            {
                sqlString = DataProviderWx.MapDao.GetSelectString(publishmentSystemID);
            }
            else if (keywordType == EKeywordType.Message)
            {
                sqlString = DataProviderWx.MessageDao.GetSelectString(publishmentSystemID);
            }
            else if (keywordType == EKeywordType.Search)
            {
                sqlString = DataProviderWx.SearchDao.GetSelectString(publishmentSystemID);
            }
            else if (keywordType == EKeywordType.Store)
            {
                sqlString = DataProviderWx.StoreDao.GetSelectString(publishmentSystemID);
            }
            else if (keywordType == EKeywordType.View360)
            {
                sqlString = DataProviderWx.View360Dao.GetSelectString(publishmentSystemID);
            }
            else if (keywordType == EKeywordType.Vote)
            {
                sqlString = DataProviderWx.VoteDao.GetSelectString(publishmentSystemID);
            }
            else if (keywordType == EKeywordType.Card)
            {
                sqlString = DataProviderWx.CardDao.GetSelectString(publishmentSystemID);
            }

            return sqlString;
        }
Exemplo n.º 30
0
        public static string GetNavigationUrl(PublishmentSystemInfo publishmentSystemInfo, ENavigationType navigationType, EKeywordType keywordType, int functionID, int channelID, int contentID, string url)
        {
            var navigationUrl = string.Empty;

            if (navigationType == ENavigationType.Url)
            {
                navigationUrl = url;
            }
            else if (navigationType == ENavigationType.Function)
            {
                navigationUrl = KeywordManager.GetFunctionUrl(publishmentSystemInfo, keywordType, functionID);
            }
            else if (navigationType == ENavigationType.Site)
            {
                if (contentID > 0)
                {
                    var tableStyle = NodeManager.GetTableStyle(publishmentSystemInfo, channelID);
                    var tableName  = NodeManager.GetTableName(publishmentSystemInfo, channelID);

                    var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentID);

                    navigationUrl = PageUtilityWX.GetContentUrl(publishmentSystemInfo, contentInfo);
                }
                else if (channelID > 0)
                {
                    var nodeNames = NodeManager.GetNodeNameNavigation(publishmentSystemInfo.PublishmentSystemId, channelID);
                    navigationUrl = PageUtilityWX.GetChannelUrl(publishmentSystemInfo, NodeManager.GetNodeInfo(publishmentSystemInfo.PublishmentSystemId, channelID));
                }
            }

            return(navigationUrl);
        }