コード例 #1
0
        private IRequestCommand CollectNavigationCommand(MemberInfo mi)
        {
            ControllerNavigationTargetAttribute attribute = AttributeHelper.GetCustomAttribute <ControllerNavigationTargetAttribute>(mi);

            PageNavigateCommandBase result = null;

            if (attribute != null)
            {
                if (attribute.TransferType == ControllerNavigationType.Transfer)
                {
                    result = new TransferCommand(attribute.Name);
                }
                else
                {
                    result = new RedirectCommand(attribute.Name);
                }

                result.NavigateUrl = attribute.Url;

                if (ResourceUriSettings.GetConfig().Features.ContainsKey(attribute.FeatureName))
                {
                    result.Feature = ResourceUriSettings.GetConfig().Features[attribute.FeatureName].Feature;
                }
            }

            return(result);
        }
コード例 #2
0
        private static void InitTraceControlEntry(IAttributeAccessor target, string resourceID, string processID)
        {
            target.SetAttribute("resourceID", resourceID);
            target.SetAttribute("feature", GetWindowFeature().ToWindowFeatureClientString());

            ResourceUriSettings settings = ResourceUriSettings.GetConfig();

            string path = "/MCSWebApp/OACommonPages/AppTrace/appTraceViewer.aspx";

            if (settings.Paths.ContainsKey("appTrace"))
            {
                path = settings.Paths["appTrace"].Uri.ToString();
            }

            target.SetAttribute("href",
                                string.Format(path + "?resourceID={0}&processID={1}&{2}={3}",
                                              resourceID,
                                              processID,
                                              GlobalizationWebHelper.LanguageParameterName,
                                              HttpUtility.UrlEncode(GlobalizationWebHelper.GetCurrentHandlerLanguageID())));

            target.SetAttribute("target", "WfTrace" + resourceID.Replace("-", string.Empty));

            target.SetAttribute("onclick", "onWfTraceButtonClick()");
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string resourceID = Request.QueryString["resourceID"];

            WfProcessCurrentInfoCollection infos =
                WfProcessCurrentInfoAdapter.Instance.Load(false,
                                                          builder => builder.AppendItem("RESOURCE_ID", resourceID));

            string newUrl  = "";
            string signStr = "";
            string keyName = "";

            if (infos.Count > 0)
            {
                keyName = "appTrace";
            }
            else
            {
                keyName = "oldAppTrace";
            }
            if (ResourceUriSettings.GetConfig().Paths[keyName].Uri.ToString().IndexOf('?') != -1)
            {
                signStr = "{0}&{1}";
            }
            else
            {
                signStr = "{0}?{1}";
            }

            newUrl = string.Format(signStr
                                   , ResourceUriSettings.GetConfig().Paths[keyName].Uri.ToString()
                                   , Request.QueryString.ToString());
            Response.Redirect(newUrl);
        }
コード例 #4
0
        /// <summary>
        /// 获取应用对应的窗口控制代码
        /// </summary>
        /// <param name="task">消息对象</param>
        /// <returns>用于JS的弹出窗口控制代码</returns>
        internal static string GetFeature(string appName, TaskLevel level, TaskStatus status, string url)
        {
            string feature   = string.Empty;
            string featureID = string.Empty;

            //判断消息级别,同时消息状态是阅
            //老系统中的url会自动添加 http:// 字符串,新系统中没有
            if ((level < TaskLevel.Normal && status == TaskStatus.Yue && !url.StartsWith("http://")) ||
                url.StartsWith("/MCSWebApp/MCSOAPortal/TaskList/NoticeTaskDetail.aspx"))
            {
                if (ResourceUriSettings.GetConfig().Features.ContainsKey("MessageRemind"))
                {
                    feature = ResourceUriSettings.GetConfig().Features["MessageRemind"].Feature.ToWindowFeatureClientString();
                }
                else
                {
                    feature = "width=800,height=600,left=' + ((window.screen.width - 800) / 2) + ',top=' + ((window.screen.height - 600) / 2) + ',resizable=yes,scrollbars=yes,toolbar=no,location=no";
                }
            }
            else
            { //Note:获取js的窗口形态(待办)ApplicationInfoConfig.GetConfig().Applications.ContainsKey(appName) ? ApplicationInfoConfig.GetConfig().Applications[appName].FeatureID : string.Empty;
                feature = "width=800,height=600,left=' + ((window.screen.width - 800) / 2) + ',top=' + ((window.screen.height - 600) / 2) + ',resizable=yes,scrollbars=yes,toolbar=no,location=no";
            }
            return(feature);
        }
コード例 #5
0
        protected void btnSync_Click(object sender, EventArgs e)
        {
            InvokeWebServiceJob job = InvokeWebServiceJobAdapter.Instance.LoadSingleDataByJobID(JobID);

            if (job == null)
            {
                string url        = ResourceUriSettings.GetConfig().Paths["pcServiceAdSync"].Uri.ToString();
                string methodName = "StartADReverseSynchronize";
                WfServiceOperationParameterCollection parameters = new WfServiceOperationParameterCollection();
                parameters.Add(new WfServiceOperationParameter()
                {
                    Name = "taskID", Type = WfSvcOperationParameterType.RuntimeParameter, Value = "taskID"
                });                                                                                                                                                           //特殊用法
                string name = "AD逆同步-用户发起";

                job = Util.CreateImmediateJob(JobID, name, "AD→PC", url, methodName, parameters);
                InvokeWebServiceJobAdapter.Instance.Update(job);
            }

            //检查是否有任务已经进入执行序列
            if (SysTaskAdapter.Instance.Load(w => { w.AppendItem("CATEGORY", "AD→PC"); }).Any())
            {
                BannerNotice notic = (BannerNotice)Master.FindControl("notice");
                notic.Text = ("检测到已经存在一个未执行或执行中的同步任务,请等待任务结束或者终止任务后重试。");
            }
            else
            {
                SysTask task = job.ToSysTask();
                task.Url    = this.ResolveUrl("~/lists/ADReverseLog.aspx?id=" + task.TaskID);
                task.Source = MCS.Library.Principal.DeluxeIdentity.CurrentUser;
                SysTaskAdapter.Instance.Update(task);
            }
        }
コード例 #6
0
        /// <summary>
        /// 获取应用对应的窗口控制代码
        /// </summary>
        /// <param name="task">消息对象</param>
        /// <returns>用于JS的弹出窗口控制代码</returns>
        internal static string GetFeature(UserTask task)
        {
            string appName   = task.ApplicationName;
            string feature   = string.Empty;
            string featureID = string.Empty;

            //判断消息级别,同时消息状态是阅
            //老系统中的url会自动添加 http:// 字符串,新系统中没有
            if ((task.Level < TaskLevel.Normal && task.Status == TaskStatus.Yue && !task.Url.StartsWith("http://")) ||
                task.Url.StartsWith("/SinoOceanWebApp/SinoOceanOAPortal/TaskList/NoticeTaskDetail.aspx"))
            {
                if (ResourceUriSettings.GetConfig().Features.ContainsKey("MessageRemind"))
                {
                    feature = ResourceUriSettings.GetConfig().Features["MessageRemind"].Feature.ToWindowFeatureClientString();
                }
                else
                {
                    feature = "width=800,height=600,left=' + ((window.screen.width - 800) / 2) + ',top=' + ((window.screen.height - 600) / 2) + ',resizable=yes,scrollbars=yes,toolbar=no,location=no";
                }
            }
            else
            {
                featureID = string.Empty; //ApplicationInfoConfig.GetConfig().Applications.ContainsKey(appName) ? ApplicationInfoConfig.GetConfig().Applications[appName].FeatureID : string.Empty;
                if (task.Url.StartsWith("http://"))
                {
                    switch (appName)
                    {
                    case "Cooperation":
                        featureID = "shouwendengji";
                        break;

                    case "SHOUWEN":
                        featureID = "shouwendengji";
                        break;

                    case "GW_FAWEN":
                        featureID = "oldfawen";
                        break;

                    case "GW_QIANBAO":
                        featureID = "oldqianbao";
                        break;

                    case "ZS_DUBAN":
                        featureID = "shouwendengji";
                        break;
                    }
                }

                if (string.IsNullOrEmpty(featureID) == false)
                {
                    if (ResourceUriSettings.GetConfig().Features.ContainsKey(featureID))
                    {
                        feature = ResourceUriSettings.GetConfig().Features[featureID].Feature.ToWindowFeatureClientString();
                    }
                }
            }
            return(feature);
        }
コード例 #7
0
        public static string GetRefreshBridgeScript()
        {
            string html = string.Empty;

            if (ResourceUriSettings.GetConfig().Paths.ContainsKey("refreshBridge"))
            {
                html = string.Format("<iframe style=\"display:none\" src=\"{0}\"></iframe>",
                                     ResourceUriSettings.GetConfig().Paths["refreshBridge"].Uri.ToString());
            }

            return(html);
        }
コード例 #8
0
        protected override void OnPreRender(EventArgs e)
        {
            this.relativeLink.Style["display"] = "inline";

            string template = "/MCSWebApp/PermissionCenter/lists/AppRoles.aspx?appCodeName={0}";

            UriConfigurationCollection urls = ResourceUriSettings.GetConfig().Paths;

            if (urls.ContainsKey("appRoles"))
            {
                template = urls["appRoles"].Uri.ToString();
            }

            this.relativeLink.HRef = string.Format(template, ddlApps.SelectedValue);

            base.OnPreRender(e);
        }
コード例 #9
0
ファイル: WfStatusControl.cs プロジェクト: wooln/AK47Source
        private static void InitTraceControlEntry(IAttributeAccessor target, string resourceID, string processID)
        {
            target.SetAttribute("resourceID", resourceID);

            ResourceUriSettings settings = ResourceUriSettings.GetConfig();

            string path = "/MCSWebApp/OACommonPages/AppTrace/appTraceViewer.aspx";

            if (settings.Paths.ContainsKey("appTrace"))
            {
                path = settings.Paths["appTrace"].Uri.ToString();
            }

            target.SetAttribute("href",
                                string.Format(path + "?resourceID={0}&processID={1}",
                                              resourceID, processID));

            target.SetAttribute("target", "WfTrace" + resourceID.Replace("-", string.Empty));

            target.SetAttribute("onclick", "onWfTraceButtonClick()");
        }
コード例 #10
0
        private static WindowFeature GetWindowFeature()
        {
            WindowFeature feature = null;

            if (ResourceUriSettings.GetConfig().Features.ContainsKey("viewProcess"))
            {
                feature = ResourceUriSettings.GetConfig().Features["viewProcess"].Feature;
            }
            else
            {
                feature = new WindowFeature();

                feature.Width          = 800;
                feature.Height         = 650;
                feature.Resizable      = true;
                feature.ShowAddressBar = false;
                feature.ShowMenuBar    = false;
                feature.Center         = true;
                feature.ShowStatusBar  = false;
            }

            return(feature);
        }
コード例 #11
0
ファイル: Transfer.ashx.cs プロジェクト: wooln/AK47Source
        public void ProcessRequest(HttpContext context)
        {
            context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            switch (context.Request.QueryString["type"])
            {
            case "processKey":
                string url;
                if (ResourceUriSettings.GetConfig().Paths["workflowDesigner"] != null)
                {
                    url = ResourceUriSettings.GetConfig().Paths["workflowDesigner"].Uri.ToString();
                }
                else
                {
                    url = "/MCSWebApp/WorkflowDesigner/default.aspx";
                }

                url += "?processDescKey=" + context.Server.UrlEncode(context.Request.QueryString["id"]);
                context.Response.Redirect(url, true);
                break;

            default:
                break;
            }
        }
コード例 #12
0
        private void InitCopyFormTargetControl(IAttributeAccessor target)
        {
            string resourceID     = WfClientContext.Current.OriginalActivity.Process.ResourceID;
            string processDescKey = WfClientContext.Current.OriginalActivity.RootActivity.Descriptor.Process.Key;
            string appName        = WfClientContext.Current.OriginalActivity.Process.Descriptor.ApplicationName;
            string programName    = WfClientContext.Current.OriginalActivity.Process.Descriptor.ProgramName;

            target.SetAttribute("resourceID", resourceID);
            target.SetAttribute("feature", GetWindowFeature().ToWindowFeatureClientString());

            ResourceUriSettings settings = ResourceUriSettings.GetConfig();

            string path = WfClientContext.Current.EntryUri.ToString();

            target.SetAttribute("href",
                                string.Format(path + "?processDescKey={0}&sourceResourceID={1}&appName={2}&programName={3}",
                                              HttpUtility.UrlEncode(processDescKey),
                                              HttpUtility.UrlEncode(resourceID),
                                              HttpUtility.UrlEncode(appName),
                                              HttpUtility.UrlEncode(programName)));

            target.SetAttribute("target", "_blank" + resourceID.Replace("-", string.Empty));
            target.SetAttribute("onclick", "onOpenFormButtonClick();top.$HBRootNS.WfProcessControlBase.close();");
        }
コード例 #13
0
        /// <summary>
        /// 构造,初始化服务地址
        /// </summary>
        private UserTaskServicePluginBroker()
        {
            ServiceBrokerContext.Current.InitWebClientProtocol(this);

            this.Url = ResourceUriSettings.GetConfig().Paths.CheckAndGet("userTaskPluginService").Uri.ToString();
        }
コード例 #14
0
 protected virtual void PrepareAddress(WfServiceAddressDefinition address)
 {
     address.Address = ResourceUriSettings.GetConfig().Paths.CheckAndGet("wfProcessService").Uri.ToUriString();
 }