SummaryOK.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 Core.Mes.Client.Comm.Control;
  10. using Core.Mes.Client.Comm.Tool;
  11. using CoreFS.CA06;using Pur.Entity;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Pur.configure;
  14. using Pur.Entity.configureEntity;
  15. using com.hnshituo.pur.vo;
  16. using Pur.Entity.pur_planEntity;
  17. namespace Pur.pur_plan
  18. {
  19. public partial class SummaryOK : FrmPmsBase
  20. {
  21. public SummaryOK()
  22. {
  23. InitializeComponent();
  24. }
  25. UltraGridRow uge = null;
  26. public SummaryOK(OpeBase ob, UltraGridRow ugr)
  27. {
  28. InitializeComponent();
  29. this.ob = ob;
  30. uge = ugr;
  31. }
  32. /// <summary>
  33. /// 界面加载
  34. /// </summary>
  35. /// <param name="sender"></param>
  36. /// <param name="e"></param>
  37. private void SummaryOK_Load(object sender, EventArgs e)
  38. {
  39. txt_taskId.Text = uge.Cells["taskId"].Value.ToString();
  40. txt_taskName.Text = uge.Cells["taskName"].Value.ToString();
  41. txt_negDate.Value = DateTime.Now;
  42. txt_mngOrgName.Text = UserInfo.GetDepartment();
  43. txt_buyerUsername.Text = UserInfo.GetUserName();
  44. }
  45. /// <summary>
  46. /// 科室弹窗
  47. /// </summary>
  48. /// <param name="sender"></param>
  49. /// <param name="e"></param>
  50. string mngOrgId = null;
  51. private void txt_mngOrgName_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  52. {
  53. frmdepartment fdt = new frmdepartment(ob);
  54. fdt.ShowDialog();
  55. if (fdt.BuyerUnitDesc == null)
  56. return;
  57. txt_mngOrgName.Text = fdt.BuyerUnitDesc;
  58. mngOrgId = fdt.BuyerUnitCode;
  59. }
  60. /// <summary>
  61. /// 采购员弹窗
  62. /// </summary>
  63. /// <param name="sender"></param>
  64. /// <param name="e"></param>
  65. string buyerUsrId = null;
  66. private void txt_buyerUsername_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  67. {
  68. SetectManByDept SmbD = new SetectManByDept(ob);
  69. SmbD.ShowDialog();
  70. if (SmbD.StrUserID == null)
  71. return;
  72. txt_buyerUsername.Text = SmbD.StrUserName;
  73. buyerUsrId = SmbD.StrUserID;
  74. }
  75. /// <summary>
  76. /// 菜单栏
  77. /// </summary>
  78. /// <param name="sender"></param>
  79. /// <param name="e"></param>
  80. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  81. {
  82. switch (e.Tool.Key.ToString())
  83. {
  84. case "confirm":
  85. confirm_Summary();
  86. break;
  87. case "ESC":
  88. this.Close();
  89. break;
  90. }
  91. }
  92. /// <summary>
  93. /// 确认
  94. /// </summary>
  95. private void confirm_Summary()
  96. {
  97. try
  98. {
  99. PurTaskRecordEntity TkR = new PurTaskRecordEntity();
  100. TkR.Validflag = "1";
  101. TkR.Status = "2";
  102. TkR.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
  103. TkR.CreateTime = DateTime.Now;
  104. TkR.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
  105. TkR.BuyerUserid = UserInfo.GetUserID();
  106. TkR.BuyerUsername = UserInfo.GetUserName();
  107. TkR.MngOrgId = UserInfo.GetDeptid();
  108. TkR.MngOrgName = UserInfo.GetDepartment();
  109. if (txt_negDate.Text=="")
  110. {
  111. MessageUtil.ShowTips("谈判日期不能为空!");
  112. txt_negDate.Focus();
  113. return;
  114. }
  115. TkR.NegDate = Convert.ToDateTime(txt_negDate.Value);
  116. TkR.TaskId = txt_taskId.Text.ToString().Trim();
  117. TkR.TaskName = txt_taskName.Text.ToString().Trim();
  118. if (String.IsNullOrEmpty(txt_procRecord.Text.ToString()))
  119. {
  120. MessageUtil.ShowTips("纪要过程不能为空!");
  121. txt_procRecord.Focus();
  122. return;
  123. }
  124. TkR.ProcRecord = txt_procRecord.Text.ToString().Trim();
  125. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskRecordService", "doInsert_Record", new object[] { TkR });
  126. if (crt.Resultcode != 0)
  127. {
  128. MessageUtil.ShowTips("采购纪要评审单生成失败!" + crt.Resultmsg);
  129. return;
  130. }
  131. else
  132. {
  133. MessageUtil.ShowTips("操作成功:生成采购纪要:" + crt.Resultmsg);
  134. this.Close();
  135. }
  136. }
  137. catch (Exception ex)
  138. {
  139. MessageBox.Show("生成失败:" + ex);
  140. }
  141. }
  142. }
  143. }