ucBofIronInfo.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. using Core.LgMes.Client.Comm;
  10. namespace Core.LgMes.Client.LgJobMgt
  11. {
  12. public partial class ucBofIronInfo : UserControl
  13. {
  14. public ucBofIronInfo()
  15. {
  16. InitializeComponent();
  17. CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式
  18. }
  19. private void ucBofIronInfo_Load(object sender, EventArgs e)
  20. {
  21. ultraDataSource1.Rows.Add(new object[] { "", "", "", "", "", "" });
  22. }
  23. public void ResetData()
  24. {
  25. try
  26. {
  27. for (int i = 0; i < this.ultraDataSource1.Band.Columns.Count; i++)
  28. {
  29. if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime))
  30. this.ultraDataSource1.Rows[0][i] = null;
  31. else
  32. this.ultraDataSource1.Rows[0][i] = "";
  33. }
  34. }
  35. catch { }
  36. }
  37. public void SetData(Hashtable ar)
  38. {
  39. if (ar == null || ar.Count == 0)
  40. return;
  41. int count = this.ultraDataSource1.Band.Columns.Count;
  42. string strKey = "";
  43. for (int i = 0; i < count; i++)
  44. {
  45. try
  46. {
  47. strKey = this.ultraDataSource1.Band.Columns[i].Key;
  48. if (ar.Contains(strKey))
  49. if (strKey == "MOLIRNTYPE") //铁水来源
  50. {
  51. string strMolirnType = "";
  52. if (ar[strKey].ToString().Length == 2)
  53. {
  54. switch (ar[strKey].ToString().Substring(0, 1))
  55. {
  56. case "1":
  57. strMolirnType = "半钢";
  58. break;
  59. case "2":
  60. strMolirnType = "脱硫";
  61. break;
  62. case "3":
  63. strMolirnType = "混铁炉";
  64. break;
  65. case "4":
  66. strMolirnType = "直上";
  67. break;
  68. default:
  69. break;
  70. }
  71. }
  72. this.ultraDataSource1.Rows[0][i] = strMolirnType;
  73. }
  74. else
  75. this.ultraDataSource1.Rows[0][i] = ar[strKey];
  76. else
  77. {
  78. if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime))
  79. this.ultraDataSource1.Rows[0][i] = null;
  80. else
  81. this.ultraDataSource1.Rows[0][i] = "";
  82. }
  83. }
  84. catch { }
  85. }
  86. }
  87. }
  88. }