Example #1
0
        public IActionResult FlowMonitorFrame()
        {
            base.SetGlobalViewBag();
            string         UserId      = CPExpressionHelper.Instance.RunCompile("${CPUser.UserId()}");
            string         UserRoleIds = CPExpressionHelper.Instance.RunCompile("${CPUser.UserRoleIds()}");
            CPFlowTemplate template    = CPFlowTemplate.Instance();
            List <int>     roleIdCol   = new List <int>();

            UserRoleIds.Split(',').ToList().ForEach(t => {
                if (string.IsNullOrEmpty(t) == false)
                {
                    roleIdCol.Add(int.Parse(t));
                }
            });
            List <CPFlow> col        = template.GetHasMonitorRightFlow(int.Parse(UserId), roleIdCol);
            string        flowVerIds = "";

            col.ForEach(t => {
                if (string.IsNullOrEmpty(flowVerIds))
                {
                    flowVerIds = t.FlowVerId.ToString();
                }
                else
                {
                    flowVerIds += "," + t.FlowVerId.ToString();
                }
            });
            if (string.IsNullOrEmpty(flowVerIds))
            {
                flowVerIds = "-1";
            }
            CPAppContext.GetHttpContext().Session.SetString("UserHasMonitorRightFlowVerIds", flowVerIds);
            return(Redirect(CPAppContext.CPWebRootPath() + "/Plat/Grid/GridView?GridCode=" + CPAppContext.QueryString <string>("GridCode")));
        }
Example #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        //注册服务
        public void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            //不加这句的话,发布到IIS里会运行不起来
            services.AddApplicationInsightsTelemetry(Configuration);
            //注册编辑器
            services.AddUEditorService();
            services.AddMvc(o => o.Conventions.Add(new FeatureConvention()))
            .AddJsonOptions(t => t.SerializerSettings.ContractResolver = new DefaultContractResolver())
            .AddRazorOptions(options =>
            {
                // {0} - Action Name
                // {1} - Controller Name
                // {2} - Area Name
                // {3} - Feature Name
                // replace normal view location entirely
                //    options.ViewLocationFormats.Clear();
                options.ViewLocationFormats.Add("/Plat/{3}/{1}/{0}.cshtml");
                options.ViewLocationFormats.Add("/Plat/{3}/{0}.cshtml");
                options.ViewLocationFormats.Add("/Plat/Shared/{0}.cshtml");


                options.ViewLocationExpanders.Add(new FeatureViewLocationExpander());
            }).AddSessionStateTempDataProvider();

            //.AddApplicationPart(typeof(GridEngineController).Assembly).AddControllersAsServices(); ;
            //services.AddMvc()
            // .AddApplicationPart(typeof(GridEngineController).Assembly).AddControllersAsServices();
            //services.AddMvc().AddApplicationPart(Assembly.Load(new AssemblyName("CPFrameWork.UIInterface")));
            //使用session
            services.AddSession();
            Services = services;
            //设置文件大小
            services.Configure <FormOptions>(options =>
            {
                //1个G
                options.MultipartBodyLengthLimit = 1024 * 1024 * 1024;
            });
            //自己加的
            CPLogHelper.StartupInit(services, Configuration);
            CPSystemHelper.StartupInit(services, Configuration);
            CPAutoNumHelper.StartupInit(services, Configuration);
            COOrgans.StartupInit(services, Configuration);
            CPFormEngine.StartupInit(services, Configuration);
            CPFormTemplate.StartupInit(services, Configuration);
            CPGridEngine.StartupInit(services, Configuration);
            CPTabEngine.StartupInit(services, Configuration);
            CPTreeEngine.StartupInit(services, Configuration);
            CPModuleEngine.StartupInit(services, Configuration);
            CPFlowTemplate.StartupInit(services, Configuration);
            CPFlowEngine.StartupInit(services, Configuration);
            CPMsgs.StartupInit(services, Configuration);
        }
Example #3
0
        public IActionResult FlowStartFrame()
        {
            base.SetGlobalViewBag();
            string         UserId      = CPExpressionHelper.Instance.RunCompile("${CPUser.UserId()}");
            string         UserRoleIds = CPExpressionHelper.Instance.RunCompile("${CPUser.UserRoleIds()}");
            string         DepIds      = CPExpressionHelper.Instance.RunCompile("${CPUser.DepIds()}");
            CPFlowTemplate template    = CPFlowTemplate.Instance();
            List <int>     roleIdCol   = new List <int>();
            List <int>     depIdCol    = new List <int>();

            UserRoleIds.Split(',').ToList().ForEach(t => {
                if (string.IsNullOrEmpty(t) == false)
                {
                    roleIdCol.Add(int.Parse(t));
                }
            });
            DepIds.Split(',').ToList().ForEach(t => {
                if (string.IsNullOrEmpty(t) == false)
                {
                    depIdCol.Add(int.Parse(t));
                }
            });
            List <CPFlow> col        = template.GetHasStartRightFlow(int.Parse(UserId), roleIdCol, depIdCol);
            string        flowVerIds = "";

            col.ForEach(t => {
                if (string.IsNullOrEmpty(flowVerIds))
                {
                    flowVerIds = t.FlowVerId.ToString();
                }
                else
                {
                    flowVerIds += "," + t.FlowVerId.ToString();
                }
            });
            if (string.IsNullOrEmpty(flowVerIds))
            {
                flowVerIds = "-1";
            }
            CPAppContext.GetHttpContext().Session.SetString("UserHasRightFlowVerIds", flowVerIds);
            return(View());
        }