📄 getcreateprogressservice.cs
字号:
namespace PowerEasy.WebSite.Admin.Collection
{
using PowerEasy.Collection;
using PowerEasy.Components;
using PowerEasy.Enumerations;
using System;
using System.ComponentModel;
using System.Web.Script.Services;
using System.Web.Services;
[WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1), ScriptService, WebService(Namespace="http://tempuri.org/"), ToolboxItem(false)]
public class GetCreateProgressService : WebService
{
[WebMethod]
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;
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);
}
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;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -