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.
 
 
 
 
 
 

426 lines
11 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. #endregion
  142. #region 提交数据
  143. /// <summary>
  144. /// 生成教师帐号
  145. /// </summary>
  146. public void GenerateAccout(string empId = null)
  147. {
  148. try
  149. {
  150. empInfoService.GenerateAccout(empId);
  151. }
  152. catch (Exception ex)
  153. {
  154. if (ex is ExceptionEx)
  155. {
  156. throw;
  157. }
  158. else
  159. {
  160. throw ExceptionEx.ThrowBusinessException(ex);
  161. }
  162. }
  163. }
  164. public void Lock(string keyValue)
  165. {
  166. try
  167. {
  168. empInfoService.Lock(keyValue);
  169. }
  170. catch (Exception ex)
  171. {
  172. if (ex is ExceptionEx)
  173. {
  174. throw;
  175. }
  176. else
  177. {
  178. throw ExceptionEx.ThrowBusinessException(ex);
  179. }
  180. }
  181. }
  182. public void UnLock(string keyValue)
  183. {
  184. try
  185. {
  186. empInfoService.UnLock(keyValue);
  187. }
  188. catch (Exception ex)
  189. {
  190. if (ex is ExceptionEx)
  191. {
  192. throw;
  193. }
  194. else
  195. {
  196. throw ExceptionEx.ThrowBusinessException(ex);
  197. }
  198. }
  199. }
  200. /// <summary>
  201. /// 删除实体数据
  202. /// <param name="keyValue">主键</param>
  203. /// <summary>
  204. /// <returns></returns>
  205. public void DeleteEntity(string keyValue)
  206. {
  207. try
  208. {
  209. empInfoService.DeleteEntity(keyValue);
  210. }
  211. catch (Exception ex)
  212. {
  213. if (ex is ExceptionEx)
  214. {
  215. throw;
  216. }
  217. else
  218. {
  219. throw ExceptionEx.ThrowBusinessException(ex);
  220. }
  221. }
  222. }
  223. /// <summary>
  224. /// 保存实体数据(新增、修改)
  225. /// <param name="keyValue">主键</param>
  226. /// <summary>
  227. /// <returns></returns>
  228. public void SaveEntity(string keyValue, EmpInfoEntity entity)
  229. {
  230. try
  231. {
  232. empInfoService.SaveEntity(keyValue, entity);
  233. }
  234. catch (Exception ex)
  235. {
  236. if (ex is ExceptionEx)
  237. {
  238. throw;
  239. }
  240. else
  241. {
  242. throw ExceptionEx.ThrowBusinessException(ex);
  243. }
  244. }
  245. }
  246. /// <summary>
  247. /// 保存实体数据(新增、修改)
  248. /// <param name="keyValue">主键</param>
  249. /// <summary>
  250. /// <returns></returns>
  251. public void SaveEntity(UserInfo userInfo, string keyValue, EmpInfoEntity entity)
  252. {
  253. try
  254. {
  255. empInfoService.SaveEntity(userInfo, keyValue, entity);
  256. }
  257. catch (Exception ex)
  258. {
  259. if (ex is ExceptionEx)
  260. {
  261. throw;
  262. }
  263. else
  264. {
  265. throw ExceptionEx.ThrowBusinessException(ex);
  266. }
  267. }
  268. }
  269. public void UpdatePhoto(string id, string photo)
  270. {
  271. try
  272. {
  273. empInfoService.UpdatePhoto(id, photo);
  274. }
  275. catch (Exception ex)
  276. {
  277. if (ex is ExceptionEx)
  278. {
  279. throw;
  280. }
  281. else
  282. {
  283. throw ExceptionEx.ThrowBusinessException(ex);
  284. }
  285. }
  286. }
  287. public void CheckAll()
  288. {
  289. try
  290. {
  291. empInfoService.CheckAll();
  292. }
  293. catch (Exception ex)
  294. {
  295. if (ex is ExceptionEx)
  296. {
  297. throw;
  298. }
  299. else
  300. {
  301. throw ExceptionEx.ThrowBusinessException(ex);
  302. }
  303. }
  304. }
  305. public EmpInfoEntity GetEmpInfoEntityByEmpNo(string keyValue)
  306. {
  307. try
  308. {
  309. return empInfoService.GetEmpInfoEntityByNo(keyValue);
  310. }
  311. catch (Exception ex)
  312. {
  313. if (ex is ExceptionEx)
  314. {
  315. throw;
  316. }
  317. else
  318. {
  319. throw ExceptionEx.ThrowBusinessException(ex);
  320. }
  321. }
  322. }
  323. public List<EmpInfoEntity> GetEmpInfoEntityByDepartment(string keyValue)
  324. {
  325. try
  326. {
  327. return empInfoService.GetEmpInfoEntityByDepartment(keyValue);
  328. }
  329. catch (Exception ex)
  330. {
  331. if (ex is ExceptionEx)
  332. {
  333. throw;
  334. }
  335. else
  336. {
  337. throw ExceptionEx.ThrowBusinessException(ex);
  338. }
  339. }
  340. }
  341. public EmpInfoEntity GetEmpInfoEntityById(string keyValue)
  342. {
  343. try
  344. {
  345. return empInfoService.GetEmpInfoEntityById(keyValue);
  346. }
  347. catch (Exception ex)
  348. {
  349. if (ex is ExceptionEx)
  350. {
  351. throw;
  352. }
  353. else
  354. {
  355. throw ExceptionEx.ThrowBusinessException(ex);
  356. }
  357. }
  358. }
  359. public void UpdateAccount(string empId=null)
  360. {
  361. try
  362. {
  363. empInfoService.UpdateAccount(empId);
  364. }
  365. catch (Exception ex)
  366. {
  367. if (ex is ExceptionEx)
  368. {
  369. throw;
  370. }
  371. else
  372. {
  373. throw ExceptionEx.ThrowBusinessException(ex);
  374. }
  375. }
  376. }
  377. /// <summary>
  378. /// 保存部门、系部
  379. /// <param name="keyValue">主键</param>
  380. /// <summary>
  381. /// <returns></returns>
  382. public void SaveEditEntity(string keyValue, EmpInfoEntity entity)
  383. {
  384. try
  385. {
  386. empInfoService.SaveEditEntity(keyValue, entity);
  387. }
  388. catch (Exception ex)
  389. {
  390. if (ex is ExceptionEx)
  391. {
  392. throw;
  393. }
  394. else
  395. {
  396. throw ExceptionEx.ThrowBusinessException(ex);
  397. }
  398. }
  399. }
  400. #endregion
  401. }
  402. }