예제 #1
0
 void AddClicks(string id)
 {
     if (!String.IsNullOrEmpty(id))
     {
         Article a = ArticleHelper.GetArticle(id);
         if (a != null)
         {
             a.Clicks = a.Clicks + 1;
             ArticleHelper.UpdateArticle(a, new string[] { "Clicks" });
         }
     }
 }
예제 #2
0
        public string GetProcessState(string id)
        {
            Article    a           = ArticleHelper.GetArticle(id);
            Processing ap          = ProcessHelper.GetArticleProcess(a);
            string     processText = "草稿";

            if (ap != null)
            {
                processText = ap.ProcessDirectionText + ap.ProcessText;
            }
            return(processText);
        }
예제 #3
0
        void LoadArticles()
        {
            //取出所有待审批文章,逐一判断是否具有权限
            ArticleQuery query = new ArticleQuery();

            query.State = ArticleStates.Checking;
            List <Article> GetAllArticles = ArticleHelper.QueryArtilcesByAll(query);
            List <Article> articles       = new List <Article>();

            foreach (Article article in GetAllArticles)
            {
                try
                {
                    string curLayerNOText = ProcessHelper.GetCurLayerNOText(article.ID);
                    if (curLayerNOText != "") //文章当前审批进程:类似 Channel.FirstAudit
                    {
                        string        channelID = ArticleHelper.GetArticle(article.ID).OwnerID;
                        List <string> contents  = AccountHelper.GetPermissionContents(AccountID, channelID);
                        if (contents.Contains(curLayerNOText))
                        {
                            articles.Add(article);
                        }
                    }
                }
                catch
                { }
            }

            if (articles != null)
            {
                Pager.RecorderCount = articles.Count;
            }
            else
            {
                Pager.RecorderCount = 0;
            }
            if (Pager.Count < 0)
            {
                Pager.PageIndex = 0;
            }
            Pager.FreshMyself();
            if (Pager.Count <= 0)
            {
                DataGridView.DataSource = null;
                DataGridView.DataBind();
                return;
            }

            DataGridView.DataSource = articles.GetRange(Pager.Begin, Pager.Count);
            DataGridView.DataBind();
        }
예제 #4
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);
                }
            }
        }
예제 #5
0
        string GetChannelProcessLayerNO(string id)
        {
            string  channelID = ArticleHelper.GetArticle(id).OwnerID;
            Channel ch        = ChannelHelper.GetChannel(channelID, null);

            if (ch.ProcessLayerNO != null)
            {
                return(ch.ProcessLayerNO);
            }
            else
            {
                return("");
            }
        }
예제 #6
0
        protected void GenarateButton_ServerClick(object sender, EventArgs e)
        {
            Article a        = ArticleHelper.GetArticle(ArticleID);
            string  fn       = Server.MapPath(a.Thumbnail);
            string  ext      = Path.GetExtension(fn);
            string  path     = a.Thumbnail;
            string  fileName = path.Substring(path.LastIndexOf("/") + 1, path.LastIndexOf(".") - path.LastIndexOf("/") - 1);

            string ret = GenerateThumbImage(Server.MapPath(a.Thumbnail), ext, fileName);

            if (ret != "")
            {
                Response.Redirect(We7Helper.AddParamToUrl(Request.RawUrl, "generated", ret));
            }
        }
예제 #7
0
        void LoadArticle()
        {
            Attachments = new List <Attachment>();

            if (!We7Helper.IsEmptyID(ArticleID))
            {
                Article a = ArticleHelper.GetArticle(ArticleID);
                if (a != null)
                {
                    TitleLabel.Text   = a.Title;
                    ContentLabel.Text = a.Content;
                    Attachments       = AttachmentHelper.GetAttachments(a.ID);
                }
            }
        }
예제 #8
0
        /// <summary>
        /// 添加记录过程
        /// </summary>
        /// <param name="url">文章url</param>
        protected void AddClick(string url)
        {
            //从URL获取文章SN
            string ArticleID = ArticleHelper.GetArticleIDFromURL(url);

            //string ArticleID = ArticleHelper.GetArticleIDBySN(SN);
            if (!string.IsNullOrEmpty(ArticleID))
            {
                //获取文章实体
                Article article = ArticleHelper.GetArticle(ArticleID);
                if (article != null)
                {
                    //保存日记录
                    ClickRecords cr = new ClickRecords();
                    cr.ObjectID   = article.ID;
                    cr.VisitDate  = ClickRecordHelper.ConvertIntegerFromDate(DateTime.Now);
                    cr.ObjectType = String.IsNullOrEmpty(article.ModelName)? "Article" :article.ModelName;
                    ClickRecordHelper.SaveClickRecord(cr);

                    //获取点击量报表
                    Dictionary <string, int> dictReports
                        = ClickRecordHelper.GetObjectClickReport(cr.ObjectType, article.ID);
                    //通过工厂获取具体的Helper
                    IObjectClickHelper helper = ClickHelperFactory.Create(article.ModelName);
                    helper.UpdateClicks(article.ModelName, article.ID, dictReports);
                }
                else
                {
                    AdviceInfo advice = AdviceFactory.Create().GetAdvice(ArticleID);
                    if (advice != null)
                    {
                        //保存日记录
                        ClickRecords cr = new ClickRecords();
                        cr.ObjectID   = advice.ID;
                        cr.VisitDate  = ClickRecordHelper.ConvertIntegerFromDate(DateTime.Now);
                        cr.ObjectType = "Advice";
                        ClickRecordHelper.SaveClickRecord(cr);

                        //获取点击量报表
                        Dictionary <string, int> dictReports
                            = ClickRecordHelper.GetObjectClickReport(cr.ObjectType, advice.ID);

                        IObjectClickHelper helper = ClickHelperFactory.Create(cr.ObjectType);
                        helper.UpdateClicks(cr.ObjectType, cr.ObjectID, dictReports);
                    }
                }
            }
        }
예제 #9
0
 private void btnAddArticle_Click(object sender, EventArgs e)
 {
     if (!this.dropArticleCategory.SelectedValue.HasValue)
     {
         this.ShowMsg("请选择文章分类", false);
     }
     else
     {
         ArticleInfo article = ArticleHelper.GetArticle(this.articleId);
         try
         {
             string value = article.IconUrl = this.UploadImage();
             this.hidOldImages.Value = value;
         }
         catch
         {
             this.ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false);
             return;
         }
         article.ArticleId        = this.articleId;
         article.CategoryId       = this.dropArticleCategory.SelectedValue.Value;
         article.Title            = this.txtArticleTitle.Text.Trim();
         article.Meta_Description = this.txtMetaDescription.Text.Trim();
         article.Meta_Keywords    = this.txtMetaKeywords.Text.Trim();
         article.Description      = this.txtShortDesc.Text.Trim();
         article.Content          = this.fcContent.Text;
         article.AddedDate        = DateTime.Now;
         article.IsRelease        = this.ooRelease.SelectedValue;
         ValidationResults validationResults = Validation.Validate(article, "ValArticleInfo");
         string            text2             = string.Empty;
         if (!validationResults.IsValid)
         {
             foreach (ValidationResult item in (IEnumerable <ValidationResult>)validationResults)
             {
                 text2 += Formatter.FormatErrorMessage(item.Message);
             }
             this.ShowMsg(text2, false);
         }
         else if (ArticleHelper.UpdateArticle(article))
         {
             this.ShowMsg("已经成功修改当前文章", true);
         }
         else
         {
             this.ShowMsg("修改文章失败", false);
         }
     }
 }
예제 #10
0
        /// <summary>
        /// 删除文章标签
        /// </summary>
        /// <returns></returns>
        string DeleteArticleTag()
        {
            Article a = ArticleHelper.GetArticle(ObjectID);

            if (a != null && a.Tags != null)
            {
                a.Tags = a.Tags.Replace("'" + TagName + "'", "");
                ArticleHelper.UpdateArticle(a, new string[] { "Tags" });

                //记录日志
                AddLog("编辑文章", string.Format("删除了文章【{0}】的标签【{1}】", a.Title, TagName));

                return("{\"success\":true,\"msg\":\"操作成功!\"}");
            }
            return("{\"success\":false,\"msg\":\"操作失败,请刷新后再试!\"}");
        }
예제 #11
0
        void MoveArticleNode(string id, string parentID, string index)
        {
            Article a = ArticleHelper.GetArticle(id);

            if (a != null)
            {
                int seq = 0;
                if (!string.IsNullOrEmpty(index))
                {
                    seq = int.Parse(index);
                }
                a.Index    = seq;
                a.ParentID = parentID;
                ArticleHelper.UpdateArticle(a, new string[] { "ParentID", "Index" });
            }
        }
예제 #12
0
        void QuoteArticles(string id)
        {
            Article a = ArticleHelper.GetArticle(id, null);

            a.Content     = "";
            a.ContentType = (int)TypeOfArticle.LinkArticle;

            Channel ch = ChannelHelper.GetChannel(a.OwnerID, null);

            a.ContentUrl  = ch.FullUrl + a.FullUrl;
            a.OwnerID     = QuoteOwnerID;
            a.EnumState   = ch.EnumState;
            a.ChannelName = ch.FullPath;

            ArticleHelper.AddArticle(a);
        }
예제 #13
0
        public string GetUrl(string ID)
        {
            string  url       = "/addins/ArticleEdit.aspx?id={0}";
            Article a         = ArticleHelper.GetArticle(ID, new string[] { "Title", "State" });
            string  returnurl = "";

            if (a.State != (int)ArticleStates.Checking)
            {
                returnurl = String.Format(url, ID);
            }
            else
            {
                returnurl = "javascript:alert('文章正在审核流程,不能编辑。');";
            }

            return(returnurl);
        }
예제 #14
0
        public void BindingData()
        {
            //取出所有待审批文章,逐一判断是否具有权限
            ArticleQuery query = new ArticleQuery();

            query.State = ArticleStates.Checking;
            List <Article> GetAllArticles = ArticleHelper.QueryArtilcesByAll(query);

            if (GetAllArticles == null)
            {
                return;
            }
            List <Article> articles = new List <Article>();

            foreach (Article article in GetAllArticles)
            {
                if (article.Title.Length > 25)
                {
                    article.Title = article.Title.Substring(0, 25) + "...";
                }
                try
                {
                    string curLayerNOText = ArticleProcessHelper.GetCurLayerNOText(article.ID);
                    if (curLayerNOText != "") //文章当前审批进程:类似 Channel.FirstAudit
                    {
                        string        channelID = ArticleHelper.GetArticle(article.ID).OwnerID;
                        List <string> contents  = AccountHelper.GetPermissionContents(AccountID, channelID);
                        if (contents.Contains(curLayerNOText))
                        {
                            articles.Add(article);
                        }
                    }
                }
                catch
                { }
            }
            if (articles.Count > 5)
            {
                DataGridView.DataSource = articles.GetRange(0, 5);
            }
            else
            {
                DataGridView.DataSource = articles;
            }
            DataGridView.DataBind();
        }
예제 #15
0
        /// <summary>
        /// 上传原图
        /// </summary>
        /// <param name="fileName"></param>
        void UploadAndCreateThumbnails()
        {
            try
            {
                Article article = ArticleHelper.GetArticle(ArticleID, null);
                string  relPath = article.AttachmentUrlPath + "/thumbnail/";

                string folderPath = Server.MapPath(relPath);
                //判断路径是否存在
                if (!Directory.Exists(folderPath))
                {
                    Directory.CreateDirectory(folderPath);
                }
                string ext      = Path.GetExtension(filePhotot.FileName);
                string imgName  = DateTime.Now.Ticks.ToString();
                string fileName = DateTime.Now.Ticks.ToString() + ext;
                //上传后图片的路径
                string fn = Path.Combine(folderPath, fileName);

                //上传
                filePhotot.SaveAs(fn);
                string thumbnailFilePath = Path.Combine(folderPath, imgName + "_S" + ext);

                string   imageSize = ddlSize.SelectedValue;
                string[] izeSplit  = imageSize.Split('*');
                int      width     = int.Parse(izeSplit[0]);
                int      height    = int.Parse(izeSplit[1]);

                if (File.Exists(thumbnailFilePath))
                {
                    File.Delete(thumbnailFilePath);
                }

                ImageUtils.MakeThumbnail(fn, thumbnailFilePath, width, height, "HW");

                relPath = relPath + fileName;

                article.Photos = !String.IsNullOrEmpty(article.Photos) ? (article.Photos + "|" + relPath) : relPath;

                ArticleHelper.UpdateArticle(article, new string[] { "Photos" });
            }
            catch (Exception ex)
            {
                Messages.ShowError(ex.Message);
            }
        }
예제 #16
0
        /// <summary>
        /// 加载缩略图列表
        /// </summary>
        void LoadImages()
        {
            if (ArticleID != null)
            {
                Article            a          = ArticleHelper.GetArticle(ArticleID);
                List <ImageDetail> imageList  = new List <ImageDetail>();
                string             folderPath = ExistFilePath();
                if (!Directory.Exists(folderPath))
                {
                    return;
                }
                else
                {
                    List <ThumbnailConfig>  configList = GetAllThumbnailConfigs();
                    System.IO.DirectoryInfo dir        = new System.IO.DirectoryInfo(folderPath);
                    //string[] fields = new string[] { "ChannelFolder" };
                    //Channel ch = ChannelHelper.GetChannel(OwnerID, fields);
                    //string aid = Helper.GUIDToFormatString(ArticleID);
                    StringBuilder sb = new StringBuilder();
                    foreach (System.IO.FileInfo fi in dir.GetFiles())
                    {
                        if (Server.MapPath(a.Thumbnail) == fi.FullName)
                        {
                            continue;
                        }
                        ImageDetail image = new ImageDetail();
                        image.ImagePath = string.Format("/{0}/thumbnail/{1}", !String.IsNullOrEmpty(a.AttachmentUrlPath)?a.AttachmentUrlPath.Trim('/'):"", fi.Name);

                        image.ImagePath = image.ImagePath.Replace("\\", "/");
                        string          idChar = fi.Name.Substring(fi.Name.LastIndexOf("_") + 1, fi.Name.LastIndexOf(".") - fi.Name.LastIndexOf("_") - 1);
                        ThumbnailConfig config = SearchThumbnailConfig(configList, idChar);
                        image.FileName = fi.Name;
                        if (config != null)
                        {
                            image.Name = config.Name;
                            image.Tag  = config.Tag;
                            imageList.Add(image);
                        }
                    }
                }

                ImagesRepeater.DataSource = imageList;
                ImagesRepeater.DataBind();
            }
        }
예제 #17
0
        void InitControls()
        {
            SignPanelDiv.Visible = false;
            string curLayerNOText = "";

            if (!IsAdivice)
            {
                curLayerNOText = ProcessHelper.GetCurLayerNOText(ObjectID);
            }
            else
            {
                curLayerNOText = ProcessHelper.GetCurLayerNOAdviceText(ObjectID);
            }

            if (curLayerNOText != "") //文章当前审批进程:类似 Channel.FirstAudit
            {
                string channelID = "";
                if (!IsAdivice)
                {
                    channelID = ArticleHelper.GetArticle(ObjectID).OwnerID;
                }
                else
                {
                    channelID = AdviceHelper.GetAdvice(ObjectID).TypeID;
                }

                List <string> contents = AccountHelper.GetPermissionContents(AccountID, channelID);
                if (contents.Contains(curLayerNOText))
                {
                    ApproveDate.Text = DateTime.Now.ToString("yyyy年MM月dd日");
                    ApproveName.Text = AccountHelper.GetAccount(AccountID, new string[] { "LastName" }).LastName;
                    if (!IsAdivice)
                    {
                        Article article = ArticleHelper.GetArticle(ObjectID);
                        SummaryLabel.Text = "审核路径:" + ProcessingHelper.CreateArticleFlowPathHtml(article, TargetSites);
                    }
                    else
                    {
                        Advice advice = AdviceHelper.GetAdvice(ObjectID);
                        SummaryLabel.Text = "审核路径:" + ProcessingHelper.CreateAdviceFlowPathHtml(advice, TargetSites);
                    }
                    SignPanelDiv.Visible = true;
                }
            }
        }
예제 #18
0
 /// <summary>
 /// 验证当前控件
 /// </summary>
 protected virtual void ValidateControl()
 {
     if (ArticleID != null && ArticleID != "")
     {
         Visible = ArticleHelper.GetArticle(ArticleID).AllowComments == 1;
     }
     else
     {
         if (ArticleIDByRedirect != null && ArticleIDByRedirect != "")
         {
             Visible = true;
         }
         else
         {
             Visible = false;
         }
     }
 }
예제 #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindAttachmentList();
            }
            //多文件上传
            //string jscript = "function UploadComplete(){" + this.Page.ClientScript.GetPostBackEventReference(LinkButton1, "") + "};";
            //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "FileCompleteUpload", jscript, true);
            Article a = ArticleHelper.GetArticle(ArticleID);

            Session["ARTICLEDETAIL_CHANNELFILEPATH"] = a.AttachmentUrlPath;

            if (Request["count"] != null && Request["count"].ToString() != "")
            {
                Messages.ShowMessage("您成功上传" + Request["count"].ToString() + "个图片");
            }
        }
예제 #20
0
        private void btnPicDelete_Click(object sender, EventArgs e)
        {
            ArticleInfo article = ArticleHelper.GetArticle(articleId);

            try
            {
                ResourcesHelper.DeleteImage(article.IconUrl);
            }
            catch
            {
            }
            article.IconUrl = (string)(imgPic.ImageUrl = null);
            if (ArticleHelper.UpdateArticle(article))
            {
                btnPicDelete.Visible = !string.IsNullOrEmpty(imgPic.ImageUrl);
                imgPic.Visible       = !string.IsNullOrEmpty(imgPic.ImageUrl);
            }
        }
예제 #21
0
        public override object Do(PanelContext data)
        {
            try
            {
                List <DataKey> dataKeys = data.State as List <DataKey>;
                if (dataKeys != null)
                {
                    foreach (DataKey key in dataKeys)
                    {
                        string  id = key["ID"] as string;
                        Article a  = ArticleHelper.GetArticle(id, null);

                        if (a != null && a.State != 2)
                        {
                            a.State = 0;

                            if (!String.IsNullOrEmpty(a.ModelXml))
                            {
                                DataSet ds = BaseDataProvider.CreateDataSet(data.Model);
                                BaseDataProvider.ReadXml(ds, a.ModelXml);

                                if (ds.Tables[data.Table.Name].Rows.Count > 0 && ds.Tables[data.Table.Name].Columns.Contains("State"))
                                {
                                    ds.Tables[data.Table.Name].Rows[0]["State"] = 0;
                                    a.ModelXml = BaseDataProvider.GetXml(ds);
                                }
                            }
                            if (DbHelper.CheckTableExits(data.Table.Name))
                            {
                                DbHelper.ExecuteSql(String.Format("UPDATE [{0}] SET [State]=0 WHERE [ID]='{1}'", data.Table.Name, id));
                            }
                            ArticleHelper.UpdateArticle(a, new string[] { "State", "ModelXml" });
                        }
                    }
                }
                UIHelper.SendMessage("取消发布成功");
                CacheRecord.Create(data.ModelName).Release();
            }
            catch (Exception ex)
            {
                UIHelper.SendError("取消发布失败:" + ex.Message);
            }
            return(null);
        }
예제 #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <CouponInfo> coupon = new List <CouponInfo>();

            coupon = CouponHelper.GetHishop_Coupons();
            foreach (CouponInfo co in coupon)
            {
                ListItem item = new ListItem();
                item.Text  = co.Name;
                item.Value = co.CouponId.ToString();
                DDLcoupon.Items.Add(item);
            }
            if (!int.TryParse(this.Page.Request.QueryString["articleId"], out this.articleId))
            {
                base.GotoResourceNotFound();
            }
            else
            {
                this.btnAddArticle.Click += new EventHandler(this.btnAddArticle_Click);
                this.btnPicDelete.Click  += new EventHandler(this.btnPicDelete_Click);
                if (!this.Page.IsPostBack)
                {
                    this.dropArticleCategory.DataBind();
                    ArticleInfo article = ArticleHelper.GetArticle(this.articleId);
                    if (article == null)
                    {
                        base.GotoResourceNotFound();
                    }
                    else
                    {
                        Globals.EntityCoding(article, false);
                        this.txtArticleTitle.Text              = article.Title;
                        this.txtMetaDescription.Text           = article.MetaDescription;
                        this.txtMetaKeywords.Text              = article.MetaKeywords;
                        this.imgPic.ImageUrl                   = article.IconUrl;
                        this.txtShortDesc.Text                 = article.Description;
                        this.fcContent.Text                    = article.Content;
                        this.dropArticleCategory.SelectedValue = new int?(article.CategoryId);
                        this.btnPicDelete.Visible              = !string.IsNullOrEmpty(this.imgPic.ImageUrl);
                        this.ckrrelease.Checked                = article.IsRelease;
                    }
                }
            }
        }
예제 #23
0
        string LoadMyTags()
        {
            string tagLi = "<LI><IMG class=Icon height=16 src=\"/admin/images/icon_globe.gif\" width=16 alt=\"{0}\">{1}<A class=\"Del\" title=\"{0}\" href=\"javascript:void(0)\">[x]</A> </LI>";

            StringBuilder sb = new StringBuilder();

            if (!We7Helper.IsEmptyID(ArticleID))
            {
                Article a = ArticleHelper.GetArticle(ArticleID, null);

                List <string> tagsList = ArticleHelper.GetTags(ArticleID);
                foreach (string str in tagsList)
                {
                    sb.AppendLine(string.Format(tagLi, str, str.Length > 10 ? We7.Framework.Util.Utils.CutString(str, 0, 10) + ".." : str));
                }
            }

            return(sb.ToString());
        }
예제 #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Article a = ArticleHelper.GetArticle(ArticleID);

            if (a != null &&
                !String.IsNullOrEmpty(a.ModelName) &&
                !Constants.ArticleModelName.Equals(a.ModelName, StringComparison.OrdinalIgnoreCase) &&
                String.Compare(a.ModelName, "Article", true) == 0)
            {
                Response.Redirect(String.Format("~/Admin/Addins/ModelEditor.aspx?notiframe={2}&model={0}&ID={1}", a.ModelName, a.ID, Request["notiframe"]), true);
            }

            if (a != null)
            {
                Channel ch = ChannelHelper.GetChannel(OwnerID, null);
                if (ch != null &&
                    !String.IsNullOrEmpty(ch.ModelName) &&
                    String.Compare(ch.ModelName, "Article", true) != 0 &&
                    String.Compare(ch.ModelName, Constants.ArticleModelName) != 0)
                {
                    Response.Redirect(String.Format("~/Admin/Addins/ModelEditor.aspx?notiframe={3}&model={0}&ID={1}&oid={2}", ch.ModelName, We7Helper.CreateNewID(), ch.ID, Request["notiframe"]), true);
                }

                Processing    p        = ProcessHelper.GetArticleProcess(a);
                List <string> contents = AccountHelper.GetPermissionContents(AccountID, a.OwnerID);
                if (a != null && a.AccountID != AccountID && a.State == (int)ArticleStates.Checking && !contents.Contains(p.CurLayerNOToChannel))
                {
                    MessageLiteral.Text = "<p class='alertInfo' >本篇文章正在审核流程中,您不能进行编辑。</p>";
                    //Response.End();
                }
                else
                {
                    MenuTabLabel.Text = BuildNavString();
                }
            }
            else
            {
                MenuTabLabel.Text = BuildNavString();
            }

            PagePathLiteral.Text = BuildPagePath();
        }
예제 #25
0
        public override DataRow Get(PanelContext data)
        {
            DataRow row = null;

            if (data.DataKey["ID"] != null)
            {
                Article article = ArticleHelper.GetArticle(data.DataKey["ID"].ToString());
                if (article != null && !String.IsNullOrEmpty(article.ModelXml))
                {
                    DataSet ds = CreateDataSet(data.Model);
                    ReadXml(ds, article.ModelXml);
                    row = ds.Tables[0].Rows.Count > 0 ? ds.Tables[0].Rows[0] : null;
                    if (row != null)
                    {
                        row[OBJECTCOLUMN] = article;
                    }
                }
            }
            return(row);
        }
예제 #26
0
        /// <summary>
        /// 构建当前位置导航
        /// </summary>
        /// <returns></returns>
        string BuildPagePath()
        {
            string  pos         = "<a href='/admin/' target='_parent'>开始</a> > <a href='../AddIns/Articlelist.aspx?notiframe=1'>文章</a> >  <a href={0}>{1}</a> > {2}";
            string  channelName = "";
            string  article     = "发布文章";
            Channel ch          = ChannelHelper.GetChannel(OwnerID, null);

            if (ch != null)
            {
                channelName = ch.Name;
                if (ArticleID != null)
                {
                    string  url         = "#";
                    string  title       = "";
                    string  editArticle = " 编辑信息“ <a href={0} target=_blank>{1}</a>”";
                    Article a           = ArticleHelper.GetArticle(ArticleID);
                    if (a != null)
                    {
                        if (a.Title.Length < 10)
                        {
                            title = a.Title;
                        }
                        else
                        {
                            title = a.Title.Substring(0, 5) + "…" + a.Title.Substring(a.Title.Length - 5);
                        }

                        url     = a.GetFullUrlWithChannel(ch.FullUrl);
                        article = string.Format(editArticle, url, title);
                    }
                }
                string url2 = "../AddIns/ArticleList.aspx?oid=" + OwnerID;
                if (MasterPageIs == MasterPageMode.FullMenu)
                {
                    url2 = "../AddIns/ArticleList.aspx?notiframe=1&oid=" + OwnerID;
                }
                return(string.Format(pos, url2, "[栏目]" + channelName, article));
            }

            return("");
        }
예제 #27
0
        /// <summary>
        /// 处理流转
        /// </summary>
        void HandleProcessAction()
        {
            ProcessAction action = ProcessAction.Next;

            if (ActionTextBox.Text != "")
            {
                action = (ProcessAction)int.Parse(ActionTextBox.Text);
            }
            Object oldObject   = null;
            bool   dataSuccess = true;

            if (!IsAdivice)
            {
                oldObject = ArticleHelper.GetArticle(ObjectID);
                Article oa = new Article();
                oa     = (Article)oldObject;
                action = UpdateArticleProcessState(action, oa);
                Article a = ArticleHelper.GetArticle(ObjectID);
                dataSuccess = TransferSitesFlow(action, a);
            }
            else
            {
                oldObject = AdviceHelper.GetAdvice(ObjectID);
                Advice a = new Advice();
                a = (Advice)oldObject;
                UpdateAdviceProcessState(action, a);
                dataSuccess = true;
            }

            if (!dataSuccess)
            {
                RollBackProcessState(oldObject);
                Messages.ShowError("无法完成操作!跨站数据传递时出现错误。");
            }
            else
            {
                Messages.ShowMessage("您的操作已成功执行!");
                SignPanelDiv.Visible = false;
                ProcessHistoryList1.Binding();
            }
        }
예제 #28
0
        protected void BindData()
        {
            Article article = ArticleHelper.GetArticle(ArticleID);

            if (!String.IsNullOrEmpty(article.Photos))
            {
                string[] ss = article.Photos.Split('|');
                for (int i = 0; i < ss.Length; i++)
                {
                    string s = ss[i];
                    ss[i] = s.Substring(0, s.LastIndexOf(".")) + "_S" + s.Substring(s.LastIndexOf("."));
                }
                dlstPhotos.DataSource = ss;
                dlstPhotos.DataBind();
            }
            else
            {
                dlstPhotos.DataSource = null;
            }
            dlstPhotos.DataBind();
        }
예제 #29
0
        private string GetProcessState(string id)
        {
            if (!ChannelProcess(id))
            {
                return("[流转历程]");
            }
            Article a = ArticleHelper.GetArticle(id);

            if (a != null && a.State != 2)
            {
                return("[流转历程]");
            }
            Processing ap          = ArticleProcessHelper.GetArticleProcess(a);
            string     processText = "草稿";

            if (ap != null)
            {
                processText = ap.ProcessDirectionText + ap.ProcessText;
            }
            return(processText);
        }
예제 #30
0
        protected void ChannelDropDownList_SelectedIndexChanged(object sender, EventArgs e)
        {
            string ownerId = OwnerID;

            if (ownerId == null)
            {
                ownerId = ChannelDropDownList.SelectedValue;
            }
            if (ChannelHelper.GetChannel(ownerId, null).Process == "1")
            {
                if (ArticleID != null && ArticleID != "")
                {
                    Article a = ArticleHelper.GetArticle(ArticleID);
                    if (a.ProcessState.Trim() != "99")
                    {
                        StateDropDownList.Enabled = false;
                    }
                }
                StateDropDownList.Items[0].Selected = false;
                StateDropDownList.Items[1].Selected = true;
            }
        }