全局数据 GetGlobalDataSet

 1  /// <summary>
 2         /// 获取全局数据
 3         /// </summary>
 4         /// <returns></returns>
 5         public DataSet GetGlobalDataSet()
 6         {
 7             try
 8             {
 9                 //lizhijie LoadGlobalData加载所有的数据库表放到dataset中
10                 string sql = OracleHelper.ParseSchema("LoadGlobalData");
11                 DbCommand command = DatabaseInstance.GetStoredProcCommand(sql);
12                 #region
13                 #region --节点 (20-23)
14                 OracleParameter ServerData = new OracleParameter("ServerData", OracleType.Cursor);
15                 ServerData.Direction = ParameterDirection.Output;
16                 command.Parameters.Add(ServerData);
17                 OracleParameter CANData = new OracleParameter("CANData", OracleType.Cursor);
18                 CANData.Direction = ParameterDirection.Output;
19                 command.Parameters.Add(CANData);
20                 OracleParameter IoLogicOrICPCONData = new OracleParameter("IoLogicOrICPCONData", OracleType.Cursor);
21                 IoLogicOrICPCONData.Direction = ParameterDirection.Output;
22                 command.Parameters.Add(IoLogicOrICPCONData);
23                 OracleParameter VerintAudioCodecData = new OracleParameter("VerintAudioCodecData", OracleType.Cursor);
24                 VerintAudioCodecData.Direction = ParameterDirection.Output;
25                 command.Parameters.Add(VerintAudioCodecData);
26                 #endregion
27                 #region --节点 (24-28)
28                 OracleParameter SwitchData = new OracleParameter("SwitchData", OracleType.Cursor);
29                 SwitchData.Direction = ParameterDirection.Output;
30                 command.Parameters.Add(SwitchData);
31                 OracleParameter LightData = new OracleParameter("LightData", OracleType.Cursor);
32                 LightData.Direction = ParameterDirection.Output;
33                 command.Parameters.Add(LightData);
34                 OracleParameter MultiNodeData = new OracleParameter("MultiNodeData", OracleType.Cursor);
35                 MultiNodeData.Direction = ParameterDirection.Output;
36                 command.Parameters.Add(MultiNodeData);
37                 OracleParameter CameraData = new OracleParameter("CameraData", OracleType.Cursor);
38                 CameraData.Direction = ParameterDirection.Output;
39                 command.Parameters.Add(CameraData);
40                 OracleParameter SpeakerData = new OracleParameter("SpeakerData", OracleType.Cursor);
41                 SpeakerData.Direction = ParameterDirection.Output;
42                 command.Parameters.Add(SpeakerData);
43                 #endregion
44 
45                 #region --扩展节点信息(33)
46                 OracleParameter ExtNodeInfoData = new OracleParameter("ExtNodeInfoData", OracleType.Cursor);
47                 ExtNodeInfoData.Direction = ParameterDirection.Output;
48                 command.Parameters.Add(ExtNodeInfoData);
49                 #endregion
50                 #endregion
51                 DataSet ds = DatabaseInstance.ExecuteDataSet(command);
52                 return ds;
53             }
54 }
55 
56 
57     internal class OracleHelper
58     {
59         private const string SCHEMA_NAME = "AppServer";
60         public static string ParseSchema(string sql, string schemaVarName)
61         {
62             return sql.Replace(schemaVarName, SCHEMA_NAME);
63         }
64 
65         public static string ParseSchema(string sql)
66         {
67             return SCHEMA_NAME + "." + sql;
68         }
69 }

 

posted @ 2013-07-04 17:40  yufeiyunsui  阅读(513)  评论(0编辑  收藏  举报