CraftSelect.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Tool;
  3. using Core.StlMes.Client.Judge.Commons;
  4. using CoreFS.CA06;
  5. using Infragistics.Win.UltraWinGrid;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Windows.Forms;
  14. namespace Core.StlMes.Client.Judge.Forms
  15. {
  16. public partial class CraftSelect : FrmBase
  17. {
  18. private Dal _d;
  19. public CraftSelect(OpeBase ob)
  20. {
  21. if (!"admin".Equals(UserInfo.GetUserName()) && !"屈松山".Equals(UserInfo.GetUserName()) && !"宋丹".Equals(UserInfo.GetUserName()))
  22. {
  23. throw new Exception("您没有该权限!");
  24. }
  25. InitializeComponent();
  26. _d = new Dal(ob);
  27. }
  28. public UltraGridRow row {
  29. get { return ultraGrid1.ActiveRow; }
  30. }
  31. public void Query(string ordLnPk)
  32. {
  33. DataTable dt = _d.GetTableByXmlId("JdgCraftOrdDesign.getCraftInfo", ordLnPk);
  34. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  35. GridHelper.RefreshAndAutoSize(ultraGrid1);
  36. ultraGrid1.EndUpdate();
  37. }
  38. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  39. {
  40. switch (e.Tool.Key)
  41. {
  42. case "Save":
  43. UltraGridRow urg = ultraGrid1.ActiveRow;
  44. if (urg == null)
  45. {
  46. MessageUtil.ShowTips("请选择数据!");
  47. return;
  48. }
  49. this.DialogResult = DialogResult.OK;
  50. break;
  51. case "Close":
  52. this.DialogResult = DialogResult.Cancel;
  53. break;
  54. }
  55. }
  56. }
  57. }