WD_ZoneInfoBusinessLogic.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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_ZoneInfoBusinessLogic : BusinessLogicBase2<WD_ZoneInfo>
  11. {
  12. public WD_ZoneInfoBusinessLogic(string ActionFlag)
  13. : base()
  14. {
  15. this.ActionFlag = ActionFlag;
  16. }
  17. public WD_ZoneInfoExt QueryAll()
  18. {
  19. this.wd_ZoneInfoDataAccess.QueryAll();
  20. return this.wd_ZoneInfoDataAccess.ext;
  21. }
  22. public override ModelExtBase<WD_ZoneInfo> Query(string id)
  23. {
  24. this.wd_ZoneInfoDataAccess.QueryAll();
  25. this.wd_ZoneInfoDataAccess.ext.messageDataList = this.wd_ZoneInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == id).ToList();
  26. return this.wd_ZoneInfoDataAccess.ext;
  27. }
  28. public override ModelBase Business(string data)
  29. {
  30. base.Business(data);
  31. this.wd_ZoneInfoDataAccess.Business(this.insert_list, update_list, delete_list);
  32. return this.DefaultReturn();
  33. }
  34. protected override void Dispatch(string data)
  35. {
  36. if(data.Length == 0)
  37. {
  38. this.bSuccess = false;
  39. this.Message = "传入数据长度必须大于0";
  40. return;
  41. }
  42. string[] items = data.Split(new char[]{'$'});
  43. foreach(string item in items)
  44. {
  45. string[] subitems = item.Split(new char[]{'@'});
  46. WD_ZoneInfo wd_ZoneInfo = new WD_ZoneInfo()
  47. {
  48. ID = subitems[1],
  49. ZONE_ZONEID = subitems[2],
  50. ZONE_FILELIST = subitems[3],
  51. ZONE_STATUS = subitems[4],
  52. ZONE_CONTENT = subitems[5],
  53. ZONE_WEEK = subitems[6],
  54. ZONE_STARTTIME = subitems[7],
  55. ZONE_ENDTIME = subitems[8],
  56. ZONE_DATETIME = subitems[9],
  57. };
  58. if(subitems[0].ToLower() == "i")
  59. {
  60. this.insert_list.Add(wd_ZoneInfo);
  61. }
  62. if (subitems[0].ToLower() == "u")
  63. {
  64. this.update_list.Add(wd_ZoneInfo);
  65. }
  66. if (subitems[0].ToLower() == "d")
  67. {
  68. this.delete_list.Add(wd_ZoneInfo);
  69. }
  70. }
  71. }
  72. }
  73. }