Esempio n. 1
0
        /// <summary>
        /// 获取前台当前页面栏目内容类型
        /// </summary>
        /// <returns></returns>
        string GetColumnMode()
        {
            if (Request["mode"] != null)
            {
                return(Request["mode"]);
            }
            else
            {
                if (ArticleID != null && ArticleID != "")
                {
                    Article a         = ArticleHelper.GetArticle(ArticleID);
                    string  channelID = "";
                    if (a != null)
                    {
                        channelID = a.OwnerID;
                    }
                    if (channelID != "")
                    {
                        Channel ch = this.ChannelHelper.GetChannel(channelID, new string[] { "EnumState" });
                        //string type = StateManagement.GetStateName(ch.EnumState, UserEnumLibrary.Business.ArticleType).ToString();
                        EnumLibrary.ArticleType type = (EnumLibrary.ArticleType)StateMgr.GetStateValueEnum(ch.EnumState, EnumLibrary.Business.ArticleType);
                        if (type == EnumLibrary.ArticleType.Product)
                        {
                            return("productDetail");
                        }
                        else if (type == EnumLibrary.ArticleType.Article)
                        {
                            return("detail");
                        }
                        else
                        {
                            return("contentMode");
                        }
                    }
                    else if (AdviceHelper.Exist(ArticleID))
                    {
                        return("adviceMode");
                    }
                    else
                    {
                        return(string.Empty);
                    }
                }

                else
                {
                    return(string.Empty);
                }
            }
        }
Esempio n. 2
0
        public string GetDisplayStyle(string enumStateString, string mustHandle)
        {
            string display = "";

            try
            {
                EnumLibrary.AdviceDisplay adDisplay = EnumLibrary.AdviceDisplay.DefaultDisplay;
                adDisplay = (EnumLibrary.AdviceDisplay)StateMgr.GetStateValueEnum(enumStateString, EnumLibrary.Business.AdviceDisplay);
                switch (adDisplay)
                {
                case EnumLibrary.AdviceDisplay.DisplayFront:
                    display = "公开";
                    break;

                case EnumLibrary.AdviceDisplay.UnDisplayFront:
                    display = "";
                    break;

                default:
                case EnumLibrary.AdviceDisplay.DefaultDisplay:
                    display = "";
                    break;
                }

                if (string.IsNullOrEmpty(mustHandle))
                {
                    mustHandle = "0";
                }
                int i = int.Parse(mustHandle);
                if (i == 1)
                {
                    display += ",必办";
                }
                else if (i == 2)
                {
                    display += ",催办";
                }

                if (display.StartsWith(","))
                {
                    display = display.Remove(0, 1);
                }
            }
            catch
            {
            }
            return(display);
        }
Esempio n. 3
0
        private void Initilize()
        {
            try
            {
                //所有当前站点的共享站点
                SitePartnership[] sps = null;

                //查找当前站点、当前栏目所创建的共享站点
                string siteID  = CDHelper.GetSiteID();
                object objEnum = (object)EnumLibrary.SitePartnership.Sharing;
                sps = IDHelper.GetSharingSites(siteID, objEnum);

                if (sps != null)
                {
                    SiteDropDownList.Items.Clear();
                    foreach (SitePartnership sp in sps)
                    {
                        ListItem item = new ListItem();
                        item.Text  = sp.ToSiteName;
                        item.Value = sp.ToSiteID;
                        SiteDropDownList.Items.Add(item);
                    }
                }

                if (SiteDropDownList.Items.Count > 0)
                {
                    SiteDropDownList.SelectedIndex = 0;
                    BindSelectForm(SiteDropDownList.SelectedValue);
                }

                //对已建立的关联关系进行查找并给赋值
                //获取当前站点siteID与channelID
                string fromSiteID    = siteID;
                string fromChannelID = ChannelID;

                ChannelPartnership[] result = IDHelper.GetChannelPartnerships(fromSiteID, fromChannelID, objEnum);

                ChannelSelected.Items.Clear();

                if (result != null && result.Length > 0)
                {
                    EnumLibrary.SiteAutoUsering useringType = (EnumLibrary.SiteAutoUsering)
                                                              StateMgr.GetStateValueEnum(result[0].EnumState, EnumLibrary.Business.SiteAutoUsering);
                    switch (useringType)
                    {
                    case EnumLibrary.SiteAutoUsering.MatchingUser:
                        IfAutoUseringCHK.Checked = true;
                        break;

                    case EnumLibrary.SiteAutoUsering.UnMatchingUser:
                        IfAutoUseringCHK.Checked = false;
                        break;

                    default:
                        break;
                    }

                    EnumLibrary.SiteSyncType syncType = (EnumLibrary.SiteSyncType)
                                                        StateMgr.GetStateValueEnum(result[0].EnumState, EnumLibrary.Business.SiteSyncType);
                    switch (syncType)
                    {
                    case EnumLibrary.SiteSyncType.ManualSync:
                        IfAutoSharingCHK.Checked = false;
                        break;

                    case EnumLibrary.SiteSyncType.AutoSync:
                        IfAutoSharingCHK.Checked = true;
                        break;

                    default:
                        break;
                    }

                    foreach (ChannelPartnership sp in result)
                    {
                        string   value = sp.ToSiteID + "→" + sp.ToChannelID;
                        string   text  = sp.ToSiteName + "→" + sp.ToChannelName;
                        ListItem item  = new ListItem(text, value);
                        ChannelSelected.Items.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                Messages.ShowMessage("页面初始化出错!出错原因:" + ex.Message);
            }
        }
Esempio n. 4
0
        void LoadArticle()
        {
            SourceTextBox.Value = GeneralConfigs.GetConfig().ArticleSourceDefault;

            if (ArticleID != null)
            {
                Article a = ThisArticle;
                TitleTextBox.Value       = a.Title;
                SubTitleTextBox.Value    = a.SubTitle;
                DescriptionTextBox.Value = a.Description;
                CreatedLabel.Text        = a.Created.ToString();
                UpdatedTextBox.Value     = a.Updated.ToString();
                ContentUrlTextBox.Value  = a.ContentUrl;
                CreatorLabel.Text        = GetAccountName(a.AccountID);
                txtInvalidDate.Value     = a.Overdue.ToString();
                AuthorTextBox.Value      = a.Author;
                IndexTextBox.Value       = a.Index.ToString();
                SourceTextBox.Value      = a.Source;
                //SourceTextBox.Disabled = true;
                if (a.KeyWord != null)
                {
                    KeywordTextBox.Value = a.KeyWord.ToString();
                }
                if (a.DescriptionKey != null)
                {
                    DescriptionKeyTextBox.Value = a.DescriptionKey.ToString();
                }
                SetDropdownList(StateDropDownList, a.State.ToString());
                EnumLibrary.HomeRecommend type = (EnumLibrary.HomeRecommend)StateMgr.GetStateValueEnum(a.EnumState, EnumLibrary.Business.HomeRecommend);
                if (type == EnumLibrary.HomeRecommend.RecommendArticle)
                {
                    IsShowCheckBox.Checked = true;
                }
                //IsShowCheckBox.Checked = (a.IsShow == 1) ? true : false;

                if (a.ContentType.ToString() != "")
                {
                    ActicleTypeDropDownList.SelectedValue = a.ContentType.ToString();
                }

                if ((TypeOfArticle)a.ContentType == TypeOfArticle.LinkArticle)
                {
                    BodyDiv.Visible = false;
                    linkSpan.Attributes["style"] = "";
                }

                chkBold.Checked        = !String.IsNullOrEmpty(a.FontWeight);
                chkItalic.Checked      = !String.IsNullOrEmpty(a.FontStyle);
                ddlColor.SelectedValue = a.Color;

                //TODO:thj add it to get the state of AllowCommentsCheckBox
                if (a.AllowComments == 1)
                {
                    AllowCommentsCheckBox.Checked = true;
                }
                else
                {
                    AllowCommentsCheckBox.Checked = false;
                }

                if (a.Content != null && a.Content != "")
                {
                    ContentTextBox.Value = We7Helper.ConvertPageBreakFromCharToVisual(a.Content);
                }

                if (!string.IsNullOrEmpty(a.ParentID) && !We7Helper.IsEmptyID(a.ParentID))
                {
                    Article pa = ArticleHelper.GetArticle(a.ParentID);
                    if (pa != null)
                    {
                        ParentArticleTitle.Text = pa.Title;
                        ParentArticleID.Value   = pa.ID;
                    }
                    ParentArticleDiv.Visible = true;
                }
            }
        }
Esempio n. 5
0
        private void Initilize()
        {
            try
            {
                WebEngine2007.WebServices.ID.SitePartnership[] sps;
                System.Text.StringBuilder sb;
                string siteID = CDHelper.GetSiteID();

                #region 绑定共享站点数据源
                //查找当前站群下所有可共享站点
                WDWebService wws   = GetWDWebService();
                WebSite[]    sites = wws.GetWebSites();

                //Tips:使用泛型集合类,可以避免检查数组越界
                IList <WebSite> sitesCopy = new List <WebSite>();
                foreach (WebSite item in sites)
                {
                    if (item.ID != siteID)
                    {
                        if (item.IpOrDomain == 1 && item.ZoneName.ToLower().Equals("localhost"))
                        {
                            item.Url = item.ZoneName + ":" + item.Port.ToString();
                        }

                        sitesCopy.Add(item);
                    }
                }
                SiteListSharing.DataSource = sitesCopy;
                SiteListSharing.DataBind();

                //查找已创建共享站点
                object objEnum = (object)EnumLibrary.SitePartnership.Sharing;
                sps = null;
                sps = IDHelper.GetSharingSites(siteID, objEnum);
                sb  = new System.Text.StringBuilder();
                EnumLibrary.SiteValidateStyle svs = EnumLibrary.SiteValidateStyle.NoMustReceived;
                if (sps != null)
                {
                    foreach (WebEngine2007.WebServices.ID.SitePartnership sp in sps)
                    {
                        svs = (EnumLibrary.SiteValidateStyle)
                              StateMgr.GetStateValueEnum(sp.EnumState, EnumLibrary.Business.SiteValidateStyle);

                        if (sb.Length > 0)
                        {
                            sb.Append(";");
                        }
                        sb.Append(sp.ToSiteID + "," + sp.ToSiteName);
                    }
                }

                //站点生效方式仅共享存在此值,且一个站点唯一
                switch (svs)
                {
                case EnumLibrary.SiteValidateStyle.MustReceived:
                    ValidateStyle.Checked = true;
                    break;

                case EnumLibrary.SiteValidateStyle.NoMustReceived:
                    ValidateStyle.Checked = false;
                    break;

                default:
                    break;
                }

                SiteSharingAddsTextBox.Text = sb.ToString();
                SiteSharingDelsTextBox.Text = string.Empty;
                #endregion

                #region 绑定接收站点数据源
                //从SitePartnership查找所有可接收站点
                objEnum = (object)EnumLibrary.SitePartnership.Sharing;
                sps     = null;
                sps     = IDHelper.GetReceivingSites(siteID, objEnum);
                SiteListReceive.DataSource = sps;
                SiteListReceive.DataBind();

                objEnum = (object)EnumLibrary.SitePartnership.Receiving;
                sps     = null;
                sps     = IDHelper.GetReceivingSites(siteID, objEnum);
                sb      = new System.Text.StringBuilder();
                if (sps != null)
                {
                    foreach (WebEngine2007.WebServices.ID.SitePartnership sp in sps)
                    {
                        if (sb.Length > 0)
                        {
                            sb.Append(";");
                        }
                        sb.Append(sp.FromSiteID + "," + sp.FromSiteName);
                    }
                }

                SiteReceiveAddsTextBox.Text = sb.ToString();
                SiteReceiveDelsTextBox.Text = string.Empty;
                #endregion

                //并获取已经设定好的数据范围,并直接赋值给
                //SiteReceiveTextBox、SiteSharingTextBox由前台分解而后对已选站点进行打勾
                //当然需要注册启动脚本
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>onDocumentLoad();</script>");
            }
            catch (Exception ex)
            {
                Messages.ShowMessage("页面初始化出错!出错原因:" + ex.Message);
            }
        }