RecruitSpecialtyServices.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Transactions;
  6. using EMIS.Entities;
  7. using EMIS.ViewModel;
  8. using EMIS.ViewModel.CacheManage;
  9. using EMIS.CommonLogic.SystemServices;
  10. namespace EMIS.ExtensionLogic.ServiceLogic.EnrollManage
  11. {
  12. public class RecruitSpecialtyServices : EMIS.CommonLogic.EnrollManage.SpecialtyManage.RecruitSpecialtyServices
  13. {
  14. /// <summary>
  15. /// 流水号生成Services
  16. /// </summary>
  17. public ISerialNumberServices SerialNumberServices { get; set; }
  18. /// <summary>
  19. /// 东莞理工专业班级生成规则(此版本生成规则,暂时这么处理,专业分方向不支持生成)
  20. /// </summary>
  21. /// <param name="recruitSpecialtyIDs"></param>
  22. /// <returns></returns>
  23. public override string GenerateClass(List<Guid?> recruitSpecialtyIDs)
  24. {
  25. //生成规则如下:
  26. //院系编码:院系所编号+学习形式Value+培养层次Value+6位专业代码,拼出来,如:0112030101
  27. //院系名称:院系所简称+"-"+专业名称+学习形式+培养层次,如:莞城-法学业余专升本
  28. //年级专业编码:年级后两位+院系所编号+学习形式Value+培养层次Value+6位专业代码,拼出来,如:170112030101
  29. //年级专业名称:年级+院系所简称+"-"+专业名称+学习形式+培养层次,如:2017莞城-法学业余专升本
  30. //班级编码:年级+3位流水号,拼出来,如:2017001
  31. //班级名称(区分本专科):
  32. //本科:年级后两位+专业名称+"本科"+学习形式+"班"+"("+院系所简称+")"
  33. //专科:年级后两位+专业名称+学习形式+"班"+"("+院系所简称+")"
  34. try
  35. {
  36. //查询招生专业信息
  37. var recruitSpecialtyList = recruitSpecialtyDAL.recruitSpecialtyRepository.GetList(x => recruitSpecialtyIDs.Contains(x.RecruitSpecialtyID)).ToList();
  38. //年级ID
  39. var gradeIDList = recruitSpecialtyList.Where(x => !string.IsNullOrEmpty(x.GradeID.ToString())).Select(x => x.GradeID).ToList();
  40. //专业信息ID
  41. var specialtyIDList = recruitSpecialtyList.Where(x => !string.IsNullOrEmpty(x.SpecialtyID.ToString())).Select(x => x.SpecialtyID).ToList();
  42. //院系所ID
  43. var collegeIDList = recruitSpecialtyList.Where(x => !string.IsNullOrEmpty(x.CollegeID.ToString())).Select(x => x.CollegeID).ToList();
  44. //查询专业信息
  45. var specialtyList = recruitSpecialtyDAL.specialtyRepository.GetList(x => specialtyIDList.Contains(x.SpecialtyID)).ToList();
  46. //查询院系所信息
  47. var collegeList = recruitSpecialtyDAL.collegeRepository.Entities.Where(x => collegeIDList.Contains(x.CollegeID)).ToList();
  48. //年级
  49. var gradeList = IdNameExt.GetDictionaryItem(DictionaryItem.CF_Grade).ToList();
  50. //专业代码、专业名称、专业ID(Value)
  51. var standardList = IdNameExt.GetDictionaryItem(DictionaryItem.CF_Standard).ToList();
  52. //培养层次(所修学历)
  53. var educationList = IdNameExt.GetDictionaryItem(DictionaryItem.CF_Education).ToList();
  54. //学习形式
  55. var learningFormList = IdNameExt.GetDictionaryItem(DictionaryItem.CF_Learningform).ToList();
  56. //查询对应的院系专业信息
  57. var facultyMajorList = recruitSpecialtyDAL.GetFacultymajorByRecruitSpecialty(x => recruitSpecialtyIDs.Contains(x.RecruitSpecialtyID)).ToList();
  58. //院系专业ID
  59. var facultyMajorIDList = facultyMajorList.Where(x => !string.IsNullOrEmpty(x.FacultymajorID.ToString())).Select(x => x.FacultymajorID).ToList();
  60. //查询对应的年级专业信息
  61. var gradeMajorList = recruitSpecialtyDAL.GetGrademajorByRecruitSpecialty(x => recruitSpecialtyIDs.Contains(x.RecruitSpecialtyID), x => facultyMajorIDList.Contains(x.FacultymajorID)).ToList();
  62. //年级专业ID
  63. var gradeMajorIDList = gradeMajorList.Where(x => !string.IsNullOrEmpty(x.GrademajorID.ToString())).Select(x => x.GrademajorID).ToList();
  64. //查询对应的班级信息
  65. var classMajorList = recruitSpecialtyDAL.GetClassmajorByRecruitSpecialty(x => recruitSpecialtyIDs.Contains(x.RecruitSpecialtyID), x => facultyMajorIDList.Contains(x.FacultymajorID), x => gradeMajorIDList.Contains(x.GrademajorID)).ToList();
  66. //班级信息ID
  67. var classMajorIDList = classMajorList.Where(x => !string.IsNullOrEmpty(x.ClassmajorID.ToString())).Select(x => x.ClassmajorID).ToList();
  68. //查询学年学期信息
  69. var schoolyearList = recruitSpecialtyDAL.schoolyearRepository.GetList(x => true).ToList();
  70. //培养层次类型(区分本科、专科)
  71. var educationTypeList = IdNameExt.GetDictionaryItem(DictionaryItem.CF_EducationType).ToList();
  72. //查询培养类型设置信息
  73. var educationTypeSettingList = recruitSpecialtyDAL.educationTypeSettingRepository.GetList(x => true).ToList();
  74. //判断培养类型设置信息
  75. if (educationTypeSettingList == null || educationTypeSettingList.Count() <= 0)
  76. {
  77. throw new Exception("培养类型设置信息未配置,请检查。");
  78. }
  79. var facultymajorCode = "";
  80. var facultymajorName = "";
  81. var grademajorCode = "";
  82. var grademajorName = "";
  83. var classmajorCode = "";
  84. var classmajorName = "";
  85. int facultyMajorfail = 0;
  86. int gradeMajorfail = 0;
  87. int classMajorfail = 0;
  88. int fail = 0;
  89. int success = 0;
  90. string classNoSerialNumber = null;
  91. string tipMessage = null;
  92. List<CF_RecruitSpecialty> recruitSpecialtyUpList = new List<CF_RecruitSpecialty>();
  93. List<CF_Facultymajor> facultymajorInList = new List<CF_Facultymajor>();
  94. List<CF_Grademajor> grademajorInList = new List<CF_Grademajor>();
  95. List<CF_Classmajor> classmajorInList = new List<CF_Classmajor>();
  96. foreach (var recruitSpecialty in recruitSpecialtyList)
  97. {
  98. //目前只处理招生专业与专业班级一对一的情况(已存在的情况下,不做处理)
  99. //由于存在专业分方向、同一年级专业有多个班的情况(后期可在此处进行扩展:普教版本存在此类情况)
  100. //查询对应的院系所信息
  101. var college = collegeList.Where(x => x.CollegeID == recruitSpecialty.CollegeID).SingleOrDefault();
  102. //查询对应的专业信息
  103. var specialty = specialtyList.Where(x => x.SpecialtyID == recruitSpecialty.SpecialtyID).SingleOrDefault();
  104. //专业名称数据字典
  105. var standard = standardList.Where(x => x.Value == specialty.StandardID).SingleOrDefault();
  106. //培养层次(所修学历)
  107. var education = educationList.Where(x => x.Value == specialty.EducationID).SingleOrDefault();
  108. //学习形式
  109. var learningForm = learningFormList.Where(x => x.Value == specialty.LearningformID).SingleOrDefault();
  110. //查询培养类型设置对应的信息
  111. var educationTypeSetting = educationTypeSettingList.Where(x => x.EducationID == specialty.EducationID).SingleOrDefault();
  112. //查询对应的培养层次类型
  113. var educationType = educationTypeList.Where(x => x.Value == educationTypeSetting.EducationTypeID).SingleOrDefault();
  114. //计算毕业学年学期Value
  115. var graduateSchoolyearValue = (recruitSpecialty.GradeID * 2) - 1 + (recruitSpecialty.SemesterID - 1)
  116. + Convert.ToInt32(Math.Ceiling(specialty.LearnSystem.Value * 2 - 1));
  117. //查询对应的学年学期信息
  118. var graduateSchoolyear = schoolyearList.Where(x => x.Value == graduateSchoolyearValue).SingleOrDefault();
  119. //院系专业编号(处理6位专业代码的问题)
  120. if (standard.Code.Length > 6)
  121. {
  122. //院系所编号+学习形式Value+培养层次Value+6位专业代码
  123. facultymajorCode = college.No.Trim() + specialty.LearningformID.ToString().Trim() + specialty.EducationID.ToString().Trim()
  124. + standard.Code.Substring(0, 6);
  125. }
  126. else
  127. {
  128. //院系所编号+学习形式Value+培养层次Value+6位专业代码
  129. facultymajorCode = college.No.Trim() + specialty.LearningformID.ToString().Trim() + specialty.EducationID.ToString().Trim() + standard.Code.PadLeft(6, '0');
  130. }
  131. //院系专业名称(院系所简称+"-"+专业名称+学习形式+培养层次)
  132. if (string.IsNullOrEmpty(college.SimpleName))
  133. {
  134. facultymajorName = college.Name.Trim() + "-" + standard.Name.Trim() + learningForm.Name.Trim() + education.Name.Trim();
  135. }
  136. else
  137. {
  138. facultymajorName = college.SimpleName.Trim() + "-" + standard.Name.Trim() + learningForm.Name.Trim() + education.Name.Trim();
  139. }
  140. //年级专业编号(年级后两位+院系所编号+学习形式Value+培养层次Value+6位专业代码)
  141. grademajorCode = recruitSpecialty.GradeID.ToString().Substring(recruitSpecialty.GradeID.ToString().Length - 2) + facultymajorCode;
  142. //年级专业名称(年级+院系所简称+"-"+专业名称+学习形式+培养层次)
  143. grademajorName = recruitSpecialty.GradeID.ToString() + facultymajorName;
  144. //班级编号(年级+3位流水号,注:先获取,再存储)
  145. classNoSerialNumber = SerialNumberServices.GetSN("Const.CF_CLASSMAJOR_NO_PREFIX" + recruitSpecialty.GradeID.ToString(), 3);
  146. classmajorCode = classNoSerialNumber.Replace("Const.CF_CLASSMAJOR_NO_PREFIX", " ").Trim();
  147. //班级名称(区分本专科):
  148. //本科:年级后两位+专业名称+"本科"+学习形式+"班"+"("+院系所简称+")"
  149. //专科:年级后两位+专业名称+学习形式+"班"+"("+院系所简称+")"
  150. if (educationType.Value == (int)CF_EducationType.UnderGraduate)
  151. {
  152. //表示本科
  153. if (string.IsNullOrEmpty(college.SimpleName.Trim()))
  154. {
  155. classmajorName = recruitSpecialty.GradeID.ToString().Substring(recruitSpecialty.GradeID.ToString().Length - 2)
  156. + standard.Name.Trim() + educationType.Name.Trim() + learningForm.Name.Trim() + "班" + "(" + college.Name + ")";
  157. }
  158. else
  159. {
  160. classmajorName = recruitSpecialty.GradeID.ToString().Substring(recruitSpecialty.GradeID.ToString().Length - 2)
  161. + standard.Name.Trim() + educationType.Name.Trim() + learningForm.Name.Trim() + "班" + "(" + college.SimpleName + ")";
  162. }
  163. }
  164. else if (educationType.Value == (int)CF_EducationType.Special)
  165. {
  166. //表示专科
  167. if (string.IsNullOrEmpty(college.SimpleName.Trim()))
  168. {
  169. classmajorName = recruitSpecialty.GradeID.ToString().Substring(recruitSpecialty.GradeID.ToString().Length - 2)
  170. + standard.Name.Trim() + learningForm.Name.Trim() + "班" + "(" + college.Name + ")";
  171. }
  172. else
  173. {
  174. classmajorName = recruitSpecialty.GradeID.ToString().Substring(recruitSpecialty.GradeID.ToString().Length - 2)
  175. + standard.Name.Trim() + learningForm.Name.Trim() + "班" + "(" + college.SimpleName + ")";
  176. }
  177. }
  178. else
  179. {
  180. //表示无法根据培养层次类型表定位时,默认此规则(由于是基础数据配置暂时不考虑抛出错误)
  181. classmajorName = recruitSpecialty.GradeID.ToString().Substring(recruitSpecialty.GradeID.ToString().Length - 2)
  182. + standard.Name.Trim() + learningForm.Name.Trim() + education.Name.Trim() + "班" + "(" + college.SimpleName + ")";
  183. }
  184. var facultymajor = new CF_Facultymajor();
  185. var grademajor = new CF_Grademajor();
  186. var classmajor = new CF_Classmajor();
  187. //查询院系专业
  188. var facultyMajorVerify = facultyMajorList.Where(x => x.RecruitSpecialtyID == recruitSpecialty.RecruitSpecialtyID).ToList();
  189. //判断对应的院系专业
  190. if (facultyMajorVerify != null && facultyMajorVerify.Count() > 0)
  191. {
  192. //表示对应的院系专业信息已存在(可在此处,做更新处理:需准确定位院系专业)
  193. if (facultyMajorVerify.Count() == 1)
  194. {
  195. //查询对应的院系专业(只有一条院系专业可在此处做更新处理)
  196. var facultyMajorEntity = facultyMajorVerify.Where(x => x.RecruitSpecialtyID == recruitSpecialty.RecruitSpecialtyID).SingleOrDefault();
  197. //查询年级专业
  198. var gradeMajorVerify = gradeMajorList.Where(x => x.RecruitSpecialtyID == recruitSpecialty.RecruitSpecialtyID).ToList();
  199. //判断对应的年级专业
  200. if (gradeMajorVerify != null && gradeMajorVerify.Count() > 0)
  201. {
  202. //表示对应的年级专业信息已存在(可在此处,做更新处理:需准确定位院系专业)
  203. if (gradeMajorVerify.Count() == 1)
  204. {
  205. //查询对应的年级专业(只有一条年级专业可在此处做更新处理)
  206. var gradeMajorEntity = gradeMajorVerify.Where(x => x.RecruitSpecialtyID == recruitSpecialty.RecruitSpecialtyID).SingleOrDefault();
  207. //查询班级信息
  208. var classMajorVerify = classMajorList.Where(x => x.RecruitSpecialtyID == recruitSpecialty.RecruitSpecialtyID).ToList();
  209. //判断对应的班级信息
  210. if (classMajorVerify != null && classMajorVerify.Count() > 0)
  211. {
  212. //表示对应的班级信息已存在(可在此处,做更新处理:需准确定位院系专业)
  213. if (classMajorVerify.Count() == 1)
  214. {
  215. //查询对应的班级信息(只有一条班级信息可在此处做更新处理)
  216. var classMajorEntity = classMajorVerify.Where(x => x.RecruitSpecialtyID == recruitSpecialty.RecruitSpecialtyID).SingleOrDefault();
  217. //(暂时不做更新处理)
  218. //更新招生专业信息生成状态
  219. recruitSpecialty.isGenerated = true;
  220. recruitSpecialtyUpList.Add(recruitSpecialty);
  221. success++;
  222. }
  223. else
  224. {
  225. //在此处进行处理特殊情况(存在专业分方向、同一年级专业有多个班的情况)
  226. classMajorfail++;
  227. continue;
  228. }
  229. }
  230. else
  231. {
  232. //表示对应的班级信息不存在
  233. classmajor.ClassmajorID = Guid.NewGuid();
  234. classmajor.GrademajorID = gradeMajorEntity.GrademajorID;
  235. classmajor.No = classmajorCode;
  236. classmajor.Name = classmajorName;
  237. classmajor.Abbreviation = classmajor.Name;
  238. classmajor.ClassNum = 1;
  239. SetNewStatus(classmajor, (int)SYS_STATUS.USABLE);
  240. classmajorInList.Add(classmajor);
  241. //存储序列号
  242. SerialNumberServices.SetSN("Const.CF_CLASSMAJOR_NO_PREFIX" + recruitSpecialty.GradeID.ToString(), 3);
  243. //更新招生专业信息生成状态
  244. recruitSpecialty.isGenerated = true;
  245. recruitSpecialtyUpList.Add(recruitSpecialty);
  246. success++;
  247. }
  248. }
  249. else
  250. {
  251. //在此处进行处理特殊情况(存在专业分方向、同一年级专业有多个班的情况)
  252. gradeMajorfail++;
  253. continue;
  254. }
  255. }
  256. else
  257. {
  258. //表示对应的年级专业信息不存在
  259. grademajor.GrademajorID = Guid.NewGuid();
  260. grademajor.Code = grademajorCode;
  261. grademajor.Name = grademajorName;
  262. grademajor.Abbreviation = grademajor.Name;
  263. grademajor.GradeID = recruitSpecialty.GradeID;
  264. grademajor.SemesterID = recruitSpecialty.SemesterID;
  265. grademajor.FacultymajorID = facultyMajorEntity.FacultymajorID;
  266. if (graduateSchoolyear == null)
  267. {
  268. //表示年级专业对应的毕业学期,在学年学期信息中不存在
  269. fail++;
  270. continue;
  271. }
  272. else
  273. {
  274. grademajor.GraduateSchoolyearID = graduateSchoolyear.SchoolyearID;
  275. }
  276. SetNewStatus(grademajor, (int)SYS_STATUS.USABLE);
  277. //表示对应的班级信息不存在
  278. classmajor.ClassmajorID = Guid.NewGuid();
  279. classmajor.GrademajorID = grademajor.GrademajorID;
  280. classmajor.No = classmajorCode;
  281. classmajor.Name = classmajorName;
  282. classmajor.Abbreviation = classmajor.Name;
  283. classmajor.ClassNum = 1;
  284. SetNewStatus(classmajor, (int)SYS_STATUS.USABLE);
  285. grademajorInList.Add(grademajor);
  286. classmajorInList.Add(classmajor);
  287. //存储序列号
  288. SerialNumberServices.SetSN("Const.CF_CLASSMAJOR_NO_PREFIX" + recruitSpecialty.GradeID.ToString(), 3);
  289. //更新招生专业信息生成状态
  290. recruitSpecialty.isGenerated = true;
  291. recruitSpecialtyUpList.Add(recruitSpecialty);
  292. success++;
  293. }
  294. }
  295. else
  296. {
  297. //在此处进行处理特殊情况(存在专业分方向、同一年级专业有多个班的情况)
  298. facultyMajorfail++;
  299. continue;
  300. }
  301. }
  302. else
  303. {
  304. //表示对应的院系专业信息不存在
  305. facultymajor.FacultymajorID = Guid.NewGuid();
  306. facultymajor.CollegeID = recruitSpecialty.CollegeID;
  307. facultymajor.Code = facultymajorCode;
  308. facultymajor.Name = facultymajorName;
  309. facultymajor.Abbreviation = facultymajor.Name;
  310. facultymajor.StandardID = specialty.StandardID;
  311. facultymajor.EducationID = specialty.EducationID;
  312. facultymajor.LearningformID = specialty.LearningformID;
  313. facultymajor.LearnSystem = specialty.LearnSystem;
  314. SetNewStatus(facultymajor, (int)SYS_STATUS.USABLE);
  315. //表示对应的年级专业信息不存在
  316. grademajor.GrademajorID = Guid.NewGuid();
  317. grademajor.Code = grademajorCode;
  318. grademajor.Name = grademajorName;
  319. grademajor.Abbreviation = grademajor.Name;
  320. grademajor.GradeID = recruitSpecialty.GradeID;
  321. grademajor.SemesterID = recruitSpecialty.SemesterID;
  322. grademajor.FacultymajorID = facultymajor.FacultymajorID;
  323. if (graduateSchoolyear == null)
  324. {
  325. //表示年级专业对应的毕业学期,在学年学期信息中不存在
  326. fail++;
  327. continue;
  328. }
  329. else
  330. {
  331. grademajor.GraduateSchoolyearID = graduateSchoolyear.SchoolyearID;
  332. }
  333. SetNewStatus(grademajor, (int)SYS_STATUS.USABLE);
  334. //表示对应的班级信息不存在
  335. classmajor.ClassmajorID = Guid.NewGuid();
  336. classmajor.GrademajorID = grademajor.GrademajorID;
  337. classmajor.No = classmajorCode;
  338. classmajor.Name = classmajorName;
  339. classmajor.Abbreviation = classmajor.Name;
  340. classmajor.ClassNum = 1;
  341. SetNewStatus(classmajor, (int)SYS_STATUS.USABLE);
  342. facultymajorInList.Add(facultymajor);
  343. grademajorInList.Add(grademajor);
  344. classmajorInList.Add(classmajor);
  345. //存储序列号
  346. SerialNumberServices.SetSN("Const.CF_CLASSMAJOR_NO_PREFIX" + recruitSpecialty.GradeID.ToString(), 3);
  347. //更新招生专业信息生成状态
  348. recruitSpecialty.isGenerated = true;
  349. recruitSpecialtyUpList.Add(recruitSpecialty);
  350. success++;
  351. }
  352. }
  353. using (TransactionScope ts = new TransactionScope())
  354. {
  355. if (facultymajorInList != null && facultymajorInList.Count() > 0)
  356. {
  357. UnitOfWork.BulkInsert(facultymajorInList);
  358. }
  359. if (grademajorInList != null && grademajorInList.Count() > 0)
  360. {
  361. UnitOfWork.BulkInsert(grademajorInList);
  362. }
  363. if (classmajorInList != null && classmajorInList.Count() > 0)
  364. {
  365. UnitOfWork.BulkInsert(classmajorInList);
  366. }
  367. if (recruitSpecialtyUpList != null && recruitSpecialtyUpList.Count() > 0)
  368. {
  369. UnitOfWork.BatchUpdate(recruitSpecialtyUpList);
  370. }
  371. ts.Complete();
  372. }
  373. if (facultyMajorfail <= 0 && gradeMajorfail <= 0 && classMajorfail <= 0 && fail <= 0)
  374. {
  375. tipMessage = success + "条专业班级的信息";
  376. }
  377. else
  378. {
  379. if (facultyMajorfail <= 0 && gradeMajorfail <= 0 && classMajorfail <= 0 && fail > 0)
  380. {
  381. tipMessage = success + "条专业班级的信息,失败" + fail + "条,原因:年级专业对应的毕业学期不存在,请核查";
  382. }
  383. else if (facultyMajorfail > 0 && gradeMajorfail <= 0 && classMajorfail <= 0 && fail <= 0)
  384. {
  385. tipMessage = success + "条专业班级的信息," + facultyMajorfail + "条由于院系专业信息的原因无法生成,请核查";
  386. }
  387. else if (facultyMajorfail <= 0 && gradeMajorfail > 0 && classMajorfail <= 0 && fail <= 0)
  388. {
  389. tipMessage = success + "条专业班级的信息," + gradeMajorfail + "条由于年级专业信息的原因无法生成,请核查";
  390. }
  391. else if (facultyMajorfail <= 0 && gradeMajorfail <= 0 && classMajorfail > 0 && fail <= 0)
  392. {
  393. tipMessage = success + "条专业班级的信息," + classMajorfail + "条由于班级信息的原因无法生成,请核查";
  394. }
  395. else
  396. {
  397. tipMessage = success + "条专业班级的信息," + fail + "条由于年级专业对应的毕业学期不存在的原因无法生成,"
  398. + facultyMajorfail + "条由于院系专业信息的原因无法生成," + gradeMajorfail + "条由于年级专业信息的原因无法生成,"
  399. + classMajorfail + "条由于班级信息的原因无法生成,请核查";
  400. }
  401. }
  402. return tipMessage;
  403. }
  404. catch (Exception ex)
  405. {
  406. throw new Exception(ex.Message);
  407. }
  408. }
  409. }
  410. }