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