Exemple #1
0
        public ActionResult DeleteExamRole(string ExamRoleName)
        {
            var model  = new ExamRoleModel();
            var result = model.DeleteExamRole(ExamRoleName);

            return(Json(new { result, tableData = model.ListExamRole }, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        public ActionResult SaveRoleInfo(ExamRoleModel model)
        {
            var username = this.UserNameContext;
            var Result   = model.SaveExamRole(username);

            return(Json(new { Result, ListExamRole = model.ListExamRole }, JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        public ActionResult GetExamRole(string ExamRoleName)
        {
            var model = new ExamRoleModel();
            var roles = model.GetExamRole(ExamRoleName);

            return(Json(new { tableData = roles, checkRole = model.checkRole, LRole = model.LRole }, JsonRequestBehavior.AllowGet));
        }
Exemple #4
0
        public ActionResult GetBankPic()
        {
            var           model  = new ExamRoleModel();
            List <string> ja     = new List <string>();
            var           path1  = System.AppDomain.CurrentDomain.BaseDirectory; //获取程序集目录
            string        path   = Path.Combine(path1, "Attachment", "BankPic"); //Path.Combine 将3个字符串组合成路径
            var           images = Directory.GetFiles(path, ".", SearchOption.AllDirectories).Where(s => s.EndsWith(".png") || s.EndsWith(".jpg") || s.EndsWith(".gif"));

            //images = Directory.GetFiles(path, "*.png|*.jpg", SearchOption.AllDirectories);
            //Directory.GetFiles 返回指定目录的文件路径 SearchOption.AllDirectories 指定搜索当前目录及子目录

            //遍历string 型 images数组
            foreach (var i in images)
            {
                var str   = i.Replace(path1, "");//获取相对路径
                var names = i.Replace(path + "\\", "");
                var path2 = str.Replace("\\", "/");
                model.LPic.Add(new PicData {
                    PicName = names, PicPath = "/" + path2
                });
            }

            return(Json(new { LPic = model.LPic }, JsonRequestBehavior.AllowGet));
        }
Exemple #5
0
        public ActionResult MaintainExamRole()
        {
            var model = new ExamRoleModel();

            return(View(model));
        }