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.
 
 
 
 
 
 

486 lines
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. public EmpInfoEntity GetEmpInfoEntityByIdCard(string idcard)
  142. {
  143. try
  144. {
  145. return empInfoService.GetEmpInfoEntityByIdCard(idcard);
  146. }
  147. catch (Exception ex)
  148. {
  149. if (ex is ExceptionEx)
  150. {
  151. throw;
  152. }
  153. else
  154. {
  155. throw ExceptionEx.ThrowBusinessException(ex);
  156. }
  157. }
  158. }
  159. /// <summary>
  160. /// 教师年龄比例
  161. /// </summary>
  162. /// <returns></returns>
  163. public EmpInfoEntity GetEmpInfoAgeRate()
  164. {
  165. try
  166. {
  167. return empInfoService.GetEmpInfoAgeRate();
  168. }
  169. catch (Exception ex)
  170. {
  171. if (ex is ExceptionEx)
  172. {
  173. throw;
  174. }
  175. else
  176. {
  177. throw ExceptionEx.ThrowBusinessException(ex);
  178. }
  179. }
  180. }
  181. #endregion
  182. #region 提交数据
  183. /// <summary>
  184. /// 生成教师帐号
  185. /// </summary>
  186. public void GenerateAccout(string empId = null)
  187. {
  188. try
  189. {
  190. empInfoService.GenerateAccout(empId);
  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 Lock(string keyValue)
  205. {
  206. try
  207. {
  208. empInfoService.Lock(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. public void UnLock(string keyValue)
  223. {
  224. try
  225. {
  226. empInfoService.UnLock(keyValue);
  227. }
  228. catch (Exception ex)
  229. {
  230. if (ex is ExceptionEx)
  231. {
  232. throw;
  233. }
  234. else
  235. {
  236. throw ExceptionEx.ThrowBusinessException(ex);
  237. }
  238. }
  239. }
  240. /// <summary>
  241. /// 删除实体数据
  242. /// <param name="keyValue">主键</param>
  243. /// <summary>
  244. /// <returns></returns>
  245. public void DeleteEntity(string keyValue)
  246. {
  247. try
  248. {
  249. empInfoService.DeleteEntity(keyValue);
  250. }
  251. catch (Exception ex)
  252. {
  253. if (ex is ExceptionEx)
  254. {
  255. throw;
  256. }
  257. else
  258. {
  259. throw ExceptionEx.ThrowBusinessException(ex);
  260. }
  261. }
  262. }
  263. /// <summary>
  264. /// 保存实体数据(新增、修改)
  265. /// <param name="keyValue">主键</param>
  266. /// <summary>
  267. /// <returns></returns>
  268. public void SaveEntity(string keyValue, EmpInfoEntity entity)
  269. {
  270. try
  271. {
  272. empInfoService.SaveEntity(keyValue, entity);
  273. }
  274. catch (Exception ex)
  275. {
  276. if (ex is ExceptionEx)
  277. {
  278. throw;
  279. }
  280. else
  281. {
  282. throw ExceptionEx.ThrowBusinessException(ex);
  283. }
  284. }
  285. }
  286. /// <summary>
  287. /// 保存实体数据(新增、修改)
  288. /// <param name="keyValue">主键</param>
  289. /// <summary>
  290. /// <returns></returns>
  291. public void SaveEntity(UserInfo userInfo, string keyValue, EmpInfoEntity entity)
  292. {
  293. try
  294. {
  295. empInfoService.SaveEntity(userInfo, keyValue, entity);
  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 UpdatePhoto(string id, string photo)
  310. {
  311. try
  312. {
  313. empInfoService.UpdatePhoto(id, photo);
  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 void CheckAll()
  328. {
  329. try
  330. {
  331. empInfoService.CheckAll();
  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 GetEmpInfoEntityByEmpNo(string keyValue)
  346. {
  347. try
  348. {
  349. return empInfoService.GetEmpInfoEntityByNo(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 List<EmpInfoEntity> GetEmpInfoEntityByDepartment(string keyValue)
  364. {
  365. try
  366. {
  367. return empInfoService.GetEmpInfoEntityByDepartment(keyValue);
  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 EmpInfoEntity GetEmpInfoEntityById(string keyValue)
  382. {
  383. try
  384. {
  385. return empInfoService.GetEmpInfoEntityById(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 void UpdateAccount(string empId=null)
  400. {
  401. try
  402. {
  403. empInfoService.UpdateAccount(empId);
  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 UpdateQRCodeStatus(string keyValue, int QRCodeStatus)
  418. {
  419. try
  420. {
  421. empInfoService.UpdateQRCodeStatus(keyValue, QRCodeStatus);
  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. }