Beispiel #1
0
        /// <summary>
        /// 根据调用的方法,检查用户的权限
        /// </summary>
        /// <param name="context"></param>
        /// <param name="type">请求的方法名</param>
        /// <returns></returns>
        private bool MyCheck(HttpContext context, string type)
        {
            //判断是否需要验证 config文件中的全局配置
            string connstr = ConfigurationSettings.AppSettings["是否验证"];
            if (connstr == "false")
            {
                return true;
            }

            var check = new BLL.CngQx(context);

            if (check.IsLogin == false)
            {
                return false;
            };

            bool ok = false;
            switch (type)
            {
                case "GetDay":
                case "VerGetDay":
                    {
                        ok = true;
                    }
                    break;
                //以下方法 只需要 "系统管理员", "信息管理员", "运行所", "安技办", "经理", "站长", "开票"
                case "GetYearList"://获取年度列表
                case "GetYueList"://获取月度列表
                case "ViewHtml"://生成打印预览数据
                case "ViewHtml2"://预览报表数据SWF
                case "GetChartData"://获取图表json数据
                    {
                        ok = check.isExt_or(new string[] { "系统管理员", "信息管理员", "运行所", "安技办", "经理", "站长", "开票" });
                    }
                    break;
                //生成报表需要的权限
                case "CountYue"://生成月度数据
                case "UpdateJH"://修改站点月度计划数
                case "PdfDown"://下载数据Pdf
                case "ExcelDown_dishu"://下载Excel 底数报表
                    {
                        ok = check.isExt_or(new string[] { "系统管理员", "信息管理员", "运行所" });
                    }
                    break;
                case "lockData": //锁定数据操作
                case "ExcelDown"://下载数据Excel
                    {
                        ok = check.isExt_or(new string[] { "系统管理员", "信息管理员" });
                    }
                    break;
            }
            return ok;
        }
Beispiel #2
0
        /// <summary>
        /// 启动相关进程
        /// </summary>
        /// <param name="context"></param>
        public void Return_jingcheng(HttpContext context)
        {
            //需要进行权限检查
            string retext = "{ \"ok\":true }";
            var check = new BLL.CngQx(context);
            if (!check.isExt_or(new string[] { "信息管理员", "系统管理员" }))
            {
                retext = "{ \"ok\":false }";
                context.Response.Write(retext);
                return;
            }

            string path = "";

            KillProcess("monitor");
            KillProcess("Server");
            KillProcess("CNGServer");
            //KillProcess("notepad");
            Thread.Sleep(500);

            try
            {
                //path = "notepad.exe";
                path = @"D:\成都华气厚普机电科技有限责任公司\qd1.bat";
                StartProcess(path);
                Thread.Sleep(1500);

                //path = @"D:\新CNG服务\CNGServer.exe";
                //StartProcess(path);
                //Thread.Sleep(1000);
                Sys.addLogErrToFiles("启动进程错误", "成功");
            }
            catch (Exception e)
            {
                Sys.addLogErrToFiles("启动进程错误", e.Message);
                retext = "{ \"ok\":false }";
            }

            context.Response.Write(retext);
        }
Beispiel #3
0
        /// <summary>
        /// 根据调用的方法,检查用户的权限
        /// </summary>
        /// <param name="context"></param>
        /// <param name="type">请求的方法名</param>
        /// <returns></returns>
        private bool MyCheck(HttpContext context, string type)
        {
            var check = new BLL.CngQx(context);

            if (check.IsLogin == false)
            {
                return false;
            };

            bool ok = false;
            switch (type)
            {
                case "VerLoad":
                case "VerGetDay":
                    {
                        ok = true;
                    }
                    break;
                //以下方法 需要 系统管理员权限
                case "VerAdd":
                case "VerUpdate":
                case "VerDel":
                case "VerDay":
                    {
                        ok = check.IsExt("系统管理员");
                    }
                    break;
            }
            return ok;
        }
Beispiel #4
0
        /// <summary>
        /// 根据调用的方法,检查用户的权限
        /// </summary>
        /// <param name="context"></param>
        /// <param name="type">请求的方法名</param>
        /// <returns></returns>
        private bool MyCheck(HttpContext context, string type)
        {
            //判断是否需要验证 config文件中的全局配置
            string connstr = ConfigurationSettings.AppSettings["是否验证"];
            if (connstr == "false")
            {
                return true;
            }

            bool ok = false;
            switch (type)
            {
                case "tkGet"://获取题库列表
                case "TKgetTree"://获取分类树列表
                case "sjGet"://获取试卷列表
                case "sjGetPz"://获取试卷配置列表
                case "sjCount"://获取试卷试题数量
                case "sjTestGet"://获取试卷列表
                case "sjTextAdd"://新增一套答题卷
                case "sjstGet"://试卷试题列表
                case "stGetOne"://获取一道试题内容
                case "stOver"://完成试卷
                case "stError"://纠错
                case "sjInfo"://获取试卷信息
                case "sjPxb"://获取试卷排行
                case "sjText"://获取试卷文本
                    {
                        ok = true;
                    }
                    break;
                //以下方法 只需要 "系统管理员", "信息管理员", "安技办"
                case "treeAppend"://新增分类
                case "treeDle"://删除分类
                case "treeRename"://重命名分类
                case "tkUpdate"://新增题库 或 更新题库
                case "tkdaGet"://获取题库答案选项
                case "tkDel"://删除试题
                case "tkGuiLei"://题库归类
                case "sjAdd"://添加试卷
                case "sjDel"://删除试卷
                case "sjUpdate"://更新试卷
                case "sjTyong"://开 关 试卷
                case "sjMove"://排序试卷
                case "tk_jc_del"://删除纠错信息
                case "tk_jc"://题库纠错列表
                    {
                        var check = new BLL.CngQx(context);

                        if (check.IsLogin == false)
                        {
                            return false;
                        };
                        ok = check.isExt_or(new string[] { "系统管理员", "信息管理员", "安技办" });
                    }
                    break;

            }
            return ok;
        }