ucCcmPlan.cs 3.0 KB

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