QCM030716.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 Infragistics.Win.UltraWinGrid;
  11. namespace Core.LZMes.Client.QCM.QCM03
  12. {
  13. public partial class QCM030716 : FrmBase
  14. {
  15. public QCM030716()
  16. {
  17. InitializeComponent();
  18. }
  19. public string lock_id = "";
  20. private void QCM030703_Load(object sender, EventArgs e)
  21. {
  22. try
  23. {
  24. this.dataSet6.Clear();
  25. string sic = lock_id;
  26. CoreClientParam ccp = new CoreClientParam();
  27. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  28. if (lock_id.Contains("Y"))
  29. {
  30. ccp.MethodName = "getToleranceInfoNewY";
  31. }
  32. else
  33. {
  34. ccp.MethodName = "getToleranceInfo";
  35. }
  36. ccp.ServerParams = new object[] { sic };
  37. ccp.SourceDataTable = this.dataSet6.Tables[0];
  38. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  39. this.dataSet7.Clear();
  40. ccp = new CoreClientParam();
  41. ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
  42. ccp.MethodName = "getQcmJudgeMeasureJ";
  43. ccp.ServerParams = new object[] { sic };
  44. ccp.SourceDataTable = this.dataSet7.Tables[0];
  45. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  46. RefreshAndAutoSize(ultraGrid6);
  47. RefreshAndAutoSize(ultraGrid7);
  48. }
  49. catch (Exception ex)
  50. {
  51. System.Diagnostics.Debug.WriteLine(ex.ToString());
  52. MessageBox.Show("系统出错,请联系管理人员", "警告");
  53. }
  54. }
  55. public static void RefreshAndAutoSize(UltraGrid ultraGrid)
  56. {
  57. try
  58. {
  59. ultraGrid.BeginUpdate();
  60. foreach (UltraGridBand band in ultraGrid.DisplayLayout.Bands)
  61. {
  62. foreach (UltraGridColumn column in band.Columns)
  63. {
  64. column.PerformAutoResize(PerformAutoSizeType.AllRowsInBand, band.ColHeadersVisible ? true : false);
  65. }
  66. }
  67. }
  68. catch { }
  69. ultraGrid.EndUpdate();
  70. }
  71. }
  72. }