public IActionResult ListCount() { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.扩展管理.搜索管理.统计); if (!IsPermission(funcId)) { return(ToPermission(funcId)); } string startTime = GetQueryString("datemin"); string endTime = GetQueryString("datemax"); string keyword = GetQueryString("keyword"); ViewData["DateMin"] = startTime; ViewData["DateMax"] = endTime; ViewData["Keyword"] = keyword; int total = 100; List <CountSearchKeywordByKeywordResult> lists = new List <CountSearchKeywordByKeywordResult>(); string strKeyword = string.Format("{0}{1}", startTime, keyword); if (string.IsNullOrWhiteSpace(strKeyword)) { lists = SearchKeywordService.CountSearchKeywordByKeyword(SystemID, CompanyID, total); } else { lists = SearchKeywordService.CountSearchKeywordByKeyword(SystemID, CompanyID, startTime, endTime, keyword, total); } ViewData["Count"] = SearchKeywordService.CountSearchKeyword(SystemID, CompanyID); return(View(lists)); } catch (Exception ex) { return(ToError(ex.Message)); } }
public JsonResult Delete(string departmentId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.公司管理.部门管理.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } if (string.IsNullOrEmpty(departmentId)) { return(Error("department id not empty")); } var entity = DepartmentService.GetDepartmentPro(SystemID, CompanyID, departmentId); var result = DepartmentService.DeleteDepartmentPro(SystemID, CompanyID, departmentId); TableOperationManager.Delete(entity, result); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult DeleteBatch(string[] arrId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.公告管理.类别管理.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } if (arrId.Length == 0) { return(Error("请选择删除ID!")); } List <object> lists = new List <object>(); foreach (var item in arrId) { string categoryId = item; try { bool result = NoticeCategoryService.DeleteNoticeCategory(SystemID, CompanyID, categoryId); lists.Add(new { category_id = categoryId, result, message = "ok" }); } catch (Exception ex) { lists.Add(new { category_id = categoryId, result = false, message = ex.Message }); } } return(Success("成功!", lists)); } catch (Exception ex) { return(Error(ex.Message)); } }
public IActionResult UpdatePassword(string memberId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.会员管理.会员资料.改密); if (!IsPermission(funcId)) { return(ToPermission(funcId)); } if (string.IsNullOrEmpty(memberId)) { return(View(new Ld_Member_Account())); } var entity = AccountService.GetAccountPro(SystemID, CompanyID, memberId); if (entity == null) { return(View(new Ld_Member_Account())); } return(View(entity)); } catch (Exception ex) { return(ToError(ex.Message)); } }
public IActionResult DeleteBatch(string[] arrId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.系统管理.操作记录.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } if (arrId.Length == 0) { return(Error("请选择删除ID!")); } foreach (var item in arrId) { long id = Convert.ToInt64(item); bool result = TableOperationService.DeleteTableOperation(id); } return(Success("成功!")); } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult Update(string tableId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.系统管理.数据字典.编辑); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } string businessName = GetFormValue("fBusinessName"); string remark = GetFormValue("fRemark"); if (string.IsNullOrWhiteSpace(businessName)) { return(Error("中文注释不能为空!")); } bool result = TableService.UpdateTableBusinessName(tableId, businessName, remark); if (result) { return(Success("成功!")); } else { return(Error("失败!")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult UpdatePrimaryKey(long id) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.系统管理.数据字典.设置主建); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } string fState = GetFormValue("fState"); bool isPrimaryKey = fState.ToBool(); bool result = TableDetailsService.UpdateTableDetailsPrimaryKey(id, isPrimaryKey); if (result) { return(Success("成功!")); } else { return(Error("失败!")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult Save() { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.接口管理.接口设置.新增); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } string fWebHost = GetFormValue("fWebHost"); string fRemark = GetFormValue("fRemark"); string fState = GetFormValue("fState"); bool state = fState.ToBool(); var result = AccessCorsHostService.SaveAccessCorsHostPro(SystemID, fWebHost, fRemark, StaffID, StaffName, state); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult UpdateState(string linkId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.扩展管理.友情链接.审核); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } bool state = GetFormValue("state").ToBool(); var result = LinkService.UpdateLinkState(SystemID, CompanyID, linkId, state); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public IActionResult Edit(string roleId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.管理员管理.角色管理.编辑); if (!IsPermission(funcId)) { return(ToPermission(funcId)); } var entity = RoleService.GetRolePro(SystemID, CompanyID, roleId); if (entity == null) { return(ToError("角色ID错误!")); } var lists = RoleService.GetRoleFunctionSelectPro(SystemID, CompanyID, roleId); ViewData["RoleID"] = entity.RoleID; ViewData["RoleName"] = entity.RoleName; ViewData["Remark"] = entity.Remark; ViewData["State"] = entity.State; return(View(lists)); } catch (Exception ex) { return(ToError(ex.Message)); } }
public SysFunctionController(IBaseManager BaseManager, IFunctionService FunctionService) : base(BaseManager) { this.BaseManager = BaseManager; this.FunctionService = FunctionService; this.FunctionID = PermissionEnum.CodeFormat((int)PermissionEnum.Admins.所有者); }
public JsonResult DeleteBatch(string[] arrRoleId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.管理员管理.角色管理.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } List <object> lists = new List <object>(); foreach (var roleId in arrRoleId) { try { bool result = RoleService.DeleteRolePro(SystemID, CompanyID, roleId); lists.Add(new { role_id = roleId, result, message = "成功" }); } catch (Exception ex) { lists.Add(new { role_id = roleId, result = false, message = ex.Message }); } } return(Success("ok", lists)); } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult Delete(string roleId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.管理员管理.角色管理.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } if (string.IsNullOrEmpty(roleId)) { return(Error("角色ID不能为空!")); } var result = RoleService.DeleteRolePro(SystemID, CompanyID, roleId); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult UpdateState(string roleId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.管理员管理.角色管理.审核); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } if (roleId == "2001") { return(Error("初始化角色不可变更状态!")); } string fState = GetFormValue("State"); bool state = fState.ToBool(); var result = RoleService.UpdateRoleStatePro(SystemID, CompanyID, roleId, state); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult UpdateDelete(string articeId, bool delete) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.内容管理.资讯管理.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } var result = ArticeService.UpdateArticeDelete(SystemID, CompanyID, articeId, delete); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult DeleteLink(string linkId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.扩展管理.友情链接.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } var result = LinkService.DeleteLink(SystemID, CompanyID, linkId); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult UpdateDeleteBatch(string[] arrId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.内容管理.资讯管理.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } if (arrId.Length == 0) { return(Error("请选择删除ID!")); } List <object> lists = new List <object>(); foreach (var item in arrId) { string articeId = item; try { bool result = ArticeService.UpdateArticeDelete(SystemID, CompanyID, articeId, true); lists.Add(new { artice_id = articeId, result, message = "ok" }); } catch (Exception ex) { lists.Add(new { artice_id = articeId, result = false, message = ex.Message }); } } return(Success("成功!", lists)); } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult DeleteLinkBatch(string[] arrId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.扩展管理.友情链接.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } if (arrId.Length == 0) { return(Error("请选择删除ID!")); } List <object> lists = new List <object>(); foreach (var item in arrId) { string linkId = item.ToString(); try { bool result = LinkService.DeleteLink(SystemID, CompanyID, linkId); lists.Add(new { link_id = linkId, result, message = "ok" }); } catch (Exception ex) { lists.Add(new { link_id = linkId, result = false, message = ex.Message }); } } return(Success("成功!", lists)); } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult UpdateDetails(long id) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.系统管理.数据字典.编辑明细); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } string columnText = GetFormValue("fColumnText"); string remark = GetFormValue("fRemark"); if (string.IsNullOrWhiteSpace(columnText)) { return(Error("字段中文名称不能为空!")); } bool result = TableDetailsService.UpdateTableDetailsColumnText(id, columnText, remark); if (result) { return(Success("成功!")); } else { return(Error("失败!")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult DeleteLinkGroup() { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.扩展管理.链接类别.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } string groupId = GetFormValue("GroupID"); var result = LinkGroupService.DeleteLinkGroup(SystemID, CompanyID, groupId); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public IActionResult List() { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.系统管理.数据字典.列表); if (!IsPermission(funcId)) { return(ToPermission(funcId)); } string keyword = GetQueryString("keyword"); ViewBag.Keyword = keyword; int totalNum = 0; List <Ld_Log_Table> lists = new List <Ld_Log_Table>(); if (string.IsNullOrWhiteSpace(keyword)) { lists = TableService.GetTablePaging(1, 500, out totalNum); } else { lists = TableService.SearchTable(keyword); totalNum = lists.Count(); } ViewBag.Count = totalNum; return(View(lists)); } catch (Exception ex) { return(ToError(ex.Message)); } }
public JsonResult GetLinkGroup(string groupId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.扩展管理.链接类别.查看); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } var entity = LinkGroupService.GetLinkGroup(SystemID, CompanyID, groupId); if (entity == null) { return(Error("主建ID无效!")); } var data = new { id = entity.GroupID, name = entity.Name, remark = entity.Remark, external = entity.IsExternal.ToBool() ? 1 : 0, state = entity.State.ToBool() }; return(Success("ok", data)); } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult Delete(string memberId, string delete) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.会员管理.除的会员.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } bool isDel = true; bool result = false; if (delete.ToBool()) { result = AccountService.DeleteAccountPro(SystemID, CompanyID, memberId); } else { result = AccountService.UpdateAccountDeletePro(SystemID, CompanyID, memberId, isDel); } if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult UpdateState(string rankId, bool state) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.会员管理.等级管理.审核); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } var entity = RankService.GetRankPro(SystemID, CompanyID, rankId); var result = RankService.UpdateRankStatePro(SystemID, CompanyID, rankId, state); string newEntityJson = GetNewEntityJson(entity, state); TableOperationManager.Update(entity, newEntityJson, result); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public IActionResult Delete(long id) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.系统管理.操作记录.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } var entity = TableOperationService.GetTableOperation(id); if (entity == null) { return(Error("id not exists!")); } bool result = TableOperationService.DeleteTableOperation(id); if (result) { return(Success("成功!")); } else { return(Error("失败!")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult Delete(string rankId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.会员管理.等级管理.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } var entity = RankService.GetRankPro(SystemID, CompanyID, rankId); var result = RankService.DeleteRankPro(SystemID, CompanyID, rankId); TableOperationManager.Delete(entity, result); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult UpdateState(string categoryId, bool state) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.公告管理.类别管理.审核); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } var result = NoticeCategoryService.UpdateNoticeCategoryState(SystemID, CompanyID, categoryId, state); if (result) { return(Success("ok")); } else { return(Error("fail")); } } catch (Exception ex) { return(Error(ex.Message)); } }
public IActionResult List() { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.公司管理.资料管理.列表); if (!IsPermission(funcId)) { return(ToPermission(funcId)); } string startTime = GetQueryString("datemin"); string endTime = GetQueryString("datemax"); string keyword = GetQueryString("keyword"); ViewBag.datemin = startTime; ViewBag.datemax = endTime; ViewBag.keyword = keyword; List <Institution_Company> lists = new List <Institution_Company>(); if (string.IsNullOrWhiteSpace(keyword) && string.IsNullOrWhiteSpace(startTime)) { lists.Add(CompanyService.GetCompanyPro(SystemID, CompanyID)); } else { lists = CompanyService.SearchCompanyPro(SystemID, CompanyID, startTime, endTime, keyword); } int totalNum = lists == null ? 0 : lists.Count(); ViewBag.Count = totalNum; return(View(lists)); } catch (Exception ex) { return(ToError(ex.Message)); } }
public IActionResult DeleteBatch(string[] arrId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.系统管理.系统日志.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } if (arrId.Length == 0) { return(Error("请选择删除ID!")); } foreach (var item in arrId) { long id = Convert.ToInt64(item); long operationId = 0; var entity = LoginRecordService.GetLoginRecord(id); if (entity == null) { return(Error("id not exists!")); } TableOperationManager.Delete(entity, out operationId); bool result = LoginRecordService.DeleteLoginRecord(SystemID, CompanyID, id); TableOperationManager.SetState(operationId, result); } return(Success("成功!")); } catch (Exception ex) { return(Error(ex.Message)); } }
public JsonResult DeleteBatch(string[] arrId) { try { string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.扩展管理.搜索管理.除); if (!IsPermission(funcId)) { return(Error("您没有操作权限,请联系系统管理员!")); } if (arrId.Length == 0) { return(Error("请选择删除ID!")); } List <object> lists = new List <object>(); foreach (var item in arrId) { long id = item.ToInt(); try { bool result = SearchKeywordService.DeleteSearchKeyword(id); lists.Add(new { id, result, message = "ok" }); } catch (Exception ex) { lists.Add(new { id, result = false, message = ex.Message }); } } return(Success("成功!", lists)); } catch (Exception ex) { return(Error(ex.Message)); } }