reportHMPData.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Collections;
  9. using Infragistics.Win.UltraWinGrid;
  10. using CoreFS.CA06;
  11. using Core.Mes.Client.Common;
  12. namespace Core.LgMes.Client.Report
  13. {
  14. public partial class reportHMPData : frmStyleBase
  15. {
  16. bool bFirst = false; //在页面Load事件中调用proc_Query()则true,否则false
  17. public reportHMPData()
  18. {
  19. InitializeComponent();
  20. }
  21. private void reportHMPData_Load(object sender, EventArgs e)
  22. {
  23. ultraDateTimeEditor1.DateTime = DateTime.Today;
  24. ultraDateTimeEditor2.DateTime = DateTime.Today;
  25. reportCommon.SetUltraGridColumnsReadOnly(ref this.ultraGrid1);
  26. }
  27. private void proc_setButtonEnable(bool bEnabled)
  28. {
  29. }
  30. private void proc_Query()
  31. {
  32. if (!bFirst)
  33. {
  34. proc_setButtonEnable(false);
  35. Application.DoEvents();
  36. }
  37. try
  38. {
  39. if (ultraDateTimeEditor1.DateTime.Date > ultraDateTimeEditor2.DateTime.Date)
  40. {
  41. MessageBox.Show("查询开始日期不能大于结束日期!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  42. return;
  43. }
  44. string strEquipmentNo = "";
  45. string strMolirnSource = "";
  46. string strShiftCode = "";
  47. string strShiftCBB = "";
  48. if (cbPos.Checked && cbbPos.SelectedIndex > -1)
  49. {
  50. //strEquipmentNo = Convert.ToString(cbbPos.SelectedIndex + 1);
  51. switch (cbbPos.Text.Trim())
  52. {
  53. case"1#脱硫":
  54. strEquipmentNo = "1";
  55. strMolirnSource = "K";
  56. break;
  57. case "2#脱硫":
  58. strEquipmentNo = "2";
  59. strMolirnSource = "K";
  60. break;
  61. case "1#转炉":
  62. strEquipmentNo = "1";
  63. strMolirnSource = "J";
  64. break;
  65. case "2#转炉":
  66. strEquipmentNo = "2";
  67. strMolirnSource = "J";
  68. break;
  69. }
  70. }
  71. if (chkMolirnSource.Checked && cboMolirnSource.SelectedIndex > -1)
  72. {
  73. //strMolirnSource = Convert.ToString(chkMolirnSource.SelectedIndex + 1);
  74. switch (cboMolirnSource.Text.Trim())
  75. {
  76. case "脱硫":
  77. strMolirnSource = "K";
  78. break;
  79. case "转炉":
  80. strMolirnSource = "J";
  81. break;
  82. }
  83. }
  84. if (cbBC.Checked && cbbBC.SelectedIndex > -1)
  85. {
  86. strShiftCode = Convert.ToString(cbbBC.SelectedIndex + 1);
  87. }
  88. if (cbBB.Checked && cbbBB.SelectedIndex > -1)
  89. {
  90. strShiftCBB = Convert.ToString(cbbBB.SelectedIndex + 1);
  91. }
  92. string sqlstr = this.appendAllSql(ultraDateTimeEditor1.DateTime, ultraDateTimeEditor2.DateTime, strEquipmentNo, strMolirnSource, strShiftCode, strShiftCBB);
  93. DataSet ds = this.returnNewDataSet(Core.Mes.Client.Common.DbCommon.returnDataSet(sqlstr,this.ob));
  94. if (ds != null && ds.Tables.Count > 0)
  95. {
  96. this.dataTable1.Rows.Clear();
  97. if (ds.Tables[0].Rows.Count == 0) return;
  98. DataRow dr;
  99. for (int iRow = 0; iRow < ds.Tables[0].Rows.Count; iRow++)
  100. {
  101. dr = this.dataTable1.NewRow();
  102. for (int jCol = 0; jCol < ds.Tables[0].Columns.Count; jCol++)
  103. {
  104. dr[ds.Tables[0].Columns[jCol].ColumnName] = ds.Tables[0].Rows[iRow][jCol];
  105. }
  106. this.dataTable1.Rows.Add(dr);
  107. }
  108. }
  109. try
  110. {
  111. ArrayList alistColumns = new ArrayList();
  112. ArrayList alistFormat = new ArrayList();
  113. alistColumns.Add("ARRIVEWGT");
  114. alistColumns.Add("LEAVEWGT");
  115. alistColumns.Add("IRONPOTBOFWGT");
  116. alistColumns.Add("DREGSSOLVENT");
  117. alistColumns.Add("DFRWGT");
  118. alistColumns.Add("LIMESTONE");
  119. alistFormat.Add(" {0:############0.0}");
  120. alistFormat.Add(" {0:############0.0}");
  121. alistFormat.Add(" {0:############0.0}");
  122. alistFormat.Add(" {0:############0.0}");
  123. alistFormat.Add(" {0:############0.0}");
  124. alistFormat.Add(" {0:############0.0}");
  125. reportCommon.proc_Statics(ref ultraGrid1, alistColumns, true, " {0:############0.0}");
  126. reportCommon.proc_Statics_Avg2(ref ultraGrid1, alistColumns, false, alistFormat);
  127. }
  128. catch { }
  129. }
  130. catch (Exception ex)
  131. {
  132. MessageBox.Show(ex.Message);
  133. }
  134. finally
  135. {
  136. if (!bFirst)
  137. proc_setButtonEnable(true);
  138. else
  139. bFirst = false;
  140. }
  141. }
  142. private void cbPos_CheckedChanged(object sender, EventArgs e)
  143. {
  144. cbbPos.Enabled = cbPos.Checked;
  145. }
  146. private void cbBC_CheckedChanged(object sender, EventArgs e)
  147. {
  148. cbbBC.Enabled = cbBC.Checked;
  149. }
  150. private void cbBB_CheckedChanged(object sender, EventArgs e)
  151. {
  152. cbbBB.Enabled = cbBB.Checked;
  153. }
  154. public override void ToolBar_Click(object sender, string ToolbarKey)
  155. {
  156. switch (ToolbarKey)
  157. {
  158. case "Query":
  159. {
  160. proc_Query();
  161. break;
  162. }
  163. case "Export":
  164. {
  165. if (!reportCommon.ExcelInstalled()) return;
  166. proc_setButtonEnable(false);
  167. reportCommon.ExportDataWithSaveDialog(ref ultraGrid1, this.Text);
  168. proc_setButtonEnable(true);
  169. break;
  170. }
  171. case "Close":
  172. {
  173. this.Close();
  174. break;
  175. }
  176. }
  177. }
  178. private void uCkEditorForFilter_CheckedChanged(object sender, EventArgs e)
  179. {
  180. reportCommon.SetGridRowFilter(ref this.ultraGrid1, uCkEditorForFilter.Checked);
  181. }
  182. private void uCkEditorStatistics_CheckedChanged(object sender, EventArgs e)
  183. {
  184. reportCommon.SetStatisticsMod(ref this.ultraGrid1, uCkEditorStatistics.Checked, ref uCkEditorStatistics);
  185. }
  186. private void chkMolirnSource_CheckedChanged(object sender, EventArgs e)
  187. {
  188. cboMolirnSource.Enabled = chkMolirnSource.Checked;
  189. }
  190. private string returnSqlstr()
  191. {
  192. return @"select distinct t.misid,
  193. t.stoveid,
  194. t.stovetime,
  195. t.tapholeno,
  196. to_char(b.changestarttime, 'HH24:mi') changestarttime,
  197. round(changestarttime -leavetime ) WaitingTime,
  198. to_char(t.hstapholetime, 'HH24:mi') hstapholetime,
  199. to_char(a.dr_bef_endtime, 'HH24:mi') dr_bef_endtime,
  200. to_char(a.dr_aft_endtime, 'HH24:mi') dr_aft_endtime,
  201. t.BFIRONTEMTURE,
  202. t.IRONTEMPERATURE,
  203. case substr(t.shiftcode, 1, 1)
  204. when '1' then
  205. '白'
  206. when '2' then
  207. '中'
  208. when '3' then
  209. '晚'
  210. end bc,
  211. case substr(t.shiftcode, 2, 1)
  212. when '1' then
  213. '甲'
  214. when '2' then
  215. '乙'
  216. when '3' then
  217. '丙'
  218. when '4' then
  219. '丁'
  220. end bb,
  221. decode(substr(t.molirnsource, 1, 1), 'J', '转炉', '脱硫') molirnsource,
  222. a.hudwid,
  223. round(t.tfpotwgt, 2) arrivewgt,
  224. case
  225. when nvl(a.leavewgt, 0) > 0
  226. and nvl(a.arrivewgt, 0) > 0
  227. and nvl(a.leavewgt, 0) < nvl(a.arrivewgt, 0) then
  228. round(t.tfpotwgt -
  229. (nvl(a.arrivewgt, 0) - nvl(a.leavewgt, 0)), 2)
  230. else
  231. t.tfpotwgt
  232. end leavewgt,
  233. round(t.tfpotwgt - (t.tfpotwgt - (nvl(a.arrivewgt, 0) -
  234. nvl(a.leavewgt, 0))), 2) drquantity,
  235. case
  236. when nvl(a.leavewgt, 0) > 0 then
  237. (nvl(a.leavewgt, 0) - nvl(t4.tareweight, 0))
  238. else
  239. 0
  240. end leavewgt_out,
  241. case
  242. when nvl(a.arrivewgt, 0) > 0 then
  243. (nvl(a.arrivewgt, 0) - nvl(t4.tareweight, 0))
  244. else
  245. 0
  246. end arrivewgt_out,
  247. t4.tareweight ironpotbofwgt,
  248. t.tfpotid || '-' || t4.age ironpwrapno,
  249. case
  250. when b.plansteel is not null then
  251. b.plansteel
  252. else
  253. a.plansteel
  254. end plansteel,
  255. decode(substr(t.molirnsource, 1, 1), 'J', to_char(t.OPERATIONDATE, 'HH24:mi'), to_char(a.arrivetime, 'HH24:mi')) arrivetime,
  256. decode(substr(t.molirnsource, 1, 1), 'J', to_char(t.OPERATIONDATE, 'yyyy-MM-dd HH24:mi'), to_char(a.leavetime, 'yyyy-MM-dd HH24:mi')) leavetime,
  257. a.dr_bef_time,
  258. a.dr_aft_time,
  259. a.swbtemperature,
  260. a.swftemperature,
  261. a.dregssolvent,
  262. a.churnupdate,
  263. a.mostrotatespeed,
  264. a.sggage,
  265. a.dfrwgt,
  266. case
  267. when a.heatno is not null then
  268. a.heatno
  269. when substr(t.molirnsource, 1, 1) = 'J' then
  270. t.molirnsource
  271. end heatno,
  272. t.si si_bf,
  273. t.mn mn_bf,
  274. t.p p_bf,
  275. t.s s_bf,
  276. t2.si,
  277. t2.mn,
  278. t2.p,
  279. t2.s,
  280. t3.si si2,
  281. t3.mn mn2,
  282. t3.p p2,
  283. t3.s s2,
  284. abs(t.Mn - t2.Mn) Mn差,
  285. abs(t.si - t2.si) si差,
  286. abs(t.s - t2.s) S差,
  287. abs(t.p - t2.p) P差,
  288. to_char(t2.assaydate, 'yyyy-MM-dd HH24:mi')assaydate,
  289. '' LIMESTONE,
  290. a.memo";
  291. //to_char(a.arrivetime, 'HH24:mi') arrivetime,
  292. // to_char(a.leavetime, 'HH24:mi') leavetime,
  293. }
  294. private string returnSqlOfStl_mis_importiron(string sqlCondition)
  295. {
  296. string sqlStr = "";
  297. sqlStr = @" from (select * from stl_mis_importiron where 1 = 1 {0}) t,";
  298. return string.Format(sqlStr,sqlCondition);
  299. }
  300. private string returnSqlOfStl_hmp_optinfo(string sqlCondition)
  301. {
  302. string sqlStr = "";
  303. sqlStr = @" (select * from stl_hmp_optinfo where 1 = 1 {0}
  304. union select * from j#stl_hmp_optinfo where 1 = 1 {0}) a,";
  305. return string.Format(sqlStr, sqlCondition);
  306. }
  307. private string returnSqlOfStl_bof_optinfo(string sqlCondition)
  308. {
  309. string sqlStr = "";
  310. sqlStr = @" (select * from stl_bof_optinfo where 1 = 1 {0} union select * from j#stl_bof_optinfo where 1 = 1 {0}) b,";
  311. return string.Format(sqlStr, sqlCondition);
  312. }
  313. private string returnSqlOfStl_chemelement(string sqlCondition)
  314. {
  315. string sqlStr = "";
  316. sqlStr = @"
  317. (select heatno, si,
  318. mn,
  319. p,
  320. s,
  321. assaytypecode
  322. from stl_chemelement
  323. where upper(substr(assaytypecode, 1, 1)) = 'B' {0}
  324. union
  325. select heatno, si,
  326. mn,
  327. p,
  328. s,
  329. assaytypecode
  330. from j#stl_chemelement
  331. where upper(substr(assaytypecode, 1, 1)) = 'B' {0}) t2,";
  332. return string.Format(sqlStr, sqlCondition);
  333. }
  334. private string returnSqlOfStl_chemelement_s(string sqlCondition)
  335. {
  336. string sqlStr = "";
  337. sqlStr = @" (select y.* from (select x.*, row_number() over(partition by x.heatno, substr(assaytypecode, 1, 1) order by x.assaytypecode desc) xh,
  338. substr(assaytypecode, 1, 1) typecode from (select * from stl_chemelement where upper(substr(assaytypecode, 1, 1)) = 'B'
  339. {0} union select * from j#stl_chemelement where upper(substr(assaytypecode, 1, 1)) = 'B' {0}) x) y
  340. where y.xh = 1) t3, dev_ib_base_info t4";
  341. return string.Format(sqlStr, sqlCondition);
  342. }
  343. private string returnSqlOfSqlWhere(string sqlCondition)
  344. {
  345. string sqlStr = "";
  346. sqlStr = @" where 1 = 1and t.molirnsource = a.hudwid(+) and t.molirnsource = b.heatno(+) and t.misid = t2.heatno(+)
  347. and a.hudwid = t3.heatno(+) and t.tfpotid = t4.ladleid(+) {0}";
  348. return string.Format(sqlStr, sqlCondition);
  349. }
  350. private string returnSqlConditionOfDate(string conditionColumn,string startDate,string endDate)
  351. {
  352. string sqlCondition = "";
  353. sqlCondition = " and {0} >= trunc(to_date('{1}','yyyy-mm-dd')) and {0} < trunc(to_date('{2}','yyyy-mm-dd') + 1)";
  354. sqlCondition = string.Format(sqlCondition,conditionColumn,startDate,endDate);
  355. return sqlCondition;
  356. }
  357. private string returnSqlConditionOther(string moSource,string heatStation,string shfitCode,string shiftCodeBb)
  358. {
  359. string sqlStr = "";
  360. sqlStr = @" AND substr(T.MOLIRNSOURCE,3, 1) =
  361. decode('{0}', null, substr(T.MOLIRNSOURCE, 3, 1), '{0}')
  362. and substr(T.MOLIRNSOURCE,1, 1) =
  363. decode('{1}', null, substr(T.MOLIRNSOURCE, 1, 1), '{1}')
  364. and substr(T.SHIFTCODE, 1, 1) =
  365. decode('{2}', null, substr(T.SHIFTCODE, 1, 1), '{2}')
  366. and substr(T.SHIFTCODE, 2, 1) =
  367. decode('{3}', null, substr(T.SHIFTCODE, 2, 1),'{3}')";
  368. sqlStr = string.Format(sqlStr,moSource,heatStation,shfitCode,shiftCodeBb);
  369. return sqlStr;
  370. }
  371. private string appendAllSql(DateTime startDate, DateTime endDate, string moSource, string heatStation, string shfitCode, string shiftCodeBb)
  372. {
  373. string sqlStr = "";
  374. string strStart = startDate.AddDays(-1).ToString("yyyy-MM-dd");
  375. string strEnd = endDate.AddDays(1).ToString("yyyy-MM-dd");
  376. sqlStr += returnSqlstr();
  377. sqlStr += returnSqlOfStl_mis_importiron(returnSqlConditionOfDate("operationdate", startDate.ToString("yyyy-MM-dd"), endDate.ToString("yyyy-MM-dd")));
  378. sqlStr += returnSqlOfStl_hmp_optinfo(returnSqlConditionOfDate("optdate",strStart,strEnd));
  379. sqlStr += returnSqlOfStl_bof_optinfo(returnSqlConditionOfDate("optdate", strStart, strEnd));
  380. sqlStr += returnSqlOfStl_chemelement(returnSqlConditionOfDate("assaydate", strStart, strEnd));
  381. sqlStr += returnSqlOfStl_chemelement_s(returnSqlConditionOfDate("assaydate", strStart, strEnd));
  382. sqlStr += returnSqlOfSqlWhere(returnSqlConditionOther(moSource,heatStation,shfitCode,shiftCodeBb));
  383. sqlStr += " order by t.misid ";
  384. return sqlStr;
  385. }
  386. private DataSet returnBofDs(string sqlCondtion)
  387. {
  388. DataSet ds = new DataSet();
  389. try
  390. {
  391. ds = Core.Mes.Client.Common.DbCommon.returnDataSet(Core.LgMes.Client.lgBll.lgResMgt.CommonAtomForLgResMgt.returnSqlOfStl_Bof_Optinfo(sqlCondtion),this.ob);
  392. }
  393. catch
  394. {
  395. }
  396. return ds;
  397. }
  398. private string returnAllHeatNo(DataSet ds,string tbColumn)
  399. {
  400. string sqlWhere = "";
  401. try
  402. {
  403. if (ds != null & ds.Tables.Count > 0)
  404. {
  405. foreach (DataRow dr in ds.Tables[0].Rows)
  406. {
  407. if (dr[tbColumn.ToUpper()].ToString().Length > 0)
  408. sqlWhere += string.Format(" {1} = '{0}'", dr[tbColumn.ToUpper()].ToString(), tbColumn) + " or ";
  409. }
  410. }
  411. }
  412. catch
  413. {
  414. }
  415. if (sqlWhere.Length > 0)
  416. {
  417. sqlWhere = " and (" + sqlWhere + " 1 = 2 )";
  418. }
  419. return sqlWhere;
  420. }
  421. private DataSet returnHmpDs(string sqlCondtion)
  422. {
  423. DataSet ds = new DataSet();
  424. try
  425. {
  426. ds = Core.Mes.Client.Common.DbCommon.returnDataSet(Core.LgMes.Client.lgBll.lgResMgt.CommonAtomForLgResMgt.returnSqlOfStl_Hmp_Optinfo(sqlCondtion),this.ob);
  427. }
  428. catch
  429. {
  430. }
  431. return ds;
  432. }
  433. private double returnHmpDataInfo(string vHuwid,DataSet dsSource)
  434. {
  435. double result = 0;
  436. if (vHuwid.Trim().Length == 0)
  437. return result;
  438. string rowFilter = string.Format("HUDWID = '{0}'", vHuwid);
  439. DataRow[] drTemp = dsSource.Tables[0].Select(rowFilter);
  440. try
  441. {
  442. if (drTemp.Length > 0)
  443. result = Convert.ToDouble(drTemp[0]["LIMESTONE"]);
  444. }
  445. catch
  446. {
  447. }
  448. return result;
  449. }
  450. private ArrayList returnHuwid(DataSet ds)
  451. {
  452. ArrayList list = new ArrayList();
  453. if (lgCommon.isDataSetDataFoundCheck(ds))
  454. {
  455. foreach (DataRow dr in ds.Tables[0].Rows)
  456. {
  457. if (dr["HUDWID"].ToString().Length > 0)
  458. {
  459. list.Add(dr["HUDWID"].ToString());
  460. }
  461. }
  462. }
  463. return list;
  464. }
  465. private DataSet returnHuwidByList(DataSet dsSource)
  466. {
  467. DataSet ds = null;
  468. try
  469. {
  470. ds = Core.LgMes.Client.lgBll.lgResMgt.CommonAtomStlHmpMgt.returnDsOfHmpInfo(new ClientParamWithSqlConditionAndOpenBase(lgCommon.returnSqlWhereConditionByColumnListAndColumnName(returnHuwid(dsSource), "HUDWID"), this.ob));
  471. }
  472. catch
  473. {
  474. }
  475. return ds;
  476. }
  477. private DataSet returnNewDataSet(DataSet ds)
  478. {
  479. DataSet dsReturn = new DataSet();
  480. if (ds != null & ds.Tables.Count > 0)
  481. {
  482. if (ds.Tables[0].Rows.Count == 0)
  483. return dsReturn;
  484. dsReturn = ds.Copy();
  485. DataSet dsBof = this.returnBofDs(this.returnAllHeatNo(dsReturn, "HEATNO"));
  486. DataSet dsHmp = returnHuwidByList(returnHuwidByList(ds));
  487. foreach (DataRow dr in dsReturn.Tables[0].Rows)
  488. {
  489. try
  490. {
  491. try
  492. {
  493. dr["LIMESTONE"] = "" + returnHmpDataInfo(dr["HUDWID"].ToString(), dsHmp);
  494. }
  495. catch
  496. { }
  497. string rowFilter = string.Format("HEATNO = '{0}'", dr["HEATNO"].ToString());
  498. DataRow[] drTemp = dsBof.Tables[0].Select(rowFilter);
  499. dr["PLANSTEEL"] = drTemp[0]["PLANSTEEL"];
  500. DateTime dateTime = Convert.ToDateTime(drTemp[0]["CHANGESTARTTIME"]);
  501. dr["CHANGESTARTTIME"] = dateTime.ToString("HH:mm");
  502. DateTime leavetime = Convert.ToDateTime(dr["LEAVETIME"]);
  503. dr["WaitingTime"] = returnTimeSubByDifferentTimeDate(dateTime, leavetime);
  504. //dr["CHANGESTARTTIME"] = dateTime.ToString();
  505. dr["LEAVETIME"] = leavetime.ToString("HH:mm");
  506. }
  507. catch
  508. {
  509. }
  510. }
  511. }
  512. return dsReturn;
  513. }
  514. /// <summary>
  515. /// 计算两个时间差(分钟)
  516. /// </summary>
  517. /// <param name="dt1"></param>
  518. /// <param name="dt2"></param>
  519. /// <returns></returns>
  520. public double returnTimeSubByDifferentTimeDate(System.DateTime dt1, System.DateTime dt2)
  521. {
  522. try
  523. {
  524. TimeSpan ts = dt1.Subtract(dt2);
  525. // string s1 = (Convert.ToSingle(ts.Hours))*60 + Convert.ToSingle(ts.Minutes) +"." + Convert.ToSingle(ts.Seconds);
  526. double s1 = (Convert.ToSingle(ts.Hours)) * 60 + Convert.ToSingle(ts.Minutes) + (Convert.ToSingle(ts.Seconds)/60);
  527. double result = Convert.ToDouble(s1); ;
  528. return Math.Round(s1);
  529. // return Math.Round(result);
  530. }
  531. catch
  532. {
  533. return 0;
  534. }
  535. }
  536. }
  537. }