OrderLineChoicePopup.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using Core.Mes.Client.Comm.Control;
  11. using Core.Mes.Client.Comm.Server;
  12. using CoreFS.CA06;
  13. using Infragistics.Win.UltraWinGrid;
  14. namespace Core.StlMes.Client.SaleOrder.Dialog
  15. {
  16. public partial class OrderLineChoicePopup : FrmBase
  17. {
  18. private string _ordLnPk = "";
  19. private ArrayList _ordLnPkList;
  20. public ArrayList OrdLnPkList
  21. {
  22. get { return _ordLnPkList; }
  23. set { _ordLnPkList = value; }
  24. }
  25. public OrderLineChoicePopup(string ordPk, string ordLnPk, OpeBase ob)
  26. {
  27. InitializeComponent();
  28. _ordLnPk = ordLnPk;
  29. this.ob = ob;
  30. Query(ordPk, ordLnPk);
  31. }
  32. private void Query(string ordPk, string ordLnPk)
  33. {
  34. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.ReviewForm.CoreOrderReviewTechnology.getOrdSeqByOrdPk",
  35. new object[] { ordPk }, ob);
  36. GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
  37. foreach (UltraGridRow row in ultraGrid1.Rows)
  38. {
  39. if (row.GetValue("ORD_LN_PK") == ordLnPk)
  40. {
  41. row.Cells["CHK"].Value = true;
  42. row.Cells["CHK"].Activation = Activation.ActivateOnly;
  43. break;
  44. }
  45. }
  46. }
  47. private void ultraButton1_Click(object sender, EventArgs e)
  48. {
  49. ultraGrid1.UpdateData();
  50. _ordLnPkList = new ArrayList();
  51. foreach (UltraGridRow row in ultraGrid1.Rows)
  52. {
  53. if (row.GetValue("CHK") == "True" && _ordLnPk != row.GetValue("ORD_LN_PK"))
  54. {
  55. _ordLnPkList.Add(row.GetValue("ORD_LN_PK"));
  56. }
  57. }
  58. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  59. }
  60. private void ultraButton2_Click(object sender, EventArgs e)
  61. {
  62. this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  63. }
  64. private void ultraGrid1_AfterCellUpdate(object sender, CellEventArgs e)
  65. {
  66. ultraGrid1.UpdateData();
  67. }
  68. }
  69. }