ucCcmPlan.cs 2.9 KB

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