Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

489 linhas
12 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Data;
  4. using System.Collections.Generic;
  5. namespace Learun.Application.TwoDevelopment.EducationalAdministration
  6. {
  7. /// <summary>
  8. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  9. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  10. /// 创 建:超级管理员
  11. /// 日 期:2019-01-29 17:31
  12. /// 描 述:教师信息管理
  13. /// </summary>
  14. public class EmpInfoBLL : EmpInfoIBLL
  15. {
  16. private EmpInfoService empInfoService = new EmpInfoService();
  17. #region 获取数据
  18. /// <summary>
  19. /// 获取页面显示列表数据
  20. /// <summary>
  21. /// <param name="queryJson">查询参数</param>
  22. /// <returns></returns>
  23. public IEnumerable<EmpInfoEntity> GetPageList(Pagination pagination, string queryJson)
  24. {
  25. try
  26. {
  27. return empInfoService.GetPageList(pagination, queryJson);
  28. }
  29. catch (Exception ex)
  30. {
  31. if (ex is ExceptionEx)
  32. {
  33. throw;
  34. }
  35. else
  36. {
  37. throw ExceptionEx.ThrowBusinessException(ex);
  38. }
  39. }
  40. }
  41. public IEnumerable<EmpInfoEntity> GetAllList()
  42. {
  43. try
  44. {
  45. return empInfoService.GetAllList();
  46. }
  47. catch (Exception ex)
  48. {
  49. if (ex is ExceptionEx)
  50. {
  51. throw;
  52. }
  53. else
  54. {
  55. throw ExceptionEx.ThrowBusinessException(ex);
  56. }
  57. }
  58. }
  59. /// <summary>
  60. /// 获取页面显示列表数据
  61. /// <summary>
  62. /// <param name="queryJson">查询参数</param>
  63. /// <returns></returns>
  64. public IEnumerable<EmpInfoEntity> GetList(string queryJson)
  65. {
  66. try
  67. {
  68. return empInfoService.GetList(queryJson);
  69. }
  70. catch (Exception ex)
  71. {
  72. if (ex is ExceptionEx)
  73. {
  74. throw;
  75. }
  76. else
  77. {
  78. throw ExceptionEx.ThrowBusinessException(ex);
  79. }
  80. }
  81. }
  82. public bool GetAny()
  83. {
  84. try
  85. {
  86. return empInfoService.GetAny();
  87. }
  88. catch (Exception ex)
  89. {
  90. if (ex is ExceptionEx)
  91. {
  92. throw;
  93. }
  94. else
  95. {
  96. throw ExceptionEx.ThrowBusinessException(ex);
  97. }
  98. }
  99. }
  100. /// <summary>
  101. /// 获取EmpInfo表实体数据
  102. /// <param name="keyValue">主键</param>
  103. /// <summary>
  104. /// <returns></returns>
  105. public EmpInfoEntity GetEmpInfoEntity(string keyValue)
  106. {
  107. try
  108. {
  109. return empInfoService.GetEmpInfoEntity(keyValue);
  110. }
  111. catch (Exception ex)
  112. {
  113. if (ex is ExceptionEx)
  114. {
  115. throw;
  116. }
  117. else
  118. {
  119. throw ExceptionEx.ThrowBusinessException(ex);
  120. }
  121. }
  122. }
  123. public IEnumerable<EmpInfoEntity> GetEmpInfoEntitiesByName(string name)
  124. {
  125. try
  126. {
  127. return empInfoService.GetEmpInfoEntitiesByName(name);
  128. }
  129. catch (Exception ex)
  130. {
  131. if (ex is ExceptionEx)
  132. {
  133. throw;
  134. }
  135. else
  136. {
  137. throw ExceptionEx.ThrowBusinessException(ex);
  138. }
  139. }
  140. }
  141. /// <summary>
  142. /// 教师年龄比例
  143. /// </summary>
  144. /// <returns></returns>
  145. public EmpInfoEntity GetEmpInfoAgeRate()
  146. {
  147. try
  148. {
  149. return empInfoService.GetEmpInfoAgeRate();
  150. }
  151. catch (Exception ex)
  152. {
  153. if (ex is ExceptionEx)
  154. {
  155. throw;
  156. }
  157. else
  158. {
  159. throw ExceptionEx.ThrowBusinessException(ex);
  160. }
  161. }
  162. }
  163. #endregion
  164. #region 提交数据
  165. /// <summary>
  166. /// 生成教师帐号
  167. /// </summary>
  168. public void GenerateAccout(string empId = null)
  169. {
  170. try
  171. {
  172. empInfoService.GenerateAccout(empId);
  173. }
  174. catch (Exception ex)
  175. {
  176. if (ex is ExceptionEx)
  177. {
  178. throw;
  179. }
  180. else
  181. {
  182. throw ExceptionEx.ThrowBusinessException(ex);
  183. }
  184. }
  185. }
  186. public void Lock(string keyValue)
  187. {
  188. try
  189. {
  190. empInfoService.Lock(keyValue);
  191. }
  192. catch (Exception ex)
  193. {
  194. if (ex is ExceptionEx)
  195. {
  196. throw;
  197. }
  198. else
  199. {
  200. throw ExceptionEx.ThrowBusinessException(ex);
  201. }
  202. }
  203. }
  204. public void UnLock(string keyValue)
  205. {
  206. try
  207. {
  208. empInfoService.UnLock(keyValue);
  209. }
  210. catch (Exception ex)
  211. {
  212. if (ex is ExceptionEx)
  213. {
  214. throw;
  215. }
  216. else
  217. {
  218. throw ExceptionEx.ThrowBusinessException(ex);
  219. }
  220. }
  221. }
  222. /// <summary>
  223. /// 删除实体数据
  224. /// <param name="keyValue">主键</param>
  225. /// <summary>
  226. /// <returns></returns>
  227. public void DeleteEntity(string keyValue)
  228. {
  229. try
  230. {
  231. empInfoService.DeleteEntity(keyValue);
  232. }
  233. catch (Exception ex)
  234. {
  235. if (ex is ExceptionEx)
  236. {
  237. throw;
  238. }
  239. else
  240. {
  241. throw ExceptionEx.ThrowBusinessException(ex);
  242. }
  243. }
  244. }
  245. /// <summary>
  246. /// 保存实体数据(新增、修改)
  247. /// <param name="keyValue">主键</param>
  248. /// <summary>
  249. /// <returns></returns>
  250. public void SaveEntity(string keyValue, EmpInfoEntity entity)
  251. {
  252. try
  253. {
  254. empInfoService.SaveEntity(keyValue, entity);
  255. }
  256. catch (Exception ex)
  257. {
  258. if (ex is ExceptionEx)
  259. {
  260. throw;
  261. }
  262. else
  263. {
  264. throw ExceptionEx.ThrowBusinessException(ex);
  265. }
  266. }
  267. }
  268. /// <summary>
  269. /// 保存实体数据(新增、修改)
  270. /// <param name="keyValue">主键</param>
  271. /// <summary>
  272. /// <returns></returns>
  273. public void SaveEntity(UserInfo userInfo, string keyValue, EmpInfoEntity entity)
  274. {
  275. try
  276. {
  277. empInfoService.SaveEntity(userInfo, keyValue, entity);
  278. }
  279. catch (Exception ex)
  280. {
  281. if (ex is ExceptionEx)
  282. {
  283. throw;
  284. }
  285. else
  286. {
  287. throw ExceptionEx.ThrowBusinessException(ex);
  288. }
  289. }
  290. }
  291. public void UpdatePhoto(string id, string photo)
  292. {
  293. try
  294. {
  295. empInfoService.UpdatePhoto(id, photo);
  296. }
  297. catch (Exception ex)
  298. {
  299. if (ex is ExceptionEx)
  300. {
  301. throw;
  302. }
  303. else
  304. {
  305. throw ExceptionEx.ThrowBusinessException(ex);
  306. }
  307. }
  308. }
  309. public void CheckAll()
  310. {
  311. try
  312. {
  313. empInfoService.CheckAll();
  314. }
  315. catch (Exception ex)
  316. {
  317. if (ex is ExceptionEx)
  318. {
  319. throw;
  320. }
  321. else
  322. {
  323. throw ExceptionEx.ThrowBusinessException(ex);
  324. }
  325. }
  326. }
  327. public EmpInfoEntity GetEmpInfoEntityByEmpNo(string keyValue)
  328. {
  329. try
  330. {
  331. return empInfoService.GetEmpInfoEntityByNo(keyValue);
  332. }
  333. catch (Exception ex)
  334. {
  335. if (ex is ExceptionEx)
  336. {
  337. throw;
  338. }
  339. else
  340. {
  341. throw ExceptionEx.ThrowBusinessException(ex);
  342. }
  343. }
  344. }
  345. public EmpInfoEntity GetEmpInfoEntityByIdCardNo(string keyValue)
  346. {
  347. try
  348. {
  349. return empInfoService.GetEmpInfoEntityByIdCardNo(keyValue);
  350. }
  351. catch (Exception ex)
  352. {
  353. if (ex is ExceptionEx)
  354. {
  355. throw;
  356. }
  357. else
  358. {
  359. throw ExceptionEx.ThrowBusinessException(ex);
  360. }
  361. }
  362. }
  363. public EmpInfoEntity GetEmpInfoEntityByMobile(string mobile)
  364. {
  365. try
  366. {
  367. return empInfoService.GetEmpInfoEntityByMobile(mobile);
  368. }
  369. catch (Exception ex)
  370. {
  371. if (ex is ExceptionEx)
  372. {
  373. throw;
  374. }
  375. else
  376. {
  377. throw ExceptionEx.ThrowBusinessException(ex);
  378. }
  379. }
  380. }
  381. public List<EmpInfoEntity> GetEmpInfoEntityByDepartment(string keyValue)
  382. {
  383. try
  384. {
  385. return empInfoService.GetEmpInfoEntityByDepartment(keyValue);
  386. }
  387. catch (Exception ex)
  388. {
  389. if (ex is ExceptionEx)
  390. {
  391. throw;
  392. }
  393. else
  394. {
  395. throw ExceptionEx.ThrowBusinessException(ex);
  396. }
  397. }
  398. }
  399. public EmpInfoEntity GetEmpInfoEntityById(string keyValue)
  400. {
  401. try
  402. {
  403. return empInfoService.GetEmpInfoEntityById(keyValue);
  404. }
  405. catch (Exception ex)
  406. {
  407. if (ex is ExceptionEx)
  408. {
  409. throw;
  410. }
  411. else
  412. {
  413. throw ExceptionEx.ThrowBusinessException(ex);
  414. }
  415. }
  416. }
  417. public void UpdateAccount(string empId = null)
  418. {
  419. try
  420. {
  421. empInfoService.UpdateAccount(empId);
  422. }
  423. catch (Exception ex)
  424. {
  425. if (ex is ExceptionEx)
  426. {
  427. throw;
  428. }
  429. else
  430. {
  431. throw ExceptionEx.ThrowBusinessException(ex);
  432. }
  433. }
  434. }
  435. /// <summary>
  436. /// 保存部门、系部
  437. /// <param name="keyValue">主键</param>
  438. /// <summary>
  439. /// <returns></returns>
  440. public void SaveEditEntity(string keyValue, EmpInfoEntity entity)
  441. {
  442. try
  443. {
  444. empInfoService.SaveEditEntity(keyValue, entity);
  445. }
  446. catch (Exception ex)
  447. {
  448. if (ex is ExceptionEx)
  449. {
  450. throw;
  451. }
  452. else
  453. {
  454. throw ExceptionEx.ThrowBusinessException(ex);
  455. }
  456. }
  457. }
  458. #endregion
  459. }
  460. }