d4c41fe6139d4c2057bf8c8d2e27015a5735d607.svn-base 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  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 Infragistics.Win.UltraWinGrid;
  12. namespace Core.LZMes.Client.UIM.UIM03
  13. {
  14. public partial class UIM031000 : FrmBase
  15. {
  16. public UIM031000()
  17. {
  18. InitializeComponent();
  19. }
  20. public override void ToolBar_Click(object sender, string ToolbarKey)
  21. {
  22. switch (ToolbarKey)
  23. {
  24. case "Query":
  25. this.DoQuery();
  26. break;
  27. case "Export":
  28. this.DoExport();
  29. break;
  30. case "Exit":
  31. this.Close();
  32. break;
  33. }
  34. }
  35. private void DoQuery()
  36. {
  37. try
  38. {
  39. this.dataSet1.Tables[0].Clear();
  40. string queryDate = this.ultraDateTimeEditor1.Value == null ? "" : this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  41. string queryDate1 = this.ultraDateTimeEditor2.Value == null ? "" : this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  42. if (queryDate1.Substring(0, 6) != queryDate.Substring(0, 6))
  43. {
  44. MessageBox.Show("请确保两个查询日期在同一月份", "错误");
  45. return;
  46. }
  47. string queryDate2 = "";//月累统计截止日期
  48. if (queryDate.Substring(0, 6) == DateTime.Today.ToString("yyyyMM"))//查询日期为当月
  49. queryDate2 = DateTime.Today.ToString("yyyyMMdd");
  50. else
  51. {
  52. DateTime date = ultraDateTimeEditor2.DateTime;
  53. queryDate2 = date.AddDays(1 - date.Day).AddMonths(1).AddDays(-1).ToString("yyyyMMdd");
  54. }
  55. CoreClientParam ccp1 = null;
  56. ccp1 = new CoreClientParam();
  57. Hashtable ht = new Hashtable();
  58. ht.Add("i1", this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));
  59. ht.Add("i2", this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
  60. ht.Add("o3", "");
  61. //规格明细统计
  62. ccp1.ServerName = "UIB.COM.ComDBProcedure";
  63. ccp1.MethodName = "doXmlProcedure";
  64. ccp1.ServerParams = new object[] { "UIM020010_LC.CALL", ht };
  65. this.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
  66. //规格明细查询
  67. CoreClientParam ccp = new CoreClientParam();
  68. ccp.ServerName = "UIM.UIM02.UIM020010";
  69. ccp.MethodName = "querylcDetail";
  70. ccp.ServerParams = null;
  71. ccp.SourceDataTable = this.dataSet1.Tables[0];
  72. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  73. //foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in ultraGrid1.Rows)
  74. //{
  75. // double actWgt = 0;
  76. // try
  77. // {
  78. // Color color = Color.White;
  79. // string status = ugr.Cells["PRODUCT_NAME"].Value.ToString().Trim();
  80. // if ("成材率".Equals(status))
  81. // {
  82. // color = Color.FromArgb(255, 128, 128);
  83. // }
  84. // ugr.Appearance.BackColor = color;
  85. // }
  86. // catch (Exception e)
  87. // {
  88. // }
  89. //}
  90. //合计成材率的计算
  91. #region
  92. if (ultraGrid1.Rows.Count > 0)
  93. {
  94. UltraGridRow ur1 = null;
  95. UltraGridRow ur2 = null;
  96. UltraGridRow ur3 = null;
  97. int n = 0;
  98. foreach (UltraGridRow ur in ultraGrid1.Rows)
  99. {
  100. if (ur.Cells["SPEC_STL_GRD"].Text == "合计" && ur.Cells["PRODUCT_NAME"].Text == "原料")
  101. {
  102. ur1 = ur;
  103. n++;
  104. }
  105. else if (ur.Cells["SPEC_STL_GRD"].Text == "合计" && ur.Cells["PRODUCT_NAME"].Text == "产量")
  106. {
  107. ur2 = ur;
  108. n++;
  109. }
  110. else if (ur.Cells["SPEC_STL_GRD"].Text == "合计" && ur.Cells["PRODUCT_NAME"].Text == "成材率")
  111. {
  112. ur3 = ur;
  113. n++;
  114. }
  115. if (n == 3)
  116. break;
  117. }
  118. //ACT_WGT1
  119. if (double.Parse(ur2.Cells["ACT_WGT1"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT1"].Value.ToString())==0)
  120. ur3.Cells["ACT_WGT1"].Value = 0;
  121. else
  122. {
  123. double n1 = double.Parse(ur2.Cells["ACT_WGT1"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT1"].Value.ToString()) * 100;
  124. n1 = Math.Round(n1, 2);
  125. ur3.Cells["ACT_WGT1"].Value = n1.ToString();
  126. }
  127. //ACT_WGT2
  128. if (double.Parse(ur2.Cells["ACT_WGT2"].Value.ToString())==0 || double.Parse(ur1.Cells["ACT_WGT2"].Value.ToString())==0)
  129. ur3.Cells["ACT_WGT2"].Value = 0;
  130. else
  131. {
  132. double n1 = double.Parse(ur2.Cells["ACT_WGT2"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT2"].Value.ToString()) * 100;
  133. n1 = Math.Round(n1, 2);
  134. ur3.Cells["ACT_WGT2"].Value = n1.ToString();
  135. }
  136. //ACT_WGT2_3
  137. if (double.Parse(ur2.Cells["ACT_WGT2_3"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT2_3"].Value.ToString()) == 0)
  138. ur3.Cells["ACT_WGT2_3"].Value = 0;
  139. else
  140. {
  141. double n1 = double.Parse(ur2.Cells["ACT_WGT2_3"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT2_3"].Value.ToString()) * 100;
  142. n1 = Math.Round(n1, 2);
  143. ur3.Cells["ACT_WGT2_3"].Value = n1.ToString();
  144. }
  145. //ACT_WGT3
  146. if (double.Parse(ur2.Cells["ACT_WGT3"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT3"].Value.ToString()) == 0)
  147. ur3.Cells["ACT_WGT3"].Value = 0;
  148. else
  149. {
  150. double n1 = double.Parse(ur2.Cells["ACT_WGT3"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT3"].Value.ToString()) * 100;
  151. n1 = Math.Round(n1, 2);
  152. ur3.Cells["ACT_WGT3"].Value = n1.ToString();
  153. }
  154. //ACT_WGT4
  155. if (double.Parse(ur2.Cells["ACT_WGT4"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT4"].Value.ToString()) == 0)
  156. ur3.Cells["ACT_WGT4"].Value = 0;
  157. else
  158. {
  159. double n1 = double.Parse(ur2.Cells["ACT_WGT4"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT4"].Value.ToString()) * 100;
  160. n1 = Math.Round(n1, 2);
  161. ur3.Cells["ACT_WGT4"].Value = n1.ToString();
  162. }
  163. //ACT_WGT5判断是否为空
  164. if (string.IsNullOrEmpty(ur2.Cells["ACT_WGT5"].Value.ToString()) || string.IsNullOrEmpty(ur1.Cells["ACT_WGT5"].Value.ToString()))
  165. {
  166. ur3.Cells["ACT_WGT5"].Value = 0;
  167. }
  168. else if (double.Parse(ur2.Cells["ACT_WGT5"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT5"].Value.ToString()) == 0)
  169. {
  170. ur3.Cells["ACT_WGT5"].Value = 0;
  171. }
  172. else
  173. {
  174. double n1 = double.Parse(ur2.Cells["ACT_WGT5"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT5"].Value.ToString()) * 100;
  175. n1 = Math.Round(n1, 2);
  176. ur3.Cells["ACT_WGT5"].Value = n1.ToString();
  177. }
  178. ////////////////////////////////////////
  179. if (double.Parse(ur2.Cells["ACT_WGT6"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT6"].Value.ToString()) == 0)
  180. ur3.Cells["ACT_WGT6"].Value = 0;
  181. else
  182. {
  183. double n1 = double.Parse(ur2.Cells["ACT_WGT6"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT6"].Value.ToString()) * 100;
  184. n1 = Math.Round(n1, 2);
  185. ur3.Cells["ACT_WGT6"].Value = n1.ToString();
  186. }
  187. if (double.Parse(ur2.Cells["ACT_WGT7"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT7"].Value.ToString()) == 0)
  188. ur3.Cells["ACT_WGT7"].Value = 0;
  189. else
  190. {
  191. double n1 = double.Parse(ur2.Cells["ACT_WGT7"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT7"].Value.ToString()) * 100;
  192. n1 = Math.Round(n1, 2);
  193. ur3.Cells["ACT_WGT7"].Value = n1.ToString();
  194. }
  195. if (double.Parse(ur2.Cells["ACT_WGT8"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT8"].Value.ToString()) == 0)
  196. ur3.Cells["ACT_WGT8"].Value = 0;
  197. else
  198. {
  199. double n1 = double.Parse(ur2.Cells["ACT_WGT8"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT8"].Value.ToString()) * 100;
  200. n1 = Math.Round(n1, 2);
  201. ur3.Cells["ACT_WGT8"].Value = n1.ToString();
  202. }
  203. if (double.Parse(ur2.Cells["ACT_WGT9"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT9"].Value.ToString()) == 0)
  204. ur3.Cells["ACT_WGT9"].Value = 0;
  205. else
  206. {
  207. double n1 = double.Parse(ur2.Cells["ACT_WGT9"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT9"].Value.ToString()) * 100;
  208. n1 = Math.Round(n1, 2);
  209. ur3.Cells["ACT_WGT9"].Value = n1.ToString();
  210. }
  211. if (double.Parse(ur2.Cells["ACT_WGT10"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT10"].Value.ToString()) == 0)
  212. ur3.Cells["ACT_WGT10"].Value = 0;
  213. else
  214. {
  215. double n1 = double.Parse(ur2.Cells["ACT_WGT10"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT10"].Value.ToString()) * 100;
  216. n1 = Math.Round(n1, 2);
  217. ur3.Cells["ACT_WGT10"].Value = n1.ToString();
  218. }
  219. if (double.Parse(ur2.Cells["ACT_WGT11"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT11"].Value.ToString()) == 0)
  220. ur3.Cells["ACT_WGT11"].Value = 0;
  221. else
  222. {
  223. double n1 = double.Parse(ur2.Cells["ACT_WGT11"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT11"].Value.ToString()) * 100;
  224. n1 = Math.Round(n1, 2);
  225. ur3.Cells["ACT_WGT11"].Value = n1.ToString();
  226. }
  227. /////////////////////////////////////////////
  228. //ACT_WGT
  229. if (double.Parse(ur2.Cells["ACT_WGT"].Value.ToString()) == 0 || double.Parse(ur1.Cells["ACT_WGT"].Value.ToString()) == 0)
  230. ur3.Cells["ACT_WGT"].Value = 0;
  231. else
  232. {
  233. double n1 = double.Parse(ur2.Cells["ACT_WGT"].Value.ToString()) / double.Parse(ur1.Cells["ACT_WGT"].Value.ToString()) * 100;
  234. n1 = Math.Round(n1, 2);
  235. ur3.Cells["ACT_WGT"].Value = n1.ToString();
  236. }
  237. //SUMACT_WGT1
  238. if (double.Parse(ur2.Cells["SUMACT_WGT1"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT1"].Value.ToString()) == 0)
  239. ur3.Cells["SUMACT_WGT1"].Value = 0;
  240. else
  241. {
  242. double n1 = double.Parse(ur2.Cells["SUMACT_WGT1"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT1"].Value.ToString()) * 100;
  243. n1 = Math.Round(n1, 2);
  244. ur3.Cells["SUMACT_WGT1"].Value = n1.ToString();
  245. }
  246. //SUMACT_WGT2
  247. if (double.Parse(ur2.Cells["SUMACT_WGT2"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT2"].Value.ToString()) == 0)
  248. ur3.Cells["SUMACT_WGT2"].Value = 0;
  249. else
  250. {
  251. double n1 = double.Parse(ur2.Cells["SUMACT_WGT2"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT2"].Value.ToString()) * 100;
  252. n1 = Math.Round(n1, 2);
  253. ur3.Cells["SUMACT_WGT2"].Value = n1.ToString();
  254. }
  255. //SUMACT_WGT2_3
  256. if (double.Parse(ur2.Cells["SUMACT_WGT2_3"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT2_3"].Value.ToString()) == 0)
  257. ur3.Cells["SUMACT_WGT2_3"].Value = 0;
  258. else
  259. {
  260. double n1 = double.Parse(ur2.Cells["SUMACT_WGT2_3"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT2_3"].Value.ToString()) * 100;
  261. n1 = Math.Round(n1, 2);
  262. ur3.Cells["SUMACT_WGT2_3"].Value = n1.ToString();
  263. }
  264. //SUMACT_WGT3
  265. if (double.Parse(ur2.Cells["SUMACT_WGT3"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT3"].Value.ToString()) == 0)
  266. ur3.Cells["SUMACT_WGT3"].Value = 0;
  267. else
  268. {
  269. double n1 = double.Parse(ur2.Cells["SUMACT_WGT3"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT3"].Value.ToString()) * 100;
  270. n1 = Math.Round(n1, 2);
  271. ur3.Cells["SUMACT_WGT3"].Value = n1.ToString();
  272. }
  273. //SUMACT_WGT4
  274. if (double.Parse(ur2.Cells["SUMACT_WGT4"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT4"].Value.ToString()) == 0)
  275. ur3.Cells["SUMACT_WGT4"].Value = 0;
  276. else
  277. {
  278. double n1 = double.Parse(ur2.Cells["SUMACT_WGT4"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT4"].Value.ToString()) * 100;
  279. n1 = Math.Round(n1, 2);
  280. ur3.Cells["SUMACT_WGT4"].Value = n1.ToString();
  281. }
  282. //SUMACT_WGT5判断是否为空
  283. if (string.IsNullOrEmpty(ur2.Cells["SUMACT_WGT5"].Value.ToString()) || string.IsNullOrEmpty(ur1.Cells["SUMACT_WGT5"].Value.ToString()))
  284. {
  285. ur3.Cells["SUMACT_WGT5"].Value = 0;
  286. }
  287. else if (double.Parse(ur2.Cells["SUMACT_WGT5"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT5"].Value.ToString()) == 0)
  288. ur3.Cells["SUMACT_WGT5"].Value = 0;
  289. else
  290. {
  291. double n1 = double.Parse(ur2.Cells["SUMACT_WGT5"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT5"].Value.ToString()) * 100;
  292. n1 = Math.Round(n1, 2);
  293. ur3.Cells["SUMACT_WGT5"].Value = n1.ToString();
  294. }
  295. //////////////////////////////////////////////////////
  296. if (double.Parse(ur2.Cells["SUMACT_WGT6"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT6"].Value.ToString()) == 0)
  297. ur3.Cells["SUMACT_WGT6"].Value = 0;
  298. else
  299. {
  300. double n1 = double.Parse(ur2.Cells["SUMACT_WGT6"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT6"].Value.ToString()) * 100;
  301. n1 = Math.Round(n1, 2);
  302. ur3.Cells["SUMACT_WGT6"].Value = n1.ToString();
  303. }
  304. if (double.Parse(ur2.Cells["SUMACT_WGT7"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT7"].Value.ToString()) == 0)
  305. ur3.Cells["SUMACT_WGT7"].Value = 0;
  306. else
  307. {
  308. double n1 = double.Parse(ur2.Cells["SUMACT_WGT7"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT7"].Value.ToString()) * 100;
  309. n1 = Math.Round(n1, 2);
  310. ur3.Cells["SUMACT_WGT7"].Value = n1.ToString();
  311. }
  312. if (double.Parse(ur2.Cells["SUMACT_WGT8"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT8"].Value.ToString()) == 0)
  313. ur3.Cells["SUMACT_WGT8"].Value = 0;
  314. else
  315. {
  316. double n1 = double.Parse(ur2.Cells["SUMACT_WGT8"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT8"].Value.ToString()) * 100;
  317. n1 = Math.Round(n1, 2);
  318. ur3.Cells["SUMACT_WGT8"].Value = n1.ToString();
  319. }
  320. if (double.Parse(ur2.Cells["SUMACT_WGT9"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT9"].Value.ToString()) == 0)
  321. ur3.Cells["SUMACT_WGT9"].Value = 0;
  322. else
  323. {
  324. double n1 = double.Parse(ur2.Cells["SUMACT_WGT9"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT9"].Value.ToString()) * 100;
  325. n1 = Math.Round(n1, 2);
  326. ur3.Cells["SUMACT_WGT9"].Value = n1.ToString();
  327. }
  328. if (double.Parse(ur2.Cells["SUMACT_WGT10"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT10"].Value.ToString()) == 0)
  329. ur3.Cells["SUMACT_WGT10"].Value = 0;
  330. else
  331. {
  332. double n1 = double.Parse(ur2.Cells["SUMACT_WGT10"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT10"].Value.ToString()) * 100;
  333. n1 = Math.Round(n1, 2);
  334. ur3.Cells["SUMACT_WGT10"].Value = n1.ToString();
  335. }
  336. if (double.Parse(ur2.Cells["SUMACT_WGT11"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT11"].Value.ToString()) == 0)
  337. ur3.Cells["SUMACT_WGT11"].Value = 0;
  338. else
  339. {
  340. double n1 = double.Parse(ur2.Cells["SUMACT_WGT11"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT11"].Value.ToString()) * 100;
  341. n1 = Math.Round(n1, 2);
  342. ur3.Cells["SUMACT_WGT11"].Value = n1.ToString();
  343. }
  344. ////////////////////////////////////////////////
  345. //SUMACT_WGT
  346. if (double.Parse(ur2.Cells["SUMACT_WGT"].Value.ToString()) == 0 || double.Parse(ur1.Cells["SUMACT_WGT"].Value.ToString()) == 0)
  347. ur3.Cells["SUMACT_WGT"].Value = 0;
  348. else
  349. {
  350. double n1 = double.Parse(ur2.Cells["SUMACT_WGT"].Value.ToString()) / double.Parse(ur1.Cells["SUMACT_WGT"].Value.ToString()) * 100;
  351. n1 = Math.Round(n1, 2);
  352. ur3.Cells["SUMACT_WGT"].Value = n1.ToString();
  353. }
  354. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  355. {
  356. if (ultraGrid1.Rows[i].Cells["SPEC_STL_GRD"].Text == "合计" && ultraGrid1.Rows[i].Cells["PRODUCT_NAME"].Text == "成材率")
  357. {
  358. ultraGrid1.Rows[i].Cells["SUMACT_WGT1"].Value = ur3.Cells["SUMACT_WGT1"].Value;
  359. ultraGrid1.Rows[i].Cells["SUMACT_WGT2"].Value = ur3.Cells["SUMACT_WGT2"].Value;
  360. ultraGrid1.Rows[i].Cells["SUMACT_WGT2_3"].Value = ur3.Cells["SUMACT_WGT2_3"].Value;
  361. ultraGrid1.Rows[i].Cells["SUMACT_WGT3"].Value = ur3.Cells["SUMACT_WGT3"].Value;
  362. ultraGrid1.Rows[i].Cells["SUMACT_WGT4"].Value = ur3.Cells["SUMACT_WGT4"].Value;
  363. ultraGrid1.Rows[i].Cells["SUMACT_WGT5"].Value = ur3.Cells["SUMACT_WGT5"].Value;
  364. ultraGrid1.Rows[i].Cells["SUMACT_WGT"].Value = ur3.Cells["SUMACT_WGT"].Value;
  365. ultraGrid1.Rows[i].Cells["SUMACT_WGT6"].Value = ur3.Cells["SUMACT_WGT6"].Value;
  366. ultraGrid1.Rows[i].Cells["SUMACT_WGT7"].Value = ur3.Cells["SUMACT_WGT7"].Value;
  367. ultraGrid1.Rows[i].Cells["SUMACT_WGT8"].Value = ur3.Cells["SUMACT_WGT8"].Value;
  368. ultraGrid1.Rows[i].Cells["SUMACT_WGT9"].Value = ur3.Cells["SUMACT_WGT9"].Value;
  369. ultraGrid1.Rows[i].Cells["SUMACT_WGT10"].Value = ur3.Cells["SUMACT_WGT10"].Value;
  370. ultraGrid1.Rows[i].Cells["SUMACT_WGT11"].Value = ur3.Cells["SUMACT_WGT11"].Value;
  371. ultraGrid1.Rows[i].Cells["ACT_WGT1"].Value = ur3.Cells["ACT_WGT1"].Value;
  372. ultraGrid1.Rows[i].Cells["ACT_WGT2"].Value = ur3.Cells["ACT_WGT2"].Value;
  373. ultraGrid1.Rows[i].Cells["ACT_WGT2_3"].Value = ur3.Cells["ACT_WGT2_3"].Value;
  374. ultraGrid1.Rows[i].Cells["ACT_WGT3"].Value = ur3.Cells["ACT_WGT3"].Value;
  375. ultraGrid1.Rows[i].Cells["ACT_WGT4"].Value = ur3.Cells["ACT_WGT4"].Value;
  376. ultraGrid1.Rows[i].Cells["ACT_WGT5"].Value = ur3.Cells["ACT_WGT5"].Value;
  377. ultraGrid1.Rows[i].Cells["ACT_WGT"].Value = ur3.Cells["ACT_WGT"].Value;
  378. ultraGrid1.Rows[i].Cells["ACT_WGT6"].Value = ur3.Cells["ACT_WGT6"].Value;
  379. ultraGrid1.Rows[i].Cells["ACT_WGT7"].Value = ur3.Cells["ACT_WGT7"].Value;
  380. ultraGrid1.Rows[i].Cells["ACT_WGT8"].Value = ur3.Cells["ACT_WGT8"].Value;
  381. ultraGrid1.Rows[i].Cells["ACT_WGT9"].Value = ur3.Cells["ACT_WGT9"].Value;
  382. ultraGrid1.Rows[i].Cells["ACT_WGT10"].Value = ur3.Cells["ACT_WGT10"].Value;
  383. ultraGrid1.Rows[i].Cells["ACT_WGT11"].Value = ur3.Cells["ACT_WGT11"].Value;
  384. ultraGrid1.Update();
  385. break;
  386. }
  387. }
  388. }
  389. #endregion
  390. //else if (CustomInfo == "3")
  391. //{
  392. // //规格明细查询
  393. // CoreClientParam ccp = new CoreClientParam();
  394. // ccp.ServerName = "UIM.UIM02.UIM020010";
  395. // ccp.MethodName = "queryRclSizeDetail";
  396. // ccp.ServerParams = new object[] { queryDate, queryDate1, queryDate2 };
  397. // ccp.SourceDataTable = this.dataSet1.Tables[0];
  398. // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  399. //}
  400. }
  401. catch (Exception EX)
  402. {
  403. MessageBox.Show(EX.ToString());
  404. }
  405. }
  406. private void DoExport()
  407. {
  408. try
  409. {
  410. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  411. {
  412. string fileName = this.saveFileDialog1.FileName;
  413. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  414. System.Diagnostics.Process.Start(fileName);
  415. }
  416. }
  417. catch (Exception EX)
  418. {
  419. MessageBox.Show(EX.ToString());
  420. }
  421. }
  422. private void UIM031000_Load(object sender, EventArgs e)
  423. {
  424. if (CustomInfo == "7")
  425. {
  426. this.ultraGrid1.DisplayLayout.Bands[0].RowLayoutStyle = RowLayoutStyle.GroupLayout;
  427. modifyColumn("UnboundColumn2", "厚度≤3mm", 0, 0, 2, 1);
  428. modifyColumn("UnboundColumn3", "3<厚度≤4mm", 0, 0, 2, 1);
  429. modifyColumn("UnboundColumn4", "4<厚度≤5mm", 0, 0, 2, 1);
  430. modifyColumn("UnboundColumn8", "5<厚度≤6mm", 0, 0, 2, 1);
  431. modifyColumn("UnboundColumn5", "6<厚度", 0, 0, 2, 1);
  432. }
  433. }
  434. private void modifyColumn(string columnName, string caption, int x, int y, int spanX, int spanY)
  435. {
  436. //this.ultraGrid1.DisplayLayout.Bands[0].Columns.Add(columnName);
  437. UltraGridColumn GridColumn = this.ultraGrid1.DisplayLayout.Bands[0].Columns[columnName];
  438. GridColumn.Header.Caption = caption;
  439. //GridColumn.Header.Appearance.TextVAlign = Infragistics.Win.VAlign.Middle;
  440. //GridColumn.Header.Appearance.TextHAlign = Infragistics.Win.HAlign.Center;
  441. //GridColumn.RowLayoutColumnInfo.OriginX = x;
  442. //GridColumn.RowLayoutColumnInfo.OriginY = y;
  443. //GridColumn.RowLayoutColumnInfo.SpanX = spanX;
  444. //GridColumn.RowLayoutColumnInfo.SpanY = spanY;
  445. ////GridColumn.CellActivation = Activation.Disabled;
  446. //GridColumn.RowLayoutColumnInfo.AllowCellSizing = RowLayoutSizing.None;
  447. //GridColumn.SortIndicator = SortIndicator.Disabled;
  448. }
  449. }
  450. }