FrmWaterRatio.cs 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using CoreFS.CA06;
  5. using Infragistics.Win.UltraWinEditors;
  6. using Infragistics.Win.UltraWinGrid;
  7. using System;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. using System.Data;
  11. using System.Drawing;
  12. using System.Linq;
  13. using System.Windows.Forms;
  14. namespace Core.StlMes.Client.Qcm
  15. {
  16. public partial class FrmWaterRatio : FrmBase
  17. {
  18. private string _stdCode = "";
  19. //private UltraComboEditor _uce;
  20. private DataTable copyTable = null;
  21. public DataTable CopyTable
  22. {
  23. get { return copyTable; }
  24. set { copyTable = value; }
  25. }
  26. private bool isPasting = false;
  27. public string StdCode
  28. {
  29. get { return _stdCode; }
  30. set { _stdCode = value; }
  31. }
  32. private string _steelCode = "";
  33. public string SteelCode
  34. {
  35. get { return _steelCode; }
  36. set { _steelCode = value; }
  37. }
  38. private string stdStyleCode = "1";
  39. public string StdStyleCode
  40. {
  41. get { return stdStyleCode; }
  42. set { stdStyleCode = value; }
  43. }
  44. private string stdCodeNk = "";
  45. public string StdCodeNk
  46. {
  47. get { return stdCodeNk; }
  48. set { stdCodeNk = value; }
  49. }
  50. public FrmWaterRatio()
  51. {
  52. InitializeComponent();
  53. ExceptionHelper.RegistException();
  54. }
  55. public void PopupLoad(string customInfo, OpeBase ob)
  56. {
  57. panel1.Visible = false;
  58. this.CustomInfo = customInfo;
  59. this.ob = ob;
  60. this.OnLoad(EventArgs.Empty);
  61. }
  62. ArrayList listA = new ArrayList(); //新增数据
  63. ArrayList listU = new ArrayList(); //修改数据
  64. ArrayList listS = new ArrayList(); //Grid2数据
  65. ArrayList listM = new ArrayList(); //Grid3数据
  66. int waterid = 0;
  67. private string _id = "";
  68. string copyStdCode = ""; //复制时的标准代码
  69. string pastStdCode = ""; //粘贴了的标准代码
  70. List<string> onlyList = new List<string>();
  71. public override void ToolBar_Click(object sender, string ToolbarKey)
  72. {
  73. switch (ToolbarKey)
  74. {
  75. case "Query":
  76. try
  77. {
  78. this.Cursor = Cursors.WaitCursor;
  79. doQuery(false);
  80. }
  81. finally
  82. {
  83. this.Cursor = Cursors.Default;
  84. }
  85. break;
  86. case "QueryV":
  87. try
  88. {
  89. this.Cursor = Cursors.WaitCursor;
  90. doQuery(true);
  91. }
  92. finally
  93. {
  94. this.Cursor = Cursors.Default;
  95. }
  96. break;
  97. case "Save":
  98. doSave();
  99. break;
  100. case "Delete":
  101. doDeleteOrResume(true);
  102. break;
  103. case "Resume":
  104. doDeleteOrResume(false);
  105. break;
  106. case "Refresh":
  107. doRefresh();
  108. break;
  109. case "CopyStd":
  110. CopyStd();
  111. break;
  112. case "Copy":
  113. Copy();
  114. break;
  115. case "Paste":
  116. isPasting = true;
  117. try
  118. {
  119. Paste();
  120. isPasting = false;
  121. }
  122. finally
  123. {
  124. isPasting = false;
  125. }
  126. break;
  127. case "WaterStd":
  128. ShowWindow();
  129. break;
  130. case "Close":
  131. this.Close();
  132. break;
  133. }
  134. }
  135. private void FrmWaterRatio_Load(object sender, EventArgs e)
  136. {
  137. InitCombox();
  138. doQuery(false);
  139. }
  140. private void CopyStd()
  141. {
  142. this.Cursor = Cursors.WaitCursor;
  143. var chkRow = ultraGrid1.Rows.Where(a => a.GetValue("CHK") == "True").FirstOrDefault();
  144. if (chkRow == null)
  145. {
  146. MessageUtil.ShowWarning("请选择一条记录!");
  147. this.Cursor = Cursors.Default;
  148. return;
  149. }
  150. string stdCode = chkRow.GetValue("STD_CODE");
  151. string stdName = chkRow.GetValue("STD_NAME");
  152. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.GetStd",
  153. new object[] { _stdCode }, this.ob);
  154. dt.Columns["STD_NAME"].Caption = "新标准名称";
  155. BaseInfoPopup popup = new BaseInfoPopup(dt, "STD_NAME", "STD_CODE");
  156. popup.Text = "被复制标准" + stdName;
  157. popup.Load += ((a, b) =>
  158. {
  159. var row = popup.UltraGrid1.Rows.Where(c => c.GetValue("STD_CODE") == stdCode).FirstOrDefault();
  160. if (row != null)
  161. {
  162. row.Activate();
  163. }
  164. this.Cursor = Cursors.Default;
  165. });
  166. if (popup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  167. {
  168. ServerHelper.SetData("com.steering.pss.qcm.CoreWaterRatio.copyRatioByStd",
  169. new object[] { stdCode, popup.ChoicedRow.GetValue("STD_CODE"), popup.ChoicedRow.GetValue("STD_NAME") }, ob);
  170. MessageUtil.ShowTips("复制标准成功!");
  171. }
  172. }
  173. /// <summary>
  174. /// 复制一行数据
  175. /// </summary>
  176. private void Copy()
  177. {
  178. if (ultraGrid1.ActiveRow == null)
  179. {
  180. MessageUtil.ShowWarning("请选择一行记录,再进行操作!");
  181. return;
  182. }
  183. ultraGrid1.UpdateData();
  184. copyTable = dataTable1.Copy();
  185. copyTable.Clear();
  186. DataRow dr = copyTable.NewRow();
  187. CopyRowToRow(((DataRowView)ultraGrid1.ActiveRow.ListObject).Row, dr);
  188. copyTable.Rows.Add(dr);
  189. waterid = Convert.ToInt32(ultraGrid1.GetActiveRowValue("RATIO_ID"));
  190. copyStdCode = ultraGrid1.GetActiveRowValue("STD_CODE");
  191. }
  192. private void CopyRowToRow(DataRow srcRow, DataRow desRow)
  193. {
  194. for (int i = 0; i < srcRow.Table.Columns.Count; i++)
  195. {
  196. string columnName = srcRow.Table.Columns[i].ColumnName;
  197. desRow[columnName] = srcRow[columnName];
  198. }
  199. }
  200. /// <summary>
  201. /// 粘贴
  202. /// </summary>
  203. private void Paste()
  204. {
  205. if (copyTable == null || copyTable.Rows.Count == 0)
  206. {
  207. MessageUtil.ShowWarning("没有数据,请复制后再进行操作!");
  208. return;
  209. }
  210. dataTable1.BeginInit();
  211. foreach (DataRow row in copyTable.Rows)
  212. {
  213. DataRow tempRow = dataTable1.NewRow();
  214. foreach (DataColumn column in dataTable1.Columns)
  215. {
  216. string columnName = column.ColumnName;
  217. List<string> notCopyColumns = new List<string>();
  218. notCopyColumns.AddRange("RATIO_ID", "CREATE_TIME", "CREATE_NAME", "UPDATE_TIME", "UPDATE_NAME",
  219. "DELETE_TIME", "DELETE_NAME", "VALIDFLAG");
  220. if (notCopyColumns.Contains(columnName) == true) continue;
  221. tempRow[columnName] = row[columnName];
  222. }
  223. tempRow["RATIO_ID"] = waterid;
  224. dataTable1.Rows.Add(tempRow);
  225. }
  226. dataTable1.EndInit();
  227. ultraGrid1.UpdateData();
  228. }
  229. private void InitCombox()
  230. {
  231. //_uce = new UltraComboEditor();
  232. //DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.GetStd",
  233. // new object[]{_stdCode}, this.ob);
  234. //if (dt != null && dt.Rows.Count > 0)
  235. //{
  236. // _uce.DataSource = dt;
  237. // _uce.DisplayMember = "STD_NAME";
  238. // _uce.ValueMember = "STD_CODE";
  239. //}
  240. //_uce.DropDownListWidth = -1;
  241. //this.Controls.Add(_uce);
  242. //_uce.Visible = false;
  243. //ClsBaseInfo.SetComboItemHeight(_uce);
  244. ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].EditorComponent = ultraTextEditor2;
  245. UltraComboEditor cmbStdNk = new UltraComboEditor();
  246. cmbStdNk.Visible = false;
  247. this.Controls.Add(cmbStdNk);
  248. QcmBaseQuery.NitializeInnerStandard(cmbStdNk, false, ob);
  249. if (stdCodeNk != "")
  250. {
  251. ((DataTable)cmbStdNk.DataSource).DefaultView.RowFilter = "STD_CODE = '" + stdCodeNk + "' OR STD_CODE = ''";
  252. }
  253. ultraGrid1.DisplayLayout.Bands[0].Columns["STD_CODE_NK"].EditorComponent = cmbStdNk;
  254. ultraGrid1.DisplayLayout.Bands[0].Columns["STD_CODE_NK"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  255. //ultraGrid1.DisplayLayout.Bands[0].Columns["STD_NAME"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  256. UltraComboEditor uceStyle = new UltraComboEditor();
  257. this.Controls.Add(uceStyle);
  258. uceStyle.Visible = false;
  259. DataTable dt1 = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.getStdStyle", null, this.ob);
  260. if (dt1 != null && dt1.Rows.Count > 0)
  261. {
  262. Object[] obj = new Object[] { "", "" };
  263. DataRow dr = dt1.NewRow();
  264. dr.ItemArray = obj;
  265. dt1.Rows.InsertAt(dr, 0);
  266. uceStyle.DataSource = dt1;
  267. uceStyle.DisplayMember = "STD_STYLE_DESC";
  268. uceStyle.ValueMember = "STD_STYLE";
  269. }
  270. ClsBaseInfo.SetComboItemHeight(uceStyle);
  271. ultraGrid1.DisplayLayout.Bands[0].Columns["STD_STYLE"].EditorComponent = uceStyle;
  272. ultraGrid1.DisplayLayout.Bands[0].Columns["STD_STYLE"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  273. ultraComboEditor3.SelectedIndex = 0;
  274. ClsBaseInfo.SetComboItemHeight(ultraComboEditor3);
  275. }
  276. private void doRefresh()
  277. {
  278. InitCombox();
  279. }
  280. private string ratioId = ""; //保存前一次激活的行
  281. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  282. {
  283. ((Form)ultraGrid1.TopLevelControl).Cursor = Cursors.WaitCursor;
  284. try
  285. {
  286. ultraGrid1.UpdateData();
  287. UltraGridRow ugr = this.ultraGrid1.ActiveRow; //当前激活行
  288. if (ugr == null)
  289. return;
  290. //if (ugr.GetValue("RATIO_ID") != ratioId)
  291. //{
  292. // UltraGridRow[] rows = ultraGrid1.Rows.AsQueryable().Where(a => a.GetValue("RATIO_ID") == ratioId).ToArray();
  293. // if (rows.Length > 0)
  294. // {
  295. // rows[0].Cells["CHK"].Value = false;
  296. // }
  297. //}
  298. ratioId = ugr.GetValue("RATIO_ID");
  299. if (ugr.Cells["VALIDFLAG"].Value.ToString() != "")
  300. GetSteel(ugr);
  301. else if (ugr.Cells["ISPASTED"].Text == "")
  302. GetSteelNew(ugr.Cells["RATIO_ID"].Value.ToString(), ugr.Cells["STD_CODE"].Value.ToString());
  303. else
  304. GetSteel(ugr);
  305. GetModel(ugr);
  306. ultraGrid1.UpdateData();
  307. }
  308. finally
  309. {
  310. ((Form)ultraGrid1.TopLevelControl).Cursor = Cursors.Default;
  311. }
  312. }
  313. private void GetSteel(UltraGridRow ugr)
  314. {
  315. if (ugr == null)
  316. return;
  317. string ratio_id = ugr.Cells["RATIO_ID"].Value.ToString();
  318. _id = ratio_id;
  319. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.GetSteel", new Object[] { ratio_id }, this.ob);
  320. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable2, true);
  321. //UltraGridColumn[] col = new UltraGridColumn[] { this.ultraGrid2.DisplayLayout.Bands[0].Columns["MEMO"] };
  322. //GridHelper.RefreshAndAutoSizeExceptRows(ultraGrid2, col);
  323. for (int i = 0; i < ultraGrid2.Rows.Count; i++)
  324. {
  325. ultraGrid2.Rows[i].Cells["RATIO_ID"].Value = ugr.Cells["RATIO_ID"].Value.ToString();
  326. }
  327. ultraGrid2.UpdateData();
  328. }
  329. public void GetSteelNew(string id, string stdname)
  330. {
  331. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.getSteelNew", new object[] { stdname }, this.ob);
  332. GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
  333. for (int i = 0; i < ultraGrid2.Rows.Count; i++)
  334. {
  335. ultraGrid2.Rows[i].Cells["RATIO_ID"].Value = id;
  336. }
  337. for (int i = 0; i < ultraGrid3.Rows.Count; i++)
  338. {
  339. ultraGrid3.Rows[i].Cells["RATIO_ID"].Value = id;
  340. }
  341. ultraGrid2.UpdateData();
  342. ultraGrid3.UpdateData();
  343. }
  344. private void GetModel(UltraGridRow ugr)
  345. {
  346. if (ugr == null)
  347. return;
  348. string ratio_id = ugr.Cells["RATIO_ID"].Value.ToString();
  349. _id = ratio_id;
  350. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.getModel", new Object[] { ratio_id }, this.ob);
  351. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable3, true);
  352. for (int i = 0; i < ultraGrid3.Rows.Count; i++)
  353. {
  354. ultraGrid3.Rows[i].Cells["RATIO_ID"].Value = ugr.Cells["RATIO_ID"].Value.ToString();
  355. }
  356. ultraGrid3.UpdateData();
  357. }
  358. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  359. {
  360. this.ultraGrid1.UpdateData();
  361. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  362. if (ugr == null)
  363. return;
  364. if (e.Cell.Column.Key.Equals("STD_NAME"))
  365. {
  366. e.Cell.Row.Cells["STD_CODE"].Value = e.Cell.Row.Cells["STD_CODE"].Value.ToString();
  367. if (e.Cell.Row.Cells["STD_CODE"].Value.ToString() == pastStdCode)
  368. GetSteel(e.Cell.Row);
  369. else
  370. GetSteelNew(e.Cell.Row.Cells["RATIO_ID"].Value.ToString(), e.Cell.Row.Cells["STD_CODE"].Value.ToString());
  371. }
  372. else if (e.Cell.Column.Key.Equals("STD_STYLE"))
  373. {
  374. e.Cell.Row.Cells["STD_STYLE_DESC"].Value = e.Cell.Row.Cells["STD_STYLE"].Text;
  375. }
  376. else if (e.Cell.Column.Key.Equals("CHK"))
  377. {
  378. if (e.Cell.Value.ToString().ToUpper() == "TRUE")
  379. {
  380. if (e.Cell.Row.Cells["VALIDFLAG"].Value.ToString() == "无效")
  381. {
  382. for (int i = 0; i < e.Cell.Row.Cells.Count; i++)
  383. {
  384. if (e.Cell.Row.Cells[i] != e.Cell)
  385. e.Cell.Row.Cells[i].Activation = Activation.ActivateOnly;
  386. }
  387. }
  388. }
  389. }
  390. if (e.Cell.Column.Key == "CHK")
  391. {
  392. UltraGridRow chkRow = e.Cell.Row;
  393. foreach (UltraGridRow row in ultraGrid1.Rows)
  394. {
  395. if (row.Cells["CHK"].Value.ToString() == "True" && row != chkRow)
  396. {
  397. row.Cells["CHK"].Value = "False";
  398. row.Update();
  399. }
  400. }
  401. }
  402. ultraGrid1.UpdateData();
  403. }
  404. private void ultraGrid1_AfterRowInsert(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e)
  405. {
  406. ultraGrid1.UpdateData();
  407. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  408. if (ugr == null)
  409. return;
  410. this.ultraGrid1.UpdateData();
  411. DataRow[] dr = dataTable1.Select("", "RATIO_ID DESC");
  412. int index = 0;
  413. if (dr.Length > 0)
  414. {
  415. index = Convert.ToInt32(dr[0]["RATIO_ID"]);
  416. index += 1;
  417. }
  418. else
  419. {
  420. index += 1;
  421. }
  422. ugr.Cells["RATIO_ID"].Value = index;
  423. ratioId = index.ToString();
  424. if (!Convert.ToBoolean(ugr.Cells["CHK"].Value))
  425. {
  426. for (int i = 0; i < ugr.Cells.Count; i++)
  427. {
  428. if (!ugr.Cells[i].Column.Key.Equals("CHK"))
  429. ugr.Cells[i].Activation = Activation.ActivateOnly;
  430. }
  431. }
  432. for (int i = 0; i < ultraGrid2.Rows.Count; i++)
  433. {
  434. ultraGrid2.Rows[i].Cells["RATIO_ID"].Value = ugr.Cells["RATIO_ID"].Value.ToString();
  435. }
  436. if (stdCodeNk != "")
  437. {
  438. ugr.Cells["STD_CODE_NK"].Value = stdCodeNk;
  439. }
  440. }
  441. private void doQuery(bool isValid)
  442. {
  443. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.doQuery",
  444. new Object[] { _stdCode, stdStyleCode, isValid, stdCodeNk }, this.ob);
  445. ultraGrid1.BeginUpdate();
  446. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
  447. ActiveGridRow();
  448. //UltraGridColumn[] col = new UltraGridColumn[] { this.ultraGrid1.DisplayLayout.Bands[0].Columns["MEMO"],
  449. // this.ultraGrid1.DisplayLayout.Bands[0].Columns["RATIO_STD"],this.ultraGrid1.DisplayLayout.Bands[0].Columns["RATIO_ID"],
  450. //this.ultraGrid1.DisplayLayout.Bands[0].Columns["RATIO_REPLACE"]};
  451. //GridHelper.RefreshAndAutoSizeExceptRows(ultraGrid1, col);
  452. Infragistics.Win.UltraWinGrid.UltraGridRow row = null;
  453. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  454. {
  455. row = ultraGrid1.Rows[i];
  456. if (row.Cells["CHK"].Value.ToString().ToUpper() != "TRUE")
  457. {
  458. for (int j = 0; j < row.Cells.Count; j++)
  459. {
  460. if (!row.Cells[j].Column.Key.Equals("CHK"))
  461. row.Cells[j].Activation = Activation.ActivateOnly;
  462. }
  463. }
  464. if (!row.Cells["VALIDFLAG"].Value.ToString().Equals("有效"))
  465. {
  466. row.Appearance.ForeColor = Color.Red;
  467. }
  468. else
  469. {
  470. row.Appearance.ForeColor = Color.Black;
  471. }
  472. }
  473. if (ultraCheckEditor1.Checked)
  474. {
  475. GetMatchRatioIdFrm();
  476. }
  477. ultraGrid1.EndUpdate();
  478. }
  479. private void GetMatchRatioIdFrm()
  480. {
  481. string stdName = ultraTextEditor1.Text.Trim();
  482. string stdStyleDesc = ultraComboEditor3.Value.ToString2();
  483. string dimater = ultraNumericEditor1.Value.ToString2();
  484. string steelName = ultraTextEditor3.Text.Trim();
  485. string modelDesc = ultraTextEditor4.Text.Trim();
  486. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.getMatchRatioIdFrm",
  487. new object[] { stdName, dimater, stdStyleDesc, modelDesc, steelName }, ob);
  488. if (dt.Rows.Count > 0)
  489. {
  490. var rows = ultraGrid1.Rows.Where(a => dt.Select("RATIO_ID = '" + a.GetValue("RATIO_ID") + "'").Length > 0);
  491. ultraGrid1.BeginUpdate();
  492. foreach (var row in rows)
  493. {
  494. row.Appearance.BackColor = Color.FromArgb(124, 205, 124);
  495. }
  496. ultraGrid1.EndUpdate();
  497. }
  498. }
  499. private void doSave()
  500. {
  501. if (GetGrid1Data() == 0)
  502. {
  503. //List<string> tempList = onlyList.Distinct().ToList();
  504. //if (tempList.Count < onlyList.Count)
  505. //{
  506. // MessageUtil.ShowWarning("标准、标准类别、外径、试验压力系数、最大试验压力组成的记录重复!");
  507. // return;
  508. //}
  509. if (MessageBox.Show("是否保存选择记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  510. {
  511. return;
  512. }
  513. CoreClientParam ccp = new CoreClientParam(); //CoreClientParam是平台用来向服务端传递存放所有相关参数信息的。
  514. ccp.ServerName = "com.steering.pss.qcm.CoreWaterRatio"; //服务名指的是服务端的包名+类名
  515. ccp.MethodName = "doSave"; //方法名指的是服务名指定类里的方法
  516. ccp.ServerParams = new object[] { listA, listU, listS, listM };//服务端方法的参数
  517. //ExecuteNonQuery主要用来执行添加、修改、删除、存储过程的操作。
  518. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  519. if (ccp != null)
  520. {
  521. if (ccp.ReturnInfo.ToString() == "FALSE####")
  522. {
  523. MessageUtil.ShowWarning("标准已引用了基础标准,不能再维护为基础标准!");
  524. return;
  525. }
  526. if (ccp.ReturnInfo.ToString() == "FALSE#Reapt")
  527. {
  528. MessageUtil.ShowWarning("标准、标准类别、外径、试验压力系数、最大试验压力组成的记录重复!");
  529. string tempstr = ccp.ReturnObject.ToString();
  530. int num = GetRowNum(tempstr);
  531. ultraGrid1.Rows[num].Activate();
  532. ultraGrid1.Rows[num].Selected = true;
  533. return;
  534. }
  535. }
  536. if (ccp.ReturnCode == -1)
  537. return;
  538. MessageBox.Show("保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  539. doQuery(false);
  540. _id = "";
  541. }
  542. }
  543. /// <summary>
  544. /// 获取第几行
  545. /// </summary>
  546. /// <param name="parm">每一行的主键值</param>
  547. /// <returns>第几行</returns>
  548. private int GetRowNum(String parm)
  549. {
  550. int num = 0;
  551. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  552. {
  553. if (ultraGrid1.Rows[i].Cells["RATIO_ID"].Value.ToString() == parm)
  554. {
  555. num = i;
  556. break;
  557. }
  558. }
  559. return num;
  560. }
  561. private void doDeleteOrResume(bool flag)
  562. {
  563. this.ultraGrid1.UpdateData();
  564. ArrayList parm = new ArrayList();
  565. int isselect = 0;
  566. foreach (UltraGridRow row in ultraGrid1.Rows)
  567. {
  568. if (row.Cells["CHK"].Value.ToString().ToUpper() == "TRUE")
  569. {
  570. ArrayList list = new ArrayList();
  571. if (flag) //删除
  572. {
  573. if (row.Cells["VALIDFLAG"].Value.ToString() == "无效")
  574. {
  575. MessageBox.Show("无效数据,无法作废", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  576. row.Activate();
  577. return;
  578. }
  579. isselect += 1;
  580. list.Add(this.UserInfo.GetUserName());
  581. list.Add(row.Cells["RATIO_ID"].Value.ToString());
  582. parm.Add(list);
  583. }
  584. else
  585. {
  586. if (row.Cells["VALIDFLAG"].Value.ToString() == "有效")
  587. {
  588. MessageBox.Show("有效数据,无法恢复", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  589. row.Activate();
  590. return;
  591. }
  592. ArrayList listR = new ArrayList();
  593. isselect += 1;
  594. listR.Add(row.Cells["STD_CODE"].Value.ToString());
  595. listR.Add(row.Cells["STD_STYLE"].Value.ToString());
  596. listR.Add(row.Cells["SIZE_MIN_SIGN"].Value.ToString());
  597. listR.Add(row.Cells["SIZE_MIN"].Value.ToString());
  598. listR.Add(row.Cells["SIZE_MAX_SIGN"].Value.ToString());
  599. listR.Add(row.Cells["SIZE_MAX"].Value.ToString());
  600. listR.Add(row.Cells["RATIO_STD"].Value.ToString());
  601. listR.Add(row.Cells["MAX_PRESS"].Value.ToString());
  602. listR.Add(row.Cells["RATIO_ID"].Value.ToString());
  603. parm.Add(listR);
  604. }
  605. _id = row.Cells["RATIO_ID"].Value.ToString();
  606. }
  607. }
  608. if (isselect == 0)
  609. {
  610. MessageBox.Show("请选择需要操作的记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  611. return;
  612. }
  613. if (MessageBox.Show("确认" + (flag ? "作废" : "恢复") + "所选数据", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  614. {
  615. return;
  616. }
  617. // int count = ServerHelper.SetData("com.steering.pss.qcm.CoreWaterRatio.doDelete", new Object[] { parm, flag }, this.ob);
  618. CoreClientParam ccp = new CoreClientParam(); //CoreClientParam是平台用来向服务端传递存放所有相关参数信息的。
  619. ccp.ServerName = "com.steering.pss.qcm.CoreWaterRatio"; //服务名指的是服务端的包名+类名
  620. ccp.MethodName = "doDelete"; //方法名指的是服务名指定类里的方法
  621. ccp.ServerParams = new object[] { parm, flag };//服务端方法的参数
  622. //ExecuteNonQuery主要用来执行添加、修改、删除、存储过程的操作。
  623. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  624. if (ccp != null)
  625. {
  626. if (ccp.ReturnInfo == "ResumeFALSE##")
  627. {
  628. MessageUtil.ShowWarning("已存在相同的有效数据,无法恢复!");
  629. string tempstr = ccp.ReturnObject.ToString();
  630. int num = GetRowNum(tempstr);
  631. ultraGrid1.Rows[num].Activate();
  632. ultraGrid1.Rows[num].Selected = true;
  633. return;
  634. }
  635. }
  636. if (ccp.ReturnCode == -1)
  637. return;
  638. MessageBox.Show("数据" + (flag ? "作废" : "恢复") + "成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
  639. doQuery(false);
  640. _id = "";
  641. }
  642. private int GetGrid1Data()
  643. {
  644. this.ultraGrid1.UpdateData();
  645. listA = new ArrayList();
  646. listU = new ArrayList();
  647. onlyList.Clear();
  648. dataTable1.AcceptChanges();
  649. foreach (UltraGridRow row in ultraGrid1.Rows)
  650. {
  651. if (row.Cells["CHK"].Value.ToString().ToUpper() == "TRUE")
  652. {
  653. if (row.Cells["STD_NAME"].Value.ToString() == "")
  654. {
  655. MessageBox.Show("请选择标准名称", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  656. row.Cells["STD_NAME"].Activate();
  657. return -1;
  658. }
  659. if (row.Cells["STD_CODE_NK"].Value.ToString() == "")
  660. {
  661. MessageBox.Show("请选择内控管理号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  662. row.Cells["STD_CODE_NK"].Activate();
  663. return -1;
  664. }
  665. string min_sign = row.Cells["SIZE_MIN_SIGN"].Value.ToString();
  666. string min_val = row.Cells["SIZE_MIN"].Value.ToString();
  667. string max_sign = row.Cells["SIZE_MAX_SIGN"].Value.ToString();
  668. string max_val = row.Cells["SIZE_MAX"].Value.ToString();
  669. if (min_sign != "" && min_val == "")
  670. {
  671. MessageBox.Show("下限符号不为空,请输入下限值或清空下限符号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  672. row.Activate();
  673. return -1;
  674. }
  675. if (min_sign == "" && min_val != "")
  676. {
  677. MessageBox.Show("下限值不为空,请选择下限符号或清空下限值", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  678. row.Activate();
  679. return -1;
  680. }
  681. if (max_sign != "" && max_val == "")
  682. {
  683. MessageBox.Show("上限限符号不为空,请输入上限值或清空上限符号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  684. row.Activate();
  685. return -1;
  686. }
  687. if (max_sign == "" && max_val != "")
  688. {
  689. MessageBox.Show("上限值不为空,请选择上限符号或清空上限值", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  690. row.Activate();
  691. return -1;
  692. }
  693. if (min_val != "")
  694. {
  695. if (!StringUtil.IsNumber(min_val))
  696. {
  697. MessageBox.Show("外径下限值 请输入数字!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  698. row.Activate();
  699. return -1;
  700. }
  701. }
  702. if (max_val != "")
  703. {
  704. if (!StringUtil.IsNumber(max_val))
  705. {
  706. MessageBox.Show("外径上限值 请输入数字!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  707. row.Activate();
  708. return -1;
  709. }
  710. }
  711. if (min_val != "" && max_val != "")
  712. {
  713. if (Convert.ToDouble(max_val) < Convert.ToDouble(min_val))
  714. {
  715. MessageBox.Show("外径上限值不能小于下限值", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  716. row.Activate();
  717. return -1;
  718. }
  719. }
  720. string ratio_std = row.Cells["RATIO_STD"].Value.ToString();
  721. string ratio_replace = row.Cells["RATIO_REPLACE"].Value.ToString();
  722. if (ratio_std == "")
  723. {
  724. MessageBox.Show("请输入标准试验压力系数", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  725. row.Activate();
  726. return -1;
  727. }
  728. if (!StringUtil.IsNumber(ratio_std))
  729. {
  730. MessageBox.Show("标准试验压力系数:请输入数字", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  731. row.Activate();
  732. return -1;
  733. }
  734. if (Convert.ToDouble(ratio_std) < 0 || Convert.ToDouble(ratio_std) > 1)
  735. {
  736. MessageBox.Show("标准试验压力系数输入值不合法(值在0-1之间)", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  737. row.Activate();
  738. return -1;
  739. }
  740. if (ratio_replace != "")
  741. {
  742. if (!StringUtil.IsNumber(ratio_replace))
  743. {
  744. MessageBox.Show("替代试验压力系数:请输入数字", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  745. row.Activate();
  746. return -1;
  747. }
  748. if (Convert.ToDouble(ratio_replace) < 0 || Convert.ToDouble(ratio_replace) > 1)
  749. {
  750. MessageBox.Show("替代试验压力系数输入值不合法(值在0-1之间)", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  751. row.Activate();
  752. return -1;
  753. }
  754. }
  755. if (StringUtil.IsDouble(row.Cells["MAX_PRESS"].Value.ToString()) == false)
  756. {
  757. MessageUtil.ShowWarning("最大试验压力不是有效数字!");
  758. row.Activate();
  759. return -1;
  760. }
  761. else
  762. {
  763. if (double.Parse(row.Cells["MAX_PRESS"].Value.ToString()) > 250)
  764. {
  765. MessageUtil.ShowWarning("最大试验压力不能大于250MPa!");
  766. row.Activate();
  767. return -1;
  768. }
  769. }
  770. //验证重复
  771. string[] steels = ultraGrid2.Rows.Where(a => a.GetValue("CHK").ToUpper() == "TRUE").Select(a => a.GetValue("STEELCODE")).ToArray();
  772. string[] models = ultraGrid3.Rows.Where(a => a.GetValue("CHK").ToUpper() == "TRUE").Select(a => a.GetValue("MODEL_CODE")).ToArray();
  773. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.existsWaterRatio",
  774. new object[] { row.GetValue("STD_CODE"), row.GetValue("STD_STYLE"), row.GetValue("SIZE_MIN_SIGN"),
  775. row.GetValue("SIZE_MIN"), row.GetValue("SIZE_MAX_SIGN"), row.GetValue("SIZE_MAX"), row.GetValue("RATIO_STD"),
  776. row.GetValue("MAX_PRESS"), steels, models, row.GetValue("RATIO_ID"),row.GetValue("STD_CODE_NK") }, ob);
  777. if (dt.Rows.Count > 0)
  778. {
  779. MessageUtil.ShowWarning("标准、标准类别、外径、试验压力系数、最大试验压力、钢级、扣型、内控管理号组成的记录与水压系数主键["
  780. + dt.Rows[0]["RATIO_ID"].ToString() + "]重复!");
  781. row.Activate();
  782. return -1;
  783. }
  784. if (row.Cells["VALIDFLAG"].Value.ToString() == "") //新增
  785. {
  786. ArrayList list = new ArrayList();
  787. list.Add(row.Cells["RATIO_ID"].Value.ToString());
  788. list.Add(row.Cells["STD_CODE"].Value.ToString());
  789. list.Add(row.Cells["STD_NAME"].Text);
  790. list.Add(min_sign);
  791. list.Add(min_val);
  792. list.Add(max_sign);
  793. list.Add(max_val);
  794. list.Add(row.Cells["RATIO_STD"].Value.ToString());
  795. list.Add(row.Cells["RATIO_REPLACE"].Value.ToString());
  796. list.Add(this.UserInfo.GetUserName());
  797. list.Add(row.Cells["MEMO"].Value.ToString());
  798. list.Add(row.Cells["MAX_PRESS"].Value.ToString());
  799. list.Add(row.Cells["STD_STYLE"].Value.ToString());
  800. list.Add(row.Cells["STD_STYLE_DESC"].Value.ToString());
  801. list.Add(row.Cells["STD_CODE_NK"].Value.ToString());
  802. listA.Add(list);
  803. //onlyList.Add(row.Cells["STD_CODE"].Value.ToString() + row.Cells["STD_STYLE"].Value.ToString() +
  804. // min_sign + min_val + max_sign + max_val + row.Cells["RATIO_STD"].Value.ToString() + row.Cells["MAX_PRESS"].Value.ToString());
  805. }
  806. else
  807. {
  808. string[] units = ClsBaseInfo.GetUnitByUserName(row.GetValue("CREATE_NAME"), ob, "002001007", "002001001", "002023005");
  809. if (units[0] != UserInfo.GetDeptid() && UserInfo.GetUserID() != "admin")
  810. {
  811. MessageUtil.ShowWarning("只有" + units[1] + "才能修改本条记录!");
  812. row.Activate();
  813. return -1;
  814. }
  815. ArrayList list = new ArrayList();
  816. list.Add(row.Cells["RATIO_ID"].Value.ToString());
  817. list.Add(row.Cells["STD_CODE"].Value.ToString());
  818. list.Add(row.Cells["STD_NAME"].Text);
  819. list.Add(min_sign);
  820. list.Add(min_val);
  821. list.Add(max_sign);
  822. list.Add(max_val);
  823. list.Add(row.Cells["RATIO_STD"].Value.ToString());
  824. list.Add(row.Cells["RATIO_REPLACE"].Value.ToString());
  825. list.Add(this.UserInfo.GetUserName());
  826. list.Add(row.Cells["MEMO"].Value.ToString());
  827. list.Add(row.Cells["MAX_PRESS"].Value.ToString());
  828. list.Add(row.Cells["STD_STYLE"].Value.ToString());
  829. list.Add(row.Cells["STD_STYLE_DESC"].Value.ToString());
  830. list.Add(row.Cells["STD_CODE_NK"].Value.ToString());
  831. listU.Add(list);
  832. onlyList.Add(row.Cells["STD_CODE"].Value.ToString() + row.Cells["STD_STYLE"].Value.ToString() +
  833. min_sign + min_val + max_sign + max_val + row.Cells["RATIO_STD"].Value.ToString() + row.Cells["MAX_PRESS"].Value.ToString());
  834. }
  835. }
  836. }
  837. if (GetGrid2Data() == -1)
  838. return -1;
  839. if (GetGrid3Data() == -1)
  840. return -1;
  841. return 0;
  842. }
  843. private int GetGrid2Data()
  844. {
  845. listS = new ArrayList();
  846. ultraGrid2.UpdateData();
  847. UltraGridRow ugr = ultraGrid1.ActiveRow;
  848. if (ugr == null)
  849. return -1;
  850. int i = 0;
  851. foreach (UltraGridRow row in ultraGrid2.Rows)
  852. {
  853. if (row.Cells["CHK"].Value.ToString().ToUpper() == "TRUE")
  854. {
  855. i++;
  856. //if (ugr.Cells["VALIDFLAG"].Value.ToString() == "")
  857. //{
  858. // MessageBox.Show("当前激活的水压系数主键尚未写入数据,无法保存关联的钢级", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  859. // return -1;
  860. //}
  861. ArrayList list = new ArrayList();
  862. list.Add(row.Cells["RATIO_ID"].Value.ToString());
  863. list.Add(row.Cells["STEELCODE"].Value.ToString());
  864. list.Add(row.Cells["STEELNAME"].Value.ToString());
  865. list.Add(this.UserInfo.GetUserName());
  866. list.Add(row.Cells["MEMO"].Value.ToString());
  867. listS.Add(list);
  868. }
  869. }
  870. if (i == 0)
  871. {
  872. MessageUtil.ShowWarning("钢级至少选择一个!");
  873. return -1;
  874. }
  875. return 0;
  876. }
  877. private int GetGrid3Data()
  878. {
  879. listM = new ArrayList();
  880. ultraGrid3.UpdateData();
  881. UltraGridRow ugr = ultraGrid1.ActiveRow;
  882. if (ugr == null)
  883. return -1;
  884. int i = 0;
  885. foreach (UltraGridRow row in ultraGrid3.Rows)
  886. {
  887. if (row.Cells["CHK"].Value.ToString().ToUpper() == "TRUE")
  888. {
  889. i++;
  890. ArrayList list = new ArrayList();
  891. list.Add(row.Cells["RATIO_ID"].Value.ToString());
  892. list.Add(row.Cells["MODEL_CODE"].Value.ToString());
  893. list.Add(row.Cells["MODEL_DESC"].Value.ToString());
  894. list.Add(this.UserInfo.GetUserName());
  895. list.Add(row.Cells["MEMO"].Value.ToString());
  896. listM.Add(list);
  897. }
  898. }
  899. if (i == 0)
  900. {
  901. MessageUtil.ShowWarning("扣型至少选择一个!");
  902. return -1;
  903. }
  904. return 0;
  905. }
  906. private void ActiveGridRow()
  907. {
  908. foreach (UltraGridRow row in ultraGrid1.Rows)
  909. {
  910. if (row.Cells["RATIO_ID"].Value.ToString().Equals(_id))
  911. {
  912. row.Activate();
  913. break;
  914. }
  915. }
  916. }
  917. private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
  918. {
  919. List<string> listNoEdit = new List<string>();
  920. listNoEdit.Add("有效标志");
  921. listNoEdit.Add("创建人");
  922. listNoEdit.Add("创建时间");
  923. listNoEdit.Add("修改人");
  924. listNoEdit.Add("修改时间");
  925. listNoEdit.Add("删除人");
  926. listNoEdit.Add("删除时间");
  927. listNoEdit.Add("水压系数主键");
  928. List<string> listDrop = new List<string>();
  929. listDrop.Add("标准名称");
  930. listDrop.Add("符号");
  931. ControlGridSelectEdit(e, listNoEdit, listDrop, "CHK");
  932. BandCombo(e);
  933. if (isPasting)
  934. {
  935. // e.Row.SetValue("CHK", "True");
  936. e.Row.SetValue("ISPASTED", "1");
  937. pastStdCode = copyStdCode;
  938. this.ultraGrid1.Rows[ultraGrid1.Rows.Count - 1].Activate();
  939. }
  940. }
  941. private void BandCombo(InitializeRowEventArgs e)
  942. {
  943. e.Row.Cells["STD_NAME"].EditorComponent = ultraTextEditor2;
  944. e.Row.Cells["SIZE_MIN_SIGN"].EditorComponent = ultraComboEditor1;
  945. e.Row.Cells["SIZE_MAX_SIGN"].EditorComponent = ultraComboEditor2;
  946. }
  947. public void ControlGridSelectEdit(InitializeRowEventArgs e, List<string> listNoEdit, List<string> listDrop, string CkbKey)
  948. {
  949. if (e == null)
  950. return;
  951. if (e.Row.Cells[CkbKey].Value.ToString() == "True")
  952. {
  953. foreach (UltraGridCell cell in e.Row.Cells)
  954. {
  955. if (cell.Column.Header.Caption == "选择") continue;
  956. if (listNoEdit.Contains(cell.Column.Header.Caption))
  957. {
  958. cell.Activation = Activation.ActivateOnly;
  959. }
  960. else if (listDrop.Contains(cell.Column.Header.Caption))
  961. {
  962. cell.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  963. cell.Activation = Activation.AllowEdit;
  964. }
  965. else
  966. {
  967. cell.Activation = Activation.AllowEdit;
  968. }
  969. }
  970. }
  971. else
  972. {
  973. foreach (UltraGridCell cell in e.Row.Cells)
  974. {
  975. if (cell.Column.Header.Caption == "选择") continue;
  976. if (listDrop.Contains(cell.Column.Header.Caption))
  977. {
  978. cell.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
  979. cell.Activation = Activation.ActivateOnly;
  980. }
  981. else
  982. {
  983. cell.Activation = Activation.ActivateOnly;
  984. }
  985. }
  986. }
  987. }
  988. private void ShowWindow()
  989. {
  990. FrmWaterRatioStd wrs = new FrmWaterRatioStd();
  991. wrs.Ob = this.ob;
  992. wrs.ShowDialog();
  993. }
  994. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  995. {
  996. ultraGroupBox1.Enabled = ultraCheckEditor1.Checked;
  997. }
  998. private void ultraTextEditor2_EditorButtonClick(object sender, EditorButtonEventArgs e)
  999. {
  1000. this.Cursor = Cursors.WaitCursor;
  1001. string stdCode = ultraGrid1.ActiveRow.GetValue("STD_CODE");
  1002. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreWaterRatio.GetStd",
  1003. new object[] { _stdCode }, this.ob);
  1004. dt.Columns["STD_NAME"].Caption = "标准名称";
  1005. BaseInfoPopup popup = new BaseInfoPopup(dt, "STD_NAME", "STD_CODE");
  1006. popup.Load += ((a, b) =>
  1007. {
  1008. var row = popup.UltraGrid1.Rows.Where(c => c.GetValue("STD_CODE") == stdCode).FirstOrDefault();
  1009. if (row != null)
  1010. {
  1011. row.Activate();
  1012. }
  1013. this.Cursor = Cursors.Default;
  1014. });
  1015. if (popup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  1016. {
  1017. ultraGrid1.SetActiveRowValue("STD_NAME", popup.ChoicedRow.GetValue("STD_NAME"));
  1018. ultraGrid1.SetActiveRowValue("STD_CODE", popup.ChoicedRow.GetValue("STD_CODE"));
  1019. string s = popup.ChoicedRow.GetValue("STD_CODE");
  1020. ultraGrid1.ActiveRow.Update();
  1021. }
  1022. ultraGrid1.ActiveRow.Cells["STD_CODE"].Value = ultraGrid1.ActiveRow.Cells["STD_CODE"].Value.ToString();
  1023. if (ultraGrid1.ActiveRow.Cells["STD_CODE"].Value.ToString() == pastStdCode)
  1024. GetSteel(ultraGrid1.ActiveRow);
  1025. else
  1026. GetSteelNew(ultraGrid1.ActiveRow.Cells["RATIO_ID"].Value.ToString(), ultraGrid1.ActiveRow.Cells["STD_CODE"].Value.ToString());
  1027. }
  1028. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  1029. {
  1030. e.Cell.Row.Update();
  1031. }
  1032. private void ultraGrid3_CellChange(object sender, CellEventArgs e)
  1033. {
  1034. e.Cell.Row.Update();
  1035. }
  1036. }
  1037. }