UIJ030050.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. namespace Core.LZMes.Client.UIJ
  11. {
  12. public partial class UIJ030050 : FrmBase
  13. {
  14. public UIJ030050()
  15. {
  16. InitializeComponent();
  17. }
  18. public override void ToolBar_Click(object sender, string ToolbarKey)
  19. {
  20. switch (ToolbarKey)
  21. {
  22. case "Query":
  23. this.DoQuery();
  24. break;
  25. case "Save":
  26. this.DoSave();
  27. break;
  28. case "Exit":
  29. this.Close();
  30. break;
  31. }
  32. }
  33. /// <summary>
  34. /// 查询需要回退的发运明细
  35. /// </summary>
  36. private void DoQuery()
  37. {
  38. string dlivDirNo = this.textBox1.Text.Trim();
  39. this.dataSet1.Tables[0].Clear();
  40. CoreClientParam ccp = new CoreClientParam();
  41. ccp.ServerName = "UIJ.UIJ03.UIJ030050";
  42. ccp.MethodName = "queryShipRetRs";
  43. ccp.ServerParams = new Object[] { dlivDirNo };
  44. ccp.SourceDataTable = this.dataSet1.Tables[0];
  45. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  46. }
  47. private void DoUpdate()
  48. {
  49. if (DialogResult.Yes != MessageBox.Show("请确保需要回退的数据为异常指示号!", "提示", MessageBoxButtons.YesNo))
  50. {
  51. return;
  52. }
  53. string dlivDirNo = this.textBox1.Text.Trim();
  54. if (dlivDirNo=="")
  55. {
  56. MessageBox.Show("指示号不能为空");
  57. return;
  58. }
  59. CoreClientParam ccp = new CoreClientParam();
  60. ccp.ServerName = "UIJ.UIJ03.UIJ030050";
  61. ccp.MethodName = "update";
  62. ccp.ServerParams = new object[] { dlivDirNo };
  63. ccp.SourceDataTable = this.dataSet1.Tables[0];
  64. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  65. //string dlivDirNo = this.textBox1.Text.Trim();
  66. //this.dataSet1.Tables[0].Clear();
  67. //string[] param = new string[1];
  68. //param[0] = dlivDirNo;
  69. //CoreClientParam ccp = new CoreClientParam();
  70. //ccp.ServerName = "UIJ.UIJ03.UIJ030050";
  71. //ccp.MethodName = "update";
  72. //ccp.ServerParams = new Object[] { dlivDirNo };
  73. //ccp.SourceDataTable = this.dataSet1.Tables[0];
  74. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  75. }
  76. /// <summary>
  77. /// 查询异常明细
  78. /// </summary>
  79. private void query1()
  80. {
  81. string dlivDirNo = this.textBox1.Text.Trim();
  82. this.dataSet1.Tables[0].Clear();
  83. CoreClientParam ccp = new CoreClientParam();
  84. ccp.ServerName = "UIJ.UIJ03.UIJ030050";
  85. ccp.MethodName = "queryShipRetRsNoCarNo";
  86. ccp.ServerParams = new Object[] { dlivDirNo };
  87. ccp.SourceDataTable = this.dataSet1.Tables[0];
  88. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  89. }
  90. /// <summary>
  91. /// 明细回退
  92. /// </summary>
  93. private void DoSave()
  94. {
  95. string dlivDirNo = "";
  96. DataRowCollection drs = this.dataSet1.Tables[0].Rows;
  97. if (drs.Count < 1)
  98. {
  99. MessageBox.Show("没有查询到可以回退的发运明细,请确认后再进行回退操作!");
  100. return;
  101. }
  102. String return_reson = this.textBox2.Text.ToString();
  103. if (return_reson.Length < 1)
  104. {
  105. MessageBox.Show("请输入退回原因再进行回退操作!");
  106. return;
  107. }
  108. dlivDirNo = drs[0]["DLIV_DIRNO"].ToString();
  109. String regId = this.UserInfo.GetUserID();
  110. CoreClientParam ccp = new CoreClientParam();
  111. ccp.ServerName = "UIJ.UIJ03.UIJ030050";
  112. ccp.MethodName = "returnShipResult";
  113. ccp.ServerParams = new Object[] { dlivDirNo, regId, return_reson };
  114. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  115. if (ccp.ReturnCode != 0)
  116. return;
  117. this.DoQuery();
  118. }
  119. private void label2_Click(object sender, EventArgs e)
  120. {
  121. this.query1();
  122. }
  123. private void button1_Click(object sender, EventArgs e)
  124. {
  125. this.DoUpdate();
  126. }
  127. }
  128. }