FrmBuyYP.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. using Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using Infragistics.Win.UltraWinGrid;
  13. using System.Net;
  14. using System.Collections;
  15. using CoreFS.SA06;
  16. namespace Core.StlMes.Client.BuyBillet
  17. {
  18. public partial class FrmBuyYP : FrmBase
  19. {
  20. private new CoreFS.CA06.OpeBase ob = new OpeBase();
  21. private string id = string.Empty;
  22. public event Action OnAddNewYpFinished;
  23. public FrmBuyYP(OpeBase ops)
  24. {
  25. this.ob = ops;
  26. InitializeComponent();
  27. }
  28. private void btn_close_Click(object sender, EventArgs e)
  29. {
  30. this.Close();
  31. }
  32. private void FrmBuyYP_Load(object sender, EventArgs e)
  33. {
  34. Bind_PiKind();
  35. }
  36. private void btn_save_Click(object sender, EventArgs e)
  37. {
  38. string pkind = this.cb_pkind.Value.ToString();
  39. string gz = txt_steelgrade.Text.Trim();
  40. string cic = txt_cic.Text.Trim();
  41. string dm = txt_dm.Value.ToString();
  42. string dbpc =txt_dbpc.Value.ToString();
  43. string weight = txt_weight.Value.ToString();
  44. ServerHelper.SetData("com.steering.pss.buybillet.Buybillet.InsertBUY_GP_REQ_YP", new object[] { pkind,gz,cic,dm,dbpc,weight }, this.ob);
  45. if (OnAddNewYpFinished != null)
  46. {
  47. OnAddNewYpFinished();
  48. }
  49. this.Close();
  50. }
  51. private void Bind_PiKind()
  52. {
  53. DataTable dt = ServerHelper.GetData("com.steering.pss.buybillet.Buybillet.queryGP_PIKIND", new object[] { }, this.ob);
  54. this.cb_pkind.DataSource = dt;
  55. this.cb_pkind.DisplayMember = "NAME";
  56. this.cb_pkind.ValueMember = "CODE";
  57. }
  58. private void txt_cb_gz_Click(object sender, EventArgs e)
  59. {
  60. FrmYpGradeCIC frm = new FrmYpGradeCIC(this.ob);
  61. frm.onSelection += new Action<string, string>(frm_onSelection);
  62. frm.ShowDialog();
  63. }
  64. private void frm_onSelection(string cic, string steelgrades)
  65. {
  66. txt_cic.Text = cic;
  67. txt_steelgrade.Text = steelgrades;
  68. }
  69. }
  70. }