jingshanDataUploadDataJob.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. using log4net;
  2. using Quartz;
  3. using RabbitMQ.Client;
  4. using RDIFramework.Utilities;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Configuration;
  8. using System.Data;
  9. using System.IO;
  10. using System.Linq;
  11. using System.Text;
  12. namespace TimedUpload.QuartzJobs
  13. {
  14. class jingshanDataUploadDataJob : IJob
  15. {
  16. private readonly ILog log = LogManager.GetLogger(typeof(DataUploadJob));
  17. public void Execute(IJobExecutionContext context)
  18. {
  19. string[] uploadUrls = Constants.UploadUrl.Split('|');
  20. Dictionary<string, IConnection> connections = new Dictionary<string, IConnection>();
  21. Dictionary<string, IModel> channels = new Dictionary<string, IModel>();
  22. Dictionary<string, IBasicProperties> properties = new Dictionary<string, IBasicProperties>();
  23. foreach (string uploadUrl in uploadUrls)
  24. {
  25. ConnectionFactory factory = new ConnectionFactory();
  26. factory.HostName = uploadUrl;//主机名,Rabbit会拿这个IP生成一个endpoint,这个很熟悉吧,就是socket绑定的那个终结点。
  27. factory.UserName = Constants.UploadUserName;//默认用户名,用户可以在服务端自定义创建,有相关命令行
  28. factory.Password = Constants.UploadPassword;//默认密码
  29. factory.AutomaticRecoveryEnabled = true; // 链接断开会自动重连
  30. IConnection connection = factory.CreateConnection();
  31. IModel channel = connection.CreateModel();
  32. channel.QueueDeclare("zone.device", true, false, false, null);//创建一个名称为kibaqueue的消息队列
  33. channel.QueueDeclare("zone.deviceHis", true, false, false, null);//创建一个名称为kibaqueue的消息队列
  34. IBasicProperties property = channel.CreateBasicProperties();
  35. property.ContentType = "text/plain";
  36. property.DeliveryMode = 2; //持久化
  37. connections.Add(uploadUrl, connection);
  38. properties.Add(uploadUrl, property);
  39. channels.Add(uploadUrl, channel);
  40. }
  41. if (channels.Count > 0)
  42. {
  43. SendZoneDevice(channels, properties);
  44. SendZoneDeviceHis(channels, properties);
  45. }
  46. foreach (KeyValuePair<string, IConnection> item in connections)
  47. {
  48. IConnection connection = item.Value;
  49. connection.Close();
  50. }
  51. }
  52. /// <summary>
  53. /// 大表设备添加
  54. /// </summary>
  55. /// <param name="channels"></param>
  56. /// <param name="properties"></param>
  57. private void SendZoneDevice(Dictionary<string, IModel> channels, Dictionary<string, IBasicProperties> properties)
  58. {
  59. try
  60. {
  61. String meterId = Constants.MeterId;
  62. String sql = "SELECT a.ID,a.名称,a.考核表编码,a.X坐标,a.Y坐标,b.传输协议参数,ISNULL(a.是否阀控,0) AS isValve FROM [设备信息] a left join 传输设备 b on a.传输设备ID = b.ID where a.是否启用 = '是' and a.考核表编码 is not null and a.ID > " + meterId + " order by a.ID";
  63. DataTable dt = dbHelper.Fill(sql);
  64. if (dt == null)
  65. {
  66. log.Info("大表设备同步任务查询报错.................\r\n");
  67. return;
  68. }
  69. if (dt.Rows.Count == 0)
  70. {
  71. log.Info("大表设备同步任务,没有需要同步的设备.................\r\n");
  72. return;
  73. }
  74. log.Info("大表设备同步任务开始执行.................\r\n");
  75. StringBuilder message = new StringBuilder();
  76. for (int i = 0; i < dt.Rows.Count; i++)
  77. {
  78. message.Clear();
  79. try
  80. {
  81. DataRow dr = dt.Rows[i];
  82. String iccid = "";
  83. if (!"".Equals(dr["传输协议参数"].ToString()))
  84. {
  85. iccid = dr["传输协议参数"].ToString().Split(',')[0];
  86. }
  87. String lngAndLat = "";
  88. if (!"".Equals(dr["X坐标"].ToString()) && !"".Equals(dr["Y坐标"].ToString()))
  89. {
  90. lngAndLat = dr["X坐标"].ToString() + "|" + dr["Y坐标"].ToString();
  91. }
  92. message.Append("{");
  93. message.Append("\"meterAssessmentName\": \"").Append(dr["名称"]).Append("\",");
  94. message.Append("\"iccId\": ").Append(iccid).Append(",");
  95. //message.Append("\"areaId\": 22,");
  96. message.Append("\"lngAndLat\": \"").Append(lngAndLat).Append("\",");
  97. //message.Append("\"pipeCailber\": \"DN32\",");
  98. //message.Append("\"pipeTexture\": \"PVC\",");
  99. //message.Append("\"imei\": \"77564212\",");
  100. message.Append("\"isPressucre\": 1,");
  101. message.Append("\"isFlow\": 1,");
  102. message.Append("\"isZoneMeter\": 1,");
  103. message.Append("\"isTradeMeter\": 0,");
  104. message.Append("\"isLargeUser\": 0,");
  105. message.Append("\"isLargeUser\": 0,");
  106. message.Append("\"isValve\":").Append(dr["isValve"].ToString()).Append(",");
  107. message.Append("\"meterAssessmentCode\": \"").Append(dr["考核表编码"]).Append("\",");
  108. message.Append("\"manufacturerCode\": \"").Append(Constants.ManufacturerCode).Append("\",");
  109. message.Append("\"meterTypeId\": \"2\"");
  110. message.Append("}");
  111. foreach (KeyValuePair<string, IModel> item in channels)
  112. {
  113. string key = item.Key;
  114. IModel channel = item.Value;
  115. IBasicProperties property = properties[key];
  116. channel.BasicPublish("zone.device", "", property, Encoding.UTF8.GetBytes(message.ToString())); //生产消息
  117. }
  118. meterId = dr["ID"].ToString();
  119. }
  120. catch (Exception ex)
  121. {
  122. log.Info("大表设备同步任务数据推送失败:" + message.ToString() + "\r\n");
  123. log.Error(ex.Message + "===========" + ex.StackTrace + "\r\n");
  124. }
  125. }
  126. UpdateAppConfig("MeterId", meterId);
  127. log.Info("大表设备同步任务执行结束.................\r\n");
  128. }
  129. catch (Exception ex)
  130. {
  131. log.Error("大表设备同步任务执行错误:" + ex.Message + "===========" + ex.StackTrace + "\r\n");
  132. }
  133. }
  134. /// <summary>
  135. /// 大表历史数据
  136. /// </summary>
  137. /// <param name="channels"></param>
  138. /// <param name="properties"></param>
  139. private void SendZoneDeviceHis(Dictionary<string, IModel> channels, Dictionary<string, IBasicProperties> properties)
  140. {
  141. try
  142. {
  143. log.Info("大表设备历史数据同步任务开始执行.................\r\n");
  144. String sqlMeter = "SELECT ID,考核表编码,ISNULL(是否阀控,0) AS isValve FROM [设备信息] where 是否启用 = '是' and 考核表编码 is not null order by ID";
  145. DataTable dtMeter = dbHelper.Fill(sqlMeter);
  146. //Dictionary<string, object> arguments = new Dictionary<string, object>();
  147. //arguments["x-max-length-bytes"] = 2147383648;
  148. //arguments["x-overflow"] = "reject-publish";
  149. Dictionary<String, String> uploadHis = new Dictionary<string, string>();
  150. using (StreamReader sr = new StreamReader(@"TextFile1.txt"))
  151. {
  152. String line = "";
  153. while ((line = sr.ReadLine()) != null)
  154. {
  155. if (!"".Equals(line))
  156. {
  157. String[] item = line.Split(',');
  158. uploadHis[item[0]] = item[1];
  159. }
  160. }
  161. }
  162. for (int i = 0; i < dtMeter.Rows.Count; i++)
  163. {
  164. DataRow drMeter = dtMeter.Rows[i];
  165. String meterId = drMeter["ID"].ToString();
  166. String meterCode = drMeter["考核表编码"].ToString();
  167. String meterCodeTemp = meterCode;
  168. String lastTime = "";
  169. int isValve = Convert.ToInt32(drMeter["isValve"]);
  170. int nowYear = DateTime.Now.Year;
  171. int lastYear = uploadHis.ContainsKey(meterCode) ? Convert.ToDateTime(uploadHis[meterCode]).Year : nowYear;
  172. for (int k = lastYear; k <= nowYear; k++)
  173. {
  174. string tablename = "历史记录_" + ("000000" + meterId).Substring(meterId.Length, 6) + "_" + k;
  175. // 判断历史记录表是否存在
  176. if (!CheckTableExist(tablename))
  177. {
  178. continue;
  179. }
  180. String sqlMeterHis = "select 记录时间,采集时间,正累计流量,负累计流量,净累计流量,瞬时流量,电池电压,压力,设备状态,通讯状态";
  181. if (isValve == 1) {// 阀控的情况
  182. sqlMeterHis += ",开度,运行模式,手动开度设定值,压力量程设定,常用压力设定上限,步进间隔,常用压力设定下限,步进刻度";
  183. }
  184. if(isValve == 2) { // 控阀控泵的情况
  185. sqlMeterHis += ",[运行模式],[阀1开到位延时],[阀2开到位延时],[阀3开到位延时],[真空泵开启时间],[排气间隔],[控制方式],[真空泵故障],[阀1状态],[阀2状态],[阀3状态]";
  186. }
  187. if (isValve == 3) {
  188. sqlMeterHis += ",阀门状态";
  189. }
  190. sqlMeterHis +=" from " + tablename;
  191. if (uploadHis.ContainsKey(meterCode)) // 添加是否在线的判断
  192. {
  193. sqlMeterHis += " where 设备状态 = '全部正常' AND 通讯状态 = '全部正常' AND 采集时间 > '" + uploadHis[meterCode] + "'";
  194. // sqlMeterHis += " where 采集时间 > '" + uploadHis[meterCode] + "'";
  195. }
  196. else { // 添加是否在线的判断
  197. sqlMeterHis += " WHERE 设备状态 = '全部正常' AND 通讯状态 = '全部正常'";
  198. }
  199. sqlMeterHis += " order by 采集时间";
  200. DataTable dtMeterHis = dbHelper.Fill(sqlMeterHis);
  201. StringBuilder message = new StringBuilder();
  202. for (int j = 0; j < dtMeterHis.Rows.Count; j++)
  203. {
  204. message.Clear();
  205. try
  206. {
  207. DataRow drMeterHis = dtMeterHis.Rows[j];
  208. String getDateTime = Convert.ToDateTime(drMeterHis["采集时间"]).ToString("yyyy-MM-dd HH:mm:ss");
  209. if (!(meterId == "625" || meterId == "633"))
  210. {
  211. message.Append("{");
  212. message.Append("\"meterAssessmentCode\": \"").Append(meterCode).Append("\",");
  213. message.Append("\"manufacturerCode\": ").Append(Constants.ManufacturerCode).Append(",");
  214. message.Append("\"getDateTime\": \"").Append(getDateTime).Append("\",");
  215. if (isValve == 1)
  216. {
  217. if (Convert.DBNull != drMeterHis["开度"])
  218. {
  219. message.Append("\"valveOpening\": ").Append(Convert.ToDecimal(drMeterHis["开度"])).Append(",");
  220. }
  221. if (Convert.DBNull != drMeterHis["运行模式"])
  222. {
  223. message.Append("\"operaOption\": ").Append(Convert.ToDecimal(drMeterHis["运行模式"])).Append(",");
  224. }
  225. if (Convert.DBNull != drMeterHis["手动开度设定值"])
  226. {
  227. message.Append("\"autoOpingVal\": ").Append(Convert.ToDecimal(drMeterHis["手动开度设定值"])).Append(",");
  228. }
  229. if (Convert.DBNull != drMeterHis["压力量程设定"])
  230. {
  231. message.Append("\"pressureRange\": ").Append(Convert.ToDecimal(drMeterHis["压力量程设定"])).Append(",");
  232. }
  233. if (Convert.DBNull != drMeterHis["常用压力设定上限"])
  234. {
  235. message.Append("\"comPressureVal\": ").Append(Convert.ToDecimal(drMeterHis["常用压力设定上限"])).Append(",");
  236. }
  237. if (Convert.DBNull != drMeterHis["步进间隔"])
  238. {
  239. message.Append("\"changeTime\": ").Append(Convert.ToDecimal(drMeterHis["步进间隔"])).Append(",");
  240. }
  241. if (Convert.DBNull != drMeterHis["常用压力设定下限"])
  242. {
  243. message.Append("\"comPressureValDown\": ").Append(Convert.ToDecimal(drMeterHis["常用压力设定下限"])).Append(",");
  244. }
  245. if (Convert.DBNull != drMeterHis["步进刻度"])
  246. {
  247. message.Append("\"stepInterval\": ").Append(Convert.ToDecimal(drMeterHis["步进刻度"])).Append(",");
  248. }
  249. }
  250. if(isValve == 2) { // 控阀控泵
  251. if (Convert.DBNull != drMeterHis["运行模式"])
  252. {
  253. message.Append("\"OperaOption\": ").Append(drMeterHis["运行模式"]).Append(",");
  254. }
  255. if (Convert.DBNull != drMeterHis["阀1开到位延时"])
  256. {
  257. message.Append("\"valveOneOpenDelayed\": ").Append(Convert.ToDecimal(drMeterHis["阀1开到位延时"])).Append(",");
  258. }
  259. if (Convert.DBNull != drMeterHis["阀2开到位延时"])
  260. {
  261. message.Append("\"valveTwoOpenDelayed\": ").Append(Convert.ToDecimal(drMeterHis["阀2开到位延时"])).Append(",");
  262. }
  263. if (Convert.DBNull != drMeterHis["阀3开到位延时"])
  264. {
  265. message.Append("\"valveThreeOpenDelayed\": ").Append(Convert.ToDecimal(drMeterHis["阀3开到位延时"])).Append(",");
  266. }
  267. if (Convert.DBNull != drMeterHis["真空泵开启时间"])
  268. {
  269. message.Append("\"vacuumPumpOpenTime\": ").Append(Convert.ToDecimal(drMeterHis["真空泵开启时间"])).Append(",");
  270. }
  271. if (Convert.DBNull != drMeterHis["排气间隔"])
  272. {
  273. message.Append("\"exhaustTime\": ").Append(Convert.ToDecimal(drMeterHis["排气间隔"])).Append(",");
  274. }
  275. if (Convert.DBNull != drMeterHis["控制方式"])
  276. {
  277. message.Append("\"runModule\": \"").Append(drMeterHis["控制方式"]).Append("\",");
  278. }
  279. if (Convert.DBNull != drMeterHis["真空泵故障"])
  280. {
  281. message.Append("\"vacuumPumpFault\": \"").Append(drMeterHis["真空泵故障"]).Append("\",");
  282. }
  283. if (Convert.DBNull != drMeterHis["阀1状态"])
  284. {
  285. message.Append("\"valveOneState\": \"").Append(drMeterHis["阀1状态"]).Append("\",");
  286. }
  287. if (Convert.DBNull != drMeterHis["阀2状态"])
  288. {
  289. message.Append("\"valveTwoState\": \"").Append(drMeterHis["阀2状态"]).Append("\",");
  290. }
  291. if (Convert.DBNull != drMeterHis["阀3状态"])
  292. {
  293. message.Append("\"valveThreeState\": \"").Append(drMeterHis["阀3状态"]).Append("\"");
  294. }
  295. }
  296. if (isValve == 3)// 带阀控的大表
  297. {
  298. if (Convert.DBNull != drMeterHis["阀门状态"])
  299. {
  300. message.Append("\"valveOneState\": \"").Append(drMeterHis["阀门状态"]).Append("\",");
  301. }
  302. }
  303. if (Convert.DBNull != drMeterHis["净累计流量"])
  304. {
  305. message.Append("\"netCumulativeFlow\": ").Append(Convert.ToDecimal(drMeterHis["净累计流量"])).Append(",");
  306. }
  307. if (Convert.DBNull != drMeterHis["正累计流量"])
  308. {
  309. message.Append("\"positiveCumulativeFlow\": ").Append(Convert.ToDecimal(drMeterHis["正累计流量"])).Append(",");
  310. }
  311. if (Convert.DBNull != drMeterHis["负累计流量"])
  312. {
  313. message.Append("\"negativeCumulativeFlow\": ").Append(Convert.ToDecimal(drMeterHis["负累计流量"])).Append(",");
  314. }
  315. if (Convert.DBNull != drMeterHis["瞬时流量"])
  316. {
  317. message.Append("\"instantaneousFlow\": ").Append(Convert.ToDecimal(drMeterHis["瞬时流量"])).Append(",");
  318. }
  319. if (Convert.DBNull != drMeterHis["压力"])
  320. {
  321. message.Append("\"pressure\": ").Append(Convert.ToDecimal(drMeterHis["压力"])).Append(",");
  322. }
  323. if (Convert.DBNull != drMeterHis["电池电压"])
  324. {
  325. message.Append("\"batteryVoltageValue\": ").Append(Convert.ToDecimal(drMeterHis["电池电压"]));
  326. }
  327. //int isOnline = 0; // 0 不在线 1 在线
  328. //if(drMeterHis["设备状态"] == "全部正常" && drMeterHis["通讯状态"] == "全部正常")
  329. //{
  330. // isOnline = 1;
  331. //}
  332. //message.Append("\"isOnline\": ").Append(isOnline).Append("");
  333. message.Append("}");
  334. }
  335. else {
  336. if(meterId == "625") {
  337. message.Append("{");
  338. message.Append("\"meterAssessmentCode\": \"").Append(meterCode).Append("\",");
  339. message.Append("\"manufacturerCode\": ").Append(Constants.ManufacturerCode).Append(",");
  340. message.Append("\"getDateTime\": \"").Append(getDateTime).Append("\",");
  341. if (Convert.DBNull != drMeterHis["压力"])
  342. {
  343. message.Append("\"pressure\": ").Append(Convert.ToDecimal(drMeterHis["压力"])).Append(",");
  344. }
  345. if (Convert.DBNull != drMeterHis["电池电压"])
  346. {
  347. message.Append("\"batteryVoltageValue\": ").Append(Convert.ToDecimal(drMeterHis["电池电压"]));
  348. }
  349. message.Append("}");
  350. String str = message.ToString();
  351. foreach (KeyValuePair<string, IModel> item in channels)
  352. {
  353. string key = item.Key;
  354. IModel channel = item.Value;
  355. IBasicProperties property = properties[key];
  356. channel.BasicPublish("zone.deviceHis", "", property, Encoding.UTF8.GetBytes(str)); //生产消息
  357. }
  358. message.Clear();
  359. if(meterId == "625") {
  360. meterCode = "jingshan015";
  361. }
  362. else {
  363. continue;
  364. }
  365. message.Append("{");
  366. message.Append("\"meterAssessmentCode\": \"").Append(meterCode).Append("\",");
  367. message.Append("\"manufacturerCode\": ").Append(Constants.ManufacturerCode).Append(",");
  368. message.Append("\"getDateTime\": \"").Append(getDateTime).Append("\",");
  369. if (Convert.DBNull != drMeterHis["净累计流量"])
  370. {
  371. message.Append("\"netCumulativeFlow\": ").Append(Convert.ToDecimal(drMeterHis["净累计流量"])).Append(",");
  372. }
  373. if (Convert.DBNull != drMeterHis["正累计流量"])
  374. {
  375. message.Append("\"positiveCumulativeFlow\": ").Append(Convert.ToDecimal(drMeterHis["正累计流量"])).Append(",");
  376. }
  377. if (Convert.DBNull != drMeterHis["负累计流量"])
  378. {
  379. message.Append("\"negativeCumulativeFlow\": ").Append(Convert.ToDecimal(drMeterHis["负累计流量"])).Append(",");
  380. }
  381. if (Convert.DBNull != drMeterHis["瞬时流量"])
  382. {
  383. message.Append("\"instantaneousFlow\": ").Append(Convert.ToDecimal(drMeterHis["瞬时流量"])).Append(",");
  384. }
  385. if (Convert.DBNull != drMeterHis["电池电压"])
  386. {
  387. message.Append("\"batteryVoltageValue\": ").Append(Convert.ToDecimal(drMeterHis["电池电压"]));
  388. }
  389. message.Append("}");
  390. }
  391. else if(meterId == "633") {
  392. continue;
  393. }
  394. }
  395. foreach (KeyValuePair<string, IModel> item in channels)
  396. {
  397. string key = item.Key;
  398. IModel channel = item.Value;
  399. IBasicProperties property = properties[key];
  400. channel.BasicPublish("zone.deviceHis", "", property, Encoding.UTF8.GetBytes(message.ToString())); //生产消息
  401. }
  402. lastTime = getDateTime;
  403. meterCode = meterCodeTemp;
  404. }
  405. catch (Exception ex)
  406. {
  407. log.Info("大表设备历史记录同步任务数据推送失败:" + message.ToString() + "\r\n");
  408. log.Error(ex.Message + "===========" + ex.StackTrace + "\r\n");
  409. }
  410. }
  411. }
  412. if (!"".Equals(lastTime))
  413. {
  414. uploadHis[meterCode] = lastTime;
  415. uploadHis[meterCodeTemp] = lastTime;
  416. }
  417. }
  418. SavaUploadHis(uploadHis);
  419. log.Info("大表设备历史记录同步任务执行结束.................\r\n");
  420. }
  421. catch (Exception ex)
  422. {
  423. log.Error("大表设备历史记录同步任务执行错误:" + ex.Message + "===========" + ex.StackTrace + "\r\n");
  424. }
  425. }
  426. /// <summary>
  427. /// 更新配置文件中的值
  428. /// </summary>
  429. /// <param name="key">键</param>
  430. /// <param name="value">值</param>
  431. private void UpdateAppConfig(String key, String value)
  432. {
  433. var cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
  434. cfg.AppSettings.Settings[key].Value = value;
  435. cfg.Save();
  436. ConfigurationManager.RefreshSection("appSettings");
  437. }
  438. /// <summary>
  439. /// 判断历史记录表是否存在
  440. /// </summary>
  441. /// <param name="tablename"></param>
  442. /// <returns></returns>
  443. private bool CheckTableExist(string tablename)
  444. {
  445. DataTable table = dbHelper.Fill("select top 1 * from sysobjects where name='" + tablename + "' and xtype='u'");
  446. if (table == null || table.Rows.Count == 0)
  447. {
  448. return false;
  449. }
  450. return true;
  451. }
  452. /// <summary>
  453. /// 保存每块块表的上传最后一条历史记录
  454. /// </summary>
  455. /// <param name="uploadHis"></param>
  456. private void SavaUploadHis(Dictionary<String, String> uploadHis)
  457. {
  458. // 清除之前的内容
  459. FileStream stream = File.Open(@"TextFile1.txt", FileMode.OpenOrCreate, FileAccess.Write);
  460. stream.Seek(0, SeekOrigin.Begin);
  461. stream.SetLength(0);
  462. stream.Close();
  463. using (StreamWriter sw = new StreamWriter(@"TextFile1.txt"))
  464. {
  465. foreach (var item in uploadHis)
  466. {
  467. sw.WriteLine(item.Key + "," + item.Value);
  468. }
  469. }
  470. }
  471. static IDbProvider dbHelper
  472. {
  473. get
  474. {
  475. var DbDefine = DbFactoryProvider.GetProvider(CurrentDbType.SqlServer, Constants.DbConncetion);
  476. return DbDefine;
  477. }
  478. }
  479. }
  480. }