예제 #1
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var conflictKeywords = string.Empty;
                if (KeywordManager.IsKeywordUpdateConflict(PublishmentSystemId, _keywordId, TbKeyword.Text, out conflictKeywords))
                {
                    FailMessage($"关键词“{conflictKeywords}”已存在,请设置其他关键词");
                }
                else
                {
                    var keywordInfo = DataProviderWx.KeywordDao.GetKeywordInfo(_keywordId);
                    var keywordList = TranslateUtils.StringCollectionToStringList(keywordInfo.Keywords, ' ');
                    var i           = keywordList.IndexOf(_keyword);
                    if (i != -1)
                    {
                        keywordList[i] = TbKeyword.Text;
                    }
                    keywordInfo.Keywords   = TranslateUtils.ObjectCollectionToString(keywordList, " ");
                    keywordInfo.IsDisabled = !CbIsEnabled.Checked;
                    keywordInfo.MatchType  = EMatchTypeUtils.GetEnumType(DdlMatchType.SelectedValue);

                    DataProviderWx.KeywordDao.Update(keywordInfo);

                    Body.AddSiteLog(PublishmentSystemId, "编辑关键词", $"关键词:{_keyword}");

                    isChanged = true;
                }
            }
            catch (Exception ex)
            {
                FailMessage(ex, "失败:" + ex.Message);
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
예제 #2
0
        public object GetValue(string attributeName)
        {
            foreach (var name in AllAttributes)
            {
                if (StringUtils.EqualsIgnoreCase(name, attributeName))
                {
                    var nameVlaue = GetType().GetProperty(name).GetValue(this, null);

                    if (attributeName == "KeywordType")
                    {
                        return(EKeywordTypeUtils.GetEnumType(nameVlaue.ToString()));
                    }
                    if (attributeName == "MatchType")
                    {
                        return(EMatchTypeUtils.GetEnumType(nameVlaue.ToString()));
                    }
                    return(nameVlaue);
                }
            }
            return(null);
        }
예제 #3
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var keywordId  = SqlUtils.EvalInt(e.Item.DataItem, "KeywordId");
                var keywords   = SqlUtils.EvalString(e.Item.DataItem, "Keywords");
                var reply      = SqlUtils.EvalString(e.Item.DataItem, "Reply");
                var isDisabled = TranslateUtils.ToBool(SqlUtils.EvalString(e.Item.DataItem, "IsDisabled"));
                var matchType  = EMatchTypeUtils.GetEnumType(SqlUtils.EvalString(e.Item.DataItem, "MatchType"));
                var addDate    = SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate");

                var ltlReply     = e.Item.FindControl("ltlReply") as Literal;
                var ltlAddDate   = e.Item.FindControl("ltlAddDate") as Literal;
                var ltlMatchType = e.Item.FindControl("ltlMatchType") as Literal;
                var ltlIsEnabled = e.Item.FindControl("ltlIsEnabled") as Literal;
                var hlUp         = e.Item.FindControl("hlUp") as HyperLink;
                var hlDown       = e.Item.FindControl("hlDown") as HyperLink;
                var ltlEditUrl   = e.Item.FindControl("ltlEditUrl") as Literal;
                var ltlDeleteUrl = e.Item.FindControl("ltlDeleteUrl") as Literal;

                ltlReply.Text     = StringUtils.CleanText(reply);
                ltlAddDate.Text   = DateUtils.GetDateString(addDate);
                ltlMatchType.Text = EMatchTypeUtils.GetText(matchType);
                ltlIsEnabled.Text = StringUtils.GetTrueOrFalseImageHtml(!isDisabled);

                var redirectUrl = GetRedirectUrl(PublishmentSystemId);

                hlUp.NavigateUrl   = $"{redirectUrl}&SetTaxis=True&KeywordId={keywordId}&Direction=UP";
                hlDown.NavigateUrl = $"{redirectUrl}&SetTaxis=True&KeywordId={keywordId}&Direction=DOWN";

                var showPopWinString = ModalKeywordAddText.GetOpenWindowStringToEdit(PublishmentSystemId, keywordId);
                ltlEditUrl.Text = $@"<a href=""javascript:;"" onClick=""{showPopWinString}"">修改</a>";

                ltlDeleteUrl.Text =
                    $@"<a href=""{redirectUrl}&Delete=True&KeywordID={keywordId}"" onClick=""javascript:return confirm('此操作将删除关键字“{keywords}”,确认吗?');"">删除</a>";
            }
        }
예제 #4
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged    = false;
            var keywordIdNew = 0;

            try
            {
                if (_keywordId == 0)
                {
                    var conflictKeywords = string.Empty;
                    if (KeywordManager.IsKeywordInsertConflict(PublishmentSystemId, TbKeywords.Text, out conflictKeywords))
                    {
                        FailMessage($"触发关键词“{conflictKeywords}”已存在,请设置其他关键词");
                    }
                    else
                    {
                        var keywordInfo = new KeywordInfo();

                        keywordInfo.KeywordId           = 0;
                        keywordInfo.PublishmentSystemId = PublishmentSystemId;
                        keywordInfo.Keywords            = TbKeywords.Text;
                        keywordInfo.IsDisabled          = !CbIsEnabled.Checked;
                        keywordInfo.KeywordType         = EKeywordType.News;
                        keywordInfo.MatchType           = EMatchTypeUtils.GetEnumType(DdlMatchType.SelectedValue);
                        keywordInfo.Reply   = string.Empty;
                        keywordInfo.AddDate = DateTime.Now;
                        keywordInfo.Taxis   = 0;

                        keywordIdNew = DataProviderWx.KeywordDao.Insert(keywordInfo);

                        Body.AddSiteLog(PublishmentSystemId, "添加图文回复关键词", $"关键词:{TbKeywords.Text}");

                        isChanged = true;
                    }
                }
                else
                {
                    var conflictKeywords = string.Empty;
                    if (KeywordManager.IsKeywordUpdateConflict(PublishmentSystemId, _keywordId, TbKeywords.Text, out conflictKeywords))
                    {
                        FailMessage($"触发关键词“{conflictKeywords}”已存在,请设置其他关键词");
                    }
                    else
                    {
                        var keywordInfo = DataProviderWx.KeywordDao.GetKeywordInfo(_keywordId);
                        keywordInfo.Keywords   = TbKeywords.Text;
                        keywordInfo.IsDisabled = !CbIsEnabled.Checked;
                        keywordInfo.MatchType  = EMatchTypeUtils.GetEnumType(DdlMatchType.SelectedValue);

                        DataProviderWx.KeywordDao.Update(keywordInfo);

                        Body.AddSiteLog(PublishmentSystemId, "编辑图文回复关键词", $"关键词:{TbKeywords.Text}");

                        isChanged = true;
                    }
                }
            }
            catch (Exception ex)
            {
                FailMessage(ex, "失败:" + ex.Message);
            }

            if (isChanged)
            {
                if (_keywordId == 0)
                {
                    if (CbIsSelect.Checked)
                    {
                        PageUtils.Redirect(ModalContentSelect.GetRedirectUrlByKeywordAddList(PublishmentSystemId, !_isSingle, keywordIdNew));
                    }
                    else
                    {
                        PageUtils.CloseModalPageAndRedirect(Page, PageKeywordNewsAdd.GetRedirectUrl(PublishmentSystemId, keywordIdNew, 0, _isSingle));
                    }
                }
                else
                {
                    PageUtils.CloseModalPage(Page);
                }
            }
        }
예제 #5
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged    = false;
            var keywordIDNew = 0;

            try
            {
                if (keywordID == 0)
                {
                    var conflictKeywords = string.Empty;
                    if (KeywordManager.IsKeywordInsertConflict(PublishmentSystemID, tbKeywords.Text, out conflictKeywords))
                    {
                        FailMessage($"触发关键词“{conflictKeywords}”已存在,请设置其他关键词");
                    }
                    else
                    {
                        var keywordInfo = new KeywordInfo();

                        keywordInfo.KeywordID           = 0;
                        keywordInfo.PublishmentSystemID = PublishmentSystemID;
                        keywordInfo.Keywords            = tbKeywords.Text;
                        keywordInfo.IsDisabled          = !cbIsEnabled.Checked;
                        keywordInfo.KeywordType         = EKeywordType.News;
                        keywordInfo.MatchType           = EMatchTypeUtils.GetEnumType(ddlMatchType.SelectedValue);
                        keywordInfo.Reply   = string.Empty;
                        keywordInfo.AddDate = DateTime.Now;
                        keywordInfo.Taxis   = 0;

                        keywordIDNew = DataProviderWX.KeywordDAO.Insert(keywordInfo);

                        StringUtility.AddLog(PublishmentSystemID, "添加图文回复关键词", $"关键词:{tbKeywords.Text}");

                        isChanged = true;
                    }
                }
                else
                {
                    var conflictKeywords = string.Empty;
                    if (KeywordManager.IsKeywordUpdateConflict(PublishmentSystemID, keywordID, tbKeywords.Text, out conflictKeywords))
                    {
                        FailMessage($"触发关键词“{conflictKeywords}”已存在,请设置其他关键词");
                    }
                    else
                    {
                        var keywordInfo = DataProviderWX.KeywordDAO.GetKeywordInfo(keywordID);
                        keywordInfo.Keywords   = tbKeywords.Text;
                        keywordInfo.IsDisabled = !cbIsEnabled.Checked;
                        keywordInfo.MatchType  = EMatchTypeUtils.GetEnumType(ddlMatchType.SelectedValue);

                        DataProviderWX.KeywordDAO.Update(keywordInfo);

                        StringUtility.AddLog(PublishmentSystemID, "编辑图文回复关键词", $"关键词:{tbKeywords.Text}");

                        isChanged = true;
                    }
                }
            }
            catch (Exception ex)
            {
                FailMessage(ex, "失败:" + ex.Message);
            }

            if (isChanged)
            {
                if (keywordID == 0)
                {
                    if (cbIsSelect.Checked)
                    {
                        PageUtils.Redirect(ContentSelect.GetRedirectUrlByKeywordAddList(PublishmentSystemID, !isSingle, keywordIDNew));
                    }
                    else
                    {
                        JsUtils.OpenWindow.CloseModalPageAndRedirect(Page, BackgroundKeywordNewsAdd.GetRedirectUrl(PublishmentSystemID, keywordIDNew, 0, isSingle));
                    }
                }
                else
                {
                    JsUtils.OpenWindow.CloseModalPage(Page);
                }
            }
        }
예제 #6
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var keywordId  = SqlUtils.EvalInt(e.Item.DataItem, "KeywordId");
                var keywords   = SqlUtils.EvalString(e.Item.DataItem, "Keywords");
                var isDisabled = TranslateUtils.ToBool(SqlUtils.EvalString(e.Item.DataItem, "IsDisabled"));
                var reply      = SqlUtils.EvalString(e.Item.DataItem, "Reply");
                var matchType  = EMatchTypeUtils.GetEnumType(SqlUtils.EvalString(e.Item.DataItem, "MatchType"));
                var addDate    = SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate");

                var phSingle   = e.Item.FindControl("phSingle") as PlaceHolder;
                var phMultiple = e.Item.FindControl("phMultiple") as PlaceHolder;

                var resourceInfoList = DataProviderWx.KeywordResourceDao.GetResourceInfoList(keywordId);

                phMultiple.Visible = resourceInfoList.Count > 1;
                phSingle.Visible   = !phMultiple.Visible;

                if (phSingle.Visible)
                {
                    var resourceInfo = new KeywordResourceInfo();
                    if (resourceInfoList.Count > 0)
                    {
                        resourceInfo = resourceInfoList[0];
                    }

                    var ltlSingleTitle     = e.Item.FindControl("ltlSingleTitle") as Literal;
                    var ltlSingleKeywords  = e.Item.FindControl("ltlSingleKeywords") as Literal;
                    var ltlSingleAddDate   = e.Item.FindControl("ltlSingleAddDate") as Literal;
                    var ltlSingleImageUrl  = e.Item.FindControl("ltlSingleImageUrl") as Literal;
                    var ltlSingleSummary   = e.Item.FindControl("ltlSingleSummary") as Literal;
                    var ltlSingleEditUrl   = e.Item.FindControl("ltlSingleEditUrl") as Literal;
                    var ltlSingleDeleteUrl = e.Item.FindControl("ltlSingleDeleteUrl") as Literal;

                    ltlSingleTitle.Text    = $@"<a href=""{"javascript:;"}"" target=""_blank"">{resourceInfo.Title}</a>";
                    ltlSingleKeywords.Text =
                        $@"{keywords + (isDisabled ? "(禁用)" : string.Empty)}&nbsp;<a href=""javascript:;"" onclick=""{ModalKeywordAddNews.GetOpenWindowStringToEdit(PublishmentSystemId, keywordId)}"">修改</a>";
                    ltlSingleAddDate.Text = addDate.ToShortDateString();
                    if (!string.IsNullOrEmpty(resourceInfo.ImageUrl))
                    {
                        ltlSingleImageUrl.Text =
                            $@"<img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, resourceInfo.ImageUrl)}"" class=""appmsg_thumb"">";
                    }
                    ltlSingleSummary.Text = MPUtils.GetSummary(resourceInfo.Summary, resourceInfo.Content);
                    ltlSingleEditUrl.Text =
                        $@"<a class=""js_edit"" href=""{PageKeywordNewsAdd.GetRedirectUrl(PublishmentSystemId,
                            keywordId, resourceInfo.ResourceId, phSingle.Visible)}""><i class=""icon18_common edit_gray"">编辑</i></a>";
                    ltlSingleDeleteUrl.Text =
                        $@"<a class=""js_del no_extra"" href=""{GetRedirectUrl(
                            PublishmentSystemId)}&delete=true&keywordID={keywordId}"" onclick=""javascript:return confirm('此操作将删除图文回复“{keywords}”,确认吗?');""><i class=""icon18_common del_gray"">删除</i></a>";
                }
                else
                {
                    var resourceInfo = resourceInfoList[0];
                    resourceInfoList.Remove(resourceInfo);

                    var ltlMultipleKeywords  = e.Item.FindControl("ltlMultipleKeywords") as Literal;
                    var ltlMultipleAddDate   = e.Item.FindControl("ltlMultipleAddDate") as Literal;
                    var ltlMultipleTitle     = e.Item.FindControl("ltlMultipleTitle") as Literal;
                    var ltlMultipleImageUrl  = e.Item.FindControl("ltlMultipleImageUrl") as Literal;
                    var rptMultipleContents  = e.Item.FindControl("rptMultipleContents") as Repeater;
                    var ltlMultipleEditUrl   = e.Item.FindControl("ltlMultipleEditUrl") as Literal;
                    var ltlMultipleDeleteUrl = e.Item.FindControl("ltlMultipleDeleteUrl") as Literal;

                    ltlMultipleKeywords.Text =
                        $@"{keywords + (isDisabled ? "(禁用)" : string.Empty)}&nbsp;<a href=""javascript:;"" onclick=""{ModalKeywordAddNews.GetOpenWindowStringToEdit(PublishmentSystemId, keywordId)}"">修改</a>";

                    ltlMultipleAddDate.Text = addDate.ToShortDateString();
                    ltlMultipleTitle.Text   = $@"<a href=""{"javascript:;"}"" target=""_blank"">{resourceInfo.Title}</a>";
                    if (!string.IsNullOrEmpty(resourceInfo.ImageUrl))
                    {
                        ltlMultipleImageUrl.Text =
                            $@"<img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, resourceInfo.ImageUrl)}"" class=""appmsg_thumb"">";
                    }

                    rptMultipleContents.DataSource     = resourceInfoList;
                    rptMultipleContents.ItemDataBound += rptMultipleContents_ItemDataBound;
                    rptMultipleContents.DataBind();

                    ltlMultipleEditUrl.Text =
                        $@"<a class=""js_edit"" href=""{PageKeywordNewsAdd.GetRedirectUrl(PublishmentSystemId,
                            keywordId, resourceInfo.ResourceId, phSingle.Visible)}""><i class=""icon18_common edit_gray"">编辑</i></a>";
                    ltlMultipleDeleteUrl.Text =
                        $@"<a class=""js_del no_extra"" href=""{GetRedirectUrl(
                            PublishmentSystemId)}&delete=true&keywordID={keywordId}"" onclick=""javascript:return confirm('此操作将删除图文回复“{keywords}”,确认吗?');""><i class=""icon18_common del_gray"">删除</i></a>";
                }
            }
        }
예제 #7
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                if (_keywordId == 0)
                {
                    var conflictKeywords = string.Empty;
                    if (KeywordManager.IsKeywordInsertConflict(PublishmentSystemId, PageUtils.FilterSql(TbKeywords.Text), out conflictKeywords))
                    {
                        FailMessage($"触发关键词“{conflictKeywords}”已存在,请设置其他关键词");
                    }
                    else
                    {
                        var keywordInfo = new KeywordInfo();


                        keywordInfo.KeywordId           = 0;
                        keywordInfo.PublishmentSystemId = PublishmentSystemId;
                        keywordInfo.Keywords            = PageUtils.FilterSql(TbKeywords.Text);
                        keywordInfo.IsDisabled          = !CbIsEnabled.Checked;
                        keywordInfo.KeywordType         = EKeywordType.Text;
                        keywordInfo.MatchType           = EMatchTypeUtils.GetEnumType(DdlMatchType.SelectedValue);
                        keywordInfo.Reply   = TbReply.Text;
                        keywordInfo.AddDate = DateTime.Now;
                        keywordInfo.Taxis   = 0;

                        DataProviderWx.KeywordDao.Insert(keywordInfo);

                        Body.AddSiteLog(PublishmentSystemId, "添加文本回复关键词", $"关键词:{TbKeywords.Text}");

                        isChanged = true;
                    }
                }
                else
                {
                    var conflictKeywords = string.Empty;
                    if (KeywordManager.IsKeywordUpdateConflict(PublishmentSystemId, _keywordId, TbKeywords.Text, out conflictKeywords))
                    {
                        FailMessage($"触发关键词“{conflictKeywords}”已存在,请设置其他关键词");
                    }
                    else
                    {
                        var keywordInfo = DataProviderWx.KeywordDao.GetKeywordInfo(_keywordId);
                        keywordInfo.Keywords   = TbKeywords.Text;
                        keywordInfo.IsDisabled = !CbIsEnabled.Checked;
                        keywordInfo.MatchType  = EMatchTypeUtils.GetEnumType(DdlMatchType.SelectedValue);
                        keywordInfo.Reply      = TbReply.Text;

                        DataProviderWx.KeywordDao.Update(keywordInfo);

                        Body.AddSiteLog(PublishmentSystemId, "编辑文本回复关键词", $"关键词:{TbKeywords.Text}");

                        isChanged = true;
                    }
                }
            }
            catch (Exception ex)
            {
                FailMessage(ex, "失败:" + ex.Message);
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
예제 #8
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                if (keywordID == 0)
                {
                    var conflictKeywords = string.Empty;
                    if (KeywordManager.IsKeywordInsertConflict(PublishmentSystemID, PageUtils.FilterSql(tbKeywords.Text), out conflictKeywords))
                    {
                        FailMessage($"触发关键词“{conflictKeywords}”已存在,请设置其他关键词");
                    }
                    else
                    {
                        var keywordInfo = new KeywordInfo();


                        keywordInfo.KeywordID           = 0;
                        keywordInfo.PublishmentSystemID = PublishmentSystemID;
                        keywordInfo.Keywords            = PageUtils.FilterSql(tbKeywords.Text);
                        keywordInfo.IsDisabled          = !cbIsEnabled.Checked;
                        keywordInfo.KeywordType         = EKeywordType.Text;
                        keywordInfo.MatchType           = EMatchTypeUtils.GetEnumType(ddlMatchType.SelectedValue);
                        keywordInfo.Reply   = tbReply.Text;
                        keywordInfo.AddDate = DateTime.Now;
                        keywordInfo.Taxis   = 0;

                        DataProviderWX.KeywordDAO.Insert(keywordInfo);

                        StringUtility.AddLog(PublishmentSystemID, "添加文本回复关键词", $"关键词:{tbKeywords.Text}");

                        isChanged = true;
                    }
                }
                else
                {
                    var conflictKeywords = string.Empty;
                    if (KeywordManager.IsKeywordUpdateConflict(PublishmentSystemID, keywordID, tbKeywords.Text, out conflictKeywords))
                    {
                        FailMessage($"触发关键词“{conflictKeywords}”已存在,请设置其他关键词");
                    }
                    else
                    {
                        var keywordInfo = DataProviderWX.KeywordDAO.GetKeywordInfo(keywordID);
                        keywordInfo.Keywords   = tbKeywords.Text;
                        keywordInfo.IsDisabled = !cbIsEnabled.Checked;
                        keywordInfo.MatchType  = EMatchTypeUtils.GetEnumType(ddlMatchType.SelectedValue);
                        keywordInfo.Reply      = tbReply.Text;

                        DataProviderWX.KeywordDAO.Update(keywordInfo);

                        StringUtility.AddLog(PublishmentSystemID, "编辑文本回复关键词", $"关键词:{tbKeywords.Text}");

                        isChanged = true;
                    }
                }
            }
            catch (Exception ex)
            {
                FailMessage(ex, "失败:" + ex.Message);
            }

            if (isChanged)
            {
                JsUtils.OpenWindow.CloseModalPage(Page);
            }
        }
예제 #9
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);
        }
예제 #10
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);
        }
예제 #11
0
        public KeywordInfo GetKeywordInfo(int keywordID)
        {
            KeywordInfo keywordInfo = null;

            if (keywordID > 0)
            {
                var parms = new IDataParameter[]
                {
                    GetParameter(PARM_KEYWORD_ID, EDataType.Integer, keywordID)
                };

                using (var rdr = ExecuteReader(SQL_SELECT, 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();
                }
            }
            else
            {
                keywordInfo           = new KeywordInfo();
                keywordInfo.KeywordID = 0;
                keywordInfo.Keywords  = "";
            }

            if (keywordInfo == null)
            {
                keywordInfo           = new KeywordInfo();
                keywordInfo.KeywordID = 0;
                keywordInfo.Keywords  = "";
            }
            return(keywordInfo);
        }
예제 #12
0
        public List <KeywordMatchInfo> GetKeywordMatchInfoList(int publishmentSystemId, int keyWordId)
        {
            var keywordMatchInfoList = new List <KeywordMatchInfo>();

            string sqlWhere =
                $"WHERE {KeywordMatchAttribute.PublishmentSystemId} = {publishmentSystemId} AND {KeywordMatchAttribute.KeywordId} = {keyWordId}";

            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, null);

            using (var rdr = ExecuteReader(sqlSelect))
            {
                while (rdr.Read())
                {
                    var keywordMatchInfo = new KeywordMatchInfo(rdr.GetInt32(0), rdr.GetInt32(1), rdr.GetValue(2).ToString(), rdr.GetInt32(3), TranslateUtils.ToBool(rdr.GetValue(6).ToString()), EKeywordTypeUtils.GetEnumType(rdr.GetValue(4).ToString()), EMatchTypeUtils.GetEnumType(rdr.GetValue(5).ToString()));
                    keywordMatchInfoList.Add(keywordMatchInfo);
                }
                rdr.Close();
            }

            return(keywordMatchInfoList);
        }
예제 #13
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);
        }
예제 #14
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);
        }