reportInput.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using System.Collections;
  11. using Core.Mes.Client.Comm.Control;
  12. using Core.Mes.Client.Comm.Tool;
  13. using Core.Mes.Client.Comm.Server;
  14. using Core.StlMes.Client.YdmStuffManage;
  15. using Core.StlMes.Client.YdmStuffReport.Entity;
  16. using Infragistics.Win.UltraWinGrid;
  17. namespace Core.StlMes.Client.YdmStuffReport
  18. {
  19. public partial class reportInput : FrmBase
  20. {
  21. public reportInput()
  22. {
  23. InitializeComponent();
  24. }
  25. ArrayList alistChecked = null;
  26. private string[] arr = null;//仓库权限
  27. private string[] belongArr = null;//所属权
  28. private void reportInput_Load(object sender, EventArgs e)
  29. {
  30. RegStartTime.Value = DateTime.Parse(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString());
  31. DateTime d1 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
  32. RegEndTime.Value = DateTime.Parse(d1.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd") + " 23:59:59");
  33. dataYearMoth.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM"));
  34. EntityHelper.ShowGridCaption<YdmGpInlistEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  35. arr = BaseMethod.WarehousePermissionsStore(this.ValidDataPurviewIds,ob);
  36. belongArr = this.ValidDataPurviewIds;
  37. switch (this.CustomInfo)
  38. {
  39. case "BELONG_CODE":
  40. this.ultraGrid1.DisplayLayout.Bands[0].Columns["JudgeResultCode"].Hidden = true;
  41. this.ultraGrid1.DisplayLayout.Bands[0].Columns["OrderNo"].Hidden = true;
  42. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CHK"].Hidden = true;
  43. this.ultraGrid1.DisplayLayout.Bands[0].Columns["InstockDoc"].Hidden = true;
  44. break;
  45. case "STORAGE_NO":
  46. ultraGrid1.DisplayLayout.Bands[0].Columns["ProOrderNo"].Hidden = true;
  47. ultraGrid1.DisplayLayout.Bands[0].Columns["Producname"].Hidden = true;
  48. ultraGrid1.DisplayLayout.Bands[0].Columns["Steelname"].Hidden = true;
  49. ultraGrid1.DisplayLayout.Bands[0].Columns["IsDealer"].Hidden = true;
  50. break;
  51. }
  52. try
  53. {
  54. alistChecked = new ArrayList();
  55. alistChecked.Add("StoveNo");
  56. alistChecked.Add("JudgeStoveNo");
  57. alistChecked.Add("MaterialName");
  58. alistChecked.Add("ActLen");
  59. alistChecked.Add("JudgeResultCode");
  60. alistChecked.Add("SoureName");
  61. alistChecked.Add("Dimater");
  62. alistChecked.Add("Gradename");
  63. alistChecked.Add("ProOrderNo");
  64. alistChecked.Add("StorageName");
  65. alistChecked.Add("LocationName");
  66. alistChecked.Add("InBc");
  67. alistChecked.Add("InBz");
  68. alistChecked.Add("InTimeF");
  69. alistChecked.Add("BelongName");
  70. alistChecked.Add("CreateName");
  71. }
  72. catch { }
  73. try
  74. {
  75. ArrayList alist = new ArrayList();
  76. alist.Add("ActCount");
  77. alist.Add("ActWeight");
  78. CommonMethod.GeneralCheckedListboxItems(ref this.myCheckedListBox1, ref this.ultraGrid1, alist, alistChecked);
  79. }
  80. catch { }
  81. }
  82. /// <summary>
  83. /// 重写基类方法
  84. /// </summary>
  85. /// <param name="sender"></param>
  86. /// <param name="ToolbarKey"></param>
  87. public override void ToolBar_Click(object sender, string ToolbarKey)
  88. {
  89. switch (ToolbarKey)
  90. {
  91. case "Query":
  92. QueryData();
  93. break;
  94. case "Print":
  95. print();
  96. break;
  97. case "Export":
  98. ExportData();
  99. break;
  100. case "Close":
  101. this.Close();
  102. break;
  103. }
  104. }
  105. /// <summary>
  106. /// 查询
  107. /// </summary>
  108. private void QueryData()
  109. {
  110. List<YdmGpInlistEntity> listSource = null;
  111. if (this.chkStoveNo.Checked && string.IsNullOrEmpty(this.txtStoveNo.Text))
  112. {
  113. MessageUtil.ShowTips("请输入炉号!");
  114. this.txtStoveNo.Focus();
  115. return;
  116. }
  117. string stoveNo = "";
  118. string judegeNo = "";
  119. string startTim = "";
  120. string endTim = "";
  121. string bathYear = "";
  122. ArrayList list = new ArrayList();
  123. string strSql = "";
  124. string strGroup = "";
  125. string strOut = "";
  126. if (chkInputTim.Checked)
  127. {
  128. startTim = this.RegStartTime.Value.ToString();
  129. endTim = this.RegEndTime.Value.ToString();
  130. strOut += " and t.INSTOCK_TIME >= to_date('" + startTim + "', 'yyyy-MM-dd HH24:mi:ss') and t.INSTOCK_TIME < to_date('" + endTim + "', 'yyyy-MM-dd HH24:mi:ss')";
  131. }
  132. if (chkJudgeNo.Checked)
  133. {
  134. judegeNo = this.txtJudgeNo.Text;
  135. strOut += " and t.JUDGE_STOVE_NO ='" + judegeNo + "'";
  136. }
  137. if (chkStoveNo.Checked)
  138. {
  139. stoveNo = this.txtStoveNo.Text;
  140. strOut += " and t.STOVE_NO ='" + stoveNo + "'";
  141. }
  142. if (chkYearMoth.Checked)
  143. {
  144. bathYear = this.dataYearMoth.Value.ToString("yyyyMM");
  145. strOut += " and t.BAL_YEAR_MONTH ='" + bathYear + "'";
  146. }
  147. string strKey = "";
  148. CheckBox item;
  149. for (int i = 0; i < this.myCheckedListBox1.Controls.Count; i++)
  150. {
  151. try
  152. {
  153. item = this.myCheckedListBox1.Controls[i] as CheckBox;
  154. if (item != null && item.Checked)
  155. {
  156. strKey = item.Name;
  157. if (strKey.Equals("StoveNo"))
  158. {
  159. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.STOVE_NO";
  160. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.STOVE_NO";
  161. }
  162. else if (strKey.Equals("JudgeStoveNo"))
  163. {
  164. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.JUDGE_STOVE_NO";
  165. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.JUDGE_STOVE_NO";
  166. }
  167. else if (strKey.Equals("InstockTypeName"))
  168. {
  169. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.INSTOCK_TYPE_NAME";
  170. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.INSTOCK_TYPE_NAME";
  171. }
  172. else if (strKey.Equals("MaterialName"))
  173. {
  174. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.MATERIAL_NAME";
  175. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.MATERIAL_NAME";
  176. }
  177. else if (strKey.Equals("Gradename"))
  178. {
  179. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.GRADENAME";
  180. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.GRADENAME";
  181. }
  182. else if (strKey.Equals("StdName"))
  183. {
  184. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.STD_NAME";
  185. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.STD_NAME";
  186. }
  187. else if (strKey.Equals("Dimater"))
  188. {
  189. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.DIMATER";
  190. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.DIMATER";
  191. }
  192. else if (strKey.Equals("FixNum"))
  193. {
  194. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.FIX_NUM";
  195. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.FIX_NUM";
  196. }
  197. else if (strKey.Equals("FixLen"))
  198. {
  199. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.FIX_LEN";
  200. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.FIX_LEN";
  201. }
  202. else if (strKey.Equals("ActLen"))
  203. {
  204. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.ACT_LEN";
  205. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.ACT_LEN";
  206. }
  207. else if (strKey.Equals("StorageName"))
  208. {
  209. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "s.STORAGE_NAME";
  210. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "s.STORAGE_NAME";
  211. }
  212. else if (strKey.Equals("LocationName"))
  213. {
  214. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "(SELECT T1.LOCATION_NAME FROM YDM_BS_LOCATION T1 WHERE T1.LOCATION_NO = T.LOCATION_NO)LOCATION_NAME";
  215. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T.LOCATION_NO";
  216. }
  217. else if (strKey.Equals("CreateName"))
  218. {
  219. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.CREATE_NAME";
  220. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.CREATE_NAME";
  221. }
  222. else if(strKey.Equals("SoureName"))
  223. {
  224. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.SOURE_NAME";
  225. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.SOURE_NAME";
  226. }
  227. else if (strKey.Equals("BelongName"))
  228. {
  229. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.BELONG_NAME";
  230. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.BELONG_NAME";
  231. }
  232. else if (strKey.Equals("PlineName"))
  233. {
  234. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.PLINE_NAME";
  235. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.PLINE_NAME";
  236. }
  237. else if (strKey.Equals("InTimeF"))
  238. {
  239. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "to_char(t.IN_TIME_F,'YYYY-MM-DD HH24:MI:SS') as IN_TIME_F";
  240. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.IN_TIME_F";
  241. }
  242. else if (strKey.Equals("InstockTimeS"))
  243. {
  244. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(to_char(t.IN_TIME_F,'YYYY-MM-DD')) as INSTOCK_TIME_S";
  245. }
  246. else if (strKey.Equals("BalYearMonth"))
  247. {
  248. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.BAL_YEAR_MONTH";
  249. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.BAL_YEAR_MONTH";
  250. }
  251. else if (strKey.Equals("InBc"))
  252. {
  253. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(t.IN_BC,'1','早','2','中','3','夜')IN_BC";
  254. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.IN_BC";
  255. }
  256. else if (strKey.Equals("InBz"))
  257. {
  258. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(t.IN_BZ ,'1','甲','2','乙','3','丙','4','丁')IN_BZ";
  259. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.IN_BZ";
  260. }
  261. else if (strKey.Equals("JudgeResultCode"))
  262. {
  263. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX((SELECT (SELECT S1.BASENAME FROM COM_BASE_INFO S1 WHERE S1.BASECODE = Q.JUDGE_RESULT_CODE) JUDGE_RESULT_CODE FROM QCM_GP_JUDGE_APPLY Q WHERE Q.STOVE_NO = T.STOVE_NO AND Q.JUDGE_STOVE_NO = T.JUDGE_STOVE_NO AND Q.MULTIPLE_NUM = T.FIX_NUM AND Q.IS_FLAG = '0' AND Q.VALIDFLAG = '20' GROUP BY Q.STOVE_NO,Q.JUDGE_STOVE_NO,Q.MULTIPLE_NUM,Q.JUDGE_RESULT_CODE))JUDGE_RESULT_CODE";
  264. }
  265. else if (strKey.Equals("ProOrderNo"))
  266. {
  267. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.PRO_ORDER_NO";
  268. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.PRO_ORDER_NO";
  269. }
  270. else if (strKey.Equals("Producname"))
  271. {
  272. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "S1.PRODUCNAME";
  273. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.PRODUCNAME";
  274. }
  275. else if (strKey.Equals("Steelname"))
  276. {
  277. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "S1.STEELNAME";
  278. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.STEELNAME";
  279. }
  280. else if (strKey.Equals("OutstockTime"))
  281. {
  282. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "to_char(t.OUTSTOCK_TIME,'YYYY-MM-DD HH24:MI:SS') as OUTSTOCK_TIME";
  283. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.OUTSTOCK_TIME";
  284. }
  285. else if (strKey.Equals("OrderNo"))
  286. {
  287. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.ORDER_NO";
  288. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.ORDER_NO";
  289. }else if(strKey.Equals("IsDealer"))
  290. {
  291. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(T.IS_DEALER,'0','自用','1','双经销','2','来料加工','3','定销订购','4','库存商备坯')IS_DEALER";
  292. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T.IS_DEALER";
  293. }
  294. else if (strKey.Equals("InstockDoc"))
  295. {
  296. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t.INSTOCK_DOC";
  297. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t.INSTOCK_DOC";
  298. }
  299. else if (strKey.Equals("CHK"))
  300. {
  301. }
  302. else if (strKey.Equals("CgHtTh"))
  303. {
  304. }
  305. else
  306. {
  307. strSql += (string.IsNullOrEmpty(strSql) ? "t." : ",t.") + strKey;
  308. strGroup += (string.IsNullOrEmpty(strGroup) ? "t." : ",t.") + strKey;
  309. }
  310. }
  311. }
  312. catch { }
  313. }
  314. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",");
  315. if (string.IsNullOrEmpty(strGroup))
  316. {
  317. //strGroup = (string.IsNullOrEmpty(strGroup) ? "" : "group by ") + strGroup + " ORDER BY T.IN_TIME_F DESC";
  318. strGroup = (string.IsNullOrEmpty(strGroup) ? "" : "group by ") + strGroup;
  319. }else
  320. {
  321. //strGroup = (string.IsNullOrEmpty(strGroup) ? "" : "group by ") + strGroup + " ,T.IN_TIME_F ORDER BY T.IN_TIME_F DESC";
  322. strGroup = (string.IsNullOrEmpty(strGroup) ? "" : "group by ") + strGroup;
  323. }
  324. string _sql = strOut + strGroup;
  325. list.Add(strSql);
  326. list.Add(strOut);
  327. list.Add(strGroup);
  328. switch (this.CustomInfo)
  329. {
  330. case "STORAGE_NO":
  331. listSource = EntityHelper.GetData<YdmGpInlistEntity>(
  332. "Core.LgMes.Server.Stuffmanage.Report.FrmReportInput.doQueryData", new object[] { list, arr }, this.ob);
  333. break;
  334. case"BELONG_CODE":
  335. listSource = EntityHelper.GetData<YdmGpInlistEntity>(
  336. "Core.LgMes.Server.Stuffmanage.Report.FrmReportInput.doQueryDataBelong", new object[] { list, belongArr }, this.ob);
  337. break;
  338. }
  339. YdmGpInlistEntitybindingSource.DataSource = listSource;
  340. bool bContains = false, bChecked = false;
  341. for (int i = 0; i < this.ultraGrid1.DisplayLayout.Bands[0].Columns.Count; i++)
  342. {
  343. try
  344. {
  345. bContains = false;
  346. strKey = this.ultraGrid1.DisplayLayout.Bands[0].Columns[i].Key;
  347. for (int j = 0; j < this.myCheckedListBox1.Controls.Count; j++)
  348. {
  349. try
  350. {
  351. item = this.myCheckedListBox1.Controls[j] as CheckBox;
  352. if (item.Name.Equals(strKey))
  353. {
  354. bContains = true;
  355. bChecked = item.Checked;
  356. break;
  357. }
  358. }
  359. catch { }
  360. }
  361. if (bContains)
  362. {
  363. this.ultraGrid1.DisplayLayout.Bands[0].Columns[i].Hidden = !bChecked;
  364. }
  365. }
  366. catch { }
  367. }
  368. this.SetStaticsInfo();
  369. CommonMethod.SetGridSumArea(this.ultraGrid1);
  370. }
  371. private void SetStaticsInfo()
  372. {
  373. try
  374. {
  375. if (this.ultraGrid1.Rows.Count == 0)
  376. {
  377. this.ultraGrid1.DisplayLayout.Bands[0].Summaries.Clear();
  378. }
  379. else
  380. {
  381. ArrayList alist = new ArrayList();
  382. alist.Add("ActCount");
  383. alist.Add("ActWeight");
  384. CommonMethod.SetStaticsInfoSum(ref this.ultraGrid1, alist, true);
  385. }
  386. }
  387. catch { }
  388. }
  389. /// <summary>
  390. /// 导出
  391. /// </summary>
  392. private void ExportData()
  393. {
  394. GridHelper.ulGridToExcel(ultraGrid1, "入库实绩总汇");
  395. }
  396. /// <summary>
  397. /// 全选
  398. /// </summary>
  399. /// <param name="sender"></param>
  400. /// <param name="e"></param>
  401. private void myLinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  402. {
  403. this.myCheckedListBox1.CheckAll();
  404. }
  405. /// <summary>
  406. /// 清除
  407. /// </summary>
  408. /// <param name="sender"></param>
  409. /// <param name="e"></param>
  410. private void myLinkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  411. {
  412. this.myCheckedListBox1.UnCheckAll();
  413. }
  414. /// <summary>
  415. /// 默认
  416. /// </summary>
  417. /// <param name="sender"></param>
  418. /// <param name="e"></param>
  419. private void myLinkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  420. {
  421. CheckBox items;
  422. for (int i = 0; i < this.myCheckedListBox1.Controls.Count; i++)
  423. {
  424. try
  425. {
  426. items = this.myCheckedListBox1.Controls[i] as CheckBox;
  427. if (alistChecked.Contains(items.Name))
  428. {
  429. items.Checked = true;
  430. }
  431. else
  432. {
  433. items.Checked = false;
  434. }
  435. }
  436. catch { }
  437. }
  438. }
  439. private void chkInputTim_CheckedChanged(object sender, EventArgs e)
  440. {
  441. this.RegStartTime.Enabled = this.chkInputTim.Checked;
  442. this.RegEndTime.Enabled = this.chkInputTim.Checked;
  443. }
  444. private void chkStoveNo_CheckedChanged(object sender, EventArgs e)
  445. {
  446. this.txtStoveNo.Enabled = this.chkStoveNo.Checked;
  447. }
  448. private void chkJudgeNo_CheckedChanged(object sender, EventArgs e)
  449. {
  450. this.txtJudgeNo.Enabled = this.chkJudgeNo.Checked;
  451. }
  452. private void chkGroup_CheckedChanged(object sender, EventArgs e)
  453. {
  454. CommonMethod.SetGridGroupBy(ref this.ultraGrid1, this.chkGroup.Checked);
  455. CommonMethod.SetGridSumArea(this.ultraGrid1);
  456. }
  457. private void txtStoveNo_KeyDown(object sender, KeyEventArgs e)
  458. {
  459. if (e.KeyValue == 13)
  460. {
  461. QueryData();
  462. }
  463. }
  464. private void txtJudgeNo_KeyDown(object sender, KeyEventArgs e)
  465. {
  466. if (e.KeyValue == 13)
  467. {
  468. QueryData();
  469. }
  470. }
  471. private void chkYearMoth_CheckedChanged(object sender, EventArgs e)
  472. {
  473. this.dataYearMoth.Enabled = this.chkYearMoth.Checked;
  474. }
  475. /// <summary>
  476. /// 打印管坯库入库台账
  477. /// </summary>
  478. private void print()
  479. {
  480. this.ultraGrid1.UpdateData();
  481. int m = 0;
  482. int n = 0;
  483. string InstockDoc = "";
  484. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  485. if (checkMagRows.Count() == 0)
  486. {
  487. MessageUtil.ShowTips("请选择需要打印的信息!");
  488. return;
  489. }
  490. foreach (UltraGridRow row in checkMagRows)
  491. {
  492. if (n == 0)
  493. {
  494. InstockDoc = row.Cells["InstockDoc"].Text ;
  495. }
  496. else
  497. {
  498. InstockDoc = InstockDoc + "','" + row.Cells["InstockDoc"].Text ;
  499. }
  500. n = n + 1;
  501. }
  502. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepGpInListTH.cpt&INSTOCK_DOC=" + InstockDoc + "&BC=" + this.UserInfo.GetUserOrder() + "&BZ=" + this.UserInfo.GetUserGroup();
  503. FrmExcel fre = new FrmExcel(this.ob, strurl);
  504. fre.AutoSize = true;
  505. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  506. fre.WindowState = FormWindowState.Maximized;
  507. fre.Show();
  508. }
  509. }
  510. }