FrmBasePrdcrRStation.cs 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using Infragistics.Win.UltraWinGrid;
  13. using System.Collections;
  14. using Core.Mes.Client.Comm.Tool;
  15. namespace Core.StlMes.Client.SaleBase
  16. {
  17. public partial class FrmBasePrdcrRStation : FrmBase
  18. {
  19. public FrmBasePrdcrRStation()
  20. {
  21. InitializeComponent();
  22. }
  23. private void FrmBasePrdcrRStation_Load(object sender, EventArgs e)
  24. {
  25. }
  26. public override void ToolBar_Click(object sender, string ToolbarKey)
  27. {
  28. switch (ToolbarKey)
  29. {
  30. case "Query":
  31. DoQuery();
  32. break;
  33. case "Save":
  34. DoSave();
  35. break;
  36. case "Close":
  37. this.Close();
  38. break;
  39. }
  40. }
  41. private void DoQuery()
  42. {
  43. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.base.CoreBasePrdcrRStation.getPrdcrInfo", null, this.ob);
  44. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  45. }
  46. private void DoSave()
  47. {
  48. ultragdPrdcr.UpdateData();
  49. ultragdStation.UpdateData();
  50. UltraGridRow ugr = ultragdPrdcr.ActiveRow;
  51. string baseCode = ugr.Cells["BASECODE"].Value.ToString();
  52. string baseName = ugr.Cells["BASENAME"].Value.ToString();
  53. ArrayList parm = new ArrayList();
  54. if (MessageUtil.ShowYesNoAndQuestion("是否保存数据?") == DialogResult.No) return;
  55. foreach (UltraGridRow row in ultragdStation.Rows)
  56. {
  57. if (row.Cells["CHK"].Value.ToString().ToUpper() == "TRUE")
  58. {
  59. ArrayList list = new ArrayList();
  60. list.Add(baseCode);
  61. list.Add(baseName);
  62. list.Add(row.Cells["STATION_CODE"].Value.ToString());
  63. list.Add(row.Cells["STATION_DESC"].Value.ToString());
  64. list.Add(row.Cells["PROCESS_CDOE"].Value.ToString());
  65. list.Add(row.Cells["PROCESS_DESC"].Value.ToString());
  66. list.Add(row.Cells["PROCESS_CDOE_C"].Value.ToString());
  67. list.Add(row.Cells["PROCESS_DESC_C"].Value.ToString());
  68. list.Add(UserInfo.GetUserName());
  69. parm.Add(list);
  70. }
  71. }
  72. int count = ServerHelper.SetData("com.steering.pss.sale.base.CoreBasePrdcrRStation.save", new object[] { baseCode, parm }, this.ob);
  73. if (count > 0)
  74. {
  75. MessageUtil.ShowTips("保存成功!");
  76. }
  77. }
  78. private void ultragdPrdcr_AfterRowActivate(object sender, EventArgs e)
  79. {
  80. UltraGridRow ugr = ultragdPrdcr.ActiveRow;
  81. if (ugr == null)
  82. return;
  83. string baseCode = ugr.Cells["BASECODE"].Value.ToString();
  84. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.base.CoreBasePrdcrRStation.getStationInfo", new object[] { baseCode }, this.ob);
  85. GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
  86. }
  87. }
  88. }