You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

729 lines
26 KiB

  1. using Learun.Application.Base.AuthorizeModule;
  2. using Learun.Cache.Base;
  3. using Learun.Cache.Factory;
  4. using Learun.Util;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. namespace Learun.Application.Base.SystemModule
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  12. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  13. /// 创建人:陈彬彬
  14. /// 日 期:2017.03.08
  15. /// 描 述:功能模块(缓存在0号库)
  16. /// 功能模块缓存结构
  17. /// </summary>
  18. public class ModuleBLL : ModuleIBLL
  19. {
  20. #region 属性
  21. private ModuleService moduleService = new ModuleService();
  22. private AuthorizeIBLL authorizeIBLL = new AuthorizeBLL();
  23. #endregion
  24. #region 缓存定义
  25. private ICache cache = CacheFactory.CaChe();
  26. private string cacheKey = "learun_adms_modules";
  27. private string cacheKeyBtn = "learun_adms_modules_Btn_"; // + 模块主键
  28. private string cacheKeyColumn = "learun_adms_modules_Column_";// + 模块主键
  29. private string cacheKeyForm = "learun_adms_modules_Form_";// + 模块主键
  30. #endregion
  31. #region 功能模块
  32. /// <summary>
  33. /// 功能列表
  34. /// </summary>
  35. /// <returns></returns>
  36. public List<ModuleEntity> GetModuleList()
  37. {
  38. try
  39. {
  40. List<ModuleEntity> list = cache.Read<List<ModuleEntity>>(cacheKey, CacheId.module);
  41. if (list == null)
  42. {
  43. list = (List<ModuleEntity>)moduleService.GetList();
  44. cache.Write<List<ModuleEntity>>(cacheKey, list, CacheId.module);
  45. }
  46. //导航版
  47. var entity = list.FirstOrDefault(a => a.F_ModuleId == "be81bdde-8bbc-4080-b976-84faefc414d2");
  48. UserInfo userInfo = LoginUserInfo.Get();
  49. /*关联权限*/
  50. if (!userInfo.isSystem)
  51. {
  52. string objectIds = userInfo.userId + (string.IsNullOrEmpty(userInfo.roleIds) ? "" : ("," + userInfo.roleIds));
  53. List<string> itemIdList = authorizeIBLL.GetItemIdListByobjectIds(objectIds, 1);
  54. list = list.FindAll(t => itemIdList.IndexOf(t.F_ModuleId) >= 0);
  55. }
  56. if (!list.Any(a => a.F_ModuleId == "be81bdde-8bbc-4080-b976-84faefc414d2") && entity != null)
  57. {
  58. list.Add(entity);
  59. }
  60. return list;
  61. }
  62. catch (Exception ex)
  63. {
  64. if (ex is ExceptionEx)
  65. {
  66. throw;
  67. }
  68. else
  69. {
  70. throw ExceptionEx.ThrowBusinessException(ex);
  71. }
  72. }
  73. }
  74. /// <summary>
  75. /// 功能列表
  76. /// </summary>
  77. /// <returns></returns>
  78. public ModuleEntity GetModuleByUrl(string url)
  79. {
  80. try
  81. {
  82. if (url.Contains("?"))
  83. {
  84. if (!url.Contains("/LR_FormModule/FormRelation/PreviewIndex"))
  85. {
  86. url = url.Substring(0, url.IndexOf('?'));
  87. }
  88. }
  89. List<ModuleEntity> list = GetModuleList();
  90. return list.Find(t => t.F_UrlAddress == url);
  91. }
  92. catch (Exception ex)
  93. {
  94. if (ex is ExceptionEx)
  95. {
  96. throw;
  97. }
  98. else
  99. {
  100. throw ExceptionEx.ThrowBusinessException(ex);
  101. }
  102. }
  103. }
  104. /// <summary>
  105. /// 获取功能列表的树形数据
  106. /// </summary>
  107. /// <returns></returns>
  108. public List<TreeModel> GetModuleTree()
  109. {
  110. List<ModuleEntity> modulelist = GetModuleList();
  111. List<TreeModel> treeList = new List<TreeModel>();
  112. foreach (var item in modulelist)
  113. {
  114. TreeModel node = new TreeModel();
  115. node.id = item.F_ModuleId;
  116. node.text = item.F_FullName;
  117. node.value = item.F_EnCode;
  118. node.showcheck = false;
  119. node.checkstate = 0;
  120. node.isexpand = (item.F_AllowExpand == 1);
  121. node.icon = item.F_Icon;
  122. node.parentId = item.F_ParentId;
  123. treeList.Add(node);
  124. }
  125. return treeList.ToTree();
  126. }
  127. /// <summary>
  128. /// 获取功能列表的树形数据(带勾选框)
  129. /// </summary>
  130. /// <returns></returns>
  131. public List<TreeModel> GetModuleCheckTree()
  132. {
  133. List<ModuleEntity> modulelist = GetModuleList();
  134. List<TreeModel> treeList = new List<TreeModel>();
  135. foreach (var item in modulelist)
  136. {
  137. TreeModel node = new TreeModel();
  138. node.id = item.F_ModuleId;
  139. node.text = item.F_FullName;
  140. node.value = item.F_EnCode;
  141. node.showcheck = true;
  142. node.checkstate = 0;
  143. node.isexpand = false;
  144. node.icon = item.F_Icon;
  145. node.parentId = item.F_ParentId;
  146. treeList.Add(node);
  147. }
  148. return treeList.ToTree();
  149. }
  150. /// <summary>
  151. /// 获取功能列表的树形数据(只有展开项)
  152. /// </summary>
  153. /// <returns></returns>
  154. public List<TreeModel> GetExpendModuleTree()
  155. {
  156. List<ModuleEntity> modulelist = GetModuleList();
  157. List<TreeModel> treeList = new List<TreeModel>();
  158. foreach (var item in modulelist)
  159. {
  160. if (item.F_Target == "expand")
  161. {
  162. TreeModel node = new TreeModel();
  163. node.id = item.F_ModuleId;
  164. node.text = item.F_FullName;
  165. node.value = item.F_EnCode;
  166. node.showcheck = false;
  167. node.checkstate = 0;
  168. node.isexpand = true;
  169. node.icon = item.F_Icon;
  170. node.parentId = item.F_ParentId;
  171. treeList.Add(node);
  172. }
  173. }
  174. return treeList.ToTree();
  175. }
  176. /// <summary>
  177. /// 根据父级主键获取数据
  178. /// </summary>
  179. /// <param name="keyword">关键字</param>
  180. /// <param name="parentId">父级主键</param>
  181. /// <returns></returns>
  182. public List<ModuleEntity> GetModuleListByParentId(string keyword, string parentId)
  183. {
  184. try
  185. {
  186. List<ModuleEntity> list = (List<ModuleEntity>)GetModuleList();
  187. list = list.FindAll(t => t.F_ParentId == parentId);
  188. if (!string.IsNullOrEmpty(keyword))
  189. {
  190. list = list.FindAll(t => t.F_FullName.Contains(keyword) || t.F_EnCode.Contains(keyword));
  191. }
  192. return list;
  193. }
  194. catch (Exception ex)
  195. {
  196. if (ex is ExceptionEx)
  197. {
  198. throw;
  199. }
  200. else
  201. {
  202. throw ExceptionEx.ThrowBusinessException(ex);
  203. }
  204. }
  205. }
  206. /// <summary>
  207. /// 功能实体
  208. /// </summary>
  209. /// <param name="keyValue">主键值</param>
  210. /// <returns></returns>
  211. public ModuleEntity GetModuleEntity(string keyValue)
  212. {
  213. try
  214. {
  215. return moduleService.GetEntity(keyValue);
  216. }
  217. catch (Exception ex)
  218. {
  219. if (ex is ExceptionEx)
  220. {
  221. throw;
  222. }
  223. else
  224. {
  225. throw ExceptionEx.ThrowBusinessException(ex);
  226. }
  227. }
  228. }
  229. #endregion
  230. #region 模块按钮
  231. /// <summary>
  232. /// 获取按钮列表数据
  233. /// </summary>
  234. /// <param name="moduleId">模块Id</param>
  235. /// <returns></returns>
  236. public List<ModuleButtonEntity> GetButtonListNoAuthorize(string moduleId)
  237. {
  238. try
  239. {
  240. List<ModuleButtonEntity> list = cache.Read<List<ModuleButtonEntity>>(cacheKeyBtn + moduleId, CacheId.module);
  241. if (list == null)
  242. {
  243. list = (List<ModuleButtonEntity>)moduleService.GetButtonList(moduleId);
  244. cache.Write<List<ModuleButtonEntity>>(cacheKeyBtn + moduleId, list, CacheId.module);
  245. }
  246. return list;
  247. }
  248. catch (Exception ex)
  249. {
  250. if (ex is ExceptionEx)
  251. {
  252. throw;
  253. }
  254. else
  255. {
  256. throw ExceptionEx.ThrowBusinessException(ex);
  257. }
  258. }
  259. }
  260. /// <summary>
  261. /// 获取按钮列表数据
  262. /// </summary>
  263. /// <param name="moduleId">模块Id</param>
  264. /// <returns></returns>
  265. public List<ModuleButtonEntity> GetButtonList(string moduleId)
  266. {
  267. try
  268. {
  269. List<ModuleButtonEntity> list = cache.Read<List<ModuleButtonEntity>>(cacheKeyBtn + moduleId, CacheId.module);
  270. if (list == null)
  271. {
  272. list = (List<ModuleButtonEntity>)moduleService.GetButtonList(moduleId);
  273. cache.Write<List<ModuleButtonEntity>>(cacheKeyBtn + moduleId, list, CacheId.module);
  274. }
  275. UserInfo userInfo = LoginUserInfo.Get();
  276. /*关联权限*/
  277. if (!userInfo.isSystem)
  278. {
  279. string objectIds = userInfo.userId + (string.IsNullOrEmpty(userInfo.roleIds) ? "" : ("," + userInfo.roleIds));
  280. List<string> itemIdList = authorizeIBLL.GetItemIdListByobjectIds(objectIds, 2);
  281. list = list.FindAll(t => itemIdList.IndexOf(t.F_ModuleButtonId) >= 0);
  282. }
  283. return list;
  284. }
  285. catch (Exception ex)
  286. {
  287. if (ex is ExceptionEx)
  288. {
  289. throw;
  290. }
  291. else
  292. {
  293. throw ExceptionEx.ThrowBusinessException(ex);
  294. }
  295. }
  296. }
  297. /// <summary>
  298. /// 获取按钮列表数据
  299. /// </summary>
  300. /// <param name="url">功能模块地址</param>
  301. /// <returns></returns>
  302. public List<ModuleButtonEntity> GetButtonListByUrl(string url)
  303. {
  304. try
  305. {
  306. ModuleEntity moduleEntity = GetModuleByUrl(url);
  307. if (moduleEntity == null)
  308. {
  309. return new List<ModuleButtonEntity>();
  310. }
  311. return GetButtonList(moduleEntity.F_ModuleId);
  312. }
  313. catch (Exception ex)
  314. {
  315. if (ex is ExceptionEx)
  316. {
  317. throw;
  318. }
  319. else
  320. {
  321. throw ExceptionEx.ThrowBusinessException(ex);
  322. }
  323. }
  324. }
  325. /// <summary>
  326. /// 获取按钮列表树形数据(基于功能模块)
  327. /// </summary>
  328. /// <returns></returns>
  329. public List<TreeModel> GetButtonCheckTree()
  330. {
  331. List<ModuleEntity> modulelist = GetModuleList();
  332. List<TreeModel> treeList = new List<TreeModel>();
  333. foreach (var module in modulelist)
  334. {
  335. TreeModel node = new TreeModel();
  336. node.id = module.F_ModuleId + "_learun_moduleId";
  337. node.text = module.F_FullName;
  338. node.value = module.F_EnCode;
  339. node.showcheck = true;
  340. node.checkstate = 0;
  341. node.isexpand = false;
  342. node.icon = module.F_Icon;
  343. node.parentId = module.F_ParentId + "_learun_moduleId";
  344. if (module.F_Target != "expand")
  345. {
  346. List<ModuleButtonEntity> buttonList = GetButtonList(module.F_ModuleId);
  347. if (buttonList.Count > 0)
  348. {
  349. treeList.Add(node);
  350. }
  351. foreach (var button in buttonList)
  352. {
  353. TreeModel buttonNode = new TreeModel();
  354. buttonNode.id = button.F_ModuleButtonId;
  355. buttonNode.text = button.F_FullName;
  356. buttonNode.value = button.F_EnCode;
  357. buttonNode.showcheck = true;
  358. buttonNode.checkstate = 0;
  359. buttonNode.isexpand = true;
  360. buttonNode.icon = "fa fa-wrench";
  361. buttonNode.parentId = (button.F_ParentId == "0" ? button.F_ModuleId + "_learun_moduleId" : button.F_ParentId);
  362. treeList.Add(buttonNode);
  363. };
  364. }
  365. else
  366. {
  367. treeList.Add(node);
  368. }
  369. }
  370. return treeList.ToTree();
  371. }
  372. #endregion
  373. #region 模块视图
  374. /// <summary>
  375. /// 获取视图列表数据
  376. /// </summary>
  377. /// <param name="moduleId">模块Id</param>
  378. /// <returns></returns>
  379. public List<ModuleColumnEntity> GetColumnList(string moduleId)
  380. {
  381. try
  382. {
  383. List<ModuleColumnEntity> list = cache.Read<List<ModuleColumnEntity>>(cacheKeyColumn + moduleId, CacheId.module);
  384. if (list == null)
  385. {
  386. list = (List<ModuleColumnEntity>)moduleService.GetColumnList(moduleId);
  387. cache.Write<List<ModuleColumnEntity>>(cacheKeyColumn + moduleId, list, CacheId.module);
  388. }
  389. UserInfo userInfo = LoginUserInfo.Get();
  390. /*关联权限*/
  391. if (!userInfo.isSystem)
  392. {
  393. string objectIds = userInfo.userId + (string.IsNullOrEmpty(userInfo.roleIds) ? "" : ("," + userInfo.roleIds));
  394. List<string> itemIdList = authorizeIBLL.GetItemIdListByobjectIds(objectIds, 3);
  395. list = list.FindAll(t => itemIdList.IndexOf(t.F_ModuleColumnId) >= 0);
  396. }
  397. return list;
  398. }
  399. catch (Exception ex)
  400. {
  401. if (ex is ExceptionEx)
  402. {
  403. throw;
  404. }
  405. else
  406. {
  407. throw ExceptionEx.ThrowBusinessException(ex);
  408. }
  409. }
  410. }
  411. /// <summary>
  412. /// 获取视图列表数据
  413. /// </summary>
  414. /// <param name="url">功能模块地址</param>
  415. /// <returns></returns>
  416. public List<ModuleColumnEntity> GetColumnListByUrl(string url)
  417. {
  418. try
  419. {
  420. ModuleEntity moduleEntity = GetModuleByUrl(url);
  421. if (moduleEntity == null)
  422. {
  423. return new List<ModuleColumnEntity>();
  424. }
  425. return GetColumnList(moduleEntity.F_ModuleId);
  426. }
  427. catch (Exception ex)
  428. {
  429. if (ex is ExceptionEx)
  430. {
  431. throw;
  432. }
  433. else
  434. {
  435. throw ExceptionEx.ThrowBusinessException(ex);
  436. }
  437. }
  438. }
  439. /// <summary>
  440. /// 获取按钮列表树形数据(基于功能模块)
  441. /// </summary>
  442. /// <returns></returns>
  443. public List<TreeModel> GetColumnCheckTree()
  444. {
  445. List<ModuleEntity> modulelist = GetModuleList();
  446. List<TreeModel> treeList = new List<TreeModel>();
  447. foreach (var module in modulelist)
  448. {
  449. TreeModel node = new TreeModel();
  450. node.id = module.F_ModuleId + "_learun_moduleId";
  451. node.text = module.F_FullName;
  452. node.value = module.F_EnCode;
  453. node.showcheck = true;
  454. node.checkstate = 0;
  455. node.isexpand = false;
  456. node.icon = module.F_Icon;
  457. node.parentId = module.F_ParentId + "_learun_moduleId";
  458. if (module.F_Target != "expand")
  459. {
  460. List<ModuleColumnEntity> columnList = GetColumnList(module.F_ModuleId);
  461. if (columnList.Count > 0)
  462. {
  463. treeList.Add(node);
  464. }
  465. foreach (var column in columnList)
  466. {
  467. TreeModel columnNode = new TreeModel();
  468. columnNode.id = column.F_ModuleColumnId;
  469. columnNode.text = column.F_FullName;
  470. columnNode.value = column.F_EnCode;
  471. columnNode.showcheck = true;
  472. columnNode.checkstate = 0;
  473. columnNode.isexpand = true;
  474. columnNode.icon = "fa fa-filter";
  475. columnNode.parentId = column.F_ModuleId + "_learun_moduleId";
  476. treeList.Add(columnNode);
  477. };
  478. }
  479. else
  480. {
  481. treeList.Add(node);
  482. }
  483. }
  484. return treeList.ToTree();
  485. }
  486. #endregion
  487. #region 模块表单
  488. /// <summary>
  489. /// 获取表单字段数据
  490. /// </summary>
  491. /// <param name="moduleId">模块Id</param>
  492. /// <returns></returns>
  493. public List<ModuleFormEntity> GetFormList(string moduleId)
  494. {
  495. try
  496. {
  497. List<ModuleFormEntity> list = cache.Read<List<ModuleFormEntity>>(cacheKeyForm + moduleId, CacheId.module);
  498. if (list == null)
  499. {
  500. list = (List<ModuleFormEntity>)moduleService.GetFormList(moduleId);
  501. cache.Write<List<ModuleFormEntity>>(cacheKeyForm + moduleId, list, CacheId.module);
  502. }
  503. UserInfo userInfo = LoginUserInfo.Get();
  504. /*关联权限*/
  505. if (!userInfo.isSystem)
  506. {
  507. string objectIds = userInfo.userId + (string.IsNullOrEmpty(userInfo.roleIds) ? "" : ("," + userInfo.roleIds));
  508. List<string> itemIdList = authorizeIBLL.GetItemIdListByobjectIds(objectIds, 3);
  509. list = list.FindAll(t => itemIdList.IndexOf(t.F_ModuleFormId) >= 0);
  510. }
  511. return list;
  512. }
  513. catch (Exception ex)
  514. {
  515. if (ex is ExceptionEx)
  516. {
  517. throw;
  518. }
  519. else
  520. {
  521. throw ExceptionEx.ThrowBusinessException(ex);
  522. }
  523. }
  524. }
  525. /// <summary>
  526. /// 获取表单字段数据
  527. /// </summary>
  528. /// <param name="url">功能模块地址</param>
  529. /// <returns></returns>
  530. public List<ModuleFormEntity> GetFormListByUrl(string url)
  531. {
  532. try
  533. {
  534. ModuleEntity moduleEntity = GetModuleByUrl(url);
  535. if (moduleEntity == null)
  536. {
  537. return new List<ModuleFormEntity>();
  538. }
  539. return GetFormList(moduleEntity.F_ModuleId);
  540. }
  541. catch (Exception ex)
  542. {
  543. if (ex is ExceptionEx)
  544. {
  545. throw;
  546. }
  547. else
  548. {
  549. throw ExceptionEx.ThrowBusinessException(ex);
  550. }
  551. }
  552. }
  553. /// <summary>
  554. /// 获取表单字段树形数据(基于功能模块)
  555. /// </summary>
  556. /// <returns></returns>
  557. public List<TreeModel> GetFormCheckTree()
  558. {
  559. List<ModuleEntity> modulelist = GetModuleList();
  560. List<TreeModel> treeList = new List<TreeModel>();
  561. foreach (var module in modulelist)
  562. {
  563. TreeModel node = new TreeModel();
  564. node.id = module.F_ModuleId + "_learun_moduleId";
  565. node.text = module.F_FullName;
  566. node.value = module.F_EnCode;
  567. node.showcheck = true;
  568. node.checkstate = 0;
  569. node.isexpand = true;
  570. node.icon = module.F_Icon;
  571. node.parentId = module.F_ParentId + "_learun_moduleId";
  572. if (module.F_Target != "expand")
  573. {
  574. List<ModuleFormEntity> columnList = GetFormList(module.F_ModuleId);
  575. if (columnList.Count > 0)
  576. {
  577. treeList.Add(node);
  578. }
  579. foreach (var column in columnList)
  580. {
  581. TreeModel columnNode = new TreeModel();
  582. columnNode.id = column.F_ModuleFormId;
  583. columnNode.text = column.F_FullName;
  584. columnNode.value = column.F_EnCode;
  585. columnNode.showcheck = true;
  586. columnNode.checkstate = 0;
  587. columnNode.isexpand = true;
  588. columnNode.icon = "fa fa-filter";
  589. columnNode.parentId = column.F_ModuleId + "_learun_moduleId";
  590. treeList.Add(columnNode);
  591. };
  592. }
  593. else
  594. {
  595. treeList.Add(node);
  596. }
  597. }
  598. return treeList.ToTree();
  599. }
  600. #endregion
  601. #region 提交数据
  602. /// <summary>
  603. /// 虚拟删除模块功能
  604. /// </summary>
  605. /// <param name="keyValue">主键值</param>
  606. public bool Delete(string keyValue)
  607. {
  608. try
  609. {
  610. List<ModuleEntity> list = GetModuleListByParentId("", keyValue);
  611. if (list.Count > 0)
  612. {
  613. return false;
  614. }
  615. moduleService.Delete(keyValue);
  616. cache.Remove(cacheKey, CacheId.module);
  617. cache.Remove(cacheKeyBtn + keyValue, CacheId.module);
  618. cache.Remove(cacheKeyColumn + keyValue, CacheId.module);
  619. cache.Remove(cacheKeyForm + keyValue, CacheId.module);
  620. return true;
  621. }
  622. catch (Exception ex)
  623. {
  624. if (ex is ExceptionEx)
  625. {
  626. throw;
  627. }
  628. else
  629. {
  630. throw ExceptionEx.ThrowBusinessException(ex);
  631. }
  632. }
  633. }
  634. /// <summary>
  635. /// 保存模块功能实体(新增、修改)
  636. /// </summary>
  637. /// <param name="keyValue">主键值</param>
  638. /// <param name="moduleEntity">实体</param>
  639. /// <param name="moduleButtonEntitys">按钮列表</param>
  640. /// <param name="moduleColumnEntitys">视图列集合</param>
  641. /// <param name="moduleFormEntitys">表单字段集合</param>
  642. public void SaveEntity(string keyValue, ModuleEntity moduleEntity, List<ModuleButtonEntity> moduleButtonEntitys, List<ModuleColumnEntity> moduleColumnEntitys, List<ModuleFormEntity> moduleFormEntitys)
  643. {
  644. try
  645. {
  646. moduleService.SaveEntity(keyValue, moduleEntity, moduleButtonEntitys, moduleColumnEntitys, moduleFormEntitys);
  647. /*移除缓存信息*/
  648. cache.Remove(cacheKey, CacheId.module);
  649. if (!string.IsNullOrEmpty(keyValue))
  650. {
  651. cache.Remove(cacheKeyBtn + keyValue, CacheId.module);
  652. cache.Remove(cacheKeyColumn + keyValue, CacheId.module);
  653. cache.Remove(cacheKeyForm + keyValue, CacheId.module);
  654. }
  655. }
  656. catch (Exception ex)
  657. {
  658. if (ex is ExceptionEx)
  659. {
  660. throw;
  661. }
  662. else
  663. {
  664. throw ExceptionEx.ThrowBusinessException(ex);
  665. }
  666. }
  667. }
  668. #endregion
  669. #region 权限验证
  670. /// <summary>
  671. /// 验证当前访问的地址是否有权限
  672. /// </summary>
  673. /// <param name="url">访问地址</param>
  674. /// <returns></returns>
  675. public bool FilterAuthorize(string url)
  676. {
  677. try
  678. {
  679. List<ModuleEntity> list = GetModuleList();
  680. // 验证是否是功能页面
  681. var modulelist = list.FindAll(t => t.F_UrlAddress == url);
  682. if (modulelist.Count > 0)
  683. {
  684. return true;
  685. }
  686. // 是否是功能按钮的
  687. foreach (var item in list)
  688. {
  689. List<ModuleButtonEntity> buttonList = GetButtonList(item.F_ModuleId);
  690. var buttonList2 = buttonList.FindAll(t => t.F_ActionAddress == url);
  691. if (buttonList2.Count > 0)
  692. {
  693. return true;
  694. }
  695. }
  696. return false;
  697. }
  698. catch (Exception ex)
  699. {
  700. if (ex is ExceptionEx)
  701. {
  702. throw;
  703. }
  704. else
  705. {
  706. throw ExceptionEx.ThrowBusinessException(ex);
  707. }
  708. }
  709. }
  710. #endregion
  711. }
  712. }