public string Search(ActionLogSearcher searcher)
        {
            var vm = Wtm.CreateVM <ActionLogListVM>(passInit: true);

            vm.Searcher = searcher;
            return(vm.GetJson(enumToString: false));
        }
        public ActionResult Edit(string id)
        {
            var vm = Wtm.CreateVM <FrameworkUserVM>(id);

            vm.Entity.Password = null;
            return(PartialView(vm));
        }
Beispiel #3
0
        public ActionResult Index()
        {
            var vm = Wtm.CreateVM <DataPrivilegeListVM>();

            vm.Searcher.TableNames = Wtm.DataPrivilegeSettings.ToListItems(x => x.PrivillegeName, x => x.ModelName);
            return(PartialView(vm));
        }
        public ActionResult Index()
        {
            var vm = Wtm.CreateVM <FrameworkUserListVM>();

            vm.Searcher.IsValid = true;
            return(PartialView(vm));
        }
        public string Search(BaseSearcher searcher)
        {
            var vm = Wtm.CreateVM <FrameworkMenuListVM2>();

            vm.Searcher = searcher;
            return(vm.GetJson(enumToString: false));
        }
Beispiel #6
0
        public string Search(FrameworkUserSearcher searcher)
        {
            var vm = Wtm.CreateVM <FrameworkUserListVM>();

            vm.Searcher = searcher;
            return(vm.GetJson(enumToString: false));
        }
        public ActionResult Password(Guid id)
        {
            var vm = Wtm.CreateVM <FrameworkUserVM>(id, passInit: true);

            vm.Entity.Password = null;
            return(PartialView(vm));
        }
Beispiel #8
0
        public async Task <IActionResult> BatchDelete(string[] ids)
        {
            var vm = Wtm.CreateVM <FrameworkRoleBatchVM>();

            if (ids != null && ids.Count() > 0)
            {
                vm.Ids = ids;
            }
            else
            {
                return(Ok());
            }
            if (!ModelState.IsValid || !vm.DoBatchDelete())
            {
                return(BadRequest(ModelState.GetErrorJson()));
            }
            else
            {
                List <Guid?> roleids = new List <Guid?>();
                foreach (var item in vm?.Ids)
                {
                    roleids.Add(Guid.Parse(item));
                }
                var userids = DC.Set <FrameworkUserRole>().Where(x => DC.Set <FrameworkRole>().Where(y => roleids.Contains(y.ID)).Select(y => y.RoleCode).Contains(x.RoleCode)).Select(x => x.UserCode).ToArray();
                await Wtm.RemoveUserCache(userids);

                return(Ok(ids.Count()));
            }
        }
Beispiel #9
0
        public string Search(FrameworkRoleSearcher searcher)
        {
            var vm = Wtm.CreateVM <FrameworkRoleListVM>();

            vm.Searcher = searcher;
            return(vm.GetJson());
        }
 public IActionResult ExportExcel(ActionLogSearcher searcher)
 {
     var vm = Wtm.CreateVM<ActionLogListVM>();
     vm.Searcher = searcher;
     vm.SearcherMode = ListVMSearchModeEnum.Export;
     return vm.GetExportData();
 }
Beispiel #11
0
        public PartialViewResult PageFunction(Guid id)
        {
            var role = Wtm.CreateVM <FrameworkRoleMDVM>(id);

            role.ListVM.SearcherMode = ListVMSearchModeEnum.Custom2;
            return(PartialView(role));
        }
Beispiel #12
0
        public async Task <IActionResult> BatchDelete(string[] ids)
        {
            var           vm       = Wtm.CreateVM <FrameworkRoleBatchVM>();
            List <string> RoleCode = new List <string>();

            if (ids != null && ids.Count() > 0)
            {
                RoleCode = DC.Set <FrameworkRole>().CheckIDs(new List <string>(ids)).Select(x => x.RoleCode).ToList();
                vm.Ids   = ids;
            }
            else
            {
                return(Ok());
            }
            if (!ModelState.IsValid || !vm.DoBatchDelete())
            {
                return(BadRequest(ModelState.GetErrorJson()));
            }
            else
            {
                var ur      = DC.Set <FrameworkUserRole>().Where(x => RoleCode.Contains(x.RoleCode)).ToList();
                var itcodes = ur.Select(x => x.UserCode).ToArray();
                DC.Set <FrameworkUserRole>().RemoveRange(ur);
                DC.SaveChanges();
                await Wtm.RemoveUserCache(itcodes);

                return(Ok(ids.Count()));
            }
        }
Beispiel #13
0
        public string Search(FrameworkRoleSearcher searcher)
        {
            var vm = Wtm.CreateVM <FrameworkRoleListVM>(passInit: true);

            vm.Searcher = searcher;
            return(vm.GetJson(enumToString: false));
        }
Beispiel #14
0
        public ActionResult ChangePassword()
        {
            var vm = Wtm.CreateVM <ChangePasswordVM>();

            vm.ITCode = Wtm.LoginUserInfo.ITCode;
            return(PartialView(vm));
        }
        public string Search(DataPrivilegeSearcher searcher)
        {
            var vm = Wtm.CreateVM <DataPrivilegeListVM>();

            vm.Searcher = searcher;
            return(vm.GetJson(enumToString: false));
        }
        public IActionResult ExportExcel(GradeClassInfoSearcher searcher)
        {
            var vm = Wtm.CreateVM <GradeClassInfoListVM>();

            vm.Searcher     = searcher;
            vm.SearcherMode = ListVMSearchModeEnum.Export;
            return(vm.GetExportData());
        }
        public IActionResult ExportExcel(TeacherMajorManagerSearcher searcher)
        {
            var vm = Wtm.CreateVM <TeacherMajorManagerListVM>();

            vm.Searcher     = searcher;
            vm.SearcherMode = ListVMSearchModeEnum.Export;
            return(vm.GetExportData());
        }
        public IActionResult ExportExcel(DepotsSearcher searcher)
        {
            var vm = Wtm.CreateVM <DepotsListVM>();

            vm.Searcher     = searcher;
            vm.SearcherMode = ListVMSearchModeEnum.Export;
            return(vm.GetExportData());
        }
        public IActionResult ExportExcel(BaseSearcher searcher)
        {
            var vm = Wtm.CreateVM <FrameworkMenuListVM2>();

            vm.Searcher     = searcher;
            vm.SearcherMode = ListVMSearchModeEnum.Export;
            return(vm.GetExportData());
        }
 public IActionResult ExportExcelByIds(string[] ids)
 {
     var vm = Wtm.CreateVM<ActionLogListVM>();
     if (ids != null && ids.Count() > 0)
     {
         vm.Ids = new List<string>(ids);
         vm.SearcherMode = ListVMSearchModeEnum.CheckExport;
     }
     return vm.GetExportData();
 }
Beispiel #21
0
        public IActionResult Login()
        {
            LoginVM vm = Wtm.CreateVM <LoginVM>();

            vm.Redirect = HttpContext.Request.Query["ReturnUrl"];
            if (Wtm.ConfigInfo.IsQuickDebug == true)
            {
                vm.ITCode   = "admin";
                vm.Password = "******";
            }
            return(View(vm));
        }
 public IActionResult Search(TeacherMajorManagerSearcher searcher)
 {
     if (ModelState.IsValid)
     {
         var vm = Wtm.CreateVM <TeacherMajorManagerListVM>();
         vm.Searcher = searcher;
         return(Content(vm.GetJson()));
     }
     else
     {
         return(BadRequest(ModelState.GetErrorJson()));
     }
 }
 public IActionResult Search(GradeInfoSearcher searcher)
 {
     if (ModelState.IsValid)
     {
         var vm = Wtm.CreateVM <GradeInfoListVM>();
         vm.Searcher = searcher;
         return(Content(vm.GetJson()));
     }
     else
     {
         return(BadRequest(ModelState.GetErrorJson()));
     }
 }
 public DataPrivilegeVM Get(string TableName, string TargetId, DpTypeEnum DpType)
 {
     DataPrivilegeVM vm = null;
     if (DpType == DpTypeEnum.User)
     {
         vm = Wtm.CreateVM<DataPrivilegeVM>(values: x => x.Entity.TableName == TableName && x.Entity.UserCode == TargetId && x.DpType == DpType);
     }
     else
     {
         vm = Wtm.CreateVM<DataPrivilegeVM>(values: x => x.Entity.TableName == TableName && x.Entity.GroupCode == TargetId && x.DpType == DpType);
     }
     return vm;
 }
 public IActionResult Search(ActionLogSearcher searcher)
 {
     if (ModelState.IsValid)
     {
         var vm = Wtm.CreateVM<ActionLogListVM>(passInit:true);
         vm.Searcher = searcher;
         return Content(vm.GetJson());
     }
     else
     {
         return BadRequest(ModelState.GetErrorJson());
     }
 }
 public IActionResult Search(DepotsSearcher searcher)
 {
     if (ModelState.IsValid)
     {
         var vm = Wtm.CreateVM <DepotsListVM>();
         vm.Searcher = searcher;
         return(Content(vm.GetJson(enumToString: false)));
     }
     else
     {
         return(BadRequest(ModelState.GetErrorJson()));
     }
 }
        public ActionResult Delete(Guid id, IFormCollection noUser)
        {
            var vm = Wtm.CreateVM <FrameworkMenuVM>(id);

            vm.DoDelete();
            if (!ModelState.IsValid)
            {
                return(PartialView(vm));
            }
            else
            {
                return(FFResult().CloseDialog().RefreshGrid());
            }
        }
        public string Search(FrameworkMenuSearcher searcher)
        {
            var vm = Wtm.CreateVM <FrameworkMenuListVM>(passInit: true);

            if (ModelState.IsValid)
            {
                vm.Searcher = searcher;
                return(vm.GetJson(false));
            }
            else
            {
                return(vm.GetError());
            }
        }
        public IActionResult GetExcelTemplate()
        {
            var vm = Wtm.CreateVM <DepotsImportVM>();
            var qs = new Dictionary <string, string>();

            foreach (var item in Request.Query.Keys)
            {
                qs.Add(item, Request.Query[item]);
            }
            vm.SetParms(qs);
            var data = vm.GenerateTemplate(out string fileName);

            return(File(data, "application/vnd.ms-excel", fileName));
        }
        public ActionResult Create(Guid?id)
        {
            var vm = Wtm.CreateVM <FrameworkMenuVM>();

            if (id != null)
            {
                vm.Entity.ParentId = id;
            }
            vm.Entity.IsInside   = true;
            vm.Entity.IsPublic   = false;
            vm.Entity.FolderOnly = false;
            vm.Entity.ShowOnMenu = true;
            return(PartialView(vm));
        }