frmPopTaskOfferDelay.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 com.hnshituo.pur.vo;
  10. using Core.Mes.Client.Comm.Tool;
  11. using CoreFS.CA06;
  12. using Pur.Entity;
  13. using Pur.Entity.pur_planEntity;
  14. namespace Pur.Pop_upWindow
  15. {
  16. public partial class frmPopTaskOfferDelay : FrmPmsBase
  17. {
  18. string strTaskId = "";
  19. public string strTips = "0";
  20. public frmPopTaskOfferDelay()
  21. {
  22. InitializeComponent();
  23. }
  24. public frmPopTaskOfferDelay(OpeBase Ob,string TaskId)
  25. {
  26. InitializeComponent();
  27. this.ob = Ob;
  28. this.strTaskId = TaskId;
  29. }
  30. private void frmPopTaskOfferDelay_Load(object sender, EventArgs e)
  31. {
  32. PurTaskMEntity ptm = this.execute<PurTaskMEntity>("com.hnshituo.pur.purplan.service.TaskMService", "findById", new object[] { strTaskId });
  33. ultDt_OFFER_TIME_END.Value = ptm.OfferTimeEnd;//报价结束时间
  34. ultDt_OFFER_TIME_START.Value = ptm.OfferTimeStart;//报价开始时间
  35. this.Text = "延长任务单【" + strTaskId + "】报价时间";
  36. }
  37. private void btn_upd_Click(object sender, EventArgs e)
  38. {
  39. PurTaskMEntity m = new PurTaskMEntity();
  40. m.TaskId = strTaskId;
  41. if ((DateTime)(ultDt_OFFER_TIME_END.Value) <= System.DateTime.Now)
  42. {
  43. MessageUtil.ShowTips("报价结束时间不能<=当前时间");
  44. return;
  45. }
  46. if ((DateTime)(ultDt_OFFER_TIME_END.Value) <= (DateTime)(ultDt_OFFER_TIME_START.Value))
  47. {
  48. MessageUtil.ShowTips("报价结束时间必须>=报价开始时间");
  49. return;
  50. }
  51. m.OfferTimeStart = DateTime.Parse(ultDt_OFFER_TIME_START.Value.ToString());
  52. m.OfferTimeEnd = DateTime.Parse(ultDt_OFFER_TIME_END.Value.ToString());
  53. if (MessageUtil.ShowYesNoAndQuestion("确定延长报价时间?").Equals(DialogResult.No))
  54. {
  55. return;
  56. }
  57. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskMService", "doUpdate", new object[] { m});
  58. if (crt.Resultcode != 0)
  59. {
  60. MessageUtil.ShowTips("操作失败 " + crt.Resultmsg);
  61. return;
  62. }
  63. MessageUtil.ShowTips("操作成功!");
  64. strTips = "1";
  65. this.Close();
  66. }
  67. }
  68. }