瀏覽代碼

Init commit

linjpxc 5 年之前
當前提交
f670ab22ae
共有 100 個文件被更改,包括 8339 次插入0 次删除
  1. 233 0
      .gitignore
  2. 51 0
      HNWD.Pregrant.BusinessLogic/App_CheckUpdateBase.cs
  3. 133 0
      HNWD.Pregrant.BusinessLogic/BusinessLogicBase.cs
  4. 236 0
      HNWD.Pregrant.BusinessLogic/BusinessLogicBase2.cs
  5. 92 0
      HNWD.Pregrant.BusinessLogic/HNWD.Pregrant.BusinessLogic.csproj
  6. 22 0
      HNWD.Pregrant.BusinessLogic/IBusiness.cs
  7. 34 0
      HNWD.Pregrant.BusinessLogic/PromptingMessage.cs
  8. 36 0
      HNWD.Pregrant.BusinessLogic/Properties/AssemblyInfo.cs
  9. 121 0
      HNWD.Pregrant.BusinessLogic/WD_DeviceInfoBusinessLogic.cs
  10. 84 0
      HNWD.Pregrant.BusinessLogic/WD_NoticeInfoBusinessLogic.cs
  11. 95 0
      HNWD.Pregrant.BusinessLogic/WD_NurseCfgInfoBusinessLogic.cs
  12. 92 0
      HNWD.Pregrant.BusinessLogic/WD_PartInfoBusinessLogic.cs
  13. 122 0
      HNWD.Pregrant.BusinessLogic/WD_PartInfoBusinessLogic2.cs
  14. 117 0
      HNWD.Pregrant.BusinessLogic/WD_PatientInfoBusinessLogic.cs
  15. 136 0
      HNWD.Pregrant.BusinessLogic/WD_ProgramInfoBusinessLogic.cs
  16. 125 0
      HNWD.Pregrant.BusinessLogic/WD_RunProfileBusinessLogic.cs
  17. 102 0
      HNWD.Pregrant.BusinessLogic/WD_StaffInfoBusinessLogic.cs
  18. 81 0
      HNWD.Pregrant.BusinessLogic/WD_UrgeInfoBusinessLogic.cs
  19. 80 0
      HNWD.Pregrant.BusinessLogic/WD_VerInfoBusinessLogic.cs
  20. 93 0
      HNWD.Pregrant.BusinessLogic/WD_ZoneInfoBusinessLogic.cs
  21. 16 0
      HNWD.Pregrant.BusinessLogic/callingBed_UpdateBase.cs
  22. 17 0
      HNWD.Pregrant.BusinessLogic/callingDoctor_Update.cs
  23. 17 0
      HNWD.Pregrant.BusinessLogic/callingDoor_UpdateBase.cs
  24. 17 0
      HNWD.Pregrant.BusinessLogic/callingMainNurse_UpdateBase.cs
  25. 211 0
      HNWD.Pregrant.Common/BitmapBlack.cs
  26. 80 0
      HNWD.Pregrant.Common/BitmapGray.cs
  27. 137 0
      HNWD.Pregrant.Common/GZipCompress.cs
  28. 62 0
      HNWD.Pregrant.Common/GlobalConfigureSetting.cs
  29. 77 0
      HNWD.Pregrant.Common/HNWD.Pregrant.Common.csproj
  30. 142 0
      HNWD.Pregrant.Common/JsonHelper.cs
  31. 101 0
      HNWD.Pregrant.Common/NetLog.cs
  32. 36 0
      HNWD.Pregrant.Common/Properties/AssemblyInfo.cs
  33. 73 0
      HNWD.Pregrant.Common/clsWebService.cs
  34. 45 0
      HNWD.Pregrant.DataAccess/ConnectorManager.cs
  35. 18 0
      HNWD.Pregrant.DataAccess/DataBaseBackUpDataAccess.cs
  36. 47 0
      HNWD.Pregrant.DataAccess/FieldNickGenerator.cs
  37. 211 0
      HNWD.Pregrant.DataAccess/GenericDataAccess.cs
  38. 101 0
      HNWD.Pregrant.DataAccess/HNWD.Pregrant.DataAccess.csproj
  39. 36 0
      HNWD.Pregrant.DataAccess/Properties/AssemblyInfo.cs
  40. 59 0
      HNWD.Pregrant.DataAccess/SIPAccountService.cs
  41. 44 0
      HNWD.Pregrant.DataAccess/WD_CostInfoDataAccess.cs
  42. 296 0
      HNWD.Pregrant.DataAccess/WD_DeviceInfoDataAccess.cs
  43. 46 0
      HNWD.Pregrant.DataAccess/WD_MessageInfoDataAccess.cs
  44. 115 0
      HNWD.Pregrant.DataAccess/WD_NoticeInfoDataAccess.cs
  45. 103 0
      HNWD.Pregrant.DataAccess/WD_NurseCfgInfoDataAccess.cs
  46. 152 0
      HNWD.Pregrant.DataAccess/WD_PartInfoDataAccess.cs
  47. 332 0
      HNWD.Pregrant.DataAccess/WD_PatientInfoDataAccess.cs
  48. 109 0
      HNWD.Pregrant.DataAccess/WD_ProgramInfoDataAccess.cs
  49. 116 0
      HNWD.Pregrant.DataAccess/WD_RunProfileDataAccess.cs
  50. 186 0
      HNWD.Pregrant.DataAccess/WD_StaffInfoDataAccess.cs
  51. 20 0
      HNWD.Pregrant.DataAccess/WD_SysLogInfoDataAccess.cs
  52. 87 0
      HNWD.Pregrant.DataAccess/WD_UrgeInfoDataAccess.cs
  53. 77 0
      HNWD.Pregrant.DataAccess/WD_VerInfoDataAccess.cs
  54. 146 0
      HNWD.Pregrant.DataAccess/WD_ZoneInfoDataAccess.cs
  55. 626 0
      HNWD.Pregrant.DataAccess/clsDataBaseRW.cs
  56. 262 0
      HNWD.Pregrant.DataAccess/clsOpenSIPSAccount.cs
  57. 21 0
      HNWD.Pregrant.Model/Attributes/DescriptionAttribute.cs
  58. 24 0
      HNWD.Pregrant.Model/Attributes/IgnoreAttribute.cs
  59. 27 0
      HNWD.Pregrant.Model/Attributes/NickAttribute.cs
  60. 117 0
      HNWD.Pregrant.Model/HNWD.Pregrant.Model.csproj
  61. 13 0
      HNWD.Pregrant.Model/Model/CDoctorCharge.cs
  62. 14 0
      HNWD.Pregrant.Model/Model/CarefulMatter.cs
  63. 13 0
      HNWD.Pregrant.Model/Model/Colleague.cs
  64. 16 0
      HNWD.Pregrant.Model/Model/Cost.cs
  65. 16 0
      HNWD.Pregrant.Model/Model/MP3File.cs
  66. 22 0
      HNWD.Pregrant.Model/Model/MusicFile.cs
  67. 17 0
      HNWD.Pregrant.Model/Model/Str_Mrg_GetWD_NewSIPAccount.cs
  68. 17 0
      HNWD.Pregrant.Model/Model/WD_CostInfo.cs
  69. 319 0
      HNWD.Pregrant.Model/Model/WD_DeviceInfo.cs
  70. 68 0
      HNWD.Pregrant.Model/Model/WD_DeviceInfo_Simple.cs
  71. 14 0
      HNWD.Pregrant.Model/Model/WD_MessageInfo.cs
  72. 66 0
      HNWD.Pregrant.Model/Model/WD_NoticeInfo.cs
  73. 24 0
      HNWD.Pregrant.Model/Model/WD_NurseCfgInfo.cs
  74. 286 0
      HNWD.Pregrant.Model/Model/WD_PartInfo.cs
  75. 73 0
      HNWD.Pregrant.Model/Model/WD_PatientInfo.cs
  76. 27 0
      HNWD.Pregrant.Model/Model/WD_ProgramInfo.cs
  77. 20 0
      HNWD.Pregrant.Model/Model/WD_RunProfile.cs
  78. 20 0
      HNWD.Pregrant.Model/Model/WD_SIPSevInfo.cs
  79. 130 0
      HNWD.Pregrant.Model/Model/WD_StaffInfo.cs
  80. 95 0
      HNWD.Pregrant.Model/Model/WD_StaffInfo_Simple.cs
  81. 20 0
      HNWD.Pregrant.Model/Model/WD_SysLogInfo.cs
  82. 18 0
      HNWD.Pregrant.Model/Model/WD_UrgeInfo.cs
  83. 18 0
      HNWD.Pregrant.Model/Model/WD_UserInfo.cs
  84. 26 0
      HNWD.Pregrant.Model/Model/WD_VerInfo.cs
  85. 63 0
      HNWD.Pregrant.Model/Model/WD_ZoneInfo.cs
  86. 121 0
      HNWD.Pregrant.Model/Model/bedDetails.cs
  87. 123 0
      HNWD.Pregrant.Model/Model/bedInfo.cs
  88. 32 0
      HNWD.Pregrant.Model/Model/hospital.cs
  89. 24 0
      HNWD.Pregrant.Model/Model/wardInformation.cs
  90. 22 0
      HNWD.Pregrant.Model/ModelBase.cs
  91. 11 0
      HNWD.Pregrant.Model/ModelExt/ColleagueExt.cs
  92. 9 0
      HNWD.Pregrant.Model/ModelExt/MP3FileExt.cs
  93. 9 0
      HNWD.Pregrant.Model/ModelExt/MusicFileExt.cs
  94. 12 0
      HNWD.Pregrant.Model/ModelExt/WD_CostInfoExt.cs
  95. 17 0
      HNWD.Pregrant.Model/ModelExt/WD_DeviceInfoExt.cs
  96. 12 0
      HNWD.Pregrant.Model/ModelExt/WD_MessageInfoExt.cs
  97. 13 0
      HNWD.Pregrant.Model/ModelExt/WD_NoticeInfoExt.cs
  98. 13 0
      HNWD.Pregrant.Model/ModelExt/WD_NurseCfgInfoExt.cs
  99. 12 0
      HNWD.Pregrant.Model/ModelExt/WD_PartInfoExt.cs
  100. 0 0
      HNWD.Pregrant.Model/ModelExt/WD_PatientInfoExt.cs

+ 233 - 0
.gitignore

@@ -0,0 +1,233 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+build/
+bld/
+[Bb]in/
+[Oo]bj/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+
+# Windows Azure Build Output
+csx/
+*.build.csdef
+
+# Windows Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directory
+AppPackages/
+BundleArtifacts/
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+[Ss]tyle[Cc]op.*
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+
+# FAKE - F# Make
+.fake/
+output

+ 51 - 0
HNWD.Pregrant.BusinessLogic/App_CheckUpdateBase.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public abstract class App_CheckUpdateBase : BusinessLogicBase
+    {
+        private string deviceType = "";
+        public WD_VerInfo wd_VerInfo = null;
+
+        public App_CheckUpdateBase(string deviceType)
+        {
+            this.deviceType = deviceType;
+        } 
+
+        public bool Check()
+        {  
+            if (!this.InitializeDataAccess())
+            {
+                this.bSuccess = false;
+                this.Message = PromptingMessage.Error_Data_Initialized;
+
+                return false;
+            }
+
+            List<WD_VerInfo> lst_WD_VerInfo = wd_VerInfoDataAccess.ext.messageDataList.FindAll(f => f.VER_DEVICETYPE == this.deviceType).OrderByDescending(f => Convert.ToInt32(f.ID)).ToList();
+ 
+            if (lst_WD_VerInfo == null || lst_WD_VerInfo.Count == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "无升级信息!";
+
+                return false;
+            }
+            else
+            {
+                this.bSuccess = true;
+
+                wd_VerInfo = lst_WD_VerInfo[0];
+
+            }
+
+            return this.bSuccess;
+        }
+    }
+}

+ 133 - 0
HNWD.Pregrant.BusinessLogic/BusinessLogicBase.cs

@@ -0,0 +1,133 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.DataAccess;
+using HNWD.Pregrant.Model;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public abstract class BusinessLogicBase 
+    {
+        public bool bSuccess = true;
+        public string Message = "";
+        public int Rows = 0;
+
+        protected WD_DeviceInfoDataAccess wd_DeviceInfoDataAccess = WD_DeviceInfoDataAccess.GetInstance();
+        protected WD_PartInfoDataAccess wd_PartInfoDataAccess = WD_PartInfoDataAccess.GetInstance();
+        protected WD_PatientInfoDataAccess wd_PatientInfoDataAccess = WD_PatientInfoDataAccess.GetInstance();
+        protected WD_StaffInfoDataAccess wd_StaffInfoDataAccess = WD_StaffInfoDataAccess.GetInstance();
+        protected WD_UrgeInfoDataAccess wd_UrgeInfoDataAccess = WD_UrgeInfoDataAccess.GetInstance();
+        protected WD_VerInfoDataAccess wd_VerInfoDataAccess = WD_VerInfoDataAccess.GetInstance();
+        protected WD_NoticeInfoDataAccess wd_NoticeInfoDataAccess = WD_NoticeInfoDataAccess.GetInstance();
+        protected WD_NurseCfgInfoDataAccess wd_NurseCfgInfoDataAccess = WD_NurseCfgInfoDataAccess.GetInstance();
+        protected WD_MessageInfoDataAccess wd_MessageInfoDataAccess = WD_MessageInfoDataAccess.GetInstance();
+        protected WD_ZoneInfoDataAccess wd_ZoneInfoDataAccess = WD_ZoneInfoDataAccess.GetInstance();
+        protected WD_ProgramInfoDataAccess wd_ProgramInfoDataAccess = WD_ProgramInfoDataAccess.GetInstance();
+        protected WD_RunProfileDataAccess wd_RunProfileDataAccess = WD_RunProfileDataAccess.GetInstance();
+
+        public BusinessLogicBase()
+        {
+            this.InitializeDataAccess();
+        }
+        protected bool InitializeDataAccess()
+        {
+            bool bSuccess = true;
+
+            this.wd_DeviceInfoDataAccess.QueryAll();
+
+            if (!this.wd_DeviceInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            this.wd_PartInfoDataAccess.Query();
+
+            if (!this.wd_PartInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_PatientInfoDataAccess.QueryAll();
+
+            if (!wd_PatientInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+
+            wd_StaffInfoDataAccess.QueryAll();
+
+            if (!wd_StaffInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            wd_UrgeInfoDataAccess.QueryAll();
+
+            if (!wd_UrgeInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_VerInfoDataAccess.QueryAll();
+
+            if (!wd_VerInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_NoticeInfoDataAccess.QueryAll();
+
+            if (!wd_NoticeInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_NurseCfgInfoDataAccess.QueryAll();
+
+            if (!wd_NurseCfgInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_MessageInfoDataAccess.QueryAll();
+
+            if (!wd_NurseCfgInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            return bSuccess;
+        }
+
+
+        protected ModelBase DefaultReturn()
+        {
+            ModelBase mb = new ModelBase();
+            mb.bSuccess = this.bSuccess;
+            mb.Message = this.Message;
+            mb.Rows = this.Rows;
+
+            if (this.bSuccess)
+            {
+                mb.Code = "OK!"; 
+            }
+            else
+            {
+                mb.Code = "ERROR!";
+            }
+
+            return mb;
+        } 
+        
+     
+    }
+}

+ 236 - 0
HNWD.Pregrant.BusinessLogic/BusinessLogicBase2.cs

@@ -0,0 +1,236 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.DataAccess;
+using HNWD.Pregrant.Model;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public abstract class BusinessLogicBase2<Entity> :IBusiness<Entity> where Entity : ModelBase ,new() 
+    {
+        protected List<Entity> insert_list = new List<Entity>();
+        protected List<Entity> update_list = new List<Entity>();
+        protected List<Entity> delete_list = new List<Entity>();
+
+        public bool bSuccess = true;
+        public string Message = "";
+        public int Rows = 0;
+        protected string ActionFlag = string.Empty;
+
+
+        protected WD_DeviceInfoDataAccess wd_DeviceInfoDataAccess = WD_DeviceInfoDataAccess.GetInstance();
+        protected WD_PartInfoDataAccess wd_PartInfoDataAccess = WD_PartInfoDataAccess.GetInstance();
+        protected WD_PatientInfoDataAccess wd_PatientInfoDataAccess = WD_PatientInfoDataAccess.GetInstance();
+        protected WD_StaffInfoDataAccess wd_StaffInfoDataAccess = WD_StaffInfoDataAccess.GetInstance();
+        protected WD_UrgeInfoDataAccess wd_UrgeInfoDataAccess = WD_UrgeInfoDataAccess.GetInstance();
+        protected WD_VerInfoDataAccess wd_VerInfoDataAccess = WD_VerInfoDataAccess.GetInstance();
+        protected WD_NoticeInfoDataAccess wd_NoticeInfoDataAccess = WD_NoticeInfoDataAccess.GetInstance();
+        protected WD_NurseCfgInfoDataAccess wd_NurseCfgInfoDataAccess = WD_NurseCfgInfoDataAccess.GetInstance();
+        protected WD_MessageInfoDataAccess wd_MessageInfoDataAccess = WD_MessageInfoDataAccess.GetInstance();
+        protected WD_ZoneInfoDataAccess wd_ZoneInfoDataAccess = WD_ZoneInfoDataAccess.GetInstance();
+        protected WD_ProgramInfoDataAccess wd_ProgramInfoDataAccess = WD_ProgramInfoDataAccess.GetInstance();
+        protected WD_RunProfileDataAccess wd_RunProfileDataAccess = WD_RunProfileDataAccess.GetInstance();
+        public BusinessLogicBase2()
+        {
+            this.InitializeDataAccess();
+        }
+
+        public BusinessLogicBase2(bool runprofile)
+        {
+            this.InitializeDataAccess(runprofile);
+        }
+
+        protected bool InitializeDataAccess(bool runprofile)
+        {
+            bool bSuccess = true;
+ 
+            wd_RunProfileDataAccess.QueryAll();
+
+
+            if (!wd_RunProfileDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            return bSuccess;
+        }
+
+        public BusinessLogicBase2(bool part , string bled)
+        {
+            this.InitializeDataAccess(part , bled);
+        }
+
+        protected bool InitializeDataAccess(bool part, string bled)
+        {
+            bool bSuccess = true;
+
+            this.wd_DeviceInfoDataAccess.QueryAll();
+
+            if (!this.wd_DeviceInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            wd_ProgramInfoDataAccess.QueryAll();
+
+            if (!wd_ProgramInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            return bSuccess;
+        }
+
+
+        protected bool InitializeDataAccess()
+        {
+            bool bSuccess = true;
+
+            this.wd_DeviceInfoDataAccess.QueryAll();
+
+            if (!this.wd_DeviceInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            this.wd_PartInfoDataAccess.Query();
+
+            if (!this.wd_PartInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_PatientInfoDataAccess.QueryAll();
+
+            if (!wd_PatientInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+
+            wd_StaffInfoDataAccess.QueryAll();
+
+            if (!wd_StaffInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            wd_UrgeInfoDataAccess.QueryAll();
+
+            if (!wd_UrgeInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_VerInfoDataAccess.QueryAll();
+
+            if (!wd_VerInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_NoticeInfoDataAccess.QueryAll();
+
+            if (!wd_NoticeInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_NurseCfgInfoDataAccess.QueryAll();
+
+            if (!wd_NurseCfgInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_MessageInfoDataAccess.QueryAll();
+
+            if (!wd_NurseCfgInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_ZoneInfoDataAccess.QueryAll();
+
+            if (!wd_NurseCfgInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+
+            wd_ProgramInfoDataAccess.QueryAll();
+
+            if (!wd_ProgramInfoDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            wd_RunProfileDataAccess.QueryAll();
+
+
+            if (!wd_RunProfileDataAccess.bSuccess)
+            {
+                bSuccess = false;
+            }
+
+            return bSuccess;
+        }
+
+
+        protected ModelBase DefaultReturn()
+        {
+            ModelBase mb = new ModelBase();
+            mb.bSuccess = this.bSuccess;
+            mb.Message = this.Message;
+            mb.Rows = this.Rows;
+
+            if (this.bSuccess)
+            {
+                mb.Code = "OK!"; 
+            }
+            else
+            {
+                mb.Code = "ERROR!";
+            }
+
+            return mb;
+        }
+
+
+        public virtual ModelBase Business(string data)
+        {
+            this.Dispatch(data); 
+            
+            return this.DefaultReturn();
+
+        }
+
+        public virtual ModelExtBase<Entity> Query()
+        {
+            return null;
+        }
+
+        public virtual ModelExtBase<Entity> Query(string id )
+        {
+            return null;
+        }
+
+        public virtual ModelExtBase<Entity> QueryByParentID()
+        {
+            return null;
+        }
+
+ 
+        protected abstract void Dispatch(string data);
+
+    }
+}

+ 92 - 0
HNWD.Pregrant.BusinessLogic/HNWD.Pregrant.BusinessLogic.csproj

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{5C5D0067-3FFF-445D-8F34-81E37BD8491F}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HNWD.Pregrant.BusinessLogic</RootNamespace>
+    <AssemblyName>HNWD.Pregrant.BusinessLogic</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="App_CheckUpdateBase.cs" />
+    <Compile Include="BusinessLogicBase.cs" />
+    <Compile Include="BusinessLogicBase2.cs" />
+    <Compile Include="callingBed_UpdateBase.cs" />
+    <Compile Include="callingDoctor_Update.cs" />
+    <Compile Include="callingDoor_UpdateBase.cs" />
+    <Compile Include="callingMainNurse_UpdateBase.cs" />
+    <Compile Include="IBusiness.cs" />
+    <Compile Include="PromptingMessage.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="WD_DeviceInfoBusinessLogic.cs" />
+    <Compile Include="WD_NoticeInfoBusinessLogic.cs" />
+    <Compile Include="WD_NurseCfgInfoBusinessLogic.cs" />
+    <Compile Include="WD_PartInfoBusinessLogic.cs" />
+    <Compile Include="WD_PartInfoBusinessLogic2.cs" />
+    <Compile Include="WD_PatientInfoBusinessLogic.cs" />
+    <Compile Include="WD_ProgramInfoBusinessLogic.cs" />
+    <Compile Include="WD_RunProfileBusinessLogic.cs" />
+    <Compile Include="WD_StaffInfoBusinessLogic.cs" />
+    <Compile Include="WD_UrgeInfoBusinessLogic.cs" />
+    <Compile Include="WD_VerInfoBusinessLogic.cs" />
+    <Compile Include="WD_ZoneInfoBusinessLogic.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HNWD.Pregrant.DataAccess\HNWD.Pregrant.DataAccess.csproj">
+      <Project>{6a87d03a-5ddf-4156-84e4-92db0cecc694}</Project>
+      <Name>HNWD.Pregrant.DataAccess</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HNWD.Pregrant.Model\HNWD.Pregrant.Model.csproj">
+      <Project>{34f21f47-f2a7-49b8-a8ba-b1836aa6f5fe}</Project>
+      <Name>HNWD.Pregrant.Model</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 22 - 0
HNWD.Pregrant.BusinessLogic/IBusiness.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Runtime.InteropServices;
+using System.Data.OleDb;
+using System.IO;
+using System.Web;
+using System.Data;
+using HNWD.Pregrant.Model;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public interface IBusiness<Entity> where Entity : ModelBase, new() 
+    {
+        ModelBase Business(string data);
+
+        ModelExtBase<Entity> Query(string id);
+
+    }
+}

+ 34 - 0
HNWD.Pregrant.BusinessLogic/PromptingMessage.cs

@@ -0,0 +1,34 @@
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public static class PromptingMessage  
+    {
+        public static string Error_PartInfo = "获取科室信息失败!";
+
+        public static string Error_DeviceInfo = "获取设备信息失败!";
+
+        public static string Error_PatientInfo = "获取病人信息失败!";
+
+        public static string Error_StaffInfo = "获取病人信息失败!";
+
+
+        public static string Error_UrgeInfo = "获取医嘱信息失败!";
+
+        
+        public static string Error_MAC = "没有查找到设备信息!";
+
+
+        public static string Error_Notice = "获取通知信息失败!";
+
+        
+        public static string Error_NurseCfgInfo = "获取病人护理配置失败!"; 
+
+
+        public static string Error_Update_RunProfile = "更新运行配置信息失败!";
+        public static string Error_RunProfile = "更新运行配置信息失败!";
+
+
+        public static string Error_Data_Initialized = "数据初始化失败!";
+ 
+    }
+}

+ 36 - 0
HNWD.Pregrant.BusinessLogic/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("HNWD.Pregrant.BusinessLogic")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HNWD.Pregrant.BusinessLogic")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("600ab860-b0e8-49fe-8a1c-d61e0c1f47d6")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 121 - 0
HNWD.Pregrant.BusinessLogic/WD_DeviceInfoBusinessLogic.cs

@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_DeviceInfoBusinessLogic : BusinessLogicBase2<WD_DeviceInfo>
+    {
+        private string deviceid = string.Empty;
+
+        public WD_DeviceInfoBusinessLogic(string deviceid)
+            : base(true, "led")
+        {
+            this.deviceid = deviceid;
+        }
+ 
+        public WD_DeviceInfoExt QueryAll()
+        {
+            this.wd_DeviceInfoDataAccess.QueryAll();
+
+            return this.wd_DeviceInfoDataAccess.ext; 
+        }
+
+        public override ModelExtBase<WD_DeviceInfo> Query()
+        {
+            this.wd_DeviceInfoDataAccess.QueryAll();
+
+            this.wd_DeviceInfoDataAccess.ext.messageDataList = this.wd_DeviceInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == this.deviceid).ToList();
+
+            return this.wd_DeviceInfoDataAccess.ext;
+        }
+
+        public List<WD_DeviceInfo> QueryPartIDs()
+        {
+            List<WD_DeviceInfo> ldev = this.wd_DeviceInfoDataAccess.QueryPartIDs();
+
+            return ldev;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_DeviceInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+
+            return this.DefaultReturn();
+        }
+         
+
+        protected override  void Dispatch(string data)
+        { 
+            if(data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[]{'$'});
+
+            foreach(string item in items)
+            {
+                string[] subitems = item.Split(new char[]{'@'});
+
+                WD_DeviceInfo wd_DeviceInfo = new WD_DeviceInfo()
+                {
+                    ID = subitems[1],
+                    DEVICE_TYPE= subitems[2],
+                    DEVICE_SN = subitems[3],
+                    DEVICE_MODEL = subitems[4],
+                    DEVICE_SOFT_VER = subitems[5],
+                    DEVICE_HARD_VER = subitems[6],
+                    DEVICE_NAME = subitems[7],
+                    DEVICE_ETH_MAC = subitems[8],
+                    DEVICE_ETH_IP = subitems[9],
+                    DEVICE_WIFI_MAC = subitems[10],
+                    DEVICE_WIFI_IP = subitems[11],
+                    DEVICE_WIFI_HOSTNAME = subitems[12],
+                    DEVICE_STATUS = subitems[13],
+                    DEVICE_ROOM_NUM = subitems[14],
+                    DEVICE_ROOM_ID = subitems[15],
+                    DEVICE_BED_NUM = subitems[16],
+                    DEVICE_BED_NAME= subitems[17],
+                    DEVICE_HUMAN_TYPE= subitems[18],
+                    DEVICE_HUMAN_ID= subitems[19],
+                    DEVICE_SIP_IP= subitems[20],
+                    DEVICE_SIP_ID= subitems[21],
+                    DEVICE_SIP_PASSWORD= subitems[22],
+                    DEVICE_IR_CFG = subitems[26],
+                    DEVICE_ZONE0 = subitems[27],
+                    DEVICE_ZONE1 = subitems[28],
+                    DEVICE_ZONE2 = subitems[29],
+                    DEVICE_ZONE3 = subitems[30],
+                    DEVICE_ZONE4 = subitems[31],
+                    DEVICE_ZONE5 = subitems[32],
+                    DEVICE_DATETIME = subitems[33] 
+                
+                }; 
+ 
+                if(subitems[0].ToLower() == "i")
+                {
+                    this.insert_list.Add(wd_DeviceInfo);
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.update_list.Add(wd_DeviceInfo);
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.delete_list.Add(wd_DeviceInfo);
+                } 
+            } 
+        }
+
+    }
+}

+ 84 - 0
HNWD.Pregrant.BusinessLogic/WD_NoticeInfoBusinessLogic.cs

@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_NoticeInfoBusinessLogic : BusinessLogicBase2<WD_NoticeInfo>
+    {
+        private string patientid = string.Empty;
+
+        public WD_NoticeInfoBusinessLogic(string patientid)
+            : base()
+        {
+            this.patientid = patientid;
+        } 
+
+        public WD_NoticeInfoExt QueryAll()
+        {
+            this.wd_NoticeInfoDataAccess.QueryAll();
+
+            return this.wd_NoticeInfoDataAccess.ext; 
+        }
+
+        public override ModelExtBase<WD_NoticeInfo> Query(string patientid)
+        {
+            this.wd_NoticeInfoDataAccess.QueryAll();
+
+            this.wd_NoticeInfoDataAccess.ext.messageDataList = this.wd_NoticeInfoDataAccess.ext.messageDataList.FindAll(f => f.NOTICE_PATIENT_ID == patientid).ToList();
+
+            return this.wd_NoticeInfoDataAccess.ext;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_NoticeInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+
+            return this.DefaultReturn();
+        }
+
+
+
+
+        protected override  void Dispatch(string data)
+        { 
+            if(data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[]{'$'});
+
+            foreach(string item in items)
+            {
+                string[] subitems = item.Split(new char[]{'@'});
+
+                WD_NoticeInfo wd_noticeInfo = new WD_NoticeInfo() { ID = subitems[1], NOTICE_PATIENT_ID = subitems[2], NOTICE_TEXT = subitems[3], NOTICE_STARTTIME = subitems[4], NOTICE_ENDTIME = subitems[5], NOTICE_DATETIME = subitems[6] };
+
+
+                if(subitems[0].ToLower() == "i")
+                {
+                    this.insert_list.Add(wd_noticeInfo);
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.update_list.Add(wd_noticeInfo);
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.delete_list.Add(wd_noticeInfo);
+                } 
+            } 
+        }
+
+    }
+}

+ 95 - 0
HNWD.Pregrant.BusinessLogic/WD_NurseCfgInfoBusinessLogic.cs

@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_NurseCfgInfoBusinessLogic : BusinessLogicBase2<WD_NurseCfgInfo>
+    {
+        private string id = string.Empty;
+
+        public WD_NurseCfgInfoBusinessLogic(string id)
+            : base()
+        {
+            this.id = id;
+        } 
+
+        public WD_NurseCfgInfoExt QueryAll()
+        {
+            this.wd_NurseCfgInfoDataAccess.QueryAll();
+            return this.wd_NurseCfgInfoDataAccess.ext; 
+        }
+
+        public override ModelExtBase<WD_NurseCfgInfo> Query(string patientid)
+        {
+            this.wd_NurseCfgInfoDataAccess.QueryAll();
+
+            this.wd_NurseCfgInfoDataAccess.ext.messageDataList = this.wd_NurseCfgInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == this.id).ToList();
+
+            return this.wd_NurseCfgInfoDataAccess.ext;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_NurseCfgInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+
+            return this.DefaultReturn();
+        }
+
+
+
+
+        protected override  void Dispatch(string data)
+        { 
+            if(data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[]{'$'});
+
+            foreach(string item in items)
+            {
+           
+ 
+                string[] subitems = item.Split(new char[]{'@'});
+
+                WD_NurseCfgInfo wd_NurseCfgInfo = new WD_NurseCfgInfo() 
+                { 
+                    ID = subitems[0], 
+                    NURSECFG_ID = subitems[1], 
+                    NURSECFG_VALUE = subitems[2], 
+                    NURSECFG_HIS_VALUE = subitems[3], 
+                    NURSECFG_NAME = subitems[4], 
+                    NURSECFG_COLOR = subitems[5] ,
+                    NURSECFG_CONTENT = subitems[6], 
+                    NURSECFG_DATETIME = subitems[7]  
+                };
+
+ 
+                if(subitems[0].ToLower() == "i")
+                {
+                    this.insert_list.Add(wd_NurseCfgInfo);
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.update_list.Add(wd_NurseCfgInfo);
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.delete_list.Add(wd_NurseCfgInfo);
+                } 
+            } 
+        }
+
+    }
+}

+ 92 - 0
HNWD.Pregrant.BusinessLogic/WD_PartInfoBusinessLogic.cs

@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_PartInfoBusinessLogic : BusinessLogicBase
+    {
+        public WD_PartInfo wd_PartInfo = null;
+
+        public WD_PartInfoBusinessLogic( )
+        { 
+        } 
+
+        public bool Operate()
+        {  
+            if (!this.InitializeDataAccess())
+            {
+                this.bSuccess = false;
+                this.Message = PromptingMessage.Error_Data_Initialized;
+
+                return false;
+            } 
+                 
+            if (this.wd_PartInfoDataAccess.ext.messageDataList.Count == 0)
+            {
+                this.bSuccess = this.wd_PartInfoDataAccess.ext.bSuccess;
+                this.Message = this.wd_PartInfoDataAccess.ext.Message;
+
+                return false;
+            }
+
+
+            string tempnow = DateTime.Now.ToString("HH:mm:ss");
+
+            if (Convert.ToDateTime(tempnow) >= Convert.ToDateTime(wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_START) || Convert.ToDateTime(tempnow) < Convert.ToDateTime(wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_START))
+            {
+                wd_PartInfoDataAccess.ext.messageDataList[0].dayOrNight = "1";
+                wd_PartInfoDataAccess.ext.messageDataList[0].screenLight = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_BLIGHT;
+                wd_PartInfoDataAccess.ext.messageDataList[0].callVoice = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_RINGVOL;
+                wd_PartInfoDataAccess.ext.messageDataList[0].ringlVoice = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_SIPVOL;
+                wd_PartInfoDataAccess.ext.messageDataList[0].ringlVoiceLoop = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_RINGTIMES;
+                wd_PartInfoDataAccess.ext.messageDataList[0].nursingLight = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_NURSINGLED;
+                wd_PartInfoDataAccess.ext.messageDataList[0].BedSipVol = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_BEDSIPVOL;
+                wd_PartInfoDataAccess.ext.messageDataList[0].DoorSipVol = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_DOORSIPVOL;
+                wd_PartInfoDataAccess.ext.messageDataList[0].CallingTimeOut = wd_PartInfoDataAccess.ext.messageDataList[0].PART_SIP_OVERTIME;
+                wd_PartInfoDataAccess.ext.messageDataList[0].screenExtinguishTime = wd_PartInfoDataAccess.ext.messageDataList[0].PART_SLEEPTIME;
+            }
+            else
+            {
+                wd_PartInfoDataAccess.ext.messageDataList[0].dayOrNight = "0";
+                wd_PartInfoDataAccess.ext.messageDataList[0].screenLight = wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_BLIGHT;
+                wd_PartInfoDataAccess.ext.messageDataList[0].callVoice = wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_RINGVOL;
+                wd_PartInfoDataAccess.ext.messageDataList[0].ringlVoice = wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_SIPVOL;
+                wd_PartInfoDataAccess.ext.messageDataList[0].ringlVoiceLoop = wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_RINGTIMES;
+                wd_PartInfoDataAccess.ext.messageDataList[0].nursingLight = wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_NURSINGLED;
+                wd_PartInfoDataAccess.ext.messageDataList[0].BedSipVol = wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_BEDSIPVOL;
+                wd_PartInfoDataAccess.ext.messageDataList[0].DoorSipVol = wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_DOORSIPVOL;
+                wd_PartInfoDataAccess.ext.messageDataList[0].CallingTimeOut = wd_PartInfoDataAccess.ext.messageDataList[0].PART_SIP_OVERTIME;
+                wd_PartInfoDataAccess.ext.messageDataList[0].screenExtinguishTime = wd_PartInfoDataAccess.ext.messageDataList[0].PART_SLEEPTIME;
+            }
+
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].dayBright = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_BLIGHT;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].nightbright = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_BLIGHT;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].dayRingVol = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_RINGVOL;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].nightRightVol = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_RINGVOL;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].dayRingTimes = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_RINGTIMES;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].nightRingTimes = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_RINGTIMES;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].dayNursingLed = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_NURSINGLED;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].nightNursingLed = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_NURSINGLED;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].sipOverTime = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_SIP_OVERTIME;
+
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].screenExtinguishTime = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_SLEEPTIME;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].daySipVol = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_SIPVOL;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].nightSipVol = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_SIPVOL;
+
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].dayDoorSipVol = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_DOORSIPVOL;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].dayBedSipVol = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_DAY_BEDSIPVOL;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].nightDoorSipVol = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_DOORSIPVOL;
+            this.wd_PartInfoDataAccess.ext.messageDataList[0].nightBedSipVol = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NIGHT_BEDSIPVOL;
+
+
+            this.wd_PartInfo = wd_PartInfoDataAccess.ext.messageDataList[0];
+
+            return this.bSuccess;
+        }
+    }
+}

+ 122 - 0
HNWD.Pregrant.BusinessLogic/WD_PartInfoBusinessLogic2.cs

@@ -0,0 +1,122 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_PartInfoBusinessLogic2 : BusinessLogicBase2<WD_PartInfo>
+    {
+        public string id = string.Empty;
+
+        public WD_PartInfoBusinessLogic2(string id):base()
+        { 
+            this.id = id;
+        } 
+
+        public WD_PartInfoExt QueryAll()
+        {
+            this.wd_PartInfoDataAccess.Query();
+            return this.wd_PartInfoDataAccess.ext;
+        }
+
+        public override ModelExtBase<WD_PartInfo> Query(string patientid)
+        {
+            this.wd_PartInfoDataAccess.Query();
+            this.wd_PartInfoDataAccess.ext.messageDataList = this.wd_PartInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == this.id).ToList();
+
+            return this.wd_PartInfoDataAccess.ext;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_PartInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+
+            return this.DefaultReturn();
+        }
+
+
+
+
+        protected override void Dispatch(string data)
+        {
+            if (data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[] { '$' });
+
+            foreach (string item in items)
+            {
+
+
+                string[] subitems = item.Split(new char[] { '@' });
+
+                WD_PartInfo wd_PartInfo = new WD_PartInfo()
+                {
+                    ID = subitems[1],
+                    PART_HOSPITALNAME = subitems[2],
+                    PART_NAME = subitems[3],
+                    PART_CODE = subitems[4],
+                    PART_CONTENT = subitems[5],
+                    PART_ROOMCOUNT = subitems[6],
+                    PART_SLEEPTIME = subitems[7],
+                    PART_DAY_START = subitems[8],
+                    PART_DAY_BLIGHT = subitems[9],
+                    PART_DAY_SIPVOL = subitems[10],
+                    PART_DAY_RINGVOL = subitems[11],
+                    PART_DAY_RINGTIMES = subitems[12],
+                    PART_DAY_NURSINGLED = subitems[13],
+                    PART_DAY_DOORSIPVOL = subitems[14],
+                    PART_DAY_BEDSIPVOL = subitems[15],
+                    PART_NIGHT_START = subitems[16],
+                    PART_NIGHT_BLIGHT = subitems[17],
+                    PART_NIGHT_RINGVOL = subitems[18],
+                    PART_NIGHT_RINGTIMES = subitems[19],
+                    PART_NIGHT_NURSINGLED = subitems[20],
+                    PART_NIGHT_DOORSIPVOL = subitems[21],
+                    PART_NIGHT_BEDSIPVOL = subitems[22],                    
+                    PART_SIP_OVERTIME = subitems[23],
+                    PART_ERRORPIC = subitems[24],
+                    PART_NURSE_LEVEL0 = subitems[25],
+                    PART_NURSE_LEVEL1 = subitems[26],
+                    PART_NURSE_LEVEL2 = subitems[27],
+                    PART_NURSE_LEVEL3 = subitems[28],
+                    PART_NURSE_LEVEL4 = subitems[29],
+                    PART_SPECIAL_CARE = subitems[30],
+                    PART_PRIMARY_CARE = subitems[31],
+                    PART_DISPLAY_ILLNESS = subitems[32],
+                    PART_CODESWITCH = subitems[33],
+                    SIPSEV_IP = subitems[34],
+                    SIPSEV_MYSQLPASSWORD = subitems[35],
+                    SIPSEV_MYSQLUSERNAME = subitems[36],
+                    PART_DATETIME = subitems[37], 
+                };
+                 
+              
+                if (subitems[0].ToLower() == "i")
+                {
+                    this.insert_list.Add(wd_PartInfo);
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.update_list.Add(wd_PartInfo);
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.delete_list.Add(wd_PartInfo);
+                }
+            }
+        }
+
+    }
+}

+ 117 - 0
HNWD.Pregrant.BusinessLogic/WD_PatientInfoBusinessLogic.cs

@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_PatientInfoBusinessLogic : BusinessLogicBase2<WD_PatientInfo>
+    {
+        private string BedID = string.Empty;
+        private string patientid = string.Empty;
+        public WD_PatientInfoBusinessLogic(string patientid , string BedID)
+            : base()
+        {
+            this.BedID = BedID;
+            this.patientid = patientid;
+        } 
+
+        public WD_PatientInfoExt QueryAll()
+        {
+            this.wd_PatientInfoDataAccess.QueryAll();
+            return this.wd_PatientInfoDataAccess.ext; 
+        }
+
+        public override ModelExtBase<WD_PatientInfo> Query(string patientid)
+        {
+            this.wd_PatientInfoDataAccess.QueryAll();
+
+            this.wd_PatientInfoDataAccess.ext.messageDataList = this.wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == patientid).ToList();
+
+            return this.wd_PatientInfoDataAccess.ext;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_PatientInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+
+            return this.DefaultReturn();
+        }
+
+
+
+
+        protected override  void Dispatch(string data)
+        { 
+            if(data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[]{'$'});
+
+            foreach(string item in items)
+            {
+
+                string[] subitems = item.Split(new char[]{'@'});
+
+                WD_PatientInfo wd_PatientInfo = new WD_PatientInfo() 
+                {
+                    ID = subitems[1], 
+                    PATIENT_PHOC_ID = subitems[2], 
+                    PATIENT_ID = subitems[3], 
+                    PATIENT_CARD_ID = subitems[4], 
+                    PATIENT_NAME = subitems[5], 
+                    PATIENT_NAME_PY = subitems[6] ,
+                    PATIENT_SEX = subitems[7], 
+                    PATIENT_AGE = subitems[8], 
+                    PATIENT_AGE_UNIT = subitems[9], 
+                    PATIENT_BIRTHDAY = subitems[10], 
+                    PATIENT_IDCARD = subitems[11] ,
+                    PATIENT_ADDRESS = subitems[12], 
+                    PATIENT_MOBLIE = subitems[13], 
+                    PATIENT_INDATE = subitems[14], 
+                    PATIENT_DOCTOR_ID = subitems[15], 
+                    PATIENT_NURSE_ID = subitems[16] ,
+                    PATIENT_WORKERS_ID = subitems[17], 
+                    PATIENT_NURSE_LEVEL0 = subitems[18], 
+                    PATIENT_NURSE_LEVEL1 = subitems[19], 
+                    PATIENT_NURSE_LEVEL2 = subitems[20], 
+                    PATIENT_NURSE_LEVEL3 = subitems[21],
+                    PATIENT_NURSE_LEVEL4 = subitems[22], 
+                    PATIENT_INTIMES = subitems[23], 
+                    PATIENT_STATUS = subitems[24], 
+                    PATIENT_ILLNESS = subitems[25],
+                    PATIENT_BABYNAME = subitems[26], 
+                    PATIENT_BABYSEX = subitems[27], 
+                    PATIENT_DATETIME = subitems[28] ,
+                    BEDID = this.BedID
+
+                };
+
+                 
+                if(subitems[0].ToLower() == "i")
+                {
+                    this.insert_list.Add(wd_PatientInfo);
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.update_list.Add(wd_PatientInfo);
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.delete_list.Add(wd_PatientInfo);
+                } 
+            } 
+        }
+
+    }
+}

+ 136 - 0
HNWD.Pregrant.BusinessLogic/WD_ProgramInfoBusinessLogic.cs

@@ -0,0 +1,136 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_ProgramInfoBusinessLogic : BusinessLogicBase2<WD_ProgramInfo>
+    {
+        private string deviceid = string.Empty;
+        private string programid = string.Empty;
+
+        public WD_ProgramInfoBusinessLogic(string deviceid , string programid )
+            : base(true, "led")
+        {
+            this.deviceid = deviceid;
+            this.programid = programid;
+        }
+
+ 
+        public WD_DeviceInfoExt QueryAll()
+        {
+            this.wd_DeviceInfoDataAccess.QueryAll();
+
+            return this.wd_DeviceInfoDataAccess.ext; 
+        }
+
+        public override ModelExtBase<WD_ProgramInfo> Query()
+        {
+            this.wd_ProgramInfoDataAccess.QueryAll();
+
+            this.wd_ProgramInfoDataAccess.ext.messageDataList = this.wd_ProgramInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == this.programid).ToList();
+            this.wd_ProgramInfoDataAccess.ext.Rows = this.wd_ProgramInfoDataAccess.ext.messageDataList.Count;
+
+            return this.wd_ProgramInfoDataAccess.ext;
+        }
+
+ 
+        public override ModelExtBase<WD_ProgramInfo> QueryByParentID()
+        {
+            this.wd_ProgramInfoDataAccess.QueryAll();
+            this.wd_ProgramInfoDataAccess.ext.messageDataList = this.wd_ProgramInfoDataAccess.ext.messageDataList.FindAll(f => f.PROGRAM_DEVICE_ID == this.deviceid).ToList();
+            this.wd_ProgramInfoDataAccess.ext.Rows = this.wd_ProgramInfoDataAccess.ext.messageDataList.Count;
+
+            return this.wd_ProgramInfoDataAccess.ext;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_ProgramInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+            this.bSuccess = this.wd_ProgramInfoDataAccess.bSuccess;
+            this.Message = this.wd_ProgramInfoDataAccess.Message;
+
+            return this.DefaultReturn();
+        }
+
+
+
+
+        protected override  void Dispatch(string data)
+        { 
+            if(data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[]{'$'});
+
+            foreach(string item in items)
+            {
+                string[] subitems = item.Split(new char[]{'@'});
+               
+ 
+                if(subitems[0].ToLower() == "i")
+                {
+                    this.insert_list.Add(new WD_ProgramInfo()
+                        {
+                            ID = subitems[1],
+                            PROGRAM_NAME = subitems[2],
+                            PROGRAM_TYPE = subitems[3],
+                            PROGRAM_X = subitems[4],
+                            PROGRAM_Y = subitems[5],
+                            PROGRAM_WIDTH = subitems[6],
+                            PROGRAM_HEIGHT = subitems[7],
+                            PROGRAM_TEXT = subitems[8],
+                            PROGRAM_IMAGE = subitems[9],
+                            PROGRAM_MATRIX = subitems[10],
+                            PROGRAM_FORMAT = subitems[11],
+                            PROGRAM_ALIGN = subitems[12],
+                            PROGRAM_STAYINGTIME = subitems[13],
+                            PROGRAM_DEVICE_ID = subitems[14]
+                        }
+                        );
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.update_list.Add(new WD_ProgramInfo()
+                        {
+                            ID = subitems[1],
+                            PROGRAM_NAME = subitems[2],
+                            PROGRAM_TYPE = subitems[3],
+                            PROGRAM_X = subitems[4],
+                            PROGRAM_Y = subitems[5],
+                            PROGRAM_WIDTH = subitems[6],
+                            PROGRAM_HEIGHT = subitems[7],
+                            PROGRAM_TEXT = subitems[8],
+                            PROGRAM_IMAGE = subitems[9],
+                            PROGRAM_MATRIX = subitems[10],
+                            PROGRAM_FORMAT = subitems[11],
+                            PROGRAM_ALIGN = subitems[12],
+                            PROGRAM_STAYINGTIME = subitems[13],
+                            PROGRAM_DEVICE_ID = subitems[14]
+                        }
+                        );
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.delete_list.Add(new WD_ProgramInfo()
+                        {
+                            ID = subitems[1] 
+                        }
+                        );
+                } 
+            } 
+        }
+
+    }
+}

+ 125 - 0
HNWD.Pregrant.BusinessLogic/WD_RunProfileBusinessLogic.cs

@@ -0,0 +1,125 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_RunProfileBusinessLogic : BusinessLogicBase2<WD_RunProfile>
+    {
+        private string runid = string.Empty;
+
+        private readonly static WD_RunProfileBusinessLogic wd_RunProfileBusinessLogic = new WD_RunProfileBusinessLogic("0");
+        private readonly static object obj = new object();
+
+        private WD_RunProfileBusinessLogic(string runid)
+            : base(true)
+        {
+            this.runid = runid;
+        }
+
+        public static WD_RunProfileBusinessLogic GetInstance()
+        {
+            lock(obj)
+            {
+                return wd_RunProfileBusinessLogic;
+            }
+        }
+
+        public WD_RunProfileExt QueryAll()
+        {
+            this.wd_RunProfileDataAccess.QueryAll();
+
+            return this.wd_RunProfileDataAccess.ext; 
+        }
+
+
+        public WD_RunProfileExt QueryByPartID(string partid )
+        {
+            this.wd_RunProfileDataAccess.QueryByPartID(partid);
+
+            return this.wd_RunProfileDataAccess.ext;
+        }
+
+        public bool UpdateLedFlag(string invalid)
+        {
+            this.wd_RunProfileDataAccess.UpdateLedFlag(invalid);
+
+            return this.wd_RunProfileDataAccess.bSuccess;
+        }
+
+
+        protected override void Dispatch(string data)
+        {
+            //if (data.Length == 0)
+            //{
+            //    this.bSuccess = false;
+            //    this.Message = "传入数据长度必须大于0";
+
+            //    return;
+            //}
+
+            //string[] items = data.Split(new char[] { '$' });
+
+            //foreach (string item in items)
+            //{
+            //    string[] subitems = item.Split(new char[] { '@' });
+
+            //    WD_DeviceInfo wd_DeviceInfo = new WD_DeviceInfo()
+            //    {
+            //        ID = subitems[1],
+            //        DEVICE_TYPE = subitems[2],
+            //        DEVICE_ID = subitems[3],
+            //        DEVICE_MODEL = subitems[4],
+            //        DEVICE_SOFT_VER = subitems[5],
+            //        DEVICE_HARD_VER = subitems[6],
+            //        DEVICE_NAME = subitems[7],
+            //        DEVICE_ETH_MAC = subitems[8],
+            //        DEVICE_ETH_IP = subitems[9],
+            //        DEVICE_WIFI_MAC = subitems[10],
+            //        DEVICE_WIFI_IP = subitems[11],
+            //        DEVICE_WIFI_HOSTNAME = subitems[12],
+            //        DEVICE_STATUS = subitems[13],
+            //        DEVICE_ROOM_NUM = subitems[14],
+            //        DEVICE_ROOM_ID = subitems[15],
+            //        DEVICE_BED_NUM = subitems[16],
+            //        DEVICE_BED_NAME = subitems[17],
+            //        DEVICE_HUMAN_TYPE = subitems[18],
+            //        DEVICE_HUMAN_ID = subitems[19],
+            //        DEVICE_SIP_IP = subitems[20],
+            //        DEVICE_SIP_ID = subitems[21],
+            //        DEVICE_SIP_PASSWORD = subitems[22],
+            //        DEVICE_SIP_STATUS = subitems[23],
+            //        DEVICE_SIP_CALLLIST = subitems[24],
+            //        DEVICE_SIP_HOSTING_ID = subitems[25],
+            //        DEVICE_IR_CFG = subitems[26],
+            //        DEVICE_ZONE0 = subitems[27],
+            //        DEVICE_ZONE1 = subitems[28],
+            //        DEVICE_ZONE2 = subitems[29],
+            //        DEVICE_ZONE3 = subitems[30],
+            //        DEVICE_ZONE4 = subitems[31],
+            //        DEVICE_ZONE5 = subitems[32],
+            //        DEVICE_DATETIME = subitems[33]
+
+            //    };
+
+            //    if (subitems[0].ToLower() == "i")
+            //    {
+            //        this.insert_list.Add(wd_DeviceInfo);
+            //    }
+            //    if (subitems[0].ToLower() == "u")
+            //    {
+            //        this.update_list.Add(wd_DeviceInfo);
+            //    }
+            //    if (subitems[0].ToLower() == "d")
+            //    {
+            //        this.delete_list.Add(wd_DeviceInfo);
+            //    }
+            //}
+        }
+
+    }
+}

+ 102 - 0
HNWD.Pregrant.BusinessLogic/WD_StaffInfoBusinessLogic.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_StaffInfoBusinessLogic : BusinessLogicBase2<WD_StaffInfo>
+    {
+        private string id = string.Empty;
+
+        public WD_StaffInfoBusinessLogic(string id)
+            : base()
+        {
+            this.id = id;
+        } 
+
+        public WD_StaffInfoExt QueryAll()
+        {
+            this.wd_StaffInfoDataAccess.QueryAll();
+            return this.wd_StaffInfoDataAccess.ext; 
+        }
+
+        public override ModelExtBase<WD_StaffInfo> Query(string patientid)
+        {
+            this.wd_StaffInfoDataAccess.QueryAll();
+
+            this.wd_StaffInfoDataAccess.ext.messageDataList = this.wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == this.id).ToList();
+
+            return this.wd_StaffInfoDataAccess.ext;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_StaffInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+
+            return this.DefaultReturn();
+        }
+
+
+
+
+        protected override  void Dispatch(string data)
+        { 
+            if(data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[]{'$'});
+
+            foreach(string item in items)
+            {
+           
+ 
+                string[] subitems = item.Split(new char[]{'@'});
+
+                WD_StaffInfo wd_StaffInfo = new WD_StaffInfo() 
+                { 
+                    ID = subitems[1], 
+                    STAFF_ID = subitems[2], 
+                    STAFF_PASSWORDCARD = subitems[3], 
+                    STAFF_NAME = subitems[4], 
+                    STAFF_NAME_PY = subitems[5],
+                    STAFF_TYPE = subitems[6],
+                    STAFF_SEX = subitems[7], 
+                    STAFF_BIRTHDAY = subitems[8], 
+                    STAFF_IDCARD = subitems[9],
+                    STAFF_WORKDATE = subitems[10],
+                    STAFF_PICTURE = subitems[11], 
+                    STAFF_WORKTEL = subitems[12], 
+                    STAFF_MOBILE = subitems[13],
+                    STAFF_CONTENT = subitems[14],
+                    STAFF_DUTY = subitems[15], 
+                    STAFF_DATETIME = subitems[16], 
+                }; 
+
+                if(subitems[0].ToLower() == "i")
+                {
+                    this.insert_list.Add(wd_StaffInfo);
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.update_list.Add(wd_StaffInfo);
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.delete_list.Add(wd_StaffInfo);
+                } 
+            } 
+        }
+
+    }
+}

+ 81 - 0
HNWD.Pregrant.BusinessLogic/WD_UrgeInfoBusinessLogic.cs

@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_UrgeInfoBusinessLogic : BusinessLogicBase2<WD_UrgeInfo>
+    {
+        private string patientid = string.Empty;
+
+        public WD_UrgeInfoBusinessLogic(string patientid) : base()
+        {
+            this.patientid = patientid;
+        } 
+
+        public WD_UrgeInfoExt QueryAll()
+        {
+            this.wd_UrgeInfoDataAccess.QueryAll();
+            return this.wd_UrgeInfoDataAccess.ext; 
+        }
+
+        public override ModelExtBase<WD_UrgeInfo> Query(string patientid)
+        {
+            this.wd_UrgeInfoDataAccess.QueryAll();
+
+            this.wd_UrgeInfoDataAccess.ext.messageDataList = this.wd_UrgeInfoDataAccess.ext.messageDataList.FindAll(f => f.URGE_PATIENT_ID == patientid).ToList();
+
+            return this.wd_UrgeInfoDataAccess.ext;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_UrgeInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+
+            return this.DefaultReturn();
+        }
+
+
+
+
+        protected override  void Dispatch(string data)
+        { 
+            if(data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[]{'$'});
+
+            foreach(string item in items)
+            {
+                string[] subitems = item.Split(new char[]{'@'});
+
+                WD_UrgeInfo wd_UrgeInfo = new WD_UrgeInfo() { ID = subitems[1], URGE_PATIENT_ID = subitems[2], URGE_VALUE = subitems[3], URGE_DATETIME = subitems[4]};
+
+                if(subitems[0].ToLower() == "i")
+                {
+                    this.insert_list.Add(wd_UrgeInfo);
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.update_list.Add(wd_UrgeInfo);
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.delete_list.Add(wd_UrgeInfo);
+                } 
+            } 
+        }
+
+    }
+}

+ 80 - 0
HNWD.Pregrant.BusinessLogic/WD_VerInfoBusinessLogic.cs

@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_VerInfoBusinessLogic : BusinessLogicBase2<WD_VerInfo>
+    {
+        private string DeviceType = string.Empty;
+
+        public WD_VerInfoBusinessLogic(string DeviceType)
+            : base()
+        {
+            this.DeviceType = DeviceType;
+        } 
+
+        public WD_VerInfoExt QueryAll()
+        {
+            this.wd_VerInfoDataAccess.QueryAll();
+            return this.wd_VerInfoDataAccess.ext; 
+        }
+
+        public override ModelExtBase<WD_VerInfo> Query(string DeviceType)
+        {
+            this.wd_VerInfoDataAccess.QueryAll();
+
+            this.wd_VerInfoDataAccess.ext.messageDataList = this.wd_VerInfoDataAccess.ext.messageDataList.FindAll(f => f.VER_DEVICETYPE == DeviceType).ToList();
+
+            return this.wd_VerInfoDataAccess.ext;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_VerInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+
+            return this.DefaultReturn();
+        }
+
+        protected override  void Dispatch(string data)
+        { 
+            if(data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[]{'$'});
+
+            foreach(string item in items)
+            {
+
+                string[] subitems = item.Split(new char[]{'@'});
+
+                WD_VerInfo wd_VerInfo = new WD_VerInfo() { ID = subitems[1], VER_DEVICETYPE = subitems[2], VER_INFO = subitems[3], VER_FILEPATH = subitems[4], VER_DATETIME = subitems[5] };
+
+                if(subitems[0].ToLower() == "i")
+                { 
+                    this.insert_list.Add(wd_VerInfo);
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.insert_list.Add(wd_VerInfo);
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.insert_list.Add(wd_VerInfo);
+                } 
+            } 
+        }
+
+    }
+}

+ 93 - 0
HNWD.Pregrant.BusinessLogic/WD_ZoneInfoBusinessLogic.cs

@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HNWD.Pregrant.Model;
+using HNWD.Pregrant.DataAccess;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class WD_ZoneInfoBusinessLogic : BusinessLogicBase2<WD_ZoneInfo>
+    {
+        public WD_ZoneInfoBusinessLogic(string ActionFlag)
+            : base()
+        {
+            this.ActionFlag = ActionFlag;
+        } 
+
+        public WD_ZoneInfoExt QueryAll()
+        {
+            this.wd_ZoneInfoDataAccess.QueryAll();
+
+            return this.wd_ZoneInfoDataAccess.ext; 
+        }
+
+        public override ModelExtBase<WD_ZoneInfo> Query(string id)
+        {
+            this.wd_ZoneInfoDataAccess.QueryAll();
+
+            this.wd_ZoneInfoDataAccess.ext.messageDataList = this.wd_ZoneInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == id).ToList();
+
+            return this.wd_ZoneInfoDataAccess.ext;
+        }
+
+        public override ModelBase Business(string data)
+        {
+            base.Business(data);
+
+            this.wd_ZoneInfoDataAccess.Business(this.insert_list, update_list, delete_list);
+
+            return this.DefaultReturn();
+        }
+
+
+
+
+        protected override  void Dispatch(string data)
+        { 
+            if(data.Length == 0)
+            {
+                this.bSuccess = false;
+                this.Message = "传入数据长度必须大于0";
+
+                return;
+            }
+
+            string[] items = data.Split(new char[]{'$'});
+
+            foreach(string item in items)
+            {
+  
+                string[] subitems = item.Split(new char[]{'@'});
+
+                WD_ZoneInfo wd_ZoneInfo = new WD_ZoneInfo()
+                    {
+                        ID = subitems[1],
+                        ZONE_ZONEID = subitems[2],
+                        ZONE_FILELIST = subitems[3],
+                        ZONE_STATUS = subitems[4],
+                        ZONE_CONTENT = subitems[5],
+                        ZONE_WEEK = subitems[6],
+                        ZONE_STARTTIME = subitems[7],
+                        ZONE_ENDTIME = subitems[8],
+                        ZONE_DATETIME = subitems[9],
+                    };
+
+                if(subitems[0].ToLower() == "i")
+                {
+                    this.insert_list.Add(wd_ZoneInfo);
+                }
+                if (subitems[0].ToLower() == "u")
+                {
+                    this.update_list.Add(wd_ZoneInfo);
+                }
+                if (subitems[0].ToLower() == "d")
+                {
+                    this.delete_list.Add(wd_ZoneInfo);
+                } 
+            } 
+        }
+
+    }
+}

+ 16 - 0
HNWD.Pregrant.BusinessLogic/callingBed_UpdateBase.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class callingBed_UpdateBase : App_CheckUpdateBase
+    {
+        public callingBed_UpdateBase():base("4")
+        {
+
+        }  
+    }
+}

+ 17 - 0
HNWD.Pregrant.BusinessLogic/callingDoctor_Update.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class callingDoctor_Update : App_CheckUpdateBase
+    {
+        public callingDoctor_Update()
+            : base("2")
+        {
+
+        }  
+    }
+}

+ 17 - 0
HNWD.Pregrant.BusinessLogic/callingDoor_UpdateBase.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class callingDoor_UpdateBase : App_CheckUpdateBase
+    {
+        public callingDoor_UpdateBase()
+            : base("3")
+        {
+
+        }  
+    }
+}

+ 17 - 0
HNWD.Pregrant.BusinessLogic/callingMainNurse_UpdateBase.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.BusinessLogic
+{
+    public class callingMainNurse_UpdateBase : App_CheckUpdateBase
+    {
+        public callingMainNurse_UpdateBase()
+            : base("1")
+        {
+
+        }  
+    }
+}

+ 211 - 0
HNWD.Pregrant.Common/BitmapBlack.cs

@@ -0,0 +1,211 @@
+using System;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Runtime.InteropServices;
+
+namespace HNWD.Pregrant.Common
+{
+    public class BitmapBlack
+    {
+        public static bool bSuccessed = true;
+
+        public static Bitmap BitmapToBlack(Bitmap img, Double hsb)
+        {
+            int w = img.Width;
+            int h = img.Height;
+            Bitmap bmp = new Bitmap(w, h, PixelFormat.Format1bppIndexed);
+            BitmapData data = bmp.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.ReadWrite, PixelFormat.Format1bppIndexed);//将 Bitmap 锁定到系统内存中
+            for (int y = 0; y < h; y++)
+            {
+                byte[] scan = new byte[(w + 7) / 8];
+                for (int x = 0; x < w; x++)
+                {
+                    Color c = img.GetPixel(x, y);
+
+                    if (c.GetBrightness() >= hsb)
+                        scan[x / 8] |= (byte)(0x80 >> (x % 8));//亮度值和原来比较,二值化处理
+                }
+                Marshal.Copy(scan, 0, (IntPtr)((int)data.Scan0 + data.Stride * y), scan.Length);
+            }
+            bmp.UnlockBits(data);//将 Bitmap 锁定到系统内存中
+
+            return bmp;
+        }
+
+        //图片二值化
+        public static Bitmap binarization(Bitmap img)
+        {
+            bSuccessed = true;
+
+            int width = img.Width;
+            int height = img.Height;
+            int area = width * height;
+            int[,] gray = new int[width, height];
+            int average = 0;// 灰度平均值
+            int graysum = 0;
+            int graymean = 0;
+            int grayfrontmean = 0;
+            int graybackmean = 0;
+            int pixelGray;
+            int front = 0;
+            int back = 0;
+            int[] pix = new int[width * height];
+
+            for (int i = 1; i < width; i++)
+            { // 不算边界行和列,为避免越界
+                for (int j = 1; j < height; j++)
+                {
+                    pix[j * width + i] = img.GetPixel(i, j).ToArgb(); //得到单点上的颜色值
+                    int x = j * width + i;
+                    int r = (pix[x] >> 16) & 0xff;
+                    int g = (pix[x] >> 8) & 0xff;
+                    int b = pix[x] & 0xff;
+                    pixelGray = (int)(0.3 * r + 0.59 * g + 0.11 * b);// 计算每个坐标点的灰度
+                    gray[i, j] = (pixelGray << 16) + (pixelGray << 8) + (pixelGray);
+                    graysum += pixelGray;
+                }
+            }
+            graymean = (int)(graysum / area);// 整个图的灰度平均值
+            average = graymean;
+            for (int i = 0; i < width; i++) // 计算整个图的二值化阈值
+            {
+                for (int j = 0; j < height; j++)
+                {
+                    if (((gray[i, j]) & (0x0000ff)) < graymean)
+                    {
+                        graybackmean += ((gray[i, j]) & (0x0000ff));
+                        back++;
+                    }
+                    else
+                    {
+                        grayfrontmean += ((gray[i, j]) & (0x0000ff));
+                        front++;
+                    }
+                }
+            }
+
+            if (front == 0 || back == 0)
+            {
+                bSuccessed = false;
+                return null;
+            }
+
+            int frontvalue = (int)(grayfrontmean / front);// 前景中心
+            int backvalue = (int)(graybackmean / back);// 背景中心
+            float[] G = new float[frontvalue - backvalue + 1];// 方差数组
+            int s = 0;
+
+            for (int i1 = backvalue; i1 < frontvalue + 1; i1++)// 以前景中心和背景中心为区间采用大津法算法(OTSU算法)
+            {
+                back = 0;
+                front = 0;
+                grayfrontmean = 0;
+                graybackmean = 0;
+                for (int i = 0; i < width; i++)
+                {
+                    for (int j = 0; j < height; j++)
+                    {
+                        if (((gray[i, j]) & (0x0000ff)) < (i1 + 1))
+                        {
+                            graybackmean += ((gray[i, j]) & (0x0000ff));
+                            back++;
+                        }
+                        else
+                        {
+                            grayfrontmean += ((gray[i, j]) & (0x0000ff));
+                            front++;
+                        }
+                    }
+                }
+
+                if (front == 0 || back == 0)
+                {
+                    bSuccessed = false;
+                    return null;
+                }
+
+                grayfrontmean = (int)(grayfrontmean / front);
+                graybackmean = (int)(graybackmean / back);
+
+                G[s] = (((float)back / area) * (graybackmean - average)
+                      * (graybackmean - average) + ((float)front / area)
+                      * (grayfrontmean - average) * (grayfrontmean - average));
+                s++;
+            }
+            float max = G[0];
+            int index = 0;
+            for (int i = 1; i < frontvalue - backvalue + 1; i++)
+            {
+                if (max < G[i])
+                {
+                    max = G[i];
+                    index = i;
+                }
+            }
+
+            for (int i = 0; i < width; i++)
+            {
+                for (int j = 0; j < height; j++)
+                {
+                    int inin = j * width + i;
+                    if (((gray[i, j]) & (0x0000ff)) < (index + backvalue))
+                    {
+                        pix[inin] = Color.FromArgb(0, 0, 0).ToArgb();
+                    }
+                    else
+                    {
+                        pix[inin] = Color.FromArgb(255, 255, 255).ToArgb();
+                    }
+                }
+            }
+
+            Bitmap temp = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format16bppRgb555);
+
+            for (int i = 1; i < width; i++)
+            { // 不算边界行和列,为避免越界
+                for (int j = 1; j < height; j++)
+                {
+                    img.SetPixel(i, j, Color.FromArgb(pix[j * width + i]));
+                }
+            }
+
+            return temp;
+        }
+
+        /// <summary>
+        /// 防锯齿
+        /// </summary>
+        /// <param name="uAction"></param>
+        /// <param name="uParam"></param>
+        /// <param name="lpvParam"></param>
+        /// <param name="fuWinIni"></param>
+        /// <returns></returns>
+
+        [DllImport("user32.dll", EntryPoint = "SystemParametersInfo")]
+        private static extern int SystemParametersInfo(int uAction,
+                                                        int uParam,
+                                                        string lpvParam,
+                                                        int fuWinIni
+                                                        );
+
+        private static int BitmapHandlerAction = 75;//启用 或 关闭 平滑效果
+
+        /// <summary>
+        /// 关闭 平滑效果
+        /// </summary>
+        /// <returns></returns>
+        public static int SetBitmapSmoothDisable()
+        {
+            return SystemParametersInfo(BitmapHandlerAction, 0, null, 0); //关闭 平滑效果
+        }
+
+        /// <summary>
+        /// 启用 平滑效果
+        /// </summary>
+        /// <returns></returns>
+        public static int SetBitmapSmoothEnable()
+        {
+            return SystemParametersInfo(BitmapHandlerAction, 1, null, 0); //关闭 平滑效果
+        }
+    }
+}

+ 80 - 0
HNWD.Pregrant.Common/BitmapGray.cs

@@ -0,0 +1,80 @@
+using System.Drawing;
+
+namespace HNWD.Pregrant.Common
+{
+    public class BitmapGray
+    {
+        public static void ToGrey(Bitmap img1)
+        {
+            for (int i = 0; i < img1.Width; i++)
+            {
+                for (int j = 0; j < img1.Height; j++)
+                {
+                    Color pixelColor = img1.GetPixel(i, j);
+                    //计算灰度值
+                    int grey = (int)(0.299 * pixelColor.R + 0.587 * pixelColor.G + 0.114 * pixelColor.B);
+                    Color newColor = Color.FromArgb(grey, grey, grey);
+                    img1.SetPixel(i, j, newColor);
+                }
+            }
+        }
+
+        public static void Thresholding(Bitmap img1)
+        {
+            int[] histogram = new int[256];
+            int minGrayValue = 255, maxGrayValue = 0;
+            //求取直方图
+            for (int i = 0; i < img1.Width; i++)
+            {
+                for (int j = 0; j < img1.Height; j++)
+                {
+                    Color pixelColor = img1.GetPixel(i, j);
+                    histogram[pixelColor.R]++;
+                    if (pixelColor.R > maxGrayValue) maxGrayValue = pixelColor.R;
+                    if (pixelColor.R < minGrayValue) minGrayValue = pixelColor.R;
+                }
+            }
+            //迭代计算阀值
+            int threshold = -1;
+            int newThreshold = (minGrayValue + maxGrayValue) / 2;
+            for (int iterationTimes = 0; threshold != newThreshold && iterationTimes < 255; iterationTimes++)
+            {
+                threshold = newThreshold;
+                int lP1 = 0;
+                int lP2 = 0;
+                int lS1 = 0;
+                int lS2 = 0;
+                //求两个区域的灰度的平均值
+                for (int i = minGrayValue; i < threshold; i++)
+                {
+                    lP1 += histogram[i] * i;
+                    lS1 += histogram[i];
+                }
+                int mean1GrayValue = (lP1 / lS1);
+                for (int i = threshold + 1; i < maxGrayValue; i++)
+                {
+                    lP2 += histogram[i] * i;
+                    lS2 += histogram[i];
+                }
+                int mean2GrayValue = 0;
+
+                if (lS2 != 0)
+                {
+                    mean2GrayValue = (lP2 / lS2);
+                }
+
+                newThreshold = (mean1GrayValue + mean2GrayValue) / 2;
+            }
+            //计算二值化
+            for (int i = 0; i < img1.Width; i++)
+            {
+                for (int j = 0; j < img1.Height; j++)
+                {
+                    Color pixelColor = img1.GetPixel(i, j);
+                    if (pixelColor.R > threshold) img1.SetPixel(i, j, Color.FromArgb(255, 255, 255));
+                    else img1.SetPixel(i, j, Color.FromArgb(0, 0, 0));
+                }
+            }
+        }
+    }
+}

+ 137 - 0
HNWD.Pregrant.Common/GZipCompress.cs

@@ -0,0 +1,137 @@
+using System;
+using System.IO;
+using System.IO.Compression;
+using System.Text;
+
+namespace HNWD.Pregrant.Common
+{
+    public class GZipCompress
+    {
+        /// <summary>
+        /// 压缩字节数组
+        /// </summary>
+        /// <param name="str"></param>
+        public static byte[] Compress(byte[] inputBytes)
+        {
+            using (MemoryStream outStream = new MemoryStream())
+            {
+                using (GZipStream zipStream = new GZipStream(outStream, CompressionMode.Compress, true))
+                {
+                    zipStream.Write(inputBytes, 0, inputBytes.Length);
+                    zipStream.Close(); //很重要,必须关闭,否则无法正确解压
+                    return outStream.ToArray();
+                }
+            }
+        }
+
+        /// <summary>
+        /// 解压缩字节数组
+        /// </summary>
+        /// <param name="str"></param>
+        public static byte[] Decompress(byte[] inputBytes)
+        {
+            using (MemoryStream inputStream = new MemoryStream(inputBytes))
+            {
+                using (MemoryStream outStream = new MemoryStream())
+                {
+                    using (GZipStream zipStream = new GZipStream(inputStream, CompressionMode.Decompress))
+                    {
+                        zipStream.CopyTo(outStream);
+                        zipStream.Close();
+                        return outStream.ToArray();
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// 压缩字符串
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        public static string Compress(string input)
+        {
+            byte[] inputBytes = Encoding.Default.GetBytes(input);
+            byte[] result = Compress(inputBytes);
+            return Convert.ToBase64String(result);
+        }
+
+        /// <summary>
+        /// 解压缩字符串
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        public static string Decompress(string input)
+        {
+            byte[] inputBytes = Convert.FromBase64String(input);
+            byte[] depressBytes = Decompress(inputBytes);
+            return Encoding.Default.GetString(depressBytes);
+        }
+
+        /// <summary>
+        /// 压缩目录
+        /// </summary>
+        /// <param name="dir"></param>
+        public static void Compress(DirectoryInfo dir)
+        {
+            foreach (FileInfo fileToCompress in dir.GetFiles())
+            {
+                Compress(fileToCompress);
+            }
+        }
+
+        /// <summary>
+        /// 解压缩目录
+        /// </summary>
+        /// <param name="dir"></param>
+        public static void Decompress(DirectoryInfo dir)
+        {
+            foreach (FileInfo fileToCompress in dir.GetFiles())
+            {
+                Decompress(fileToCompress);
+            }
+        }
+
+        /// <summary>
+        /// 压缩文件
+        /// </summary>
+        /// <param name="fileToCompress"></param>
+        public static void Compress(FileInfo fileToCompress)
+        {
+            using (FileStream originalFileStream = fileToCompress.OpenRead())
+            {
+                if ((File.GetAttributes(fileToCompress.FullName) & FileAttributes.Hidden) != FileAttributes.Hidden & fileToCompress.Extension != ".gz")
+                {
+                    using (FileStream compressedFileStream = File.Create(fileToCompress.FullName + ".gz"))
+                    {
+                        using (GZipStream compressionStream = new GZipStream(compressedFileStream, CompressionMode.Compress))
+                        {
+                            originalFileStream.CopyTo(compressionStream);
+                        }
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// 解压缩文件
+        /// </summary>
+        /// <param name="fileToDecompress"></param>
+        public static void Decompress(FileInfo fileToDecompress)
+        {
+            using (FileStream originalFileStream = fileToDecompress.OpenRead())
+            {
+                string currentFileName = fileToDecompress.FullName;
+                string newFileName = currentFileName.Remove(currentFileName.Length - fileToDecompress.Extension.Length);
+
+                using (FileStream decompressedFileStream = File.Create(newFileName))
+                {
+                    using (GZipStream decompressionStream = new GZipStream(originalFileStream, CompressionMode.Decompress))
+                    {
+                        decompressionStream.CopyTo(decompressedFileStream);
+                    }
+                }
+            }
+        }
+    }
+}

+ 62 - 0
HNWD.Pregrant.Common/GlobalConfigureSetting.cs

@@ -0,0 +1,62 @@
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace HNWD.Pregrant.Common
+{
+    /// <summary>
+    /// 全局配置设置
+    /// </summary>
+    public static class GlobalConfigureSetting
+    {
+        private static Dictionary<string, string> dic = new Dictionary<string, string>();
+
+        static GlobalConfigureSetting()
+        {
+            if (ConfigurationManager.ConnectionStrings["WD_IPCALL_PREGNANT"] != null)
+            {
+                dic.Add("WD_IPCALL_PREGNANT", ConfigurationManager.ConnectionStrings["WD_IPCALL_PREGNANT"].ToString());
+            }
+        }
+
+        public static void AddConnectionSetting(string dataSource)
+        {
+            if (dic.ContainsKey("WD_IPCALL_PREGNANT"))
+            {
+                dic["WD_IPCALL_PREGNANT"] = dataSource;
+            }
+            else
+            {
+                dic.Add("WD_IPCALL_PREGNANT", dataSource);
+            }
+        }
+
+        public static void AddCallingStayingTime(string StayingTime)
+        {
+            if (dic.ContainsKey("STAYINGTIME"))
+            {
+                dic["STAYINGTIME"] = StayingTime;
+            }
+            else
+            {
+                dic.Add("STAYINGTIME", StayingTime);
+            }
+        }
+
+        public static void AddWebServerHostIP(string HostIP)
+        {
+            if (dic.ContainsKey("HostIP"))
+            {
+                dic["HostIP"] = HostIP;
+            }
+            else
+            {
+                dic.Add("HostIP", HostIP);
+            }
+        }
+
+        public static string GetConfigureSetting(string keyValue)
+        {
+            return dic[keyValue];
+        }
+    }
+}

+ 77 - 0
HNWD.Pregrant.Common/HNWD.Pregrant.Common.csproj

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{19DBC4BF-FB9E-45FE-A983-14CE569C4CD2}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HNWD.Pregrant.Common</RootNamespace>
+    <AssemblyName>HNWD.Pregrant.Common</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="Microsoft.CSharp" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="BitmapBlack.cs" />
+    <Compile Include="BitmapGray.cs" />
+    <Compile Include="clsWebService.cs" />
+    <Compile Include="GlobalConfigureSetting.cs" />
+    <Compile Include="GZipCompress.cs" />
+    <Compile Include="JsonHelper.cs" />
+    <Compile Include="NetLog.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Newtonsoft.Json">
+      <Version>12.0.3</Version>
+    </PackageReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 142 - 0
HNWD.Pregrant.Common/JsonHelper.cs

@@ -0,0 +1,142 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Text;
+using System.Web.Script.Serialization;
+
+namespace HNWD.Pregrant.Common
+{
+    public static class JsonHelper
+    {
+        public static string Serialize(Object o, string str2)
+        {
+            JavaScriptSerializer Serializer = new JavaScriptSerializer();
+            Serializer.MaxJsonLength = Int32.MaxValue;
+            string str = Serializer.Serialize(o);
+            return str;
+        }
+
+        public static string Serialize(Object o)
+        {
+            JavaScriptSerializer Serializer = new JavaScriptSerializer();
+            Serializer.MaxJsonLength = Int32.MaxValue;
+            string str = Serializer.Serialize(o);
+            return str;
+        }
+
+        public static string SerializeWithSuffix(Object o, string Suffix = ",OK!")
+        {
+            JavaScriptSerializer Serializer = new JavaScriptSerializer();
+            Serializer.MaxJsonLength = int.MaxValue;
+            string str = Serializer.Serialize(o);
+            return str + Suffix;
+        }
+
+        public static string Serialize(DataSet o)
+        {
+            string str = JsonConvert.SerializeObject(o, new DataTableConverter());
+            str = str.Replace("Table", "dataList");
+            return str;
+        }
+
+        public static string Serialize(DataTable table, string type = "javascript")
+        {
+            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
+
+            List<Dictionary<string, object>> parentRow = new List<Dictionary<string, object>>();
+
+            Dictionary<string, object> childRow;
+
+            foreach (DataRow row in table.Rows)
+            {
+                childRow = new Dictionary<string, object>();
+
+                foreach (DataColumn col in table.Columns)
+                {
+                    childRow.Add(col.ColumnName, row[col]);
+                }
+
+                parentRow.Add(childRow);
+            }
+
+            return jsSerializer.Serialize(parentRow);
+        }
+
+        public static string Serialize(DataTable table, string type = "net", string type2 = "net")
+        {
+            string jsonString = JsonConvert.SerializeObject(table);
+
+            return jsonString;
+        }
+
+        public static string Serialize(DataTable table, string type = "string", string type2 = "string", string type3 = "string")
+        {
+            var jsonString = new StringBuilder();
+
+            jsonString.Append("{\"" + table.TableName + "\":");
+
+            if (table.Rows.Count > 0)
+            {
+                jsonString.Append("[");
+
+                for (int i = 0; i < table.Rows.Count; i++)
+                {
+                    jsonString.Append("{");
+
+                    for (int j = 0; j < table.Columns.Count; j++)
+                    {
+                        if (j < table.Columns.Count - 1)
+                        {
+                            jsonString.Append("\"" + table.Columns[j].ColumnName.ToString()
+
+                        + "\":" + "\""
+
+                        + table.Rows[i][j].ToString() + "\",");
+                        }
+                        else if (j == table.Columns.Count - 1)
+                        {
+                            jsonString.Append("\"" + table.Columns[j].ColumnName.ToString()
+
+                        + "\":" + "\""
+
+                        + table.Rows[i][j].ToString() + "\"");
+                        }
+                    }
+
+                    if (i == table.Rows.Count - 1)
+                    {
+                        jsonString.Append("}");
+                    }
+                    else
+                    {
+                        jsonString.Append("},");
+                    }
+                }
+
+                jsonString.Append("]");
+
+                jsonString.Append("}");
+            }
+
+            return jsonString.ToString();
+        }
+
+        public static T Deserialize<T>(string json)
+        {
+            JavaScriptSerializer Serializer = new JavaScriptSerializer();
+            T objs = Serializer.Deserialize<T>(json);
+            return objs;
+        }
+
+        public static T DeserializeWithSuffix<T>(string json, string Suffix = ",OK!")
+        {
+            json = json.Replace(Suffix, "");
+
+            JavaScriptSerializer Serializer = new JavaScriptSerializer();
+            T objs = Serializer.Deserialize<T>(json);
+            return objs;
+        }
+    }
+}

+ 101 - 0
HNWD.Pregrant.Common/NetLog.cs

@@ -0,0 +1,101 @@
+using System;
+using System.IO;
+using System.Text;
+
+namespace HNWD.Pregrant.Common
+{
+    public class NetLog
+    {
+        private static readonly object lockobj = new object();
+
+        /// <summary>
+        /// 写入日志到文本文件
+        /// </summary>
+        /// <param name="strMessage">日志内容</param>
+        public static void WriteTextLog(string strMessage, string ok = "ok\\")
+        {
+            lock (lockobj)
+            {
+                string path = AppDomain.CurrentDomain.BaseDirectory + @"Log\" + ok;
+                if (!Directory.Exists(path))
+                    Directory.CreateDirectory(path);
+                DateTime time = DateTime.Now;
+                string fileFullPath = path + time.ToString("yyyy-MM-dd") + ".System.txt";
+                StringBuilder str = new StringBuilder();
+
+                str.Append("Time:" + time + ";Message: " + strMessage + "\r\n");
+                StreamWriter sw;
+                if (!File.Exists(fileFullPath))
+                {
+                    sw = File.CreateText(fileFullPath);
+                }
+                else
+                {
+                    sw = File.AppendText(fileFullPath);
+                }
+                sw.WriteLine(str.ToString());
+                sw.Close();
+            }
+        }
+
+        /// <summary>
+        /// 写入日志到文本文件
+        /// </summary>
+        /// <param name="strMessage">日志内容</param>
+        public static void WriteTextOkLog(string strMessage)
+        {
+            lock (lockobj)
+            {
+                string path = AppDomain.CurrentDomain.BaseDirectory + @"Log\Ok\\";
+                if (!Directory.Exists(path))
+                    Directory.CreateDirectory(path);
+                DateTime time = DateTime.Now;
+                string fileFullPath = path + time.ToString("yyyy-MM-dd") + ".System.txt";
+                StringBuilder str = new StringBuilder();
+
+                str.Append("Time:" + time + ";Message: " + strMessage + "\r\n");
+                StreamWriter sw;
+                if (!File.Exists(fileFullPath))
+                {
+                    sw = File.CreateText(fileFullPath);
+                }
+                else
+                {
+                    sw = File.AppendText(fileFullPath);
+                }
+                sw.WriteLine(str.ToString());
+                sw.Close();
+            }
+        }
+
+        /// <summary>
+        /// 写入日志到文本文件
+        /// </summary>
+        /// <param name="strMessage">日志内容</param>
+        public static void WriteTextErrorLog(string strMessage)
+        {
+            lock (lockobj)
+            {
+                string path = AppDomain.CurrentDomain.BaseDirectory + @"Log\Error\";
+                if (!Directory.Exists(path))
+                    Directory.CreateDirectory(path);
+                DateTime time = DateTime.Now;
+                string fileFullPath = path + time.ToString("yyyy-MM-dd") + ".System.txt";
+                StringBuilder str = new StringBuilder();
+
+                str.Append("Time:" + time + ";Message: " + strMessage + "\r\n");
+                StreamWriter sw;
+                if (!File.Exists(fileFullPath))
+                {
+                    sw = File.CreateText(fileFullPath);
+                }
+                else
+                {
+                    sw = File.AppendText(fileFullPath);
+                }
+                sw.WriteLine(str.ToString());
+                sw.Close();
+            }
+        }
+    }
+}

+ 36 - 0
HNWD.Pregrant.Common/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("HNWD.Pregrant.Common")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HNWD.Pregrant.Common")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("4fa0960f-062a-49b3-a72c-2a0b8881aef5")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 73 - 0
HNWD.Pregrant.Common/clsWebService.cs

@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Specialized;
+using System.IO;
+using System.Net;
+using System.Text;
+
+namespace HNWD.Pregrant.Common
+{
+    public class clsWebService
+    {
+        private string webServerIP = string.Empty;
+
+        private WebClient webClient = new WebClient();
+
+        public clsWebService(string webServerIP)
+        {
+            this.webServerIP = webServerIP;
+            webClient.Credentials = CredentialCache.DefaultCredentials;
+            webClient.Encoding = System.Text.Encoding.GetEncoding("UTF-8");
+        }
+
+        public string WebServerIP
+        {
+            get { return this.webServerIP; }
+            set { this.webServerIP = value; }
+        }
+
+        public string HttpServer
+        {
+            get { return "http://" + this.webServerIP + "/"; }
+        }
+
+        public string GetDataString(string subURL, string strPostData)
+        {
+            Byte[] bytes = Encoding.GetEncoding("UTF-8").GetBytes(strPostData.ToString());
+            webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
+            webClient.Headers.Add("ContentLength", strPostData.Length.ToString());
+
+            return Encoding.UTF8.GetString(webClient.UploadData(this.HttpServer + subURL, "POST", bytes));
+        }
+
+        public string GetDataString(string subURL, NameValueCollection nameValueCollection)
+        {
+            webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
+
+            return Encoding.UTF8.GetString(webClient.UploadValues(this.HttpServer + subURL, "POST", nameValueCollection));
+        }
+
+        public string GetDataString(string subURL)
+        {
+            return Encoding.UTF8.GetString(webClient.DownloadData(new System.Uri(this.HttpServer + subURL)));
+        }
+
+        public Boolean GetDataFile(string subURL, string FileName)
+        {
+            bool bRes = false;
+
+            if (File.Exists(FileName))
+            {
+                File.Delete(FileName);
+            }
+
+            webClient.DownloadFile(this.HttpServer + subURL, FileName);
+
+            if (File.Exists(FileName))
+            {
+                bRes = true;
+            }
+
+            return bRes;
+        }
+    }
+}

+ 45 - 0
HNWD.Pregrant.DataAccess/ConnectorManager.cs

@@ -0,0 +1,45 @@
+using HNWD.Pregrant.Common;
+using System.Data;
+using System.Data.SqlClient;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class ConnectorManager
+    {
+        //private readonly static DbConnection connection = new OleDbConnection(GlobalConfigureSetting.GetConfigureSetting("WD_IPCALL_PREGNANT"));
+        //private readonly static object lockobj = new object();
+        //public static DbConnection GetDbInstance()
+        //{
+        //    lock (lockobj)
+        //    {
+        //        if (connection.State == ConnectionState.Closed)
+        //        {
+        //            connection.Open();
+        //        }
+        //    }
+
+        //    return connection;
+        //}
+
+        //public void Close()
+        //{
+        //    if (connection.State == ConnectionState.Open)
+        //    {
+        //        connection.Close();
+        //    }
+        //}
+
+        private readonly static string connStr = GlobalConfigureSetting.GetConfigureSetting("WD_IPCALL_PREGNANT");
+
+        public SqlConnection GetInstance()
+        {
+            SqlConnection conn = new SqlConnection(connStr);
+            if (conn.State == ConnectionState.Closed)
+            {
+                conn.Open();
+            }
+
+            return conn;
+        }
+    }
+}

+ 18 - 0
HNWD.Pregrant.DataAccess/DataBaseBackUpDataAccess.cs

@@ -0,0 +1,18 @@
+using HNWD.Pregrant.Model;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class DataBaseBackUpDataAccess : GenericDataAccess<ModelBase>
+    {
+        public DataBaseBackUpDataAccess()
+        {
+        }
+
+        public void BackUpDataBase(string TempPath)
+        {
+            string strSql = " backup database WD_IPCALL_ to disk='" + TempPath + "'";
+
+            this.Execute(strSql.ToString(), new ModelBase());
+        }
+    }
+}

+ 47 - 0
HNWD.Pregrant.DataAccess/FieldNickGenerator.cs

@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Reflection;
+using HNWD.Pregrant.Model;
+ 
+
+namespace HNWD.Pregrant.DataAccess
+{
+
+    public static class FieldNickGenerator<Entity> where Entity : ModelBase,new()
+    {
+        public static StringBuilder GeneratFieldNick() 
+        {
+            StringBuilder sb = new StringBuilder(" ");
+
+            //Type t = typeof(Entity);
+
+            //foreach (FieldInfo p in t.GetFields())
+            //{
+            //    IgnoreAttribute[] attr = (IgnoreAttribute[])p.GetCustomAttributes(typeof(IgnoreAttribute), true);
+
+            //    if(!(attr == null || attr.Length == 0))
+            //    {
+            //        continue;
+            //    }
+
+            //    NickAttribute[] attrs = (NickAttribute[])p.GetCustomAttributes(typeof(NickAttribute), true);
+
+            //    if (attrs == null || attrs.Length == 0)
+            //    {
+            //        sb.Append(p.Name + " , ");
+            //    }
+            //    else
+            //    {
+            //        sb.Append(p.Name + " as " + attrs[0].NickName + ", ");
+            //    }
+            //}
+
+
+            sb.Append(" * ");
+
+            return sb;
+        }
+    }
+}

+ 211 - 0
HNWD.Pregrant.DataAccess/GenericDataAccess.cs

@@ -0,0 +1,211 @@
+using HNWD.Pregrant.Model;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using Dapper;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public abstract class GenericDataAccess<Entity>
+        where Entity : ModelBase, new()
+    {
+        public bool bSuccess = false;
+        protected string Code = "";
+        public Int32 Rows = 0;
+        public string Message = "";
+
+        /// <summary>
+        /// 源列表
+        /// </summary>
+        public List<Entity> Entities = null;
+
+        /// <summary>
+        /// 查找源数据
+        /// </summary>
+        /// <param name="t">源实例</param>
+        /// <param name="bAll"> 是否查询所有:true 为所有,false 为带条件 , 默认为:false </param>
+        /// <returns>List<T>/></returns>
+        protected List<Entity> Query(string strSql, Entity entity = null)
+        {
+            string fields = FieldNickGenerator<Entity>.GeneratFieldNick().ToString();
+
+            strSql = string.Format(strSql, fields);
+            ConnectorManager cm = new ConnectorManager();
+            SqlConnection sql = cm.GetInstance();
+
+            try
+            {
+                this.Entities = sql.Query<Entity>(strSql, entity).ToList();
+
+                this.bSuccess = true;
+                this.Rows = this.Entities.Count;
+                this.Code = "OK!";
+                this.Message = "成功获取请求数据!";
+            }
+            catch (Exception ex)
+            {
+                this.bSuccess = false;
+                this.Code = "ERROR!";
+                this.Rows = 0;
+                this.Message = ex.Message;
+            }
+            finally
+            {
+                sql.Close();
+            }
+
+            return this.Entities;
+        }
+
+        /// <summary>
+        /// 查找源数据
+        /// </summary>
+        /// <param name="t">源实例</param>
+        /// <param name="bAll"> 是否查询所有:true 为所有,false 为带条件 , 默认为:false </param>
+        /// <returns>List<T>/></returns>
+        protected void Execute(string strSql, Entity entity)
+        {
+            ConnectorManager cm = new ConnectorManager();
+            SqlConnection sql = cm.GetInstance();
+
+            IDbTransaction transaction = sql.BeginTransaction();
+
+            try
+            {
+                int i = sql.Execute(strSql, entity, transaction, null, null);
+
+                this.bSuccess = true;
+                this.Code = "OK!";
+                this.Message = "命令执行成功!";
+                this.Rows = 0;
+
+                transaction.Commit();
+            }
+            catch (Exception ex)
+            {
+                this.bSuccess = false;
+                this.Code = "ERROR!";
+                this.Rows = 0;
+                this.Message = ex.Message;
+
+                transaction.Rollback();
+            }
+            finally
+            {
+                sql.Close();
+            }
+
+            transaction.Dispose();
+        }
+
+        /// <summary>
+        /// 查找源数据
+        /// </summary>
+        /// <param name="t">源实例</param>
+        /// <param name="bAll"> 是否查询所有:true 为所有,false 为带条件 , 默认为:false </param>
+        /// <returns>List<T>/></returns>
+        protected void Execute(string isql, string usql, string dsql)
+        {
+            ConnectorManager cm = new ConnectorManager();
+            SqlConnection sql = cm.GetInstance();
+
+            IDbTransaction transaction = sql.BeginTransaction();
+
+            try
+            {
+                int i = 0, u = 0, d = 0;
+                if (isql.Length > 0)
+                {
+                    i = sql.Execute(isql, null, transaction, null, null);
+                }
+                if (usql.Length > 0)
+                {
+                    u = sql.Execute(usql, null, transaction, null, null);
+                }
+                if (dsql.Length > 0)
+                {
+                    d = sql.Execute(dsql, null, transaction, null, null);
+                }
+
+                this.bSuccess = true;
+                this.Code = "OK!";
+                this.Message = "命令执行成功!(i:" + i.ToString() + ",u:" + u.ToString() + ",d:" + d.ToString() + ")";
+                this.Rows = i;
+
+                transaction.Commit();
+            }
+            catch (Exception ex)
+            {
+                this.bSuccess = false;
+                this.Code = "ERROR!";
+                this.Rows = 0;
+                this.Message = ex.Message;
+
+                transaction.Rollback();
+            }
+            finally
+            {
+                sql.Close();
+            }
+
+            transaction.Dispose();
+        }
+
+        /// <summary>
+        /// 查找源数据
+        /// </summary>
+        /// <param name="t">源实例</param>
+        /// <param name="bAll"> 是否查询所有:true 为所有,false 为带条件 , 默认为:false </param>
+        /// <returns>List<T>/></returns>
+        protected void Execute(string isql, string usql, string dsql, string asql)
+        {
+            ConnectorManager cm = new ConnectorManager();
+            SqlConnection sql = cm.GetInstance();
+
+            IDbTransaction transaction = sql.BeginTransaction();
+
+            try
+            {
+                int i = 0, u = 0, d = 0;
+                if (isql.Length > 0)
+                {
+                    i = sql.Execute(isql, null, transaction, null, null);
+                }
+                if (usql.Length > 0)
+                {
+                    u = sql.Execute(usql, null, transaction, null, null);
+                }
+                if (dsql.Length > 0)
+                {
+                    d = sql.Execute(dsql, null, transaction, null, null);
+                }
+
+                sql.Execute(asql, null, transaction, null, null);
+
+                this.bSuccess = true;
+                this.Code = "OK!";
+                this.Message = "命令执行成功!(i:" + i.ToString() + ",u:" + u.ToString() + ",d:" + d.ToString() + ")";
+                this.Rows = i;
+
+                transaction.Commit();
+            }
+            catch (Exception ex)
+            {
+                this.bSuccess = false;
+                this.Code = "ERROR!";
+                this.Rows = 0;
+                this.Message = ex.Message;
+
+                transaction.Rollback();
+            }
+            finally
+            {
+                sql.Close();
+            }
+
+            transaction.Dispose();
+        }
+    }
+}

+ 101 - 0
HNWD.Pregrant.DataAccess/HNWD.Pregrant.DataAccess.csproj

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{6A87D03A-5DDF-4156-84E4-92DB0CECC694}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HNWD.Pregrant.DataAccess</RootNamespace>
+    <AssemblyName>HNWD.Pregrant.DataAccess</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Web" />
+    <Reference Include="System.Data" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="clsDataBaseRW.cs" />
+    <Compile Include="clsOpenSIPSAccount.cs" />
+    <Compile Include="ConnectorManager.cs" />
+    <Compile Include="DataBaseBackUpDataAccess.cs" />
+    <Compile Include="FieldNickGenerator.cs" />
+    <Compile Include="GenericDataAccess.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SIPAccountService.cs" />
+    <Compile Include="WD_CostInfoDataAccess.cs" />
+    <Compile Include="WD_DeviceInfoDataAccess.cs" />
+    <Compile Include="WD_MessageInfoDataAccess.cs" />
+    <Compile Include="WD_NoticeInfoDataAccess.cs" />
+    <Compile Include="WD_NurseCfgInfoDataAccess.cs" />
+    <Compile Include="WD_PartInfoDataAccess.cs" />
+    <Compile Include="WD_PatientInfoDataAccess.cs" />
+    <Compile Include="WD_ProgramInfoDataAccess.cs" />
+    <Compile Include="WD_RunProfileDataAccess.cs" />
+    <Compile Include="WD_StaffInfoDataAccess.cs" />
+    <Compile Include="WD_SysLogInfoDataAccess.cs" />
+    <Compile Include="WD_UrgeInfoDataAccess.cs" />
+    <Compile Include="WD_VerInfoDataAccess.cs" />
+    <Compile Include="WD_ZoneInfoDataAccess.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Dapper">
+      <Version>1.50.2</Version>
+    </PackageReference>
+    <PackageReference Include="MySql.Data">
+      <Version>6.9.12</Version>
+    </PackageReference>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HNWD.Pregrant.Common\HNWD.Pregrant.Common.csproj">
+      <Project>{19dbc4bf-fb9e-45fe-a983-14ce569c4cd2}</Project>
+      <Name>HNWD.Pregrant.Common</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HNWD.Pregrant.Model\HNWD.Pregrant.Model.csproj">
+      <Project>{34f21f47-f2a7-49b8-a8ba-b1836aa6f5fe}</Project>
+      <Name>HNWD.Pregrant.Model</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 36 - 0
HNWD.Pregrant.DataAccess/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("HNWD.Pregrant.DataAccess")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HNWD.Pregrant.DataAccess")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("65af3493-c6b9-4721-be87-4cc996e07f56")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 59 - 0
HNWD.Pregrant.DataAccess/SIPAccountService.cs

@@ -0,0 +1,59 @@
+using System.Text;
+
+
+using HNWD.Pregrant.Model;
+
+
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class SIPAccountService
+    {
+        private string path = "";
+        private string userDEVICE_ETH_MAC = "";
+
+        public SIPAccountService(string userDEVICE_ETH_MAC, string path)
+        {
+            this.userDEVICE_ETH_MAC = userDEVICE_ETH_MAC;
+            this.path = path;
+
+        }
+        public bool RegisterByuserDEVICE_ETH_MAC()
+        {
+            //'==================================================
+            //'判断SIP服务器是否存在账号信息
+
+            clsOpenSIPSAccount TempSipAccount = new clsOpenSIPSAccount(this.path);
+
+            bool TempSipRes = false;
+
+            TempSipAccount.OpenSIPs_ConnectDefault();
+
+            StringBuilder sb = FieldNickGenerator<WD_DeviceInfo>.GeneratFieldNick();
+
+ 
+
+            WD_DeviceInfoDataAccess wd_DeviceInfoDataAccess = new WD_DeviceInfoDataAccess(null);
+
+            wd_DeviceInfoDataAccess.QueryAll();
+
+            if (wd_DeviceInfoDataAccess.ext.bSuccess && wd_DeviceInfoDataAccess.ext.Rows > 0)
+            {
+
+
+                if (!string.IsNullOrEmpty(wd_DeviceInfoDataAccess.ext.messageDataList[0].deviceSipId))
+                {
+                    TempSipRes = TempSipAccount.OpenSIPs_AccountCheck(wd_DeviceInfoDataAccess.ext.messageDataList[0].deviceSipId, TempSipRes);
+                }
+                if (!TempSipRes)
+                {
+                    TempSipAccount.OpenSIPs_AccountAdd(wd_DeviceInfoDataAccess.ext.messageDataList[0].deviceSipId, wd_DeviceInfoDataAccess.ext.messageDataList[0].deviceSipId);
+                }
+                TempSipAccount.OpenSIPs_Close();
+            }
+
+
+            return TempSipRes;
+        }
+    }
+}

+ 44 - 0
HNWD.Pregrant.DataAccess/WD_CostInfoDataAccess.cs

@@ -0,0 +1,44 @@
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_CostInfoDataAccess : GenericDataAccess<WD_CostInfo>
+    {
+        private WD_CostInfo wd_CostInfo = null;
+
+        public WD_CostInfoExt ext = new WD_CostInfoExt();
+
+        private readonly static WD_CostInfoDataAccess wd_CostInfoDataAccess = new WD_CostInfoDataAccess();
+
+        public WD_CostInfoDataAccess(WD_CostInfo wd_CostInfo)
+        {
+            this.wd_CostInfo = wd_CostInfo;
+        }
+
+        public static WD_CostInfoDataAccess GetInstance()
+        {
+            return wd_CostInfoDataAccess;
+        }
+
+        private WD_CostInfoDataAccess()
+        {
+        }
+
+        public List<WD_CostInfo> QueryAll()
+        {
+            string strSql = " select {0} from [WD_CostInfo] where DATEDIFF(day,[COST_CREATEDATE],getdate() )<2 ";
+
+            ext.messageDataList = this.Query(strSql, new WD_CostInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+        }
+    }
+}

+ 296 - 0
HNWD.Pregrant.DataAccess/WD_DeviceInfoDataAccess.cs

@@ -0,0 +1,296 @@
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_DeviceInfoDataAccess : GenericDataAccess<WD_DeviceInfo>
+    {
+        private WD_DeviceInfo wd_DeviceInfo = null;
+
+        public WD_DeviceInfoExt ext = new WD_DeviceInfoExt();
+        private string webPath = string.Empty;
+
+        private readonly static WD_DeviceInfoDataAccess wd_DeviceInfoDataAccess = new WD_DeviceInfoDataAccess();
+        private readonly static object lockobj = new object();
+
+        private WD_DeviceInfoDataAccess()
+        {
+        }
+
+        public WD_DeviceInfoDataAccess(WD_DeviceInfo wd_DeviceInfo)
+        {
+            this.wd_DeviceInfo = wd_DeviceInfo;
+        }
+
+        public static WD_DeviceInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_DeviceInfoDataAccess;
+            }
+        }
+
+        public WD_DeviceInfoDataAccess(string webPath, string p2)
+        {
+            this.webPath = webPath;
+        }
+
+        public List<WD_DeviceInfo> QueryAll()
+        {
+            string strSql = " select {0} from [WD_DeviceInfo] ";
+
+            ext.messageDataList = this.Query(strSql, new WD_DeviceInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.BedInfoArray = ext.messageDataList;
+            ext.DeviceInfoArray = ext.messageDataList;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+        }
+
+        public List<WD_DeviceInfo> QueryPartIDs()
+        {
+            string strSql = " select PARTID from [WD_DeviceInfo] WHERE DEVICE_TYPE = 6 AND DEVICE_STATUS = 1 GROUP BY PARTID";
+
+            ext.messageDataList = this.Query(strSql, new WD_DeviceInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.BedInfoArray = ext.messageDataList;
+            ext.DeviceInfoArray = ext.messageDataList;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+        }
+
+        public void UpdateDEVICE_SIP_HOSTING_ID_Begin(string HostId, string paHostId)
+        {
+            StringBuilder strSql = new StringBuilder(" update [WD_DeviceInfo] SET [DEVICE_SIP_HOSTING_ID]='#" + HostId + "," + paHostId + "' where [DEVICE_SIP_HOSTING_ID]='" + paHostId + "' and [DEVICE_TYPE] in (3 , 4) ;");
+            strSql.Append("update [WD_DeviceInfo] SET [DEVICE_SIP_HOSTING_ID]='" + HostId + "," + paHostId + "' where [ID]=" + HostId + ";");
+            strSql.Append("update [WD_DeviceInfo] SET [DEVICE_SIP_HOSTING_ID]='#" + HostId + "' where [ID]=" + paHostId + ";");
+            strSql.Append("update [WD_RunProfile] SET [TrustResetFlag]='" + HostId + "," + paHostId + "';");
+
+            this.Execute(strSql.ToString(), new WD_DeviceInfo());
+        }
+
+        public void UpdateDEVICE_SIP_HOSTING_ID_Stop(string HostId, string paHostId)
+        {
+            StringBuilder strSql = new StringBuilder(" update [WD_DeviceInfo] SET [DEVICE_SIP_HOSTING_ID]='" + paHostId + "' where [DEVICE_SIP_HOSTING_ID]='#" + HostId + "," + paHostId + "'  and  [DEVICE_TYPE] in (3 , 4) ;");
+            strSql.Append("update [WD_DeviceInfo] SET [DEVICE_SIP_HOSTING_ID]='" + HostId + "' where [ID]=" + HostId + ";");
+            strSql.Append("update [WD_DeviceInfo] SET [DEVICE_SIP_HOSTING_ID]='" + paHostId + "' where [ID]=" + paHostId + ";");
+            strSql.Append("update [WD_RunProfile] SET [TrustResetFlag]='" + HostId + "," + paHostId + "';");
+
+            this.Execute(strSql.ToString(), new WD_DeviceInfo());
+        }
+
+        public void DeleteAll()
+        {
+            StringBuilder strSql = new StringBuilder(" delete from [WD_DeviceInfo] ");
+
+            this.Execute(strSql.ToString(), new WD_DeviceInfo());
+        }
+
+        public void Business(List<WD_DeviceInfo> il, List<WD_DeviceInfo> ul, List<WD_DeviceInfo> dl)
+        {
+            StringBuilder sb_itemp = new StringBuilder();
+            sb_itemp.Append(" INSERT INTO [WD_DeviceInfo] ( ");
+            sb_itemp.Append(" [DEVICE_TYPE],[DEVICE_ID],[DEVICE_MODEL],[DEVICE_SOFT_VER],[DEVICE_HARD_VER], ");
+            sb_itemp.Append(" [DEVICE_NAME],[DEVICE_ETH_MAC],[DEVICE_ETH_IP],[DEVICE_WIFI_MAC],[DEVICE_WIFI_IP], ");
+            sb_itemp.Append(" [DEVICE_WIFI_HOSTNAME],[DEVICE_STATUS],[DEVICE_ROOM_NUM],[DEVICE_ROOM_ID],[DEVICE_BED_NUM], ");
+            sb_itemp.Append(" [DEVICE_BED_NAME],[DEVICE_HUMAN_TYPE],[DEVICE_HUMAN_ID],[DEVICE_SIP_IP],[DEVICE_SIP_ID], ");
+            sb_itemp.Append(" [DEVICE_SIP_PASSWORD],[DEVICE_SIP_STATUS],[DEVICE_SIP_CALLLIST],[DEVICE_SIP_HOSTING_ID],[DEVICE_IR_CFG], ");
+            sb_itemp.Append(" [DEVICE_ZONE0],[DEVICE_ZONE1],[DEVICE_ZONE2],[DEVICE_ZONE3],[DEVICE_ZONE4], ");
+            sb_itemp.Append(" [DEVICE_ZONE5],[DEVICE_DATETIME] ");
+            sb_itemp.Append(" ) values (");
+            sb_itemp.Append(" '{0}','{1}','{2}','{3}','{4}', ");
+            sb_itemp.Append(" '{5}','{6}','{7}','{8}','{9}', ");
+            sb_itemp.Append(" '{10}','{11}','{12}','{13}','{14}', ");
+            sb_itemp.Append(" '{15}','{16}','{17}','{18}','{19}', ");
+            sb_itemp.Append(" '{20}','{21}','{22}','{23}','{24}', ");
+            sb_itemp.Append(" '{25}','{26}','{27}','{28}','{29}', ");
+            sb_itemp.Append(" '{30}','{31}' ");
+
+            StringBuilder sb_utemp = new StringBuilder();
+            sb_utemp.Append(" UPDATE [WD_DeviceInfo] SET  ");
+            sb_utemp.Append(" [DEVICE_TYPE] = '{0}',[DEVICE_ID] = '{1}',[DEVICE_MODEL] = '{2}',[DEVICE_SOFT_VER] = '{3}',[DEVICE_HARD_VER] = '{4}', ");
+            sb_utemp.Append(" [DEVICE_NAME]= '{5}',[DEVICE_ETH_MAC]= '{6}',[DEVICE_ETH_IP]= '{7}',[DEVICE_WIFI_MAC]= '{8}',[DEVICE_WIFI_IP]= '{9}', ");
+            sb_utemp.Append(" [DEVICE_WIFI_HOSTNAME]= '{10}',[DEVICE_STATUS]= '{11}',[DEVICE_ROOM_NUM]= '{12}',[DEVICE_ROOM_ID]= '{13}',[DEVICE_BED_NUM]= '{14}', ");
+            sb_utemp.Append(" [DEVICE_BED_NAME]= '{15}',[DEVICE_HUMAN_TYPE]= '{16}',[DEVICE_HUMAN_ID]= '{17}',[DEVICE_SIP_IP]= '{18}',[DEVICE_SIP_ID]= '{19}', ");
+            sb_utemp.Append(" [DEVICE_SIP_PASSWORD]= '{20}',[DEVICE_SIP_STATUS]= '{21}',[DEVICE_SIP_CALLLIST]= '{22}',[DEVICE_SIP_HOSTING_ID]= '{23}',[DEVICE_IR_CFG]= '{24}', ");
+            sb_utemp.Append(" [DEVICE_ZONE0]= '{25}',[DEVICE_ZONE1] = '{26}',[DEVICE_ZONE2]= '{27}',[DEVICE_ZONE3]= '{28}',[DEVICE_ZONE4]= '{29}', ");
+            sb_utemp.Append(" [DEVICE_ZONE5]= '{30}',[DEVICE_DATETIME]= '{31}'  ");
+            sb_utemp.Append(" WHERE ID = '{32}'  ");
+
+            StringBuilder sb_dtemp = new StringBuilder();
+            sb_dtemp.Append(" DELETE [WD_DeviceInfo] WHERE ID = '{0}' ");
+
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach (WD_DeviceInfo wd in il)
+            {
+                sb_i.AppendFormat(sb_itemp.ToString(),
+                    wd.DEVICE_TYPE,
+                    wd.DEVICE_SN,
+                    wd.DEVICE_MODEL,
+                    wd.DEVICE_SOFT_VER,
+                    wd.DEVICE_HARD_VER,
+                    wd.DEVICE_NAME,
+                    wd.DEVICE_ETH_MAC,
+                    wd.DEVICE_ETH_IP,
+                    wd.DEVICE_WIFI_MAC,
+                    wd.DEVICE_WIFI_IP,
+                    wd.DEVICE_WIFI_HOSTNAME,
+                    wd.DEVICE_STATUS,
+                    wd.DEVICE_ROOM_NUM,
+                    wd.DEVICE_ROOM_ID,
+                    wd.DEVICE_BED_NUM,
+                    wd.DEVICE_BED_NAME,
+                    wd.DEVICE_HUMAN_TYPE,
+                    wd.DEVICE_HUMAN_ID,
+                    wd.DEVICE_SIP_IP,
+                    wd.DEVICE_SIP_ID,
+                    wd.DEVICE_SIP_PASSWORD,
+                    wd.DEVICE_IR_CFG,
+                    wd.DEVICE_ZONE0,
+                    wd.DEVICE_ZONE1,
+                    wd.DEVICE_ZONE2,
+                    wd.DEVICE_ZONE3,
+                    wd.DEVICE_ZONE4,
+                    wd.DEVICE_ZONE5,
+                    wd.DEVICE_DATETIME
+                    );
+
+                clsDataBaseRW clsDataBaseRW2 = new clsDataBaseRW(this.webPath);
+                clsOpenSIPSAccount clsOpenSIPSAccount2 = new clsOpenSIPSAccount(this.webPath);
+
+                //写MAC地址到DHCP服务器
+                if (wd.DEVICE_ETH_MAC.Trim() != "")
+                {
+                    clsDataBaseRW2.DHCP_WriteIPAddressByMAC(wd.DEVICE_ETH_MAC, wd.DEVICE_ETH_IP);
+                }
+
+                if (wd.DEVICE_TYPE == "1" || wd.DEVICE_TYPE == "2" || wd.DEVICE_TYPE == "3")
+                {
+                    wd.DEVICE_SIP_ID = clsOpenSIPSAccount2.GetSipAccount(wd.DEVICE_TYPE, wd.ID);
+                    wd.DEVICE_SIP_PASSWORD = wd.DEVICE_SIP_ID;
+                    string StrSql = "update [WD_DeviceInfo] SET " +
+                    "[DEVICE_SIP_ID]='" + wd.DEVICE_SIP_ID + "'," +
+                    "[DEVICE_SIP_PASSWORD]='" + wd.DEVICE_SIP_PASSWORD + "',";
+
+                    //             '若为护士主机,需要把ID号写到[DEVICE_SIP_HOSTING_ID]
+                    if (wd_DeviceInfo.DEVICE_TYPE == "1")
+                    {
+                        StrSql += " [DEVICE_SIP_HOSTING_ID] = '" + wd.ID + "',";
+                    }
+
+                    StrSql += "[DEVICE_DATETIME]='" + wd.DEVICE_DATETIME + "' where [ID]=" + wd.ID;
+                }
+
+                if (clsOpenSIPSAccount2.OpenSIPs_ConnectDefault())
+                {
+                    if (clsOpenSIPSAccount2.OpenSIPs_AccountAdd(wd.DEVICE_SIP_ID, wd.DEVICE_SIP_PASSWORD))
+                    {
+                    }
+                }
+                clsOpenSIPSAccount2.OpenSIPs_Close();
+            }
+
+            StringBuilder sb_u = new StringBuilder();
+
+            foreach (WD_DeviceInfo wd in ul)
+            {
+                sb_u.AppendFormat(sb_utemp.ToString(),
+                     wd.DEVICE_TYPE,
+                    wd.DEVICE_SN,
+                    wd.DEVICE_MODEL,
+                    wd.DEVICE_SOFT_VER,
+                    wd.DEVICE_HARD_VER,
+                    wd.DEVICE_NAME,
+                    wd.DEVICE_ETH_MAC,
+                    wd.DEVICE_ETH_IP,
+                    wd.DEVICE_WIFI_MAC,
+                    wd.DEVICE_WIFI_IP,
+                    wd.DEVICE_WIFI_HOSTNAME,
+                    wd.DEVICE_STATUS,
+                    wd.DEVICE_ROOM_NUM,
+                    wd.DEVICE_ROOM_ID,
+                    wd.DEVICE_BED_NUM,
+                    wd.DEVICE_BED_NAME,
+                    wd.DEVICE_HUMAN_TYPE,
+                    wd.DEVICE_HUMAN_ID,
+                    wd.DEVICE_SIP_IP,
+                    wd.DEVICE_SIP_ID,
+                    wd.DEVICE_SIP_PASSWORD,
+                    wd.DEVICE_IR_CFG,
+                    wd.DEVICE_ZONE0,
+                    wd.DEVICE_ZONE1,
+                    wd.DEVICE_ZONE2,
+                    wd.DEVICE_ZONE3,
+                    wd.DEVICE_ZONE4,
+                    wd.DEVICE_ZONE5,
+                    wd.DEVICE_DATETIME,
+                    wd.ID
+                    );
+
+                clsDataBaseRW clsDataBaseRW2 = new clsDataBaseRW(this.webPath);
+                clsOpenSIPSAccount clsOpenSIPSAccount2 = new clsOpenSIPSAccount(this.webPath);
+
+                if (wd.DEVICE_ETH_MAC.Trim() != "")
+                {
+                    clsDataBaseRW2.DHCP_WriteIPAddressByMAC(wd.DEVICE_ETH_MAC, wd.DEVICE_ETH_IP);
+                }
+
+                if (wd.DEVICE_TYPE == "1" || wd.deviceType == "2" || wd.deviceType == "3")
+                {
+                    if (wd.DEVICE_SIP_ID != clsOpenSIPSAccount2.GetSipAccount(wd.DEVICE_TYPE, wd.ID))
+                    {
+                        if (clsOpenSIPSAccount2.OpenSIPs_ConnectDefault())
+                        {
+                            clsOpenSIPSAccount2.OpenSIPs_AccountDel(wd.DEVICE_SIP_ID);
+                            if (clsOpenSIPSAccount2.OpenSIPs_AccountAdd(wd.DEVICE_SIP_ID, wd.DEVICE_SIP_PASSWORD))
+                            {
+                            }
+                        }
+                    }
+                }
+
+                clsOpenSIPSAccount2.OpenSIPs_Close();
+            }
+
+            StringBuilder sb_d = new StringBuilder();
+
+            foreach (WD_DeviceInfo wd in dl)
+            {
+                sb_d.AppendFormat(sb_dtemp.ToString(), wd.ID);
+
+                clsDataBaseRW clsDataBaseRW2 = new clsDataBaseRW(this.webPath);
+                clsOpenSIPSAccount clsOpenSIPSAccount2 = new clsOpenSIPSAccount(this.webPath);
+
+                if (wd.DEVICE_ETH_MAC.Trim() != "")
+                {
+                    clsDataBaseRW2.DHCP_WriteIPAddressByMAC(wd.DEVICE_ETH_MAC, "");
+                }
+
+                if (wd.DEVICE_TYPE == "1" || wd.DEVICE_TYPE == "2" || wd.DEVICE_TYPE == "3")
+                {
+                    if (clsOpenSIPSAccount2.OpenSIPs_ConnectDefault())
+                    {
+                        clsOpenSIPSAccount2.OpenSIPs_AccountDel(wd.DEVICE_SIP_ID);
+                        clsOpenSIPSAccount2.OpenSIPs_Close();
+                    }
+                }
+            }
+
+            this.Execute(sb_i.ToString(), sb_u.ToString(), sb_d.ToString());
+        }
+    }
+}

+ 46 - 0
HNWD.Pregrant.DataAccess/WD_MessageInfoDataAccess.cs

@@ -0,0 +1,46 @@
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_MessageInfoDataAccess : GenericDataAccess<WD_MessageInfo>
+    {
+        private WD_MessageInfo wd_MessageInfo = null;
+
+        public WD_MessageInfoExt ext = new WD_MessageInfoExt();
+
+        private WD_MessageInfoDataAccess(WD_MessageInfo wd_MessageInfo)
+        {
+            this.wd_MessageInfo = wd_MessageInfo;
+        }
+
+        private readonly static WD_MessageInfoDataAccess wd_MessageInfoDataAccess = new WD_MessageInfoDataAccess(null);
+        private readonly static object lockobj = new object();
+
+        public static WD_MessageInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_MessageInfoDataAccess;
+            }
+        }
+
+        public List<WD_MessageInfo> QueryAll()
+        {
+            string strSql = " select TOP 5 [MESSAGE_CONTENT],[MESSAGE_DATETIME] from [WD_MessageInfo] order by [ID] DESC ";
+
+            ext.messageDataList = this.Query(strSql, new WD_MessageInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+        }
+    }
+}

+ 115 - 0
HNWD.Pregrant.DataAccess/WD_NoticeInfoDataAccess.cs

@@ -0,0 +1,115 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_NoticeInfoDataAccess : GenericDataAccess<WD_NoticeInfo>
+    {
+        private WD_NoticeInfo wd_NoticeInfo= null;
+
+        public WD_NoticeInfoExt ext = new WD_NoticeInfoExt();
+
+        private readonly static WD_NoticeInfoDataAccess wd_NoticeInfoDataAccess = new WD_NoticeInfoDataAccess(null);
+        private readonly static object lockobj = new object();
+
+        public static WD_NoticeInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_NoticeInfoDataAccess;
+            }
+        }  
+
+        private WD_NoticeInfoDataAccess(WD_NoticeInfo wd_NoticeInfo)
+        {
+            this.wd_NoticeInfo = wd_NoticeInfo;
+        } 
+
+        //public List<WD_NoticeInfo> QueryAll()
+        //{
+        //    string strSql = " select {0} from [WD_NoticeInfo] " ;
+
+        //    ext.NoticeArray = this.Query(strSql, new WD_NoticeInfo());
+        //    ext.messageDataList = ext.NoticeArray;
+        //    ext.NoticeArray.ForEach(f => f.bSuccess = this.bSuccess);
+        //    ext.NoticeArray.ForEach(f => f.Code = this.Code);
+        //    ext.NoticeArray.ForEach(f => f.Message = this.Message);
+        //    ext.NoticeArray.ForEach(f => f.Rows = this.Rows);
+        //    ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+        //    ext.messageDataList.ForEach(f => f.Code = this.Code);
+        //    ext.messageDataList.ForEach(f => f.Message = this.Message);
+        //    ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+
+        //    ext.bSuccess = this.bSuccess;
+        //    ext.Code = this.Code;
+        //    ext.Message = this.Message;
+        //    ext.Rows = this.Rows;
+
+        //    return ext.NoticeArray;
+
+        //}
+
+
+        public List<WD_NoticeInfo> QueryAll()
+        {
+            //string strSql = " select {0} from [WD_NoticeInfo] where abs(DATEDIFF(n,getdate(),[NOTICE_STARTTIME])) <4 and DATEDIFF(n,getdate(),[NOTICE_ENDTIME] )>0 and  [NOTICE_PATIENT_ID] =" + this.wd_NoticeInfo.NOTICE_PATIENT_ID.Trim();
+
+            string strSql = " select {0} from [WD_NoticeInfo] where abs(DATEDIFF(n,getdate(),[NOTICE_STARTTIME])) <4 and DATEDIFF(n,getdate(),[NOTICE_ENDTIME] )>0 ";
+
+
+            ext.NoticeArray = this.Query(strSql, new WD_NoticeInfo());
+            ext.messageDataList = ext.NoticeArray; 
+            ext.NoticeArray.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.NoticeArray.ForEach(f => f.Code = this.Code);
+            ext.NoticeArray.ForEach(f => f.Message = this.Message);
+            ext.NoticeArray.ForEach(f => f.Rows = this.Rows);
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.NoticeArray;
+
+        }
+
+
+        public void Business(List<WD_NoticeInfo> il, List<WD_NoticeInfo> ul, List<WD_NoticeInfo> dl)
+        {
+            string strSql_i = " Insert into WD_NoticeInfo([NOTICE_PATIENT_ID],[NOTICE_TEXT],[NOTICE_STARTTIME],[NOTICE_ENDTIME],[NOTICE_DATETIME]) VALUES ('{0}' ,  '{1}', '{2}',  '{3}', '{4}') ";
+            string strSql_u = " Update WD_NoticeInfo set NOTICE_PATIENT_ID = '{0}' , NOTICE_TEXT = '{1}' , NOTICE_STARTTIME = '{2}'  , NOTICE_ENDTIME = '{3}'  , NOTICE_DATETIME = '{4}'  where ID = '{5}' ";
+            string strSql_d = " delete WD_NoticeInfo where ID = '{0}' "; 
+
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach (WD_NoticeInfo wd in il)
+            {
+                sb_i.AppendFormat(strSql_i, wd.NOTICE_PATIENT_ID, wd.NOTICE_TEXT, wd.NOTICE_STARTTIME, wd.NOTICE_ENDTIME, wd.NOTICE_DATETIME);
+            }
+
+
+            StringBuilder sb_u = new StringBuilder();
+
+            foreach (WD_NoticeInfo wd in ul)
+            {
+                sb_u.AppendFormat(strSql_u, wd.NOTICE_PATIENT_ID, wd.NOTICE_TEXT, wd.NOTICE_STARTTIME, wd.NOTICE_ENDTIME, wd.NOTICE_DATETIME ,wd.ID);
+            }
+
+            StringBuilder sb_d = new StringBuilder();
+
+            foreach (WD_NoticeInfo wd in dl)
+            {
+                sb_d.AppendFormat(strSql_d, wd.ID);
+            }
+
+            this.Execute(sb_i.ToString(), sb_u.ToString(), sb_d.ToString());
+             
+        } 
+    }
+}

+ 103 - 0
HNWD.Pregrant.DataAccess/WD_NurseCfgInfoDataAccess.cs

@@ -0,0 +1,103 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_NurseCfgInfoDataAccess : GenericDataAccess<WD_NurseCfgInfo>
+    {
+        private WD_NurseCfgInfo wd_NurseCfgInfo = null;
+
+        public WD_NurseCfgInfoExt ext = new WD_NurseCfgInfoExt();
+
+        private readonly static WD_NurseCfgInfoDataAccess wd_NurseCfgInfoDataAccess = new WD_NurseCfgInfoDataAccess(null);
+        private readonly static object lockobj = new object();
+         public static WD_NurseCfgInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_NurseCfgInfoDataAccess;
+            }
+        }  
+
+        private WD_NurseCfgInfoDataAccess(WD_NurseCfgInfo wd_NurseCfgInfo)
+        {
+            this.wd_NurseCfgInfo = wd_NurseCfgInfo;
+
+        }
+
+        public List<WD_NurseCfgInfo> Query()
+        {
+            string strSql = " select {0} from [WD_NurseCfgInfo] where ID = '" + this.wd_NurseCfgInfo.ID + "'";
+
+            ext.messageDataList = this.Query(strSql, new WD_NurseCfgInfo());
+             ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+
+        }
+
+        public List<WD_NurseCfgInfo> QueryAll()
+        {
+            string strSql = " select {0} from [WD_NurseCfgInfo] ";
+
+            ext.messageDataList = this.Query(strSql, new WD_NurseCfgInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+
+        }
+
+
+
+        public void Business(List<WD_NurseCfgInfo> il, List<WD_NurseCfgInfo> ul, List<WD_NurseCfgInfo> dl)
+        {
+ 
+
+            string strSql_i = " Insert into WD_NurseCfgInfo([NURSECFG_ID],[NURSECFG_VALUE],[NURSECFG_HIS_VALUE],[NURSECFG_NAME],[NURSECFG_COLOR],[NURSECFG_CONTENT],[NURSECFG_DATETIME]) VALUES ('{0}' ,  '{1}', '{2}',  '{3}', '{4}' , '{5}' , '{6}' ) ";
+            string strSql_u = " Update WD_NurseCfgInfo set NURSECFG_ID = '{0}' , NURSECFG_VALUE = '{1}' , NURSECFG_HIS_VALUE = '{2}'  , NURSECFG_NAME = '{3}'  , NURSECFG_COLOR = '{4}' , NURSECFG_CONTENT = '{5}' , NURSECFG_DATETIME = '{6}'   where ID = '{7}' ";
+            string strSql_d = " delete WD_NurseCfgInfo where ID = '{0}' ";
+
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach (WD_NurseCfgInfo wd in il)
+            {
+                sb_i.AppendFormat(strSql_i, wd.NURSECFG_ID, wd.NURSECFG_VALUE, wd.NURSECFG_HIS_VALUE, wd.NURSECFG_NAME, wd.NURSECFG_COLOR, wd.NURSECFG_CONTENT, wd.NURSECFG_DATETIME);
+            }
+
+
+            StringBuilder sb_u = new StringBuilder();
+
+            foreach (WD_NurseCfgInfo wd in ul)
+            {
+                sb_u.AppendFormat(strSql_u, wd.NURSECFG_ID, wd.NURSECFG_VALUE, wd.NURSECFG_HIS_VALUE, wd.NURSECFG_NAME, wd.NURSECFG_COLOR, wd.NURSECFG_CONTENT, wd.NURSECFG_DATETIME , wd.ID);
+            }
+
+            StringBuilder sb_d = new StringBuilder();
+
+            foreach (WD_NurseCfgInfo wd in dl)
+            {
+                sb_d.AppendFormat(strSql_d, wd.ID);
+            }
+
+            this.Execute(sb_i.ToString(), sb_u.ToString(), sb_d.ToString());
+
+        } 
+    }
+}

+ 152 - 0
HNWD.Pregrant.DataAccess/WD_PartInfoDataAccess.cs

@@ -0,0 +1,152 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_PartInfoDataAccess : GenericDataAccess<WD_PartInfo>
+    {
+        private WD_PartInfo wd_DeviceInfo = null;
+
+        public WD_PartInfoExt ext = new WD_PartInfoExt();
+
+        private readonly static WD_PartInfoDataAccess wd_PartInfoDataAccess = new WD_PartInfoDataAccess();
+        private readonly static object lockobj = new object();
+        private WD_PartInfoDataAccess()
+        {
+        }
+
+
+        public static WD_PartInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_PartInfoDataAccess;
+            }
+        }  
+
+        public List<WD_PartInfo> Query()
+        {
+            string strSql = " select {0} from [WD_PartInfo] " ;
+
+            ext.messageDataList = this.Query(strSql, new WD_PartInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+
+        }
+
+
+        public bool Update(string sql)
+        {
+            this.Execute(sql, new WD_PartInfo());
+
+            return this.bSuccess;
+
+        }
+
+
+        public void Business(List<WD_PartInfo> il, List<WD_PartInfo> ul, List<WD_PartInfo> dl)
+        {
+
+            StringBuilder strSql_utemp = new StringBuilder();
+            strSql_utemp.Append( " Update WD_PartInfo set ");
+            strSql_utemp.Append( " PART_HOSPITALNAME = '{0}' , PART_NAME = '{1}' , PART_CODE = '{2}'  , PART_CONTENT = '{3}'  , PART_ROOMCOUNT = '{4}', ");
+            strSql_utemp.Append( " PART_BEDCOUNT = '{5}' , PART_SLEEPTIME = '{6}' , PART_DAY_START = '{7}'  , PART_DAY_BLIGHT = '{8}'  , PART_DAY_SIPVOL = '{9}', ");
+            strSql_utemp.Append( " PART_DAY_RINGVOL = '{10}' , PART_DAY_RINGTIMES = '{11}' , PART_DAY_NURSINGLED = '{12}'  , PART_DAY_DOORSIPVOL = '{13}'  , PART_DAY_BEDSIPVOL = '{14}', ");
+            strSql_utemp.Append( " PART_NIGHT_START = '{11}' , PART_NIGHT_BLIGHT = '{12}' , PART_NIGHT_SIPVOL = '{13}'  , PART_NIGHT_RINGVOL = '{14}'  , PART_NIGHT_RINGTIMES = '{15}', ");
+            strSql_utemp.Append( " PART_NIGHT_NURSINGLED = '{16}' , PART_NIGHT_DOORSIPVOL = '{17}' , PART_NIGHT_BEDSIPVOL = '{18}'  , PART_SIP_OVERTIME = '{19}'  , PART_ERRORPIC = '{20}', ");
+            strSql_utemp.Append( " PART_NURSE_LEVEL0 = '{21}' , PART_NURSE_LEVEL1 = '{22}' , PART_NURSE_LEVEL2 = '{23}'  , PART_NURSE_LEVEL3 = '{24}'  , PART_NURSE_LEVEL4 = '{25}', ");
+            strSql_utemp.Append( " PART_SPECIAL_CARE = '{26}' , PART_PRIMARY_CARE = '{27}' , PART_DISPLAY_ILLNESS = '{28}'  , PART_CODESWITCH = '{29}'  , SIPSEV_IP = '{30}', ");
+            strSql_utemp.Append( " SIPSEV_MYSQLPASSWORD = '{31}' , SIPSEV_MYSQLUSERNAME = '{32}' , PART_DATETIME = '{33}' ");
+            strSql_utemp.Append( " where ID = '{34}' ");
+
+            
+            StringBuilder sb_append = new StringBuilder();
+ 
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach (WD_PartInfo wd in il)
+            {
+            }
+
+
+            StringBuilder sb_u = new StringBuilder();
+ 
+            foreach (WD_PartInfo wd in ul)
+            {
+
+                sb_u.AppendFormat(strSql_utemp.ToString(),                   
+                    wd.PART_HOSPITALNAME ,
+                    wd.PART_NAME ,
+                    wd.PART_CODE ,
+                    wd.PART_CONTENT ,
+                    wd.PART_ROOMCOUNT ,
+                    wd.PART_SLEEPTIME ,
+                    wd.PART_DAY_START ,
+                    wd.PART_DAY_BLIGHT ,
+                    wd.PART_DAY_SIPVOL ,
+                    wd.PART_DAY_RINGVOL ,
+                    wd.PART_DAY_RINGTIMES ,
+                    wd.PART_DAY_NURSINGLED ,
+                    wd.PART_DAY_DOORSIPVOL ,
+                    wd.PART_DAY_BEDSIPVOL ,
+                    wd.PART_NIGHT_START ,
+                    wd.PART_NIGHT_BLIGHT ,
+                    wd.PART_NIGHT_RINGVOL ,
+                    wd.PART_NIGHT_RINGTIMES ,
+                    wd.PART_NIGHT_NURSINGLED ,
+                    wd.PART_NIGHT_DOORSIPVOL ,
+                    wd.PART_NIGHT_BEDSIPVOL ,                
+                    wd.PART_SIP_OVERTIME ,
+                    wd.PART_ERRORPIC  ,
+                    wd.PART_NURSE_LEVEL0 ,
+                    wd.PART_NURSE_LEVEL1 ,
+                    wd.PART_NURSE_LEVEL2  ,
+                    wd.PART_NURSE_LEVEL3 ,
+                    wd.PART_NURSE_LEVEL4 ,
+                    wd.PART_SPECIAL_CARE  ,
+                    wd.PART_PRIMARY_CARE  ,
+                    wd.PART_DISPLAY_ILLNESS  ,
+                    wd.PART_CODESWITCH  ,
+                    wd.SIPSEV_IP  ,
+                    wd.SIPSEV_MYSQLPASSWORD  ,
+                    wd.SIPSEV_MYSQLUSERNAME  ,
+                    wd.PART_DATETIME ,
+                    wd.ID );
+
+                //修改特级护理配置(196-255)
+                sb_append.AppendFormat( " update [WD_NurseCfgInfo] SET [NURSECFG_VALUE]=255 where [NURSECFG_ID]='0' and [ID]= '{0}' ",wd.PART_SPECIAL_CARE );
+                //修改一级护理配置(130-195)
+                sb_append.AppendFormat( " update [WD_NurseCfgInfo] SET [NURSECFG_VALUE]=195 where [NURSECFG_ID]='0' and [ID]= '{0}' ",wd.PART_PRIMARY_CARE );
+                //二级护理
+                sb_append.AppendFormat( " update [WD_NurseCfgInfo] SET [NURSECFG_VALUE]=129 where [NURSECFG_ID]='0' and [ID] <>'{0}' ",wd.PART_PRIMARY_CARE + " and [ID] <>'{1}' " + wd.PART_SPECIAL_CARE   );
+                //通知服务器发送UDP,立即生效!
+         
+                sb_append.Append( " update [WD_RunProfile] SET [SysSettingsFlag]=1 ");
+ 
+
+            }
+
+            StringBuilder sb_d = new StringBuilder();
+
+            foreach (WD_PartInfo wd in dl)
+            {
+            }
+
+            this.Execute(sb_i.ToString(), sb_u.ToString(), sb_d.ToString() , sb_append.ToString());
+
+        } 
+
+  
+    }
+}

+ 332 - 0
HNWD.Pregrant.DataAccess/WD_PatientInfoDataAccess.cs

@@ -0,0 +1,332 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_PatientInfoDataAccess : GenericDataAccess<WD_PatientInfo>
+    {
+        private WD_PatientInfo wd_DeviceInfo = null;
+
+        public WD_PatientInfoExt ext = new WD_PatientInfoExt();
+
+        private readonly static WD_PatientInfoDataAccess wd_PatientInfoDataAccess = new WD_PatientInfoDataAccess(null);
+        private readonly static object lockobj = new object();
+        public static WD_PatientInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_PatientInfoDataAccess;
+            }
+        }  
+
+        private WD_PatientInfoDataAccess(WD_PatientInfo wd_PatientInfo)
+        {
+            this.wd_DeviceInfo = wd_PatientInfo;
+
+       }
+
+        private string webPath = string.Empty;
+
+        public WD_PatientInfoDataAccess(string webPath,string r2)
+        {
+            this.webPath = webPath;
+
+        }
+
+        public List<WD_PatientInfo> Query()
+        {
+
+            string strSql = " select {0} from [WD_PatientInfo]  where [ID]=" + this.wd_DeviceInfo.ID;
+
+
+            ext.messageDataList = this.Query(strSql, new WD_PatientInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+            this.SetSexAndAge(ext);
+
+            return ext.messageDataList;
+
+        }
+
+
+        public List<WD_PatientInfo> QueryAll()
+        {
+
+            string strSql = " select DATEDIFF(day,getdate(),[PATIENT_DATETIME]) DiffDays , {0} from [WD_PatientInfo]  ";
+
+
+            ext.messageDataList = this.Query(strSql, new WD_PatientInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+            this.SetSexAndAge(ext);
+            return ext.messageDataList;
+
+        }
+
+
+        public List<WD_PatientInfo> QueryNativeAll()
+        {
+            string strSql = " select DATEDIFF(day,getdate(),[PATIENT_DATETIME]) DiffDays , {0} from [WD_PatientInfo]  ";
+
+            ext.messageDataList = this.Query(strSql, new WD_PatientInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows; 
+            return ext.messageDataList;
+
+        }
+
+        private void SetSexAndAge(WD_PatientInfoExt ex)
+        {
+            foreach (WD_PatientInfo wd in ex.messageDataList)
+            {
+                if (wd.PATIENT_SEX == "1")
+                {
+                    wd.PATIENT_SEX = "男";
+                }
+                else if (wd.PATIENT_SEX == "2")
+                {
+                    wd.PATIENT_SEX = "女";
+                }
+                else
+                {
+                    wd.PATIENT_SEX = "未知";
+                }
+
+
+                if (wd.PATIENT_BABYSEX == "1")
+                {
+                    wd.PATIENT_BABYSEX = "男";
+                }
+                else if (wd.PATIENT_BABYSEX == "2")
+                {
+                    wd.PATIENT_BABYSEX = "女";
+                }
+                else
+                {
+                    wd.PATIENT_BABYSEX = "未知";
+                }
+
+
+
+                if (wd.PATIENT_AGE_UNIT == "Y")
+                {
+                    wd.PATIENT_AGE_UNIT = "岁";
+                }
+                else if (wd.PATIENT_AGE_UNIT == "M")
+                {
+                    wd.PATIENT_AGE_UNIT = "月";
+                }
+                else if (wd.PATIENT_AGE_UNIT == "D")
+                {
+                    wd.PATIENT_AGE_UNIT = "周";
+                }
+                else
+                {
+                    wd.PATIENT_AGE_UNIT = "岁";
+                }
+            }
+
+        }
+
+        private WD_PatientInfoExt QueryMAXID()
+        {
+
+            string strSql = " select top 1 * from [WD_PatientInfo] order by ID desc ";
+
+            ext.messageDataList = this.Query(strSql, new WD_PatientInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext;
+
+        }
+
+
+        public void Business(List<WD_PatientInfo> il, List<WD_PatientInfo> ul, List<WD_PatientInfo> dl)
+        {
+            StringBuilder sb_itemp = new StringBuilder();
+            sb_itemp.Append(" INSERT INTO [WD_PatientInfo] ( ");
+            sb_itemp.Append(" [PATIENT_PHOC_ID],[PATIENT_ID],[PATIENT_CARD_ID],[PATIENT_NAME],[PATIENT_NAME_PY], ");
+            sb_itemp.Append(" [PATIENT_SEX],[PATIENT_AGE],[PATIENT_AGE_UNIT],[PATIENT_BIRTHDAY],[PATIENT_IDCARD], ");
+            sb_itemp.Append(" [PATIENT_ADDRESS],[PATIENT_MOBLIE],[PATIENT_INDATE],[PATIENT_DOCTOR_ID],[PATIENT_NURSE_ID], ");
+            sb_itemp.Append(" [PATIENT_WORKERS_ID],[PATIENT_NURSE_LEVEL0],[PATIENT_NURSE_LEVEL1],[PATIENT_NURSE_LEVEL2],[PATIENT_NURSE_LEVEL3], ");
+            sb_itemp.Append(" [PATIENT_NURSE_LEVEL4],[PATIENT_INTIMES],[PATIENT_STATUS],[PATIENT_ILLNESS],[PATIENT_BABYNAME], ");
+            sb_itemp.Append(" [PATIENT_BABYSEX],[PATIENT_DATETIME] ");
+            sb_itemp.Append(" ) values (");
+            sb_itemp.Append(" '{0}','{1}','{2}','{3}','{4}', ");
+            sb_itemp.Append(" '{5}','{6}','{7}','{8}','{9}', ");
+            sb_itemp.Append(" '{10}','{11}','{12}','{13}','{14}', ");
+            sb_itemp.Append(" '{15}','{16}','{17}','{18}','{19}', ");
+            sb_itemp.Append(" '{20}','{21}','{22}','{23}','{24}', ");
+            sb_itemp.Append(" '{25}','{26}' ");
+ 
+
+            StringBuilder strSql_utemp = new StringBuilder();
+            strSql_utemp.Append(" Update WD_PatientInfo set ");
+            strSql_utemp.Append(" PATIENT_PHOC_ID = '{0}' , PATIENT_ID = '{1}' , PATIENT_CARD_ID = '{2}'  , PATIENT_NAME = '{3}'  , PATIENT_NAME_PY = '{4}', ");
+            strSql_utemp.Append(" PATIENT_SEX = '{5}' , PATIENT_AGE = '{6}' , PATIENT_AGE_UNIT = '{7}'  , PATIENT_BIRTHDAY = '{8}'  , PATIENT_IDCARD = '{9}', ");
+            strSql_utemp.Append(" PATIENT_ADDRESS = '{10}' , PATIENT_MOBLIE = '{11}' , PATIENT_INDATE = '{12}'  , PATIENT_DOCTOR_ID = '{13}'  , PATIENT_NURSE_ID = '{14}', ");
+            strSql_utemp.Append(" PATIENT_WORKERS_ID = '{15}' , PATIENT_NURSE_LEVEL0 = '{16}' , PATIENT_NURSE_LEVEL1 = '{17}'  , PATIENT_NURSE_LEVEL2 = '{18}'  , PATIENT_NURSE_LEVEL3 = '{19}', ");
+            strSql_utemp.Append(" PATIENT_NURSE_LEVEL4 = '{20}' , PATIENT_INTIMES = '{21}' , PATIENT_STATUS = '{22}'  , PATIENT_ILLNESS = '{23}'  , PATIENT_BABYNAME = '{24}', ");
+            strSql_utemp.Append(" PATIENT_BABYSEX = '{25}' , PATIENT_DATETIME = '{26}'  ");
+            strSql_utemp.Append(" where ID = '{27}' ");
+
+
+
+             StringBuilder strSql_dtemp = new StringBuilder();
+            strSql_dtemp.Append(" Update WD_PatientInfo set [PATIENT_STATUS]='3' where [ID]= '{0}' ");
+
+            StringBuilder sb_append = new StringBuilder();
+
+             
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach (WD_PatientInfo wd in il)
+            {
+                sb_itemp.AppendFormat(sb_itemp.ToString(),
+                        wd.PATIENT_PHOC_ID,
+                        wd.PATIENT_ID,
+                        wd.PATIENT_CARD_ID,
+                        wd.PATIENT_NAME,
+                        wd.PATIENT_NAME_PY,
+                        wd.PATIENT_SEX,
+                        wd.PATIENT_AGE,
+                        wd.PATIENT_AGE_UNIT,
+                        wd.PATIENT_BIRTHDAY,
+                        wd.PATIENT_IDCARD,
+                        wd.PATIENT_ADDRESS,
+                        wd.PATIENT_MOBLIE,
+                        wd.PATIENT_INDATE,
+                        wd.PATIENT_DOCTOR_ID,
+                        wd.PATIENT_NURSE_ID,
+                        wd.PATIENT_WORKERS_ID,
+                        wd.PATIENT_NURSE_LEVEL0,
+                        wd.PATIENT_NURSE_LEVEL1,
+                        wd.PATIENT_NURSE_LEVEL2,
+                        wd.PATIENT_NURSE_LEVEL3,
+                        wd.PATIENT_NURSE_LEVEL4,
+                        wd.PATIENT_INTIMES,
+                        wd.PATIENT_STATUS,
+                        wd.PATIENT_ILLNESS,
+                        wd.PATIENT_BABYNAME,
+                        wd.PATIENT_BABYSEX,
+                        wd.PATIENT_DATETIME
+                );
+                
+                
+                WD_PatientInfoExt wd_extmax = this.QueryMAXID();
+                if(wd_extmax.bSuccess && wd_extmax.Rows == 0)
+                {
+                    wd.ID = "1";
+                }
+                else
+                {
+                    wd.ID =  wd_extmax.messageDataList[0].ID ;
+                }
+
+                //有问题
+                clsOpenSIPSAccount clsopenSIPSAccount = new clsOpenSIPSAccount(this.webPath);
+
+                WD_DeviceInfo wd_DeviceInfo = new WD_DeviceInfo();
+                wd_DeviceInfo.DEVICE_SIP_ID = clsopenSIPSAccount.GetSipAccount("4", wd.ID);
+                wd_DeviceInfo.DEVICE_SIP_PASSWORD = wd_DeviceInfo.DEVICE_SIP_ID;
+                //wd_DeviceInfo.DEVICE_SIP_STATUS = "1";
+
+                if(clsopenSIPSAccount.OpenSIPs_ConnectDefault())
+                {
+                     if(!clsopenSIPSAccount.OpenSIPs_AccountCheck(wd_DeviceInfo.DEVICE_SIP_ID, true))
+                     {
+                         clsopenSIPSAccount.OpenSIPs_AccountAdd(wd_DeviceInfo.DEVICE_SIP_ID, wd_DeviceInfo.DEVICE_SIP_PASSWORD);
+                     }
+                }
+
+                clsopenSIPSAccount.OpenSIPs_Close();
+ 
+
+                sb_append.AppendFormat(" update [WD_DeviceInfo] SET [DEVICE_HUMAN_TYPE]='1', ");
+                sb_append.AppendFormat(" [DEVICE_HUMAN_ID]='{0}',[DEVICE_SIP_IP]='{1}',[DEVICE_SIP_ID]='{2}'," , wd.ID ,clsopenSIPSAccount.GetSIPSerIP , wd_DeviceInfo.DEVICE_SIP_ID);
+                //sb_append.AppendFormat(" [DEVICE_SIP_PASSWORD]='{0}',[DEVICE_SIP_STATUS]='{1}' where [ID] = '{0}' " , wd_DeviceInfo.DEVICE_SIP_PASSWORD ,wd_DeviceInfo.DEVICE_SIP_STATUS ,  wd.BEDID);
+            }
+
+
+            StringBuilder sb_u = new StringBuilder();
+
+            foreach (WD_PatientInfo wd in ul)
+            {
+
+                sb_u.AppendFormat(strSql_utemp.ToString(),
+                    wd.PATIENT_PHOC_ID,
+                    wd.PATIENT_ID,
+                    wd.PATIENT_CARD_ID,
+                    wd.PATIENT_NAME,
+                    wd.PATIENT_NAME_PY,
+                    wd.PATIENT_SEX,
+                    wd.PATIENT_AGE,
+                    wd.PATIENT_AGE_UNIT,
+                    wd.PATIENT_BIRTHDAY,
+                    wd.PATIENT_IDCARD,
+                    wd.PATIENT_ADDRESS,
+                    wd.PATIENT_MOBLIE,
+                    wd.PATIENT_INDATE,
+                    wd.PATIENT_DOCTOR_ID,
+                    wd.PATIENT_NURSE_ID,
+                    wd.PATIENT_WORKERS_ID,
+                    wd.PATIENT_NURSE_LEVEL0,
+                    wd.PATIENT_NURSE_LEVEL1,
+                    wd.PATIENT_NURSE_LEVEL2,
+                    wd.PATIENT_NURSE_LEVEL3,
+                    wd.PATIENT_NURSE_LEVEL4,
+                    wd.PATIENT_INTIMES,
+                    wd.PATIENT_STATUS,
+                    wd.PATIENT_ILLNESS,
+                    wd.PATIENT_BABYNAME,
+                    wd.PATIENT_BABYSEX,
+                    wd.PATIENT_DATETIME,
+                    wd.ID); 
+            }
+
+            StringBuilder sb_d = new StringBuilder();
+
+            foreach (WD_PatientInfo wd in dl)
+            {
+                sb_d.AppendFormat(strSql_dtemp.ToString(),
+                       wd.ID);
+
+                sb_append.AppendFormat(" update [WD_DeviceInfo] SET [DEVICE_HUMAN_TYPE]='0', ");
+                sb_append.AppendFormat(" [DEVICE_HUMAN_ID]='0',[DEVICE_SIP_IP]='',[DEVICE_SIP_ID]='',");
+                sb_append.AppendFormat(" [DEVICE_SIP_PASSWORD]='',[DEVICE_SIP_STATUS]='2' where [ID] = '{0}' " , wd.BEDID);
+    
+            }
+
+            this.Execute(sb_i.ToString(), sb_u.ToString(), sb_d.ToString(), sb_append.ToString());
+
+        } 
+    }
+}

+ 109 - 0
HNWD.Pregrant.DataAccess/WD_ProgramInfoDataAccess.cs

@@ -0,0 +1,109 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_ProgramInfoDataAccess : GenericDataAccess<WD_ProgramInfo>
+    {
+        private WD_ProgramInfo wd_ProgramInfo = null; 
+
+        public WD_ProgramInfoExt ext = new WD_ProgramInfoExt();
+
+        private WD_ProgramInfoDataAccess(WD_ProgramInfo wd_ProgramInfo)
+        {
+            this.wd_ProgramInfo = wd_ProgramInfo; 
+
+       }
+
+        private readonly static WD_ProgramInfoDataAccess wd_ProgramInfoDataAccess = new WD_ProgramInfoDataAccess(null);
+        private readonly static object lockobj = new object();
+
+        public static WD_ProgramInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_ProgramInfoDataAccess;
+            }
+        }  
+
+        public List<WD_ProgramInfo> QueryAll()
+        { 
+            string strSql = " select {0} from [WD_ProgramInfo]  ";
+
+            ext.messageDataList = this.Query(strSql, new WD_ProgramInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+
+        }
+
+
+        public void Business(List<WD_ProgramInfo> il, List<WD_ProgramInfo> ul, List<WD_ProgramInfo> dl)
+        { 
+            StringBuilder strSql_i = new StringBuilder( " INSERT INTO WD_ProgramInfo( " );
+            strSql_i.Append( " PROGRAM_NAME ,PROGRAM_TYPE , PROGRAM_X , PROGRAM_Y , PROGRAM_WIDTH  ," );
+            strSql_i.Append( " PROGRAM_HEIGHT ,PROGRAM_TEXT , PROGRAM_IMAGE , PROGRAM_MATRIX , PROGRAM_FORMAT , " );
+            strSql_i.Append(" PROGRAM_ALIGN ,PROGRAM_STAYINGTIME ,PROGRAM_DEVICE_ID , PROGRAM_DATETIME ");
+            strSql_i.Append( " ) values (" );
+            strSql_i.Append( " '{0}' ,'{1}' , '{2}' , '{3}' , '{4}' , " );
+            strSql_i.Append( " '{5}' ,'{6}' , '{7}' , '{8}' , '{9}' , " );
+            strSql_i.Append( " '{10}' ,'{11}' , '{12}' , '{13}' " );
+            strSql_i.Append( " ) " );
+
+
+            StringBuilder strSql_u = new StringBuilder(" UPDATE WD_ProgramInfo SET ");
+            strSql_u.Append(" PROGRAM_NAME = '{0}' ,PROGRAM_TYPE = '{1}' , PROGRAM_X = '{2}', PROGRAM_Y = '{3}', PROGRAM_WIDTH= '{4}'  ,");
+            strSql_u.Append(" PROGRAM_HEIGHT = '{5}',PROGRAM_TEXT= '{6}' , PROGRAM_IMAGE= '{7}' , PROGRAM_MATRIX= '{8}' , PROGRAM_FORMAT= '{9}' , ");
+            strSql_u.Append(" PROGRAM_ALIGN = '{10}' ,PROGRAM_STAYINGTIME= '{11}' ,PROGRAM_DEVICE_ID= '{12}' , PROGRAM_DATETIME = '{13}'");
+            strSql_u.Append(" WHERE ID = '{14}' ");
+
+
+            StringBuilder strSql_d = new StringBuilder("  delete WD_ProgramInfo where ID = '{0}' ");
+
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach (WD_ProgramInfo wd in il)
+            {
+                sb_i.AppendFormat(strSql_i.ToString(), wd.PROGRAM_NAME , wd.PROGRAM_TYPE, wd.PROGRAM_X, wd.PROGRAM_Y, wd.PROGRAM_WIDTH, 
+                                                        wd.PROGRAM_HEIGHT, wd.PROGRAM_TEXT, wd.PROGRAM_IMAGE, wd.PROGRAM_MATRIX , wd.PROGRAM_FORMAT ,
+                                                        wd.PROGRAM_ALIGN , wd.PROGRAM_STAYINGTIME, wd.PROGRAM_DEVICE_ID, wd.PROGRAM_DATETIME);
+            }
+
+
+            StringBuilder sb_u = new StringBuilder();
+
+            foreach (WD_ProgramInfo wd in ul)
+            {
+                sb_u.AppendFormat(strSql_u.ToString(), wd.PROGRAM_NAME, wd.PROGRAM_TYPE, wd.PROGRAM_X, wd.PROGRAM_Y, wd.PROGRAM_WIDTH,
+                                                        wd.PROGRAM_HEIGHT, wd.PROGRAM_TEXT, wd.PROGRAM_IMAGE, wd.PROGRAM_MATRIX, wd.PROGRAM_FORMAT,
+                                                        wd.PROGRAM_ALIGN , wd.PROGRAM_STAYINGTIME, wd.PROGRAM_DEVICE_ID, wd.PROGRAM_DATETIME , wd.ID);
+            }
+
+            StringBuilder sb_d = new StringBuilder();
+
+            foreach (WD_ProgramInfo wd in dl)
+            {
+                sb_d.AppendFormat(strSql_d.ToString(), wd.ID);
+            }
+
+            StringBuilder sb_append = new StringBuilder();
+            sb_append.Append(" update WD_RunProfile set LEDDeviceFlag = 1 ");
+
+
+            this.Execute(sb_i.ToString(), sb_u.ToString(), sb_d.ToString() , sb_append.ToString());
+
+        }
+                
+         
+    }
+}

+ 116 - 0
HNWD.Pregrant.DataAccess/WD_RunProfileDataAccess.cs

@@ -0,0 +1,116 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_RunProfileDataAccess : GenericDataAccess<WD_RunProfile>
+    {
+        private WD_RunProfile wd_RunProfile = null;
+
+        public WD_RunProfileExt ext = new WD_RunProfileExt();
+
+        public WD_RunProfileDataAccess(WD_RunProfile wd_RunProfile)
+        {
+            this.wd_RunProfile = wd_RunProfile;
+
+        }
+
+        private WD_RunProfileDataAccess()
+        {
+        }
+
+        private readonly static WD_RunProfileDataAccess wd_RunProfileDataAccess = new WD_RunProfileDataAccess();
+        private readonly static object lockobj = new object();
+
+        public static WD_RunProfileDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_RunProfileDataAccess;
+            }
+        }
+
+
+        //public List<WD_RunProfile> Query()
+        //{
+
+        //    string strSql = " select {0} from [WD_RunProfile]  ";
+
+        //    ext.messageDataList = this.Query(strSql, new WD_RunProfile());
+        //    ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+        //    ext.messageDataList.ForEach(f => f.Code = this.Code);
+        //    ext.messageDataList.ForEach(f => f.Message = this.Message);
+        //    ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+        //    ext.bSuccess = this.bSuccess;
+        //    ext.Code = this.Code;
+        //    ext.Message = this.Message;
+        //    ext.Rows = this.Rows;
+
+        //    return ext.messageDataList;
+        //}
+
+        public List<WD_RunProfile> QueryAll()
+        {
+
+            string strSql = " select {0} from [WD_RunProfile]  ";
+
+            ext.messageDataList = this.Query(strSql, new WD_RunProfile());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+        }
+
+        public List<WD_RunProfile> QueryByPartID(string partid)
+        {
+
+            string strSql = " select {0} from [WD_RunProfile] WHERR PARTID = " + partid ;
+
+            ext.messageDataList = this.Query(strSql, new WD_RunProfile());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+        }
+
+        public void UpdateVol()
+        {
+
+            this.wd_RunProfile.BroadcastVol = string.IsNullOrEmpty(this.wd_RunProfile.BroadcastVol) ? "0" : this.wd_RunProfile.BroadcastVol;
+            int nVol = Convert.ToInt32(this.wd_RunProfile.BroadcastVol);
+
+            if (nVol >= 0 && nVol <= 100)
+            {
+                string strSql = " update [WD_RunProfile] SET BroadcastVol={0} ";
+                strSql = string.Format(strSql, this.wd_RunProfile.BroadcastVol);
+                this.Execute(strSql, this.wd_RunProfile);
+
+            }
+        }
+
+        /// <summary>
+        /// 更新LED标识
+        /// </summary>
+        /// <param name="invalid">是否无效</param>
+        public void UpdateLedFlag(string invalid)
+        { 
+            string strSql = " update [WD_RunProfile] SET LEDDeviceFlag={0} ";
+            strSql = string.Format(strSql, invalid);
+            this.Execute(strSql, this.wd_RunProfile); 
+        }
+    }
+}

+ 186 - 0
HNWD.Pregrant.DataAccess/WD_StaffInfoDataAccess.cs

@@ -0,0 +1,186 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_StaffInfoDataAccess : GenericDataAccess<WD_StaffInfo>
+    {
+        private WD_StaffInfo wd_StaffInfo = null;
+
+        public WD_StaffInfoExt ext = new WD_StaffInfoExt();
+
+        private readonly static WD_StaffInfoDataAccess wd_StaffInfoDataAccess = new WD_StaffInfoDataAccess(null);
+        private readonly static object lockobj = new object();
+        public static WD_StaffInfoDataAccess GetInstance()
+        {
+            lock (lockobj) 
+            {
+                return wd_StaffInfoDataAccess;
+            }
+        }
+
+        private WD_StaffInfoDataAccess(WD_StaffInfo wd_StaffInfo)
+        {
+            this.wd_StaffInfo = wd_StaffInfo;
+       }
+
+        public List<WD_StaffInfo> Query()
+        {
+ 
+            string strSql = " select {0} from [WD_StaffInfo] where id = " +  this.wd_StaffInfo.ID;
+
+            ext.messageDataList = this.Query(strSql, new WD_StaffInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+
+        }
+
+        public List<WD_StaffInfo> QueryAll()
+        {
+
+            string strSql = " select {0} from [WD_StaffInfo] ";
+
+            ext.messageDataList = this.Query(strSql, new WD_StaffInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+
+        }
+
+
+        
+        private WD_StaffInfoExt QueryMAXID()
+        {
+
+            string strSql = " select top 1 * from [WD_StaffInfo] order by ID desc ";
+
+            ext.messageDataList = this.Query(strSql, new WD_StaffInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext;
+
+        }
+
+
+
+        public void Business(List<WD_StaffInfo> il, List<WD_StaffInfo> ul, List<WD_StaffInfo> dl)
+        {
+            StringBuilder sb_itemp = new StringBuilder();
+            sb_itemp.Append(" INSERT INTO [WD_StaffInfo]( " );
+            sb_itemp.Append(" [STAFF_ID],[STAFF_PASSWORDCARD],[STAFF_NAME],[STAFF_NAME_PY],[STAFF_TYPE], " );
+            sb_itemp.Append(" [STAFF_SEX],[STAFF_BIRTHDAY],[STAFF_IDCARD],[STAFF_WORKDATE],[STAFF_PICTURE], ");
+            sb_itemp.Append(" [STAFF_WORKTEL],[STAFF_MOBILE],[STAFF_CONTENT],[STAFF_DUTY],[STAFF_DATETIME]  ");
+            sb_itemp.Append(" ) values (  ");
+            sb_itemp.Append(" '{0}' , '{1}' , '{2}' ,'{3}' ,'{4}' , ");
+            sb_itemp.Append(" '{5}' , '{6}' , '{7}' ,'{8}' ,'{9}' , ");
+            sb_itemp.Append(" '{10}' , '{11}' , '{12}' ,'{13}' ,'{14}'  ");
+            sb_itemp.Append(" ) ");
+
+
+            StringBuilder sb_utemp = new StringBuilder();
+            sb_utemp.Append(" UPDATE  [WD_StaffInfo] SET  " );
+            sb_utemp.Append(" [STAFF_ID] = '{0}',[STAFF_PASSWORDCARD] = '{1}',[STAFF_NAME] = '{2}',[STAFF_NAME_PY] = '{3}',[STAFF_TYPE] = '{4}', " );
+            sb_utemp.Append(" [STAFF_SEX] = '{5}',[STAFF_BIRTHDAY] = '{6}',[STAFF_IDCARD] = '{7}',[STAFF_WORKDATE] = '{8}',[STAFF_PICTURE] = '{9}', ");
+            sb_utemp.Append(" [STAFF_WORKTEL] = '{10}',[STAFF_MOBILE] = '{11}',[STAFF_CONTENT] = '{12}',[STAFF_DUTY] = '{13}',[STAFF_DATETIME] = '{14}'  ");
+            sb_utemp.Append(" WHERE ID = '{15}' "); 
+
+            StringBuilder sb_dtemp = new StringBuilder();
+            sb_dtemp.Append( " delete from [WD_StaffInfo] where [ID]= '{0}'" ); 
+ 
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach (WD_StaffInfo wd in il)
+            {
+                WD_StaffInfoExt wd_extmax = this.QueryMAXID();
+                if(wd_extmax.bSuccess && wd_extmax.Rows == 0)
+                {
+                    wd.STAFF_PICTURE = "Pic/1.png";
+                }
+                else
+                {
+                    wd.STAFF_PICTURE = "Pic/" + wd_extmax.messageDataList[0].ID + ".png";
+                }
+
+                sb_i.AppendFormat(sb_itemp.ToString(), 
+                    wd.STAFF_ID , 
+                    wd.STAFF_PASSWORDCARD ,
+                    wd.STAFF_NAME ,
+                    wd.STAFF_NAME_PY ,
+                    wd.STAFF_TYPE ,
+                    wd.STAFF_SEX ,
+                    wd.STAFF_BIRTHDAY ,
+                    wd.STAFF_IDCARD ,
+                    wd.STAFF_WORKDATE ,
+                    wd.STAFF_PICTURE ,
+                    wd.STAFF_WORKTEL ,
+                    wd.STAFF_MOBILE ,
+                    wd.STAFF_CONTENT ,
+                    wd.STAFF_DUTY ,
+                    wd.STAFF_DATETIME
+
+                    );
+            }
+
+
+            StringBuilder sb_u = new StringBuilder();
+
+            foreach (WD_StaffInfo wd in ul)
+            {
+                sb_u.AppendFormat(sb_utemp.ToString(), 
+                    wd.STAFF_ID , 
+                    wd.STAFF_PASSWORDCARD ,
+                    wd.STAFF_NAME ,
+                    wd.STAFF_NAME_PY ,
+                    wd.STAFF_TYPE ,
+                    wd.STAFF_SEX ,
+                    wd.STAFF_BIRTHDAY ,
+                    wd.STAFF_IDCARD ,
+                    wd.STAFF_WORKDATE ,
+                    wd.STAFF_PICTURE ,
+                    wd.STAFF_WORKTEL ,
+                    wd.STAFF_MOBILE ,
+                    wd.STAFF_CONTENT ,
+                    wd.STAFF_DUTY ,
+                    wd.STAFF_DATETIME,
+                    wd.ID
+                    );
+            }
+
+            StringBuilder sb_d = new StringBuilder();
+
+            foreach (WD_StaffInfo wd in dl)
+            {
+                sb_d.AppendFormat(sb_dtemp.ToString(), wd.ID);
+            }
+
+            this.Execute(sb_i.ToString(), sb_u.ToString(), sb_d.ToString());
+
+        } 
+ 
+    }
+}

+ 20 - 0
HNWD.Pregrant.DataAccess/WD_SysLogInfoDataAccess.cs

@@ -0,0 +1,20 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_SysLogInfoDataAccess : GenericDataAccess<WD_SysLogInfo>  
+    { 
+        public void DataBaseLog(WD_SysLogInfo wd_SysLogInfo)
+        {
+            wd_SysLogInfo.LOG_DATETIME = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
+
+            string logsql = "INSERT Into WD_SysLogInfo([LOG_TYPE],[LOG_SOURCE],[LOG_CONTENT],[LOG_DATETIME]) VALUES ('" + wd_SysLogInfo.LOG_TYPE + "','" + wd_SysLogInfo.LOG_SOURCE + "','" + wd_SysLogInfo.LOG_CONTENT + "','" + wd_SysLogInfo.LOG_DATETIME + "')";
+
+            this.Execute(logsql ,wd_SysLogInfo );
+
+        }     
+    } 
+}
+ 

+ 87 - 0
HNWD.Pregrant.DataAccess/WD_UrgeInfoDataAccess.cs

@@ -0,0 +1,87 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_UrgeInfoDataAccess : GenericDataAccess<WD_UrgeInfo>
+    {
+        private WD_UrgeInfo wd_UrgeInfo = null; 
+
+        public WD_UrgeInfoExt ext = new WD_UrgeInfoExt();
+
+
+        private readonly static WD_UrgeInfoDataAccess wd_UrgeInfoDataAccess = new WD_UrgeInfoDataAccess(null);
+        private readonly static object lockobj = new object();
+ 
+        public static WD_UrgeInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_UrgeInfoDataAccess;
+            }
+        }
+
+
+        private WD_UrgeInfoDataAccess(WD_UrgeInfo wd_UrgeInfo)
+        {
+            this.wd_UrgeInfo = wd_UrgeInfo; 
+
+       }
+
+        public List<WD_UrgeInfo> QueryAll()
+        {
+            string strSql = " select {0} from [WD_UrgeInfo] ";
+
+            ext.messageDataList = this.Query(strSql, new WD_UrgeInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+
+            return ext.messageDataList;
+        }
+
+        public void Business(List<WD_UrgeInfo> il,List<WD_UrgeInfo> ul,List<WD_UrgeInfo> dl)
+        {
+            string strSql_i = " Insert into WD_UrgeInfo(URGE_PATIENT_ID , URGE_VALUE ,URGE_DATETIME) values('{0}' ,  '{1}', '{2}') ";
+            string strSql_u = " Update WD_UrgeInfo set URGE_VALUE = '{0}' where ID = '{1}'";
+            string strSql_d = " delete WD_UrgeInfo where ID = '{0}'";
+
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach(WD_UrgeInfo wd in il)
+            {
+                sb_i.AppendFormat(strSql_i, wd.URGE_PATIENT_ID, wd.URGE_VALUE, wd.URGE_DATETIME);
+            }
+
+
+
+            StringBuilder sb_u = new StringBuilder();
+
+            foreach (WD_UrgeInfo wd in ul)
+            {
+                sb_u.AppendFormat(strSql_u, wd.URGE_VALUE, wd.ID);
+            }
+
+
+            StringBuilder sb_d = new StringBuilder();
+
+            foreach (WD_UrgeInfo wd in dl)
+            {
+                sb_d.AppendFormat(strSql_d, wd.ID);
+            }
+
+            this.Execute(sb_i.ToString(), sb_u.ToString(), sb_d.ToString());
+        }
+
+       
+    }
+}

+ 77 - 0
HNWD.Pregrant.DataAccess/WD_VerInfoDataAccess.cs

@@ -0,0 +1,77 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_VerInfoDataAccess : GenericDataAccess<WD_VerInfo>
+    {
+        private WD_VerInfo wd_VerInfo = null;
+
+        public WD_VerInfoExt ext = new WD_VerInfoExt();
+
+
+        private readonly static WD_VerInfoDataAccess wd_VerInfoDataAccess = new WD_VerInfoDataAccess(null);
+        private readonly static object lockobj = new object();
+
+        public static WD_VerInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_VerInfoDataAccess;
+            }
+        }  
+
+
+        private WD_VerInfoDataAccess(WD_VerInfo wd_VerInfo)
+        {
+            this.wd_VerInfo = wd_VerInfo;
+
+       }
+
+        public List<WD_VerInfo> QueryAll()
+        {
+            string strSql = " select {0} from [WD_VerInfo]  ";
+
+            ext.messageDataList = this.Query(strSql, new WD_VerInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+
+        }
+
+
+        public void Business(List<WD_VerInfo> il, List<WD_VerInfo> ul, List<WD_VerInfo> dl)
+        { 
+            string strSql_i = " INSERT INTO [WD_VerInfo] ([VER_DEVICETYPE],[VER_INFO],[VER_FILEPATH],[VER_DATETIME]) VALUES ('{0}' ,  '{1}', '{2}',  '{3}') ";
+            string strSql_u = "";
+            string strSql_d = "";
+        
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach (WD_VerInfo wd in il)
+            {
+                sb_i.AppendFormat(strSql_i, wd.VER_DEVICETYPE, wd.VER_INFO, wd.VER_FILEPATH, wd.VER_DATETIME);
+
+                sb_i.AppendFormat(" update [WD_RunProfile] SET [UpdateFlag]= '{0}' ;" , wd.VER_DEVICETYPE) ;
+            }
+
+
+            this.Execute(sb_i.ToString(), strSql_u, strSql_d);
+
+
+
+        }
+                
+  
+    }
+}

+ 146 - 0
HNWD.Pregrant.DataAccess/WD_ZoneInfoDataAccess.cs

@@ -0,0 +1,146 @@
+using System;
+using Dapper;
+using HNWD.Pregrant.Model;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class WD_ZoneInfoDataAccess : GenericDataAccess<WD_ZoneInfo>
+    {
+        private WD_ZoneInfo wd_ZoneInfo = null; 
+
+        public WD_ZoneInfoExt ext = new WD_ZoneInfoExt();
+
+        public WD_ZoneInfoDataAccess(WD_ZoneInfo wd_ZoneInfo)
+        {
+            this.wd_ZoneInfo = wd_ZoneInfo; 
+
+       }
+
+        private WD_ZoneInfoDataAccess()
+        {
+        }
+
+
+        private readonly static WD_ZoneInfoDataAccess wd_ZoneInfoDataAccess = new WD_ZoneInfoDataAccess();
+        private readonly static object lockobj = new object();
+
+        public static WD_ZoneInfoDataAccess GetInstance()
+        {
+            lock (lockobj)
+            {
+                return wd_ZoneInfoDataAccess;
+            }
+        }  
+
+
+        public List<WD_ZoneInfo> Query(string PartitionNo)
+        {
+            string where = this.strWhere(PartitionNo); 
+
+            string strSql = " from [WD_ZoneInfo] {0} order by [ZONE_ZONEID] ";
+            strSql = string.Format(strSql,where);
+            strSql = strSql.Insert(0, " select {0} ");
+
+
+            ext.messageDataList = this.Query(strSql, new WD_ZoneInfo());
+            ext.messageDataList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.messageDataList.ForEach(f => f.Code = this.Code);
+            ext.messageDataList.ForEach(f => f.Message = this.Message);
+            ext.messageDataList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+
+        }
+
+        public List<WD_ZoneInfo> QueryAll()
+        {
+ 
+            string strSql = " select {0} from [WD_ZoneInfo]  ";
+    
+             
+            ext.FileList = this.Query(strSql, new WD_ZoneInfo());
+            ext.FileList.ForEach(f => f.bSuccess = this.bSuccess);
+            ext.FileList.ForEach(f => f.Code = this.Code);
+            ext.FileList.ForEach(f => f.Message = this.Message);
+            ext.FileList.ForEach(f => f.Rows = this.Rows);
+            ext.bSuccess = this.bSuccess;
+            ext.Code = this.Code;
+            ext.Message = this.Message;
+            ext.Rows = this.Rows;
+
+            return ext.messageDataList;
+
+        }
+         
+
+        public void UpdateZoneStatus()
+        {
+            string strSql = "update [WD_ZoneInfo] SET ZONE_STATUS={0} where [ID]={1}  ; update [WD_RunProfile] SET [BroadcastSaveFlag]=1";
+
+            strSql = string.Format(strSql, wd_ZoneInfo.ZONE_STATUS, wd_ZoneInfo.ID);
+
+            this.Execute(strSql, this.wd_ZoneInfo);
+        }
+
+        private string strWhere(string PartitionNo)
+        {
+            string where = string.Empty;
+
+            if (PartitionNo == "0" || PartitionNo == "1" || PartitionNo == "2" || PartitionNo == "3" || PartitionNo == "4" || PartitionNo == "5")
+            {
+                where = " where [ZONE_ZONEID]=" + PartitionNo;
+            }
+            else
+            {
+                where = " where [ZONE_ZONEID] > 0 ";
+
+            }
+
+            return where;
+        }
+
+
+        public void Business(List<WD_ZoneInfo> il, List<WD_ZoneInfo> ul, List<WD_ZoneInfo> dl)
+        {
+            string strSql_i = " Insert into WD_ZoneInfo([ZONE_ZONEID],[ZONE_FILELIST],[ZONE_STATUS],[ZONE_CONTENT],[ZONE_WEEK],[ZONE_STARTTIME],[ZONE_ENDTIME],[ZONE_DATETIME]) VALUES ('{0}' ,  '{1}', '{2}',  '{3}', '{4}',  '{5}', '{6}', '{7}') ";
+            string strSql_u = " Update WD_ZoneInfo set ZONE_ZONEID = '{0}' , ZONE_FILELIST = '{1}' , ZONE_STATUS = '{2}'  , ZONE_CONTENT = '{3}'  , ZONE_WEEK = '{4}', ZONE_STARTTIME = '{5}' , ZONE_ENDTIME = '{6}' , ZONE_DATETIME = '{7}'   where ID = '{8}' ";
+            string strSql_d = " delete WD_ZoneInfo where ID = '{0}' ";
+            string strSql_a = " update [WD_RunProfile] SET [BroadcastSaveFlag]=1 ";
+
+            StringBuilder sb_i = new StringBuilder();
+
+            foreach (WD_ZoneInfo wd in il)
+            {
+                sb_i.AppendFormat(strSql_i, wd.ZONE_ZONEID, wd.ZONE_FILELIST, wd.ZONE_STATUS, wd.ZONE_CONTENT, wd.ZONE_WEEK, wd.ZONE_STARTTIME, wd.ZONE_ENDTIME, wd.ZONE_DATETIME);
+            }
+
+
+            StringBuilder sb_u = new StringBuilder();
+
+            foreach (WD_ZoneInfo wd in ul)
+            {
+                sb_u.AppendFormat(strSql_u, wd.ZONE_ZONEID, wd.ZONE_FILELIST, wd.ZONE_STATUS, wd.ZONE_CONTENT, wd.ZONE_WEEK, wd.ZONE_STARTTIME, wd.ZONE_ENDTIME, wd.ZONE_DATETIME, wd.ID);
+            }
+
+            StringBuilder sb_d = new StringBuilder();
+
+            foreach (WD_ZoneInfo wd in dl)
+            {
+                sb_d.AppendFormat(strSql_d, wd.ID);
+            }
+
+            this.Execute(sb_i.ToString(), sb_u.ToString(), sb_d.ToString(), strSql_a);
+
+
+
+        }
+                
+         
+    }
+}

+ 626 - 0
HNWD.Pregrant.DataAccess/clsDataBaseRW.cs

@@ -0,0 +1,626 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MySql.Data.MySqlClient;
+using System.Runtime.InteropServices;
+using System.Data.OleDb;
+using System.IO;
+using System.Web;
+using System.Data;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class clsDataBaseRW
+    {
+
+        private String DHCPINIFIlE = "";//'保存DHCP服务器的INI文件路径
+        private String strDataBaseServerName = "";//'数据库的IP地址,若为空表示本机IP
+        private String strDataBaseServerUserName = "";//'数据库连接用户名
+        private String strDataBaseServerPassword = ""; //数据库连接密码
+
+        //    ''' 声明从INI配置文件中获取类型为String的配置项的值的系统函数
+        [DllImport("kernel32.dll",SetLastError = true, EntryPoint = "GetPrivateProfileString")]
+      private extern static Int32 GetPrivateProfileString(string lpAppName ,string  lpKeyName ,String nDefault , string lpFileName);
+
+        ///    ''' 声明从INI配置文件中获取类型为string的配置项的值的系统函数
+      [DllImport("kernel32.dll", SetLastError = true, EntryPoint = "GetPrivateProfileString")]
+        private extern static Int32 GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, string lpReturnedString, int nSize, string lpFileName);
+
+        ///    '''声明向INI配置文件中写入类型为string的配置项的值的系统函数
+      [DllImport("kernel32.dll", SetLastError = true, EntryPoint = "WritePrivateProfileString")]
+      private extern static Int32 WritePrivateProfileString(string lpAppName, string lpKeyName, string lpString, string lpFileName);
+
+        //'''<summary>
+        //   '''INI文件路径名称
+        // '''</summary>
+        private string  strIniFile = ""; //              'InI文件的路径名称
+        private OleDbConnection DBconn ;
+        private bool InitFlag = false;
+
+        private Int32 GetStringFromINI(string sectionName, string keyName, String defaultValue, string iniPath)
+        {
+            return GetPrivateProfileString(sectionName, keyName, defaultValue, iniPath);
+        }
+
+        private string GetStrFromINI(string sectionName, string keyName, string defaultValue, string initPath)
+        {
+
+            string buffer = " ".PadLeft(256);
+            int rc = GetPrivateProfileString(sectionName, keyName, defaultValue, buffer, buffer.Length, initPath);
+
+            return  buffer.Substring(0, buffer.IndexOf("") - 1);
+  
+        }
+
+        private Int32 WriteStrINI(string sectionName, string keyName, string setValue, string iniPath)
+        {
+            int rc = WritePrivateProfileString(sectionName, keyName, setValue, iniPath);
+            if(rc > 0)
+            {
+                rc = 1;
+            }
+            return rc;
+        }
+
+ 
+        //'===================================================
+        //'返回DHCP服务器中MAC地址对应的IP地址
+
+        public string DHCP_ReadIPAddressByMAC(string strMAC)
+        {
+            string Res = "";
+             strMAC = strMAC.Replace(":", "-");
+
+             Res = GetStrFromINI(strMAC.Trim(), "IPADDR", "", DHCPINIFIlE);
+
+            return Res;
+        }
+ 
+        //'设置MACf地址对应的分配IP地址
+
+        public void DHCP_WriteIPAddressByMAC(string strMAC , string IPAddress)
+        {
+             DHCP_LockFileReadOnly(false);
+             strMAC = strMAC.Replace(":", "-");
+
+            WriteStrINI(strMAC.Trim(), "IPADDR", IPAddress, DHCPINIFIlE);
+                    DHCP_LockFileReadOnly(true);
+        }
+ 
+    //'设置DHCP模块相关的参数
+
+        public void DHCP_WriteDHCPSevCFG(string IPMASK , string GetWay , string DNS , string StartIP , string EndIP)
+        {
+            DHCP_LockFileReadOnly(false);
+
+             WriteStrINI("General", "SUBNETMASK", IPMASK.Trim(), DHCPINIFIlE);
+            WriteStrINI("General", "ROUTER_1", GetWay.Trim(), DHCPINIFIlE);
+            WriteStrINI("General", "DNS_1", DNS.Trim(), DHCPINIFIlE);
+            WriteStrINI("Settings", "IPPOOL_1", StartIP.Trim() + "-" + EndIP.Split(new char[]{'.'})[3], DHCPINIFIlE);
+            DHCP_LockFileReadOnly(true);
+
+        }
+
+        private void DHCP_LockFileReadOnly(bool Action)
+        {
+            if(File.Exists(DHCPINIFIlE))
+            {
+                if(Action)
+                {
+                    File.SetAttributes(DHCPINIFIlE, File.GetAttributes(DHCPINIFIlE) | FileAttributes.ReadOnly);
+                }
+                else
+                {
+                    //File.SetAttributes(DHCPINIFIlE, File.GetAttributes(DHCPINIFIlE) && (^FileAttributes.ReadOnly));
+                }
+            }
+        }
+
+        public void  DHCP_CreateIPList()
+        {
+            string IPMASK = "";
+            string GetWay = "";
+            string DNS = "";
+            string StartIP = "";
+            string InstallAsService = "";
+            UInt32 i = 0;
+     
+ 
+        IPMASK = GetStrFromINI("General", "SUBNETMASK", "255.255.255.0", DHCPINIFIlE);
+        GetWay = GetStrFromINI("General", "ROUTER_1", "192.168.1.1", DHCPINIFIlE);
+        DNS = GetStrFromINI("General", "DNS_1", "192.168.1.1", DHCPINIFIlE);
+        StartIP = GetStrFromINI("Settings", "IPPOOL_1", "192.168.1.50 - 250", DHCPINIFIlE);
+        InstallAsService = GetStrFromINI("Settings", "InstallAsService", "2", DHCPINIFIlE);
+        //'================================================================================
+        if(File.Exists(DHCPINIFIlE))
+        {
+            File.Copy(DHCPINIFIlE, DHCPINIFIlE + string.Format(System.DateTime.Now.ToString("yyyyMMDDHHmmss")));
+            DHCP_LockFileReadOnly(false);
+            File.Delete(DHCPINIFIlE);
+       
+        }
+       
+   
+        WriteStrINI("General", "SUBNETMASK", IPMASK.Trim(), DHCPINIFIlE);
+        WriteStrINI("General", "ROUTER_1", GetWay.Trim(), DHCPINIFIlE);
+        WriteStrINI("General", "DNS_1", DNS.Trim(), DHCPINIFIlE);
+        WriteStrINI("Settings", "IPPOOL_1", StartIP.Trim(), DHCPINIFIlE);
+        WriteStrINI("Settings", "InstallAsService", InstallAsService.Trim(), DHCPINIFIlE);
+        //'================================================================================
+        DataBaseInit();
+        try
+        {
+            OleDbCommand  SqlCmd = new OleDbCommand("", DBconn);
+
+            SqlCmd.CommandText = "select [DEVICE_ETH_MAC],[DEVICE_ETH_IP] from [WD_DeviceInfo]";
+           OleDbDataReader sdr = SqlCmd.ExecuteReader();
+
+            while( sdr.Read())
+            {
+                if(sdr.GetValue(0) != "" && sdr.GetValue(1) != "")
+                {
+                    DHCP_WriteIPAddressByMAC(sdr.GetValue(0).ToString(), sdr.GetValue(1).ToString());
+                }
+            }
+            sdr.Close();
+        }catch(Exception ex)
+        {
+
+        }
+ 
+        DHCP_LockFileReadOnly(true);
+        //'================================================================================
+        }
+
+        public clsDataBaseRW(string webPath  , bool InitFlag =  false)
+        {
+            try{
+                 this.DHCPINIFIlE = webPath + @"\DHCP\dhcpsrv.ini";
+                this.strDataBaseServerName = GetStrFromINI("DataBaseServer", "IPAddress", "", webPath + @"\Bin\Config.ini");
+                this.strDataBaseServerUserName = GetStrFromINI("DataBaseServer", "UserName", "", webPath + @"\Bin\Config.ini");
+                this.strDataBaseServerPassword = GetStrFromINI("DataBaseServer", "Password", "", webPath + @"\Bin\Config.ini");
+                if(strDataBaseServerName =="")
+                {
+                    WriteStrINI("DataBaseServer", "IPAddress", "127.0.0.1", webPath + @"\Bin\Config.ini");
+                    strDataBaseServerName = "127.0.0.1";
+                }
+                if(strDataBaseServerUserName == "")
+                {
+                    WriteStrINI("DataBaseServer", "UserName", "sa", webPath + @"\Bin\Config.ini");
+                    strDataBaseServerUserName = "sa";
+                }
+                if(strDataBaseServerPassword == "")
+                {
+                    WriteStrINI("DataBaseServer", "Password", "Wutonghai113", webPath + @"\Bin\Config.ini");
+                    strDataBaseServerPassword = "Wutonghai113";
+                }
+            }
+            catch(Exception ex)
+            {
+
+            }  
+
+              if(strDataBaseServerName == "")
+              {
+                strDataBaseServerName = "127.0.0.1";
+              }
+            if(strDataBaseServerUserName == "")
+            {
+                strDataBaseServerUserName = "sa";
+            }
+            if(strDataBaseServerPassword == "")
+            {
+                                strDataBaseServerPassword = "Wutonghai113";
+            }
+
+            if(InitFlag)
+            {
+                DataBaseInit();
+            } 
+        }
+
+         
+    //'''===================================================
+    //''' <summary>
+    //''' 
+    //''' </summary>
+    //''' <remarks></remarks>
+
+        public clsDataBaseRW(System.Web.UI.Page  Host , bool InitFlag = false)
+        {
+            try
+            {
+                if(Host != null)
+                {
+                     DHCPINIFIlE = Host.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()) + @"\DHCP\dhcpsrv.ini";
+                     strDataBaseServerName = GetStrFromINI("DataBaseServer", "IPAddress", "", Host.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()) +@"\Bin\Config.ini");
+                    strDataBaseServerUserName = GetStrFromINI("DataBaseServer", "UserName", "", Host.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()) + @"\Bin\Config.ini");
+                    strDataBaseServerPassword = GetStrFromINI("DataBaseServer", "Password", "", Host.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()) + @"\Bin\Config.ini");
+                    if(strDataBaseServerName == "")
+                    {
+                        WriteStrINI("DataBaseServer", "IPAddress", "127.0.0.1", Host.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()) + @"\Bin\Config.ini");
+                        strDataBaseServerName = "127.0.0.1";
+                    }
+
+                    if(strDataBaseServerUserName == "")
+                    {
+                        WriteStrINI("DataBaseServer", "UserName", "sa", Host.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()) + @"\Bin\Config.ini");
+                        strDataBaseServerUserName = "sa";
+                    }
+                    if(strDataBaseServerPassword == "")
+                    {
+                        WriteStrINI("DataBaseServer", "Password", "Wutonghai113", Host.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()) + @"\Bin\Config.ini");
+                        strDataBaseServerPassword = "Wutonghai113";
+                    }
+                 }
+            }
+            catch(Exception ex)
+            {
+
+            }
+
+            if(strDataBaseServerName == "")
+            {
+                strDataBaseServerName = "127.0.0.1";
+            }
+            if(strDataBaseServerUserName == "")
+            {
+                strDataBaseServerUserName = "sa";
+            }
+            if(strDataBaseServerPassword == "")
+            {
+                strDataBaseServerPassword = "Wutonghai113";
+            }
+
+            if(InitFlag)
+            {
+                 DataBaseInit();
+            } 
+
+        }
+
+
+    //'''===================================================
+    //''' <summary>
+    //''' 获得网卡MAC
+    //''' </summary>
+    //''' <returns></returns>
+
+
+        //public string GetNetMACAdd()
+        //{
+        //    string strMac = "";
+
+        //    ManagementClass myMac = new ManagementClass("Win32_NetworkAdapterConfiguration");
+        //    ManagementObjectCollection myMacConnection = new myMac.GetInstances();
+
+        //    foreach( ManagementObject myObject in myMacConnection)
+        //    {
+        //        if(string.IsNullOrEmpty(myObject("MacAddress")))
+        //        {
+        //            ///'MAC不为空,取第一个MAC
+        //        }
+        //        else
+        //        {
+        //            strMac = myObject("MacAddress");
+
+        //            break;
+        //        }
+
+        //    }
+
+        //    return strMac;
+        //}
+    //Public Function GetNetMACAdd() As String
+    //    Dim strMac As String = ""
+    //    Dim myMac As ManagementClass = New ManagementClass("Win32_NetworkAdapterConfiguration")
+    //    Dim myMacConnection As ManagementObjectCollection = myMac.GetInstances()
+
+    //    For Each myObject As ManagementObject In myMacConnection
+    //        If IsNothing(myObject("MacAddress")) = False Then 'MAC不为空,取第一个MAC
+    //            strMac = myObject("MacAddress")
+    //            Exit For
+    //        End If
+    //    Next
+    //    Return strMac
+    //End Function
+    //'''===================================================
+    //'''<summary>  
+    //'''打开登录数据库
+    //'''</summary>  
+
+        public bool DataBaseInit()
+        {
+            if(this.InitFlag)
+            {
+                return true;
+            }
+
+            string DBConnectString = "Provider=SQLOLEDB;Data Source=" + strDataBaseServerName + ",1433;Initial Catalog=WD_IPCALL_PREGNANT;User ID=" + strDataBaseServerUserName + ";Password=" + strDataBaseServerPassword + ";MultipleActiveResultSets=true;";
+
+                 try{
+                     DBconn.ConnectionString = DBConnectString;
+                     DBconn.Open();
+
+                     if(DBconn.State == ConnectionState.Open)
+                     {
+                         this.InitFlag = true;
+                     }
+                 }
+            catch(Exception ex)
+                 {
+
+            }
+
+            return this.InitFlag;
+        }
+ 
+    //'''===================================================
+    //'''<summary>  
+    //'''关闭注销数据库
+    //'''</summary>  
+
+        public bool DataBaseClose()
+        {
+            if(this.InitFlag)
+            {
+                 DBconn.Close();
+                this.InitFlag = false;
+            }
+
+            return true;
+        }
+ 
+    //''' <summary>
+    //''' 
+    //''' </summary>
+    //''' <param name="strSql"></param>
+    //''' <param name="n"></param>
+    //''' <returns></returns>
+    //''' <remarks></remarks>
+
+        public bool DataBaseCmd(String strSql ,   Int32 n )
+        {
+
+            int LIntCnt ;
+            bool res = false;
+
+            if(DataBaseInit())
+            {
+                try
+                {
+                    OleDbCommand SqlCmd = new OleDbCommand("",DBconn);
+
+                     SqlCmd.CommandText = strSql; //' "delete from " + TableName + " where [ID]=" + RowID.ToString()
+
+                         if(n>=0)
+                         {
+                              n = Convert.ToInt32(SqlCmd.ExecuteScalar());
+                              LIntCnt = n;
+
+                         }
+                         else
+
+                         {
+                             LIntCnt = SqlCmd.ExecuteNonQuery();
+                         }
+
+                         if (LIntCnt > 0)
+                    {
+                        res = true;
+                    }
+                    
+                }
+                catch(Exception ex)
+                {
+
+                }
+
+                
+            }
+            return res;
+        }
+
+         
+
+    //'''===================================================
+    //'''<summary>
+    //'''搜索数据库中的指定表格指定字段值的记录,并从其中读取指定某条记录
+    //'''</summary>
+    //'''<param name="strSql">SQL查找语句</param>
+    //'''<param name="RdLine">读取结果中的第几条记录</param>
+    //'''<param name="Result">读缓存</param>
+
+            public bool  DataBaseRead(string strSql ,UInt32  RdLine , ref string[] Result , bool  FiterFlag = false, string SpitStr = ":"  )
+            {
+                Result = new string[1];
+                bool res = false;
+
+                if(DataBaseInit())
+                {
+                    try
+                    {
+                        OleDbCommand SqlCmd = new OleDbCommand("", DBconn);
+
+                         SqlCmd.CommandText = strSql;
+                          OleDbDataReader sdr = SqlCmd.ExecuteReader();
+                        UInt32 CurLine = 1;
+
+                        while(sdr.Read())
+                        {
+                            if(RdLine == CurLine )
+                            {
+                                for(int j = 0;j<sdr.FieldCount - 1;j++)
+                                {
+                                    if(!FiterFlag)
+                                    {
+                                        Result[j] = "\"" + sdr.GetName(j).ToString() + "\"" + SpitStr + "\"" + sdr.GetValue(j).ToString() + "\"";
+                                    }
+                                    else
+                                    {
+                                        Result[j] = sdr.GetName(j).ToString() + SpitStr + sdr.GetValue(j).ToString();
+                                    }
+                                }
+
+                                res = true;
+                                break;
+                            }
+
+                            CurLine ++;
+                        }
+
+                        sdr.Close(); 
+                    }
+                    catch(Exception ex)
+                    {
+
+                    }
+                }
+                return res;
+            }
+        //    Try
+        //        Dim SqlCmd As OleDbCommand = New OleDbCommand("", DBconn)
+        //        SqlCmd.CommandText = strSql
+        //        Dim sdr As OleDbDataReader = SqlCmd.ExecuteReader()
+        //        Dim CurLine As UString = 1
+
+        //        While sdr.Read = True
+        //            If CurLine = RdLine Then
+        //                For i = 0 To sdr.FieldCount - 1
+        //                    If FiterFlag = False Then
+        //                        Result(i) = """" + sdr.GetName(i).ToString + """" + SpitStr + """" + sdr.GetValue(i).ToString() + """"
+        //                    Else
+        //                        Result(i) = sdr.GetName(i).ToString + SpitStr + sdr.GetValue(i).ToString()
+        //                    End If
+        //                Next
+        //                res = True
+        //                ReDim Preserve Result(sdr.FieldCount - 1)
+        //                Exit While
+        //            End If
+        //            CurLine += 1
+        //        End While
+        //        sdr.Close()
+        //    Catch ex As Exception
+        //    End Try
+        //End If
+        //Return res
+
+        //    }
+
+
+    //Public Function DataBaseRead(ByVal strSql As String, ByVal RdLine As UString, ByRef Result() As String, Optional FiterFlag As Boolean = False, Optional SpitStr As String = ":") As Boolean
+    //    Dim res As Boolean = False
+    //    Dim i As Stringeger
+    //    '=======================
+    //    If DataBaseInit() = True Then
+    //        Try
+    //            Dim SqlCmd As OleDbCommand = New OleDbCommand("", DBconn)
+    //            SqlCmd.CommandText = strSql
+    //            Dim sdr As OleDbDataReader = SqlCmd.ExecuteReader()
+    //            Dim CurLine As UString = 1
+
+    //            While sdr.Read = True
+    //                If CurLine = RdLine Then
+    //                    For i = 0 To sdr.FieldCount - 1
+    //                        If FiterFlag = False Then
+    //                            Result(i) = """" + sdr.GetName(i).ToString + """" + SpitStr + """" + sdr.GetValue(i).ToString() + """"
+    //                        Else
+    //                            Result(i) = sdr.GetName(i).ToString + SpitStr + sdr.GetValue(i).ToString()
+    //                        End If
+    //                    Next
+    //                    res = True
+    //                    ReDim Preserve Result(sdr.FieldCount - 1)
+    //                    Exit While
+    //                End If
+    //                CurLine += 1
+    //            End While
+    //            sdr.Close()
+    //        Catch ex As Exception
+    //        End Try
+    //    End If
+    //    Return res
+    //End Function
+
+
+        public bool DataBaseLog(String LogType , string LogSource , string Logcontent )
+        {
+            bool Res = false;
+ 
+
+            try
+            {
+                Res = DataBaseCmd("INSERT StringO WD_SysLogInfo([LOG_TYPE],[LOG_SOURCE],[LOG_CONTENT],[LOG_DATETIME]) VALUES ('" + LogType.ToString().Trim() + "','" + LogSource.Trim() + "','" + Logcontent.Trim() + "','" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "')",-1);
+            }
+            catch(Exception ex)
+            {
+                
+            }
+            return Res;
+
+        }
+
+
+    //    public bool DataBaseReadMul(String strSql , String[][] Result , bool FiterFlag = false , String SpitStr = ":")
+    //    {
+    //        bool Res = false;
+    //        String i;
+    //        UString j ;
+
+    //        if(DataBaseInit())
+    //        {
+    //            try
+    //            {
+    //                OleDbCommand SqlCmd = new OleDbCommand("",DBconn);
+
+    //                SqlCmd.CommandText = strSql;
+
+    //                OleDbDataReader sdr = SqlCmd.ExecuteReader();
+
+    //                i = 0;
+
+    //                while(sdr.Read())
+    //                {
+    //                    if(i>)
+    //                }
+    //            }
+    //        }
+    //    }
+
+
+
+    //Public Function DataBaseReadMul(ByVal strSql As String, ByRef Result(,) As String, Optional FiterFlag As Boolean = False, Optional SpitStr As String = ":") As Boolean
+    //    Dim Res As Boolean = False
+    //    Dim i As Stringeger
+    //    Dim j As UString
+    //    '=======================
+    //    If DataBaseInit() = True Then
+    //        Try
+    //            Dim SqlCmd As OleDbCommand = New OleDbCommand("", DBconn)
+    //            SqlCmd.CommandText = strSql
+    //            Dim sdr As OleDbDataReader = SqlCmd.ExecuteReader()
+    //            i = 0
+
+    //            While sdr.Read = True
+    //                If i > Result.GetUpperBound(1) Then ReDim Preserve Result(Result.GetUpperBound(0), i)
+    //                For j = 0 To sdr.FieldCount - 1
+    //                    If FiterFlag = False Then
+    //                        Result(j, i) = """" + sdr.GetName(j).ToString + """" + SpitStr + """" + sdr.GetValue(j).ToString() + """"
+    //                    Else
+    //                        Result(j, i) = sdr.GetName(j).ToString + SpitStr + sdr.GetValue(j).ToString()
+    //                    End If
+    //                Next
+    //                i += 1
+    //            End While
+    //            sdr.Close()
+    //            Res = True
+    //        Catch ex As Exception
+    //        End Try
+    //    End If
+    //    Return Res
+    //End Function
+
+
+    }
+}

+ 262 - 0
HNWD.Pregrant.DataAccess/clsOpenSIPSAccount.cs

@@ -0,0 +1,262 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MySql.Data.MySqlClient;
+using HNWD.Pregrant.Model;
+
+namespace HNWD.Pregrant.DataAccess
+{
+    public class clsOpenSIPSAccount
+    {
+
+        private MySqlConnection DBconn;
+        private MySqlCommand DBcmd;
+        private MySqlDataAdapter DBda;
+        private MySqlCommandBuilder DBcb;
+        private bool ConnectFlag = false;
+        private string SIPSerIP = string.Empty;
+        private string webPath = string.Empty;
+
+
+        public clsOpenSIPSAccount(string Path)
+        {
+            webPath = Path;
+        } 
+
+        public string GetSIPSerIP
+        {
+            get 
+            {
+                if(this.SIPSerIP == "")
+                {
+                    this.OpenSIPs_ConnectDefault();
+                }
+                return this.SIPSerIP;
+            }
+        }
+
+        public bool OpenSIPs_ConnectDefault()
+        {
+            bool Res = false;
+            clsDataBaseRW tempDataBaseReader = new clsDataBaseRW(this.webPath);
+
+
+            WD_PartInfoDataAccess wd_PartInfoDataAccess = WD_PartInfoDataAccess.GetInstance();
+            wd_PartInfoDataAccess.Query();
+
+
+            if (wd_PartInfoDataAccess.ext.bSuccess && wd_PartInfoDataAccess.ext.Rows > 0)
+            {
+                Res = OpenSIPs_Connect(wd_PartInfoDataAccess.ext.messageDataList[0].SIPSEV_IP,wd_PartInfoDataAccess.ext.messageDataList[0].SIPSEV_MYSQLUSERNAME, wd_PartInfoDataAccess.ext.messageDataList[0].SIPSEV_MYSQLPASSWORD);
+            }
+
+            return Res; 
+        }
+
+        public String GetSipAccount(string SIP_DeviceType, string SIP_DeviceID)
+        {
+            String TempSiPAccount = "";
+
+            switch (SIP_DeviceType.Trim())
+            {
+                case "1":               //'护士主机: 设备类型+八位DeviceID+"0" 
+                    TempSiPAccount = SIP_DeviceType + SIP_DeviceID.PadLeft(8, '0') + "0";
+                    break;
+                case "2":               // '医生主机: 设备类型+八位DeviceID+"0"  
+                    TempSiPAccount = SIP_DeviceType + SIP_DeviceID.PadLeft(8, '0') + "0";
+                    break;
+                case "3":                 //'门口机: 设备类型+八位DeviceID+"0" 
+                    TempSiPAccount = SIP_DeviceType + SIP_DeviceID.PadLeft(8, '0') + "0";
+                    break;
+                case "4":                //'病床分机: 设备类型+八位病人ID+"0" 
+                    TempSiPAccount = SIP_DeviceType + SIP_DeviceID.PadLeft(8, '0') + "0";
+                    break;
+                case "7":                 //'护士腕表: 设备类型+八位护士ID+"0" 
+                    TempSiPAccount = SIP_DeviceType + SIP_DeviceID.PadLeft(8, '0') + "0";
+                    break;
+                case "8":               //'护士腕表: 设备类型+八位护士ID+"0" 
+                    TempSiPAccount = SIP_DeviceType + SIP_DeviceID.PadLeft(8, '0') + "0";
+                    break;
+                case "9":                //'病人腕表: 设备类型+八位病人ID+"1~9"
+                    TempSiPAccount = SIP_DeviceType + SIP_DeviceID.PadLeft(8, '0') + "0";
+                    break;
+                case "10":               //'病人手机
+                    TempSiPAccount = SIP_DeviceType + SIP_DeviceID.PadLeft(8, '0') + "0";
+                    break;
+            }
+            return TempSiPAccount;
+        }
+
+        public bool OpenSIPs_Connect(string Server = "", string UserName = "", string Password = "")
+        {
+            bool Res = false;
+            string connStr = string.Empty;
+
+            if (this.ConnectFlag)
+            {
+                return this.ConnectFlag;
+            }
+
+            try
+            {
+
+                connStr = string.Format("server={0};user id={1}; password={2}; database=opensips; pooling=false", Server, UserName, Password);
+
+                this.DBconn = new MySqlConnection(connStr);
+                this.DBconn.Open();
+                Res = true;
+                this.ConnectFlag = true;
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return Res;
+        }
+
+        public void OpenSIPs_Close()
+        {
+            this.DBcb = null;
+            this.DBda = null;
+            this.DBconn.Close();
+            this.DBconn = null;
+        }
+
+        public bool OpenSIPs_AccountCheck(string SipName, bool Rult)
+        {
+            Int32 i;
+            bool Res = false;
+
+
+            this.OpenSIPs_Connect();
+
+            if (this.ConnectFlag)
+            {
+                try
+                {
+                    this.DBcmd = new MySqlCommand("select * from subscriber where username='" + SipName + "'", DBconn);
+                    i = Convert.ToInt32(DBcmd.ExecuteScalar());
+
+                    if (i > 0)
+                    {
+                        Res = true;
+                        Rult = true;
+                    }
+                    else
+                    {
+                        Res = true;
+                        Rult = false;
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                }
+            }
+            else
+            {
+                Res = false;
+            }
+
+            return Res;
+        }
+
+        public bool OpenSIPs_AccountAdd(string SipName, string SipPassword, string SipDomain = "")
+        {
+            bool Res = false;
+            Int64 i;
+            string strSQL = "";
+
+            this.OpenSIPs_Connect();
+
+
+            if(this.ConnectFlag)
+            {
+                DBcmd = new MySqlCommand("select * from subscriber where username='" + SipName + "'", DBconn);
+                 i =  Convert.ToInt64(DBcmd.ExecuteScalar());
+
+                if(i>0)
+                {
+                    Res = false;
+                }
+                else
+                {
+                    strSQL = "INSERT Into subscriber(username,password,domain,email_address) VALUES('" + SipName + "','" + SipPassword + "','" + SipDomain + "','" + SipName + "')";
+                    DBcmd = new MySqlCommand(strSQL, DBconn);
+                    i = DBcmd.ExecuteNonQuery();
+                    if( i > 0)
+                    {
+
+                    }
+                        Res = true;
+                   
+                }
+
+
+            }
+                return Res;
+        }
+
+        public bool OpenSIPs_AccountDel(string SipName)
+        {
+            bool Res = false;
+            Int64 i = 0;
+
+            this.OpenSIPs_Connect();
+
+            if (ConnectFlag)
+            {
+                try
+                {
+                    DBcmd = new MySqlCommand("delete from subscriber where username='" + SipName + "'", DBconn);
+                    i = DBcmd.ExecuteNonQuery();
+                    if (i > 0)
+                    {
+                        Res = true;
+                    }
+
+
+                }
+                catch (Exception ex)
+                {
+
+                }
+
+            }
+
+            return Res;
+
+        }
+
+        public bool OpenSIPs_AccountOnline(string SipName)
+        {
+            bool Res = false;
+            Int64 i = 0;
+
+            this.OpenSIPs_Connect();
+
+            if (this.ConnectFlag)
+            {
+                try
+                {
+                    DBcmd = new MySqlCommand("select * from location where username='" + SipName + "'", DBconn);
+                    i = Convert.ToInt64(DBcmd.ExecuteScalar());
+                    if (i > 0)
+                    {
+                        Res = true;
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                }
+            }
+
+            return Res;
+        }
+
+    
+    }
+}

+ 21 - 0
HNWD.Pregrant.Model/Attributes/DescriptionAttribute.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+// 需要引用的命名空间  using System.Runtime.Serialization;  
+namespace com.jiuchuangit.component.synchronization.u8.ShunLei.Model
+{
+    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, AllowMultiple = false)]
+    public class DescriptionAttribute : Attribute
+    {
+        public DescriptionAttribute(string description)
+        {
+            this.Description = description;
+        } 
+
+        public string Description { get; set; } 
+    }
+
+}

+ 24 - 0
HNWD.Pregrant.Model/Attributes/IgnoreAttribute.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
+    public class IgnoreAttribute : Attribute
+    {
+        /// <summary>
+        /// 构造方法
+        /// </summary>
+        /// <param name="fieldName">字段名</param>
+        /// <param name="typeEx">字段类型</param>
+        /// <param name="mappingFieldName">映射字段名</param>
+        public IgnoreAttribute()
+        {
+   
+        } 
+
+    }
+}

+ 27 - 0
HNWD.Pregrant.Model/Attributes/NickAttribute.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
+    public class NickAttribute : Attribute
+    {
+        /// <summary>
+        /// 构造方法
+        /// </summary>
+        /// <param name="fieldName">字段名</param>
+        /// <param name="typeEx">字段类型</param>
+        /// <param name="mappingFieldName">映射字段名</param>
+        public NickAttribute(string nickName)
+        {
+            this.NickName = nickName; 
+        } 
+ 
+
+        public string NickName { get; set; } 
+
+    }
+}

+ 117 - 0
HNWD.Pregrant.Model/HNWD.Pregrant.Model.csproj

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{34F21F47-F2A7-49B8-A8BA-B1836AA6F5FE}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HNWD.Pregrant.Model</RootNamespace>
+    <AssemblyName>HNWD.Pregrant.Model</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Attributes\DescriptionAttribute.cs" />
+    <Compile Include="Attributes\IgnoreAttribute.cs" />
+    <Compile Include="Attributes\NickAttribute.cs" />
+    <Compile Include="ModelBase.cs" />
+    <Compile Include="ModelExtBase.cs" />
+    <Compile Include="ModelExtRaw\WD_DeviceInfoExtRaw.cs" />
+    <Compile Include="ModelExtRaw\WD_ProgramInfoExtRaw.cs" />
+    <Compile Include="ModelExt\ColleagueExt.cs" />
+    <Compile Include="ModelExt\MP3FileExt.cs" />
+    <Compile Include="ModelExt\MusicFileExt.cs" />
+    <Compile Include="ModelExt\wardInformationExt.cs" />
+    <Compile Include="ModelExt\WD_CostInfoExt.cs" />
+    <Compile Include="ModelExt\WD_DeviceInfoExt.cs" />
+    <Compile Include="ModelExt\WD_MessageInfoExt.cs" />
+    <Compile Include="ModelExt\WD_NoticeInfoExt.cs" />
+    <Compile Include="ModelExt\WD_NurseCfgInfoExt.cs" />
+    <Compile Include="ModelExt\WD_PartInfoExt.cs" />
+    <Compile Include="ModelExt\WD_PatientInfoExt.cs" />
+    <Compile Include="ModelExt\WD_ProgramInfoExt.cs" />
+    <Compile Include="ModelExt\WD_RunProfileExt.cs" />
+    <Compile Include="ModelExt\WD_StaffInfoExt.cs" />
+    <Compile Include="ModelExt\WD_UrgeInfoExt.cs" />
+    <Compile Include="ModelExt\WD_VerInfoExt.cs" />
+    <Compile Include="ModelExt\WD_ZoneInfoExt.cs" />
+    <Compile Include="ModelRaw\WD_DeviceInfoRaw.cs" />
+    <Compile Include="ModelRaw\WD_ProgramInfoRaw.cs" />
+    <Compile Include="Model\bedDetails.cs" />
+    <Compile Include="Model\bedInfo.cs" />
+    <Compile Include="Model\CarefulMatter.cs" />
+    <Compile Include="Model\CDoctorCharge.cs" />
+    <Compile Include="Model\Colleague.cs" />
+    <Compile Include="Model\Cost.cs" />
+    <Compile Include="Model\hospital.cs" />
+    <Compile Include="Model\MP3File.cs" />
+    <Compile Include="Model\MusicFile.cs" />
+    <Compile Include="Model\Str_Mrg_GetWD_NewSIPAccount.cs" />
+    <Compile Include="Model\wardInformation.cs" />
+    <Compile Include="Model\WD_CostInfo.cs" />
+    <Compile Include="Model\WD_DeviceInfo.cs" />
+    <Compile Include="Model\WD_DeviceInfo_Simple.cs" />
+    <Compile Include="Model\WD_MessageInfo.cs" />
+    <Compile Include="Model\WD_NoticeInfo.cs" />
+    <Compile Include="Model\WD_NurseCfgInfo.cs" />
+    <Compile Include="Model\WD_PartInfo.cs" />
+    <Compile Include="Model\WD_PatientInfo.cs" />
+    <Compile Include="Model\WD_ProgramInfo.cs" />
+    <Compile Include="Model\WD_RunProfile.cs" />
+    <Compile Include="Model\WD_SIPSevInfo.cs" />
+    <Compile Include="Model\WD_StaffInfo.cs" />
+    <Compile Include="Model\WD_StaffInfo_Simple.cs" />
+    <Compile Include="Model\WD_SysLogInfo.cs" />
+    <Compile Include="Model\WD_UrgeInfo.cs" />
+    <Compile Include="Model\WD_UserInfo.cs" />
+    <Compile Include="Model\WD_VerInfo.cs" />
+    <Compile Include="Model\WD_ZoneInfo.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Support\Support_WD_DeviceInfo.cs" />
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 13 - 0
HNWD.Pregrant.Model/Model/CDoctorCharge.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class CDoctorCharge
+    {
+        public string DoctorCharge = string.Empty;
+    }
+}

+ 14 - 0
HNWD.Pregrant.Model/Model/CarefulMatter.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class CarefulMatter 
+    {
+        public string item = string.Empty;
+ 
+    }
+}

+ 13 - 0
HNWD.Pregrant.Model/Model/Colleague.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class Colleague : ModelBase
+    {
+       
+    }
+}

+ 16 - 0
HNWD.Pregrant.Model/Model/Cost.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class Cost
+    {
+        public string date = string.Empty;
+        public string costName = string.Empty;
+        public string money = string.Empty;
+ 
+    }
+}

+ 16 - 0
HNWD.Pregrant.Model/Model/MP3File.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class MP3File : ModelBase
+    {
+
+        public String FileName = string.Empty;
+
+        public long FileSize = 0;
+    }
+}

+ 22 - 0
HNWD.Pregrant.Model/Model/MusicFile.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class MusicFile :ModelBase
+    {
+        public string PartitionNo = string.Empty;
+        public string FileName = string.Empty;
+        public string Status = string.Empty;
+        public string Remarks = string.Empty;
+        public string Weeks = string.Empty;
+        public string StartTime = string.Empty;
+        public string IsChecked = string.Empty;
+        public string EndTime = string.Empty;
+        public string ID = string.Empty;
+    }
+}
+

+ 17 - 0
HNWD.Pregrant.Model/Model/Str_Mrg_GetWD_NewSIPAccount.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class Str_Mrg_GetWD_NewSIPAccount 
+    {
+        public string SIPSevIP =string.Empty;
+        public string SIPAccount =string.Empty;
+        public string SIPPassword =string.Empty;
+        public string Code =string.Empty;
+         
+    }
+}

+ 17 - 0
HNWD.Pregrant.Model/Model/WD_CostInfo.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_CostInfo : ModelBase
+    {
+        public string ID = "0";
+        public string COST_PATIENT_ID = string.Empty;
+        public string COST_NAME = string.Empty;
+        public string COST_VALUE = string.Empty;
+        public string COST_CREATEDATE = string.Empty;
+        public string COST_DATETIME = string.Empty;
+    }
+}

+ 319 - 0
HNWD.Pregrant.Model/Model/WD_DeviceInfo.cs

@@ -0,0 +1,319 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_DeviceInfo : ModelBase
+    {
+        [Nick("id")]
+        public String ID = "0";
+        [Nick("deviceType")]
+        public String DEVICE_TYPE = string.Empty;
+
+        //public String DEVICE_ID = string.Empty;
+
+        public String DEVICE_MODEL = string.Empty;
+
+        public String PARTID = string.Empty;
+
+        public String DEVICE_SN = string.Empty;
+
+        public String DEVICE_SOFT_VER = string.Empty;
+        public String DEVICE_HARD_VER = string.Empty;
+        [Nick("deviceName")]
+        public String DEVICE_NAME = string.Empty;
+        public String DEVICE_ETH_MAC = string.Empty;
+        public String DEVICE_ETH_IP = string.Empty;
+        public String DEVICE_WIFI_MAC = string.Empty;
+        public String DEVICE_WIFI_IP = string.Empty;
+        [Nick("deviceWifiHostName")]
+        public String DEVICE_WIFI_HOSTNAME = string.Empty;
+        [Nick("deviceRoomNum")]
+        public String DEVICE_ROOM_NUM = string.Empty; 
+
+        [Nick("deviceStatus")]
+        public String DEVICE_STATUS = string.Empty;
+
+        [Nick("deviceRoomId")]
+        public String DEVICE_ROOM_ID = string.Empty;
+
+        [Nick("deviceBedNum")]
+        public String DEVICE_BED_NUM = string.Empty;
+
+        [Nick("deviceBedName")]
+        public String DEVICE_BED_NAME = string.Empty;
+        [Nick("deviceHumanType")]
+        public String DEVICE_HUMAN_TYPE = string.Empty;
+
+
+        [Nick("deviceSipId")]
+        public String DEVICE_SIP_ID = string.Empty;
+        [Nick("deviceSipIp")]
+        public String DEVICE_SIP_IP = string.Empty;
+        [Nick("deviceHumanId")]
+        public String DEVICE_HUMAN_ID = string.Empty;
+        [Nick("deviceSipPassWord")]
+        public String DEVICE_SIP_PASSWORD = string.Empty;
+        //[Nick("deviceSipStatus")]
+        //public String DEVICE_SIP_STATUS = string.Empty;
+        ////public String DEVICE_SIP_CALLLIST = string.Empty;
+        //[Nick("deviceHostingID")]
+        //public String DEVICE_SIP_HOSTING_ID = string.Empty;
+        [Nick("devicelrCfg")]
+        public String DEVICE_IR_CFG = string.Empty;
+        [Nick("deviceZone0")]
+        public String DEVICE_ZONE0 = string.Empty;
+
+        [Nick("deviceZone1")]
+        public String DEVICE_ZONE1 = string.Empty;
+        [Nick("deviceZone2")]
+        public String DEVICE_ZONE2 = string.Empty;
+
+        [Nick("deviceZone3")]
+
+        public String DEVICE_ZONE3 = string.Empty;
+        [Nick("deviceZone4")]
+        public String DEVICE_ZONE4 = string.Empty;
+
+        [Nick("deviceZone5")]
+        public String DEVICE_ZONE5 = string.Empty;
+
+        public String DEVICE_DATETIME = string.Empty;
+
+
+        //////////////////////////////////////////////////////////////////////////////////////////
+        /////////////////////////////////////////////////////////////////////////////////////////////////////
+        /////////////////////////////////////////////////////////////////////////////////////////////////////
+        [Ignore]
+        public String id = "0";
+        [Ignore]
+        public String deviceType = string.Empty;
+        [Ignore]
+        public String deviceName = string.Empty;
+
+        [Ignore]
+        public String deviceWifiHostName = string.Empty;
+        [Ignore]
+        public String deviceRoomNum = string.Empty;
+
+        [Ignore]
+        public String deviceStatus = string.Empty;
+
+        [Ignore]
+        public String deviceRoomId = string.Empty;
+        [Ignore]
+        public String deviceBedNum = string.Empty;
+
+        [Ignore]
+        public String deviceBedName = string.Empty;
+        [Ignore]
+        public String deviceHumanType = string.Empty;
+        [Ignore]
+
+
+        public String deviceSipId = string.Empty;
+        [Ignore]
+        public String deviceSipIp = string.Empty;
+        [Ignore]
+        public String deviceHumanId = string.Empty;
+        [Ignore]
+        public String deviceSipPassWord = string.Empty;
+        [Ignore]
+        public String deviceSipStatus = string.Empty;
+        [Ignore]
+        public String deviceSipHostingID = string.Empty;
+        [Ignore]
+        public String deviceHostingID = string.Empty;
+        [Ignore]
+        public String devicelrCfg = string.Empty;
+        [Ignore]
+        public String deviceZone0 = string.Empty;
+
+        [Ignore]
+        public String deviceZone1 = string.Empty;
+        [Ignore]
+        public String deviceZone2 = string.Empty;
+        [Ignore]
+
+
+        public String deviceZone3 = string.Empty;
+        [Ignore]
+        public String deviceZone4 = string.Empty;
+        [Ignore]
+        public String deviceZone5 = string.Empty;
+
+        /////////////////////////////////////////
+        /////////////////////////////////////////
+
+        [Ignore]
+        public String deviceCallTimeOut = "0";
+
+        [Ignore]
+        public String deviceScreamSleep = "0";
+
+        [Ignore]
+        public String deviceNurse_Level0 = "0";
+
+        [Ignore]
+        public String deviceNurse_Level1 = "0";
+
+        [Ignore]
+        public String deviceNurse_Level2 = "0";
+
+        [Ignore]
+        public String deviceNurse_Level3 = "0";
+
+        [Ignore]
+        public String deviceNurse_Level4 = "0";
+
+ 
+
+        [Ignore]
+        public String hospital ="";
+         
+
+        [Ignore]
+        public String department = "";
+
+
+ 
+        /// <summary>
+        /// 床头机ID
+        /// </summary>
+        [Ignore]
+        public string bedId = string.Empty;
+
+
+
+        /// <summary>
+        /// 床号
+        /// </summary>
+
+        [Ignore]
+        public string bedNum = string.Empty;
+
+        /// <summary>
+        /// 病人ID
+        /// </summary>
+        [Ignore]
+        public string PatientID = string.Empty;
+        
+        /// <summary>
+        /// 托管状态
+        /// </summary>
+ 
+
+        [Ignore]
+        public string trusteeshipState = string.Empty;
+
+        /// <summary>
+        /// 病人姓名
+        /// </summary>
+        [Ignore]
+        public string patientName = string.Empty;
+
+
+
+        /// <summary>
+        /// 病人年龄
+        /// </summary>
+        [Ignore]
+        public string PatientAge = string.Empty;
+
+        /// <summary>
+        /// 病人性别
+        /// </summary>
+ 
+        [Ignore]
+        public string patientGender = string.Empty;
+
+        /// <summary>
+        ///  入院时间 
+        /// </summary>
+        [Ignore]
+        public string admissionTime = string.Empty;
+         
+         /// <summary>
+         /// 责任医生
+         /// </summary>
+        [Ignore]
+        public string attendingDoctor = string.Empty;
+         
+
+        /// <summary>
+        /// 责任护士
+        /// </summary>
+        [Ignore]
+        public string nurseInCharge = string.Empty;
+        /// <summary>
+        /// 病情状况
+        /// </summary> 
+        [Ignore]
+        public string Condition = string.Empty;
+        /// <summary>
+        /// 房间与病人关系
+        /// </summary>
+        [Ignore]
+        public List<wardInformation> wardInformationList = new List<wardInformation>();
+
+        /// <summary>
+        /// 用药明细
+        /// </summary>
+        [Ignore]
+        public string Medications = "未知";
+        /// <summary>
+        /// 医嘱事项
+        /// </summary>
+        [Ignore]
+        public string MedicalAdvice = "未知";
+
+        //////////////////////////
+        //////////////////////////
+                [Ignore]
+        public string babyName = string.Empty;
+                [Ignore]
+        public string babySex = string.Empty;
+                [Ignore]
+        public string name = string.Empty;
+                [Ignore]
+        public string avoidCertainFood = string.Empty;
+                [Ignore]
+        public List<CarefulMatter> carefulMatter = new List<CarefulMatter>();
+                [Ignore]
+        public string roomByname = string.Empty; 
+
+                        [Ignore]
+        public string PATIENT_NAME = string.Empty;
+
+        
+                        [Ignore]
+        public string PATIENT_SEX = string.Empty;
+
+        
+                        [Ignore]
+        public string PATIENT_AGE = string.Empty;
+
+        
+                        [Ignore]
+        public string PATIENT_AGE_UNIT = string.Empty;
+
+        
+                        [Ignore]
+        public string PATIENT_INDATE = string.Empty;
+
+
+        //////////////////////////
+        //////////////////////////
+
+
+        [Ignore]
+        public string roomNumID = string.Empty;
+
+
+        [Ignore]
+        public string roomNum = string.Empty;
+    }
+}

+ 68 - 0
HNWD.Pregrant.Model/Model/WD_DeviceInfo_Simple.cs

@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_DeviceInfo_Simple : ModelBase
+    {
+        [Ignore]
+        public String id = "0";
+        [Ignore]
+        public String deviceType = string.Empty;
+        [Ignore]
+        public String deviceName = string.Empty;
+                [Ignore]
+        public String deviceMac = string.Empty;
+        
+        [Ignore]
+        public String deviceWifiHostName = string.Empty;
+        [Ignore]
+        public String deviceRoomNum = string.Empty;
+
+        [Ignore]
+        public String deviceStatus = string.Empty;
+
+        [Ignore]
+        public String deviceRoomId = string.Empty;
+        [Ignore]
+        public String deviceBedNum = string.Empty;
+
+        [Ignore]
+        public String deviceBedName = string.Empty;
+        [Ignore]
+        public String deviceHumanType = string.Empty;
+        [Ignore]
+        public String deviceSipId = string.Empty;
+        [Ignore]
+        public String deviceSipIp = string.Empty;
+        [Ignore]
+        public String deviceHumanId = string.Empty;
+        [Ignore]
+        public String deviceSipPassWord = string.Empty;
+        [Ignore]
+        public String deviceSipStatus = string.Empty;
+        [Ignore]
+        public String deviceHostingID = string.Empty;
+        [Ignore]
+        public String devicelrCfg = string.Empty;
+        [Ignore]
+        public String deviceZone0 = string.Empty;
+
+        [Ignore]
+        public String deviceZone1 = string.Empty;
+        [Ignore]
+        public String deviceZone2 = string.Empty;
+        [Ignore]
+
+
+        public String deviceZone3 = string.Empty;
+        [Ignore]
+        public String deviceZone4 = string.Empty;
+        [Ignore]
+        public String deviceZone5 = string.Empty;
+
+    }
+}

+ 14 - 0
HNWD.Pregrant.Model/Model/WD_MessageInfo.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_MessageInfo : ModelBase
+    {
+        public String ID = "0";
+        public string MESSAGE_CONTENT = string.Empty;
+        public string MESSAGE_DATETIME = string.Empty;
+    }
+}

+ 66 - 0
HNWD.Pregrant.Model/Model/WD_NoticeInfo.cs

@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_NoticeInfo : ModelBase
+    {
+        /// <summary>
+        /// 通知ID
+        /// </summary>
+        [Nick("noticeId")]
+        public String ID = "0";
+        /// <summary>
+        /// 病人ID
+        /// </summary>
+        public String NOTICE_PATIENT_ID = string.Empty;
+        /// <summary>
+        /// 通知内容
+        /// </summary>
+        [Nick("noticeContent")]
+        public String NOTICE_TEXT = string.Empty;
+        /// <summary>
+        /// 通知开始时间
+        /// </summary>
+        [Nick("noticeStartTime")]
+        public String NOTICE_STARTTIME = string.Empty;
+        /// <summary>
+        /// 通知结束时间
+        /// </summary>
+        [Nick("noticeEndTime")]
+        public String NOTICE_ENDTIME = string.Empty;
+        public String NOTICE_DATETIME = string.Empty;
+
+        //////////////////////////////////////////
+        //////////////////////////////////////////
+
+        /// <summary>
+        /// 通知ID
+        /// </summary>
+        [Ignore]
+        public String noticeId = string.Empty;
+        /// <summary>
+        /// 通知内容
+        /// </summary>
+                [Ignore]
+        public String noticeContent = string.Empty;
+        /// <summary>
+        /// 通知开始时间
+        /// </summary>
+                [Ignore]
+                public String noticeStartTime = string.Empty;
+        /// <summary>
+        /// 通知结束时间
+        /// </summary>
+                [Ignore]
+                public String noticeEndTime = string.Empty;
+
+
+
+   
+
+    }
+}

+ 24 - 0
HNWD.Pregrant.Model/Model/WD_NurseCfgInfo.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_NurseCfgInfo : ModelBase
+    {
+        public String ID = "0";
+        public String NURSECFG_ID = string.Empty;
+        public String NURSECFG_VALUE = string.Empty;
+        public String NURSECFG_HIS_VALUE = string.Empty;
+        public String NURSECFG_NAME = string.Empty;
+        public String NURSECFG_COLOR = string.Empty;
+        public String NURSECFG_CONTENT = string.Empty;
+        public String NURSECFG_DATETIME = string.Empty;
+
+
+ 
+
+    }
+}

+ 286 - 0
HNWD.Pregrant.Model/Model/WD_PartInfo.cs

@@ -0,0 +1,286 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_PartInfo : ModelBase
+    {
+        public String ID = "0";
+        [Nick("hospital")]
+        public String PART_HOSPITALNAME = string.Empty;
+        [Nick("departments")]
+        public String PART_NAME = string.Empty;
+
+        public String PART_CODE = string.Empty;
+        public String PART_CONTENT = string.Empty;
+        public String PART_ROOMCOUNT = string.Empty;
+        public String PART_BEDCOUNT = string.Empty;
+        [Nick("deviceScreamSleep")]
+        public String PART_SLEEPTIME = string.Empty;
+        public String PART_DAY_START = string.Empty;
+        public String PART_DAY_BLIGHT = string.Empty;
+        public String PART_DAY_SIPVOL = string.Empty;
+
+        public String PART_DAY_RINGVOL = string.Empty;
+        public String PART_DAY_RINGTIMES = string.Empty;
+        public String PART_DAY_NURSINGLED = string.Empty;
+
+
+        public String PART_DAY_DOORSIPVOL = string.Empty;
+        public String PART_DAY_BEDSIPVOL = string.Empty;
+
+
+        public String PART_NIGHT_START = string.Empty;
+        public String PART_NIGHT_BLIGHT = string.Empty;
+
+        public String PART_NIGHT_SIPVOL = string.Empty;
+
+        public String PART_NIGHT_RINGVOL = string.Empty;
+
+        public String PART_NIGHT_RINGTIMES = string.Empty;
+
+        public String PART_NIGHT_NURSINGLED = string.Empty;
+
+        public String PART_NIGHT_DOORSIPVOL = string.Empty;
+        public String PART_NIGHT_BEDSIPVOL = string.Empty;
+
+        [Nick("deviceCallTimeOut")]
+        public String PART_SIP_OVERTIME = string.Empty;
+
+
+
+        public String PART_ERRORPIC = string.Empty;
+        public String PART_NURSE_LEVEL0 = string.Empty;
+        public String PART_NURSE_LEVEL1 = string.Empty;
+
+        public String PART_NURSE_LEVEL2 = string.Empty;
+
+        public String PART_NURSE_LEVEL3 = string.Empty;
+        public String PART_NURSE_LEVEL4 = string.Empty;
+        public String PART_DISPLAY_ILLNESS = string.Empty;
+
+
+        public String PART_CODESWITCH = string.Empty;
+
+
+        public String PART_SPECIAL_CARE = string.Empty;
+        public String PART_PRIMARY_CARE = string.Empty;
+        public String SIPSEV_IP = string.Empty;
+        public String SIPSEV_MYSQLUSERNAME = string.Empty;
+
+        public String SIPSEV_MYSQLPASSWORD = string.Empty;
+
+
+        public String PART_DATETIME = string.Empty;
+        /// <summary>
+        /// 床位信息列表
+        /// </summary>
+                [Ignore]
+        public List<bedInfo> bedInfoList = new List<bedInfo>();
+
+        ////////////////////////////////////////////////
+        ///////////////////////////////////////////////////
+        //nick
+        //////////////////////////////////////////////////
+        //////////////////////////////////////////////////
+
+        [Ignore]
+        public String deviceCallTimeOut = "0";
+        [Ignore]
+        public String deviceScreamSleep = "0";
+
+
+
+
+        [Ignore]
+        public String hospital = string.Empty;
+        [Ignore]
+        public String departments = string.Empty;
+
+
+        ////////////////////////////////////////////
+        [Ignore]
+        public string dayOrNight = string.Empty;
+        [Ignore]
+        public String screenLight = string.Empty;
+        [Ignore]
+        public String callVoice = string.Empty;
+        [Ignore]
+        public String ringlVoice = string.Empty;
+        [Ignore]
+        public String DoorSipVol = string.Empty;                
+        [Ignore]
+        public String ringlVoiceLoop = string.Empty;
+        [Ignore]
+        public String nursingLight = string.Empty;
+        [Ignore]
+        public String BedSipVol = string.Empty;
+        [Ignore]
+        public String CallingTimeOut = string.Empty;
+        [Ignore]
+        public String screenExtinguishTime = string.Empty;
+
+
+        ////////////////////////////////////////////////////
+        ////////////////////////////////////////////////////
+        //others
+        [Ignore]
+        public String wardNum = string.Empty;
+
+ 
+        [Ignore]
+        public string babyName = string.Empty;
+        [Ignore]
+        public string babySex = string.Empty;
+
+
+        [Ignore]
+        public string roomByname = string.Empty;
+
+        [Ignore]
+        public List<CarefulMatter> carefulMatter = new List<CarefulMatter>();
+
+                [Ignore]
+        public string avoidCertainFood = string.Empty;
+ 
+        [Ignore]
+        public String nurseLevel = string.Empty;
+
+
+        /////////////////////////////////////////////
+        /////////////////////////////////////////////
+        /////////////////////////////////////////////
+        //[Ignore]
+        //public string hospital { get;set;}
+        //[Ignore]
+        //public string departments { get;set;}
+
+        [Ignore]
+        public string leftOneTitle = string.Empty;
+        [Ignore]
+        public string leftTwoTitle = string.Empty;
+        [Ignore]
+        public string leftThreeTitle = string.Empty;
+        [Ignore]
+        public string leftFourTitle = string.Empty;
+        [Ignore]
+        public string leftFiveTitle = string.Empty;
+        [Ignore]
+        public string leftOneColor = string.Empty;
+        [Ignore]
+        public string leftTwoColor = string.Empty;
+        [Ignore]
+        public string leftThreeColor = string.Empty;
+        [Ignore]
+        public string leftFourColor = string.Empty;
+        [Ignore]
+        public string leftFiveColor = string.Empty;
+        [Ignore]
+        public string leftOneContent = string.Empty;
+        [Ignore]
+        public string leftTwoContent = string.Empty;
+        [Ignore]
+        public string leftThreeContent = string.Empty;
+        [Ignore]
+        public string leftFourContent = string.Empty;
+        [Ignore]
+        public string leftFiveContent = string.Empty;
+
+        [Ignore]
+        public string inpatientNum = string.Empty;
+        [Ignore]
+        public string name = string.Empty;
+        [Ignore]
+        public string sex = string.Empty;
+        [Ignore]
+        public string ageNum = string.Empty;
+
+
+
+        [Ignore]
+        public string ageUnit = string.Empty;
+
+        [Ignore]
+        public string illness = string.Empty;
+
+        [Ignore]
+        public string admissionTime = string.Empty;
+
+        [Ignore]
+        public string responsDoctor = string.Empty;
+
+
+
+        [Ignore]
+        public string responsDoctorPic = string.Empty;
+
+
+        [Ignore]
+        public string responsNurse = string.Empty;
+
+        [Ignore]
+        public string responsNursePic = string.Empty;
+
+        [Ignore]
+        public string qrCodeSwitch = string.Empty;
+
+
+
+
+        ////////////////////////////////
+        [Ignore]
+        public string dayBright = string.Empty;
+
+                [Ignore]
+        public string nightbright = string.Empty;
+
+
+                        [Ignore]
+        public string dayRingVol = string.Empty;
+
+                        [Ignore]
+        public string nightRightVol = string.Empty;
+
+
+                        [Ignore]
+        public string dayRingTimes = string.Empty;
+
+
+                        [Ignore]
+        public string nightRingTimes = string.Empty;
+
+                        [Ignore]
+        public string dayNursingLed = string.Empty;
+
+
+                                [Ignore]
+        public string nightNursingLed = string.Empty;
+
+
+                                [Ignore]
+        public string sipOverTime = string.Empty;
+
+
+                                [Ignore]
+        public string daySipVol = string.Empty;
+
+
+                                [Ignore]
+        public string nightSipVol = string.Empty;
+
+
+                                        [Ignore]
+        public string dayDoorSipVol = string.Empty;
+                                        [Ignore]
+        public string dayBedSipVol = string.Empty;
+                                        [Ignore]
+        public string nightDoorSipVol = string.Empty;
+                                        [Ignore]
+        public string nightBedSipVol = string.Empty;
+
+      
+    }
+}

+ 73 - 0
HNWD.Pregrant.Model/Model/WD_PatientInfo.cs

@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_PatientInfo : ModelBase
+    {
+
+        public String ID = "0";
+
+        public String PATIENT_PHOC_ID = string.Empty;
+
+        public String PATIENT_ID = string.Empty;
+        public String PATIENT_CARD_ID = string.Empty;
+        public String PATIENT_NAME = string.Empty;
+        public String PATIENT_NAME_PY = string.Empty;
+        public String PATIENT_AGE_UNIT = string.Empty;
+        public String PATIENT_BIRTHDAY = string.Empty;
+        public String PATIENT_IDCARD = string.Empty;
+        public String PATIENT_ADDRESS = string.Empty;
+        public String PATIENT_MOBLIE = string.Empty;
+
+        public String PATIENT_INDATE = string.Empty;
+
+        public String PATIENT_SEX = string.Empty;
+        public String PATIENT_AGE = string.Empty;
+
+
+        public String PATIENT_DOCTOR_ID = string.Empty;
+        public String PATIENT_NURSE_ID = string.Empty;
+        public String PATIENT_WORKERS_ID = string.Empty;
+        public String PATIENT_NURSE_LEVEL0 = string.Empty;
+        public String PATIENT_NURSE_LEVEL1 = string.Empty;
+        public String PATIENT_NURSE_LEVEL2 = string.Empty;
+
+        public String PATIENT_NURSE_LEVEL3 = string.Empty;
+
+        public String PATIENT_NURSE_LEVEL4 = string.Empty;
+        public String PATIENT_INTIMES = string.Empty;
+
+        public String PATIENT_STATUS = string.Empty;
+        public String PATIENT_ILLNESS = string.Empty;
+        public String PATIENT_DATETIME = string.Empty;
+
+        public String PATIENT_BABYNAME = string.Empty;
+        public String PATIENT_BABYSEX = string.Empty;
+ 
+        [Ignore]
+        public String DiffDays = "0";
+
+                [Ignore]
+        public String name = "";
+
+                [Ignore]
+        public String inpatientNum = "";
+  
+        [Ignore]
+                public List<CDoctorCharge> DoctorChargeArray = new List<CDoctorCharge>();
+
+
+                [Ignore]
+        public List<Cost> CostArray = new List<Cost>();
+
+
+                [Ignore]
+                public String BEDID = "";
+
+         
+    }
+}

+ 27 - 0
HNWD.Pregrant.Model/Model/WD_ProgramInfo.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_ProgramInfo : ModelBase
+    {
+        public string ID = "0"; 
+        public string PROGRAM_TYPE = string.Empty;
+        public string PROGRAM_NAME = string.Empty;
+        public string PROGRAM_X = "0";
+        public string PROGRAM_Y = "0";
+        public string PROGRAM_WIDTH = "0";
+        public string PROGRAM_HEIGHT = "0";
+        public string PROGRAM_TEXT = string.Empty;
+        public string PROGRAM_IMAGE = string.Empty;
+        public string PROGRAM_MATRIX = string.Empty;
+        public string PROGRAM_FORMAT = string.Empty;
+        public string PROGRAM_ALIGN = string.Empty;
+        public string PROGRAM_STAYINGTIME = "0";
+        public string PROGRAM_DATETIME = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
+        public string PROGRAM_DEVICE_ID = "0";
+
+    }
+}

+ 20 - 0
HNWD.Pregrant.Model/Model/WD_RunProfile.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_RunProfile : ModelBase
+    {
+        public String ID = "0";
+
+        public String BroadcastVol = string.Empty;
+        public String BroadcastSaveFlag = string.Empty;
+        public string TrustResetFlag = string.Empty;
+        public String SysSettingsFlag = string.Empty;
+        public String UpdateFlag = string.Empty;
+        public string DataFlashFlag = string.Empty;
+        public String LEDDeviceFlag = string.Empty;
+    }
+}

+ 20 - 0
HNWD.Pregrant.Model/Model/WD_SIPSevInfo.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_SIPSevInfo : ModelBase
+    {
+        public String ID = "0";
+
+        public string SIPSEV_IP = string.Empty;
+
+        public string SIPSEV_MYSQLUSERNAME = string.Empty;
+
+        public string SIPSEV_MYSQLPASSWORD = string.Empty;
+
+        public string SIPSEV_DATETIME = string.Empty;
+    }
+}

+ 130 - 0
HNWD.Pregrant.Model/Model/WD_StaffInfo.cs

@@ -0,0 +1,130 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_StaffInfo : ModelBase
+    {
+        [Nick("id")]
+        public String ID = "0";
+        [Nick("staffId")]
+        public String STAFF_ID = string.Empty;
+        [Nick("staffPassWordCode")]
+        public String STAFF_PASSWORDCARD = string.Empty;
+        [Nick("staffName")]
+        public String STAFF_NAME = string.Empty;
+        [Nick("staffNamePy")]
+        public String STAFF_NAME_PY = string.Empty;
+        [Nick("staffBirthday")]
+        public String STAFF_BIRTHDAY = string.Empty;
+        [Nick("staffIdCard")]
+        public String STAFF_IDCARD = string.Empty;
+        [Nick("staffWorkDate")]
+        public String STAFF_WORKDATE = string.Empty;
+        [Nick("staffWorkTel")]
+        public String STAFF_WORKTEL = string.Empty;
+        [Nick("staffMobile")]
+        public String STAFF_MOBILE = string.Empty;
+        [Nick("staffContent")]
+        public String STAFF_CONTENT = string.Empty;
+        [Nick("staffPicture")]
+        public String STAFF_PICTURE = string.Empty;
+        [Nick("staffDateTime")]
+        public String STAFF_DATETIME = string.Empty;
+        [Nick("staffType")]
+        public String STAFF_TYPE = string.Empty;
+        [Nick("staffSex")]
+        public String STAFF_SEX = string.Empty;
+        [Nick("staffDuty")]
+        public String STAFF_DUTY = string.Empty;
+
+        [Ignore]
+        public String id = "0";
+        [Ignore]
+        public String staffId = string.Empty;
+        [Ignore]
+        public String staffPassWordCode = string.Empty;
+        [Ignore]
+        public String staffName = string.Empty;
+        [Ignore]
+        public String staffNamePy = string.Empty;
+        [Ignore]
+        public String staffBirthday = string.Empty;
+        [Ignore]
+        public String staffIdCard = string.Empty;
+        [Ignore]
+        public String staffWorkDate = string.Empty;
+        [Ignore]
+        public String staffWorkTel = string.Empty;
+        [Ignore]
+        public String staffMobile = string.Empty;
+        [Ignore]
+        public String staffContent = string.Empty;
+        [Ignore]
+        public String staffPicture = string.Empty;
+        [Ignore]
+        public String staffDateTime = string.Empty;
+        [Ignore]
+        public String staffType = string.Empty;
+        [Ignore]
+        public String staffSex = string.Empty;
+        [Ignore]
+        public String staffDuty = string.Empty;
+
+
+
+
+
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        [Ignore]
+        public String currentPosition = "未知";
+
+        /// <summary>
+        /// 职务
+        /// </summary>
+        [Ignore]
+        public String job = "未知";
+        /// <summary>
+        /// 手机ID
+        /// </summary>
+        [Ignore]
+        public String mobileid = "未知";
+        /// <summary>
+        /// Sip的ID
+        /// </summary>
+        [Ignore]
+        public String deviceSipIp = "未知";
+        /// <summary>
+        /// Sip的密码
+        /// </summary>
+        [Ignore]
+        public String deviceSipPassWord = "未知";
+          /// <summary>
+        /// 值班时间
+        /// </summary>
+        [Ignore]
+        public String dutyTime = "未知";
+                  /// <summary>
+        /// 荣誉等级
+        /// </summary>
+        [Ignore]
+        public String honorLevel = "未知";
+
+        /// <summary>
+        ///善长项目
+        /// </summary>
+        [Ignore]
+        public String donors = "未知";
+
+        /// <summary>
+        ///最新评价
+        /// </summary>
+        [Ignore]
+        public String latestEvaluation = "未知";
+    }
+}

+ 95 - 0
HNWD.Pregrant.Model/Model/WD_StaffInfo_Simple.cs

@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_StaffInfo_Simple : ModelBase
+    {
+      
+        [Ignore]
+        public String id = "0";
+        [Ignore]
+        public String staffId = string.Empty;
+        [Ignore]
+        public String staffPassWordCode = string.Empty;
+        [Ignore]
+        public String staffName = string.Empty;
+        [Ignore]
+        public String staffNamePy = string.Empty;
+        [Ignore]
+        public String staffBirthday = string.Empty;
+        [Ignore]
+        public String staffIdCard = string.Empty;
+        [Ignore]
+        public String staffWorkDate = string.Empty;
+        [Ignore]
+        public String staffWorkTel = string.Empty;
+        [Ignore]
+        public String staffMobile = string.Empty;
+        [Ignore]
+        public String staffContent = string.Empty;
+        [Ignore]
+        public String staffPicture = string.Empty;
+        [Ignore]
+        public String staffDateTime = string.Empty;
+        [Ignore]
+        public String staffType = string.Empty;
+        [Ignore]
+        public String staffSex = string.Empty;
+        [Ignore]
+        public String staffDuty = string.Empty;
+        [Ignore]
+        public String staffAge = string.Empty;
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        [Ignore]
+        public String currentPosition = "未知";
+
+        /// <summary>
+        /// 职务
+        /// </summary>
+        [Ignore]
+        public String job = "未知";
+        /// <summary>
+        /// 手机ID
+        /// </summary>
+        [Ignore]
+        public String mobileid = "未知";
+        /// <summary>
+        /// Sip的ID
+        /// </summary>
+        [Ignore]
+        public String deviceSipIp = "未知";
+        /// <summary>
+        /// Sip的密码
+        /// </summary>
+        [Ignore]
+        public String deviceSipPassWord = "未知";
+          /// <summary>
+        /// 值班时间
+        /// </summary>
+        [Ignore]
+        public String dutyTime = "未知";
+                  /// <summary>
+        /// 荣誉等级
+        /// </summary>
+        [Ignore]
+        public String honorLevel = "未知";
+
+        /// <summary>
+        ///善长项目
+        /// </summary>
+        [Ignore]
+        public String donors = "未知";
+
+        /// <summary>
+        ///最新评价
+        /// </summary>
+        [Ignore]
+        public String latestEvaluation = "未知";
+    }
+}

+ 20 - 0
HNWD.Pregrant.Model/Model/WD_SysLogInfo.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_SysLogInfo : ModelBase
+    {
+        public String ID = "0";
+        public String LOG_TYPE = string.Empty;
+        public String LOG_SOURCE = string.Empty;
+
+        public String LOG_CONTENT = string.Empty;
+
+        public String LOG_DATETIME = string.Empty;
+ 
+    }
+}

+ 18 - 0
HNWD.Pregrant.Model/Model/WD_UrgeInfo.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_UrgeInfo : ModelBase
+    {
+        public String ID = "0";
+
+        public String URGE_PATIENT_ID = string.Empty;
+
+        public string URGE_VALUE = string.Empty;
+
+        public string URGE_DATETIME = string.Empty;
+    }
+}

+ 18 - 0
HNWD.Pregrant.Model/Model/WD_UserInfo.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_UserInfo : ModelBase
+    {
+        public String ID = "0";
+
+        public String URGE_PATIENT_ID = string.Empty;
+
+        public string URGE_VALUE = string.Empty;
+
+        public string URGE_DATETIME = string.Empty;
+    }
+}

+ 26 - 0
HNWD.Pregrant.Model/Model/WD_VerInfo.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_VerInfo : ModelBase
+    {
+        public string ID = "0";
+ 
+        public String VER_DEVICETYPE = string.Empty;
+        [Nick("APPVersion")]
+        public string VER_INFO = string.Empty;
+        [Nick("downloadURL")]
+        public string VER_FILEPATH = string.Empty;
+        public string VER_DATETIME = string.Empty;
+
+        [Ignore]
+        public string APPVersion = string.Empty;
+         
+        [Ignore]
+        public string downloadURL = string.Empty;
+     
+    }
+}

+ 63 - 0
HNWD.Pregrant.Model/Model/WD_ZoneInfo.cs

@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_ZoneInfo : ModelBase
+    {
+        [Nick("ID")]
+        public String ID = "0";
+        [Nick("PartitionNo")]
+
+        public String ZONE_ZONEID = string.Empty;
+        [Nick("FileName")]
+
+        public string ZONE_FILELIST = string.Empty;
+        [Nick("Status")]
+
+        public String ZONE_STATUS = string.Empty;
+        [Nick("Remarks")]
+        public string ZONE_CONTENT = string.Empty;
+        [Nick("Weeks")]
+        public string ZONE_WEEK = string.Empty;
+        [Nick("StartTime")]
+        public string ZONE_STARTTIME = string.Empty;
+        [Nick("EndTime")]
+        public string ZONE_ENDTIME = string.Empty;
+
+        public string ZONE_DATETIME = string.Empty;
+
+
+
+
+        /////////////////////////////
+        //////////////////////////////
+        //[Ignore]
+        //public String PartitionNo = string.Empty;
+
+        //[Ignore]
+        //public String FileName = string.Empty;
+
+        //[Ignore]
+        //public string Status = string.Empty;
+        //[Ignore]
+        //public String Remarks = string.Empty;
+        //[Ignore]
+        //public string Weeks = string.Empty;
+        //[Ignore]
+        //public string StartTime = string.Empty;
+        //[Ignore]
+        //public string EndTime = string.Empty;
+
+        ///////////////////////////
+        //////////////////////////
+        ////其他
+        //[Ignore]
+        //public string isChecked = string.Empty;
+
+
+
+    }
+}

+ 121 - 0
HNWD.Pregrant.Model/Model/bedDetails.cs

@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class bedDetails : ModelBase
+    {
+        /// <summary>
+        /// 床头机ID
+        /// </summary>
+        public string bedId { get; set; }
+        /// <summary>
+        /// 床号
+        /// </summary>
+        public string bedNum { get; set; }
+        /// <summary>
+        /// 床号
+        /// </summary>
+        public string bedName { get; set; }
+        /// <summary>
+        /// 托管状态
+        /// </summary>
+        public string trusteeshipState { get; set; }
+        /// <summary>
+        /// 病人ID
+        /// </summary>
+        public string PatientID { get; set; }
+        /// <summary>
+        /// 病人姓名
+        /// </summary>
+        public string patientName { get; set; }
+        /// <summary>
+        /// 病人年龄
+        /// </summary>
+        public string PatientAge { get; set; }
+        /// <summary>
+        /// 病人性别
+        /// </summary>
+        public string patientGender { get; set; }
+        /// <summary>
+        /// 入院时间
+        /// </summary>
+        public string admissionTime { get; set; }
+        /// <summary>
+        /// 责任医生
+        /// </summary>
+        public string attendingDoctor { get; set; }
+        /// <summary>
+        /// 责任护士
+        /// </summary>
+        public string nurseInCharge { get; set; }
+
+        /// <summary>
+        /// 病情状况/禁忌事项
+        /// </summary>
+        public string Condition { get; set; }
+        /// <summary>
+        ///
+        /// 用药明细
+        /// </summary>
+        public string Medications { get; set; }
+        /// <summary>
+        /// 医嘱事项
+        /// </summary>
+        public string MedicalAdvice { get; set; }
+        /// <summary>
+        /// 护理等级值
+        /// </summary>
+        public string gradeLevel = "0";
+        /// <summary>
+        /// 饮食等级
+        /// </summary>
+        public string DietLevel = "0";
+        /// <summary>
+        /// 计量等级
+        /// </summary>
+        public string DosageLevel = "0";
+        /// <summary>
+        /// 隔离等级
+        /// </summary>
+        public string InsulateLevel = "0";
+        /// <summary>
+        /// 过敏等级
+        /// </summary>
+        public string AllerayLevel = "0";
+
+        /// <summary>
+        /// 护理等级名称
+        /// </summary>
+        public string gradeNurse = "0";
+        ///
+        /// 是否在点滴
+        /// </summary>
+        public string isDropping { get; set; }
+        ///
+        /// 是否在吸氧
+        /// </summary>
+        public string isOxygenUptake { get; set; }
+        ///
+        /// 房间ID
+        /// </summary>
+        public string roomNumID = string.Empty;
+        ///
+        /// 房间号
+        /// </summary>
+        public string roomNum = string.Empty;
+
+        ///
+        /// SIPID
+        /// </summary>
+        public string deviceSipId = string.Empty;
+
+        ///
+        /// 设备Mac地址
+        /// </summary>
+        public string deviceMac = string.Empty;
+    }
+}

+ 123 - 0
HNWD.Pregrant.Model/Model/bedInfo.cs

@@ -0,0 +1,123 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class bedInfo 
+    {
+
+        public String DoctorID = string.Empty;
+
+
+        public String NurseID = string.Empty;
+
+
+        public string doctorName = string.Empty;
+        public string nurseName = string.Empty;
+
+ 
+        public string bedNum = "0"; 
+        public string bedName = string.Empty;
+        public string roomNum = string.Empty;
+        public string doctorHeadIcon = string.Empty;
+
+        public string nurseHeadIcon = string.Empty;
+        public string HumanID = string.Empty;
+        public string bedStatus = string.Empty;
+
+        /// <summary>
+        /// 宝妈姓名
+        /// </summary>
+        public string name = string.Empty;
+        /// <summary>
+        /// 宝宝姓名
+        /// </summary>
+        public string babyName = string.Empty;
+        /// <summary>
+        /// 忌口
+        /// </summary>
+        public string avoidCertainFood = string.Empty;
+ /// <summary>
+ /// 宝宝性别
+ /// </summary>
+        public string babySex = string.Empty;
+        /// <summary>
+        /// 注意事项
+        /// </summary>
+        public List<CarefulMatter> carefulMatter = new List<CarefulMatter>();
+
+        /// <summary>
+        /// 房间别名
+        /// </summary>
+        public string roomByname = string.Empty;
+
+
+
+        public string bedID = "0";
+
+
+        public string SipID = "0";
+
+        public string roomNumID = "0";
+
+        public string PatientID = "0";
+
+        public string patientName = "0";
+
+        public string PatientAge = "0";
+
+        public string patientGender = "0";
+
+        public string admissionTime = "0";
+        /// <summary>
+        /// 责任医生
+        /// </summary>
+        public string attendingDoctor = "0";
+        /// <summary>
+        /// 责任护士
+        /// </summary>
+        public string nurseInCharge = "0";
+        /// <summary>
+        /// 病情状况
+        /// </summary>
+        public string Condition = "0";
+        /// <summary>
+        /// 级别
+        /// </summary>
+        public string gradeLevel = "0";
+        /// <summary>
+        /// 饮食等级
+        /// </summary>
+        public string DietLevel = "0";
+        /// <summary>
+        /// 计量等级
+        /// </summary>
+        public string DosageLevel = "0";
+        /// <summary>
+        /// 隔离等级
+        /// </summary>
+        public string InsulateLevel = "0";
+        /// <summary>
+        /// 过敏等级
+        /// </summary>
+        public string AllerayLevel = "0";
+
+        /// <summary>
+        /// 护理等级
+        /// </summary>
+        public string gradeNurse = "0";
+
+        /// <summary>
+        /// 是否在点滴
+        /// </summary>
+        public string isDropping = "0";
+
+        /// <summary>
+        /// 是否在吸氧
+        /// </summary>
+        public string isOxygenUptake = "1"; 
+    }
+}

+ 32 - 0
HNWD.Pregrant.Model/Model/hospital.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class hospital : ModelBase
+    {
+        public string patientNum = "0";
+        public string freeBeds = "0";
+        public string admissionToday = "0";
+        public string dischargedToday = "0";
+        public string dischargeTomorrow = "0";
+        public string operationToday = "0";
+        public string operationTomorrow = "0";
+        public string specialCare = "0";
+        public string primaryCare = "0";
+        public List<string> dutyDoctorList = new List<string>();
+        public List<string> nurseOnDutyList = new List<string>();
+        public List<string> importantMessageList = new List<string>();
+
+        /// <summary>
+        /// 吸氧人数
+        /// </summary>
+        public string oxygenUptake = "30";
+
+        public List<WD_StaffInfo> dutyDoctorsList = new List<WD_StaffInfo>();
+        public List<WD_StaffInfo> nursesOnDutyList = new List<WD_StaffInfo>();
+    }
+}

+ 24 - 0
HNWD.Pregrant.Model/Model/wardInformation.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class wardInformation : ModelBase
+    {
+        public string roomNumID = string.Empty;
+        public string roomNum = string.Empty;
+        public string bedNum = string.Empty;
+        public string bedName = string.Empty;
+        public string SipID = string.Empty;
+        public string trusteeshipState = string.Empty;
+
+        public string roomByname = string.Empty;
+
+        public List<bedInfo> sickbedInformationList = new List<bedInfo>();
+        public List<bedDetails> sickbedList = new List<bedDetails>();
+ 
+    }
+}

+ 22 - 0
HNWD.Pregrant.Model/ModelBase.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class ModelBase
+    {
+        [Ignore]
+        public bool bSuccess = false;
+        [Ignore]
+        public String Code = "OK!";
+        [Ignore]
+        public Int32 Rows =0;
+        [Ignore]
+        public String Message  = string.Empty;
+        [Ignore]
+        public string CurTime = System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
+    }
+}

+ 11 - 0
HNWD.Pregrant.Model/ModelExt/ColleagueExt.cs

@@ -0,0 +1,11 @@
+using System.Collections.Generic;
+
+namespace HNWD.Pregrant.Model
+{
+    public class ColleagueExt : ModelExtBase<Colleague>
+    {
+        public List<WD_DeviceInfo_Simple> deviceInfoSimple = new List<WD_DeviceInfo_Simple>();
+
+        public List<WD_StaffInfo_Simple> staffInfoSimple = new List<WD_StaffInfo_Simple>();
+    }
+}

+ 9 - 0
HNWD.Pregrant.Model/ModelExt/MP3FileExt.cs

@@ -0,0 +1,9 @@
+using System.Collections.Generic;
+
+namespace HNWD.Pregrant.Model
+{
+    public class MP3FileExt : ModelExtBase<MP3File>
+    {
+        public List<MP3File> Mp3FileList = new List<MP3File>();
+    }
+}

+ 9 - 0
HNWD.Pregrant.Model/ModelExt/MusicFileExt.cs

@@ -0,0 +1,9 @@
+using System.Collections.Generic;
+
+namespace HNWD.Pregrant.Model
+{
+    public class MusicFileExt : ModelExtBase<MusicFile>
+    {
+        public List<MusicFile> FileList = new List<MusicFile>();
+    }
+}

+ 12 - 0
HNWD.Pregrant.Model/ModelExt/WD_CostInfoExt.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_CostInfoExt : ModelExtBase<WD_CostInfo>
+    {
+    }
+}

+ 17 - 0
HNWD.Pregrant.Model/ModelExt/WD_DeviceInfoExt.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_DeviceInfoExt : ModelExtBase<WD_DeviceInfo>
+    {
+        public List<WD_DeviceInfo> BedInfoArray = new List<WD_DeviceInfo>();
+        public List<WD_DeviceInfo> DeviceInfoArray = new List<WD_DeviceInfo>();
+        public List<WD_DeviceInfo> hostList = new List<WD_DeviceInfo>();
+
+   
+    }
+}

+ 12 - 0
HNWD.Pregrant.Model/ModelExt/WD_MessageInfoExt.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_MessageInfoExt : ModelExtBase<WD_MessageInfo>
+    {
+    }
+}

+ 13 - 0
HNWD.Pregrant.Model/ModelExt/WD_NoticeInfoExt.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_NoticeInfoExt : ModelExtBase<WD_NoticeInfo>
+    {
+        public List<WD_NoticeInfo> NoticeArray = new List<WD_NoticeInfo>();
+    }
+}

+ 13 - 0
HNWD.Pregrant.Model/ModelExt/WD_NurseCfgInfoExt.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_NurseCfgInfoExt : ModelExtBase<WD_NurseCfgInfo>
+    {
+        public List<WD_NurseCfgInfo> NurseCfgInfoArray = new List<WD_NurseCfgInfo>();
+    }
+}

+ 12 - 0
HNWD.Pregrant.Model/ModelExt/WD_PartInfoExt.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HNWD.Pregrant.Model
+{
+    public class WD_PartInfoExt : ModelExtBase<WD_PartInfo>
+    {
+    }
+}

+ 0 - 0
HNWD.Pregrant.Model/ModelExt/WD_PatientInfoExt.cs


部分文件因文件數量過多而無法顯示