ucRhsDevInfo.cs.svn-base 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. using System.Collections;
  5. using Core.LgMes.Client.Comm;
  6. namespace Core.LgMes.Client.LgJobMgt
  7. {
  8. public partial class ucRhsDevInfo : UserControl
  9. {
  10. public ucRhsDevInfo()
  11. {
  12. InitializeComponent();
  13. CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式
  14. }
  15. public Image m_imageDefault = null;
  16. private void ucRhsDevInfo_Load(object sender, EventArgs e)
  17. {
  18. ultraDataSource1.Rows.Add(new object[] { "", "", "", "", "", "", "", "", "", "", m_imageDefault, "", "", "", "", "", "", "", "", "" });
  19. }
  20. public void ResetData()
  21. {
  22. try
  23. {
  24. this.ultraDataSource1.Rows[0][0] = null;
  25. this.ultraDataSource1.Rows[0][1] = "";
  26. this.ultraDataSource1.Rows[0][2] = "";
  27. this.ultraDataSource1.Rows[0][3] = "";
  28. this.ultraDataSource1.Rows[0][4] = "";
  29. this.ultraDataSource1.Rows[0][5] = "";
  30. this.ultraDataSource1.Rows[0][6] = "";
  31. this.ultraDataSource1.Rows[0][7] = "";
  32. this.ultraDataSource1.Rows[0][8] = "";
  33. this.ultraDataSource1.Rows[0][9] = "";
  34. this.ultraDataSource1.Rows[0][10] = m_imageDefault;
  35. this.ultraDataSource1.Rows[0][11] = "";
  36. this.ultraDataSource1.Rows[0][12] = "";
  37. this.ultraDataSource1.Rows[0][13] = "";
  38. this.ultraDataSource1.Rows[0][14] = "";
  39. this.ultraDataSource1.Rows[0][15] = "";
  40. this.ultraDataSource1.Rows[0][16] = "";
  41. this.ultraDataSource1.Rows[0][17] = "";
  42. this.ultraDataSource1.Rows[0][18] = "";
  43. this.ultraDataSource1.Rows[0][19] = "";
  44. this.ultraDataSource1.Rows[0][20] = "";
  45. this.ultraDataSource1.Rows[0][21] = "";
  46. }
  47. catch { }
  48. }
  49. public void SetData(Hashtable ar)
  50. {
  51. if (ar == null || ar.Count == 0)
  52. return;
  53. int count = this.ultraDataSource1.Band.Columns.Count;
  54. string strKey = "";
  55. for (int i = 0; i < count; i++)
  56. {
  57. try
  58. {
  59. strKey = this.ultraDataSource1.Band.Columns[i].Key;
  60. if (ar.Contains(strKey))
  61. this.ultraDataSource1.Rows[0][i] = ar[strKey];
  62. else
  63. {
  64. if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime))
  65. this.ultraDataSource1.Rows[0][i] = null;
  66. else
  67. this.ultraDataSource1.Rows[0][i] = "";
  68. }
  69. }
  70. catch { }
  71. }
  72. }
  73. private void ultraGrid2_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
  74. {
  75. }
  76. }
  77. }