WD_NurseCfgInfoBusinessLogic.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using HNWD.Pregrant.Model;
  7. using HNWD.Pregrant.DataAccess;
  8. namespace HNWD.Pregrant.BusinessLogic
  9. {
  10. public class WD_NurseCfgInfoBusinessLogic : BusinessLogicBase2<WD_NurseCfgInfo>
  11. {
  12. private string id = string.Empty;
  13. public WD_NurseCfgInfoBusinessLogic(string id)
  14. : base()
  15. {
  16. this.id = id;
  17. }
  18. public WD_NurseCfgInfoExt QueryAll()
  19. {
  20. this.wd_NurseCfgInfoDataAccess.QueryAll();
  21. return this.wd_NurseCfgInfoDataAccess.ext;
  22. }
  23. public override ModelExtBase<WD_NurseCfgInfo> Query(string patientid)
  24. {
  25. this.wd_NurseCfgInfoDataAccess.QueryAll();
  26. this.wd_NurseCfgInfoDataAccess.ext.messageDataList = this.wd_NurseCfgInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == this.id).ToList();
  27. return this.wd_NurseCfgInfoDataAccess.ext;
  28. }
  29. public override ModelBase Business(string data)
  30. {
  31. base.Business(data);
  32. this.wd_NurseCfgInfoDataAccess.Business(this.insert_list, update_list, delete_list);
  33. return this.DefaultReturn();
  34. }
  35. protected override void Dispatch(string data)
  36. {
  37. if(data.Length == 0)
  38. {
  39. this.bSuccess = false;
  40. this.Message = "传入数据长度必须大于0";
  41. return;
  42. }
  43. string[] items = data.Split(new char[]{'$'});
  44. foreach(string item in items)
  45. {
  46. string[] subitems = item.Split(new char[]{'@'});
  47. WD_NurseCfgInfo wd_NurseCfgInfo = new WD_NurseCfgInfo()
  48. {
  49. ID = subitems[0],
  50. NURSECFG_ID = subitems[1],
  51. NURSECFG_VALUE = subitems[2],
  52. NURSECFG_HIS_VALUE = subitems[3],
  53. NURSECFG_NAME = subitems[4],
  54. NURSECFG_COLOR = subitems[5] ,
  55. NURSECFG_CONTENT = subitems[6],
  56. NURSECFG_DATETIME = subitems[7]
  57. };
  58. if(subitems[0].ToLower() == "i")
  59. {
  60. this.insert_list.Add(wd_NurseCfgInfo);
  61. }
  62. if (subitems[0].ToLower() == "u")
  63. {
  64. this.update_list.Add(wd_NurseCfgInfo);
  65. }
  66. if (subitems[0].ToLower() == "d")
  67. {
  68. this.delete_list.Add(wd_NurseCfgInfo);
  69. }
  70. }
  71. }
  72. }
  73. }