Form_PRIORITY.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using WCS.Workflow;
  11. namespace WCS_Client.From
  12. {
  13. public partial class Form_PRIORITY : Form
  14. {
  15. string TASK_NO = string.Empty;
  16. public Form_PRIORITY(string task_no,decimal priority)
  17. {
  18. InitializeComponent();
  19. TASK_NO = task_no;
  20. lblTask_no.Text = task_no;
  21. nudPRIORITY.Value = priority;
  22. }
  23. private void btnCancel_Click(object sender, EventArgs e)
  24. {
  25. Close();
  26. }
  27. private void btnUpdateSave_Click(object sender, EventArgs e)
  28. {
  29. string result = TryCachHelper.TryExecute((db) =>
  30. {
  31. BaseWorkflow.TaskUpdatePriority(db, Convert.ToInt32(TASK_NO),Convert.ToInt32(nudPRIORITY.Value));
  32. });
  33. if (string.IsNullOrWhiteSpace(result))
  34. {
  35. MessageBox.Show(string.Format("任务[{0}]修改优先级为[{1}]成功!", TASK_NO, nudPRIORITY.Value));
  36. }
  37. else
  38. {
  39. MessageBox.Show(string.Format("任务[{0}]修改优先级为[{1}]失败!", TASK_NO, nudPRIORITY.Value));
  40. }
  41. Close();
  42. }
  43. }
  44. }