DesignStatus.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using Infragistics.Win.UltraWinGrid;
  13. namespace Core.StlMes.Client.SaleOrder.Control
  14. {
  15. public partial class DesignStatus : UserControl
  16. {
  17. public DesignStatus()
  18. {
  19. InitializeComponent();
  20. }
  21. public void DoQuery(String ordNo, OpeBase ob)
  22. {
  23. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreConReviewInfo.getReviewInfomation", new Object[] { ordNo }, ob);
  24. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
  25. SetColor(ultraGridStatus, ob);
  26. updateListItem();
  27. }
  28. public void DoQuery(String ordNo, String ordLnPk, OpeBase ob)
  29. {
  30. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreConReviewInfo.getReviewInfomation", new Object[] { ordNo, ordLnPk }, ob);
  31. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
  32. SetColor(ultraGridStatus, ob);
  33. updateListItem();
  34. }
  35. public void DoClear()
  36. {
  37. dataTable1.Clear();
  38. }
  39. private void SetColor(UltraGrid ug, OpeBase ob)
  40. {
  41. foreach (UltraGridRow ugr in ug.Rows)
  42. {
  43. if (ugr.Cells["IS_CURT_REVIEW"].Value.ToString().Equals("否"))
  44. {
  45. ugr.Appearance.ForeColor = Color.Red;
  46. }
  47. else
  48. {
  49. if (ugr.Cells["REVIEW_ITM"].Value.ToString().Equals("技术") && ugr.Cells["REVIEW_STATUS"].Value.ToString().Equals("评审中"))
  50. {
  51. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreConReviewInfo.getLastQualityDept", new Object[] { ugr.Cells["LIST_PK_VAL"].Text.Trim() }, ob);
  52. if (dt != null && dt.Rows.Count > 0)
  53. {
  54. ugr.Cells["REVIEW_DEPT"].Value = dt.Rows[0][0].ToString();
  55. }
  56. }
  57. }
  58. }
  59. }
  60. private void updateListItem()
  61. {
  62. foreach (UltraGridRow ugr in ultraGridStatus.Rows)
  63. {
  64. if (ugr.Cells["RT_REVIEW_ITM"].Value.ToString().Contains("业务主管") && !ugr.Cells["ORDER_NO"].Value.ToString().StartsWith("TH"))
  65. {
  66. ugr.Cells["REVIEW_ITM"].Value = "价格(业务主管)";
  67. }
  68. if (ugr.Cells["RT_REVIEW_ITM"].Value.ToString().Contains("主管经理")
  69. && ugr.Cells["REVIEW_ITM"].Value.ToString().Contains("价格"))
  70. {
  71. ugr.Cells["REVIEW_ITM"].Value = "价格(主管经理)";
  72. }
  73. }
  74. }
  75. }
  76. }