⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 developercontroller.cs

📁 工作流的基本资料(文档资料
💻 CS
字号:
using System.Web;
using System.Collections;
using log4net;
using Castle.MonoRail.Framework;
using NetBpm.Util.Client;
using NetBpm.Workflow.Definition;
using NetBpm.Workflow.Definition.EComp;

namespace NetBpm.Web.Presentation.Controllers
{
	[Layout("default")]
	public class DeveloperController : AbstractSecureController
	{
		private static readonly ILog log = LogManager.GetLogger(typeof (DeveloperController));
		public DeveloperController()
		{
		}

		public void ShowHome()
		{
			log.Debug("showHome");
		}

		public void DeployProcess()
		{
			IDefinitionSessionLocal definitionComponent = null;
			try
			{
				definitionComponent = ServiceLocator.Instance.GetService(typeof (IDefinitionSessionLocal)) as IDefinitionSessionLocal;
				IDictionary files = Context.Request.Files;
				IEnumerator enumerator = Context.Request.Files.Keys.GetEnumerator();
				while (enumerator.MoveNext())
				{
					log.Debug("key "+enumerator.Current);
					log.Debug("value "+files[enumerator.Current]);
					HttpPostedFile postfile = (HttpPostedFile)files[enumerator.Current];
					log.Debug("name: "+postfile.FileName);

					byte[] b = new byte[postfile.InputStream.Length];
					postfile.InputStream.Read(b, 0, (int) postfile.InputStream.Length);
					definitionComponent.DeployProcessArchive(b);
				}
			} 
			catch (NpdlException npdlEx) 
			{
				IEnumerator iter = npdlEx.ErrorMsgs.GetEnumerator();
				while (iter.MoveNext())
				{
					AddMessage(iter.Current.ToString());
				}
			}
			finally
			{
				ServiceLocator.Instance.Release(definitionComponent);
			}
			Redirect("developer","showhome");
		}	
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -