protected void EgvContents_RowCommand(object sender, CommandEventArgs e)
        {
            int    num         = DataConverter.CLng(e.CommandArgument.ToString());
            string commandName = e.CommandName;

            if (commandName != null)
            {
                if (!(commandName == "CreateHtml"))
                {
                    if (!(commandName == "DeleteHtml"))
                    {
                        return;
                    }
                }
                else
                {
                    HtmlContent content = new HtmlContent();
                    content.CreateMethod          = CreateContentType.CreateByGeneralId;
                    content.NodeIdArray           = string.Empty;
                    content.ContentGeneralIdArray = e.CommandArgument.ToString();
                    content.CommonCreateHtml();
                    BasePage.ResponseRedirect("CreateHtmlProgress.aspx?workId=" + content.CreateId);
                    return;
                }
                this.DeleteHtml(num.ToString());
                this.EgvContents.DataBind();
            }
        }
Beispiel #2
0
        protected void BtnStopCreate_Click(object sender, EventArgs e)
        {
            string nodeValue = XmlManage.Instance("Config/CreateCollectionWork.config", XmlType.File).GetNodeValue("CollectionWork/WorkId");

            if (base.Application[nodeValue] != null)
            {
                CollectionProgress progress = base.Application[nodeValue] as CollectionProgress;
                progress.CreateThread.Abort();
                base.Application.Remove(nodeValue);
                if (DataConverter.CBoolean(this.HdnIsCreateHtml.Value))
                {
                    string nodeIds = "";
                    string str3    = BasePage.RequestString("ItemIds");
                    if (!string.IsNullOrEmpty(str3))
                    {
                        if (str3.Contains(","))
                        {
                            foreach (string str4 in str3.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                            {
                                nodeIds = GetNodeIs(nodeIds, str4);
                            }
                        }
                        else
                        {
                            nodeIds = GetNodeIs(nodeIds, str3);
                        }
                    }
                    HtmlContent content = new HtmlContent();
                    content.CreateMethod = CreateContentType.CreateByNotCreate;
                    content.NodeIdArray  = nodeIds;
                    content.CommonCreateHtml();
                }
            }
        }
        protected void BtnCreateAll_Click(object sender, EventArgs e)
        {
            HtmlContent content = new HtmlContent();

            content.CreateMethod = CreateContentType.CreateAll;
            content.NodeIdArray  = BasePage.RequestString("NodeID", string.Empty);
            content.CommonCreateHtml();
            BasePage.ResponseRedirect("CreateHtmlProgress.aspx?workId=" + content.CreateId);
        }
Beispiel #4
0
        protected void EBtnNotCreate_Click(object sender, EventArgs e)
        {
            HtmlContent content = new HtmlContent();

            content.CreateMethod = CreateContentType.CreateByNotCreate;
            content.NodeIdArray  = this.GetCreateHtmlNodesList(this.LstNodes);
            content.CommonCreateHtml();
            BasePage.ResponseRedirect("CreateHtmlProgress.aspx?workId=" + content.CreateId);
        }
Beispiel #5
0
 protected void EBtnTopNew_Click(object sender, EventArgs e)
 {
     if (base.IsValid)
     {
         HtmlContent content = new HtmlContent();
         content.CreateMethod = CreateContentType.CreateLatest;
         content.NodeIdArray  = this.GetCreateHtmlNodesList(this.LstNodes);
         content.LatestNumber = DataConverter.CLng(this.TxtTopNew.Text);
         content.CommonCreateHtml();
         BasePage.ResponseRedirect("CreateHtmlProgress.aspx?workId=" + content.CreateId);
     }
 }
Beispiel #6
0
 protected void EBtnAppointId_Click(object sender, EventArgs e)
 {
     if (base.IsValid)
     {
         HtmlContent content = new HtmlContent();
         content.CreateMethod          = CreateContentType.CreateByGeneralId;
         content.NodeIdArray           = this.GetCreateHtmlNodesList(this.LstNodes);
         content.ContentGeneralIdArray = this.TxtAppointId.Text;
         content.CommonCreateHtml();
         BasePage.ResponseRedirect("CreateHtmlProgress.aspx?workId=" + content.CreateId);
     }
 }
Beispiel #7
0
 protected void EBtnDate_Click(object sender, EventArgs e)
 {
     if (base.IsValid)
     {
         HtmlContent content = new HtmlContent();
         content.CreateMethod     = CreateContentType.CreateByUpdateTime;
         content.NodeIdArray      = this.GetCreateHtmlNodesList(this.LstNodes);
         content.ContentBeginTime = DataConverter.CDate(this.DpkBeginDate.Text);
         content.ContentEndTime   = DataConverter.CDate(this.DpkEndDate.Text);
         content.CommonCreateHtml();
         BasePage.ResponseRedirect("CreateHtmlProgress.aspx?workId=" + content.CreateId);
     }
 }
Beispiel #8
0
 protected void EBtnBoundId_Click(object sender, EventArgs e)
 {
     if (base.IsValid)
     {
         HtmlContent content = new HtmlContent();
         content.NodeIdArray  = this.GetCreateHtmlNodesList(this.LstNodes);
         content.CreateMethod = CreateContentType.CreateBetweenId;
         content.ContentMinId = DataConverter.CLng(this.TxtBeginId.Text);
         content.ContentMaxId = DataConverter.CLng(this.TxtEndId.Text);
         content.CommonCreateHtml();
         BasePage.ResponseRedirect("CreateHtmlProgress.aspx?workId=" + content.CreateId);
     }
 }
        protected void BtnCreate_Click(object sender, EventArgs e)
        {
            StringBuilder selectList = this.EgvContents.SelectList;

            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要删除的项目!</li>", "ContentHtml.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
            else
            {
                HtmlContent content = new HtmlContent();
                content.CreateMethod          = CreateContentType.CreateByGeneralId;
                content.NodeIdArray           = string.Empty;
                content.ContentGeneralIdArray = selectList.ToString();
                content.CommonCreateHtml();
                BasePage.ResponseRedirect("CreateHtmlProgress.aspx?workId=" + content.CreateId);
            }
        }
        public ProgressInfo AcquireProgress()
        {
            ProgressInfo info      = new ProgressInfo();
            string       nodeValue = XmlManage.Instance("Config/CreateCollectionWork.config", XmlType.File).GetNodeValue("CollectionWork/WorkId");

            if (base.Application[nodeValue] == null)
            {
                return(null);
            }
            CollectionProgress progress = (CollectionProgress)base.Application[nodeValue];

            info.IsInput       = progress.IsInput;
            info.Message       = progress.CollectionMessage;
            info.CollectionEnd = false;
            info.ErrorMessage  = progress.ErrorInfo;
            info.IsCreateHtml  = progress.IsCreateHtml;
            info.ItemId        = progress.ItemId;
            if (!string.IsNullOrEmpty(info.ErrorMessage))
            {
                info.CollectionEnd = true;
                base.Application.Remove(nodeValue);
                return(info);
            }
            if (progress.IsInput)
            {
                if (progress.CollectionCompleted == progress.CollectionCount)
                {
                    info.Completed     = progress.CollectionCompleted;
                    info.ExecutionTime = ((TimeSpan)(DateTime.Now - progress.CollectionStartTime)).ToString();
                    info.Id            = progress.CreateId;
                    info.Count         = progress.CollectionCount;
                    info.Completed     = progress.CollectionCompleted;
                    info.Progress      = "100%";
                    if (progress.ItemCompleted == progress.ItemCount)
                    {
                        info.CollectionEnd = true;
                        base.Application.Remove(nodeValue);
                    }
                    if (info.IsCreateHtml)
                    {
                        string nodeIds = "";
                        string itemId  = info.ItemId;
                        if (!string.IsNullOrEmpty(itemId))
                        {
                            if (itemId.Contains(","))
                            {
                                foreach (string str4 in itemId.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                                {
                                    nodeIds = GetNodeIs(nodeIds, str4);
                                }
                            }
                            else
                            {
                                nodeIds = GetNodeIs(nodeIds, itemId);
                            }
                        }
                        info.Message = "请稍后,准备生成采集文章...";
                        HtmlContent content = new HtmlContent();
                        content.CreateMethod = CreateContentType.CreateByNotCreate;
                        content.NodeIdArray  = nodeIds;
                        info.CreateWorkId    = Guid.NewGuid().ToString();
                        content.CommonCreateHtml();
                    }
                    return(info);
                }
                info.Completed     = progress.CollectionCompleted;
                info.Id            = progress.CreateId;
                info.Count         = progress.CollectionCount;
                info.ExecutionTime = "0:00:00";
                info.Progress      = "0";
                if (progress.CollectionCompleted != 0)
                {
                    info.Progress = (((double)progress.CollectionCompleted) / ((double)progress.CollectionCount)).ToString("p");
                    TimeSpan span2 = (TimeSpan)(DateTime.Now - progress.CollectionStartTime);
                    info.ExecutionTime = span2.Hours.ToString() + ":" + span2.Minutes.ToString() + ":" + span2.Seconds.ToString();
                }
            }
            return(info);
        }