您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MealSegmentSetPage.cs 1.6 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using HKLib.Dto;
  2. using HKLib.Interfaces;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. namespace HKCardManager.UserPages
  13. {
  14. public partial class MealSegmentSetPage : UserControl
  15. {
  16. public MealSegmentSetPage()
  17. {
  18. InitializeComponent();
  19. this.SizeChanged += MealSegmentSetPage_SizeChanged;
  20. }
  21. private void MealSegmentSetPage_SizeChanged(object? sender, EventArgs e)
  22. {
  23. panel1.Left = (this.Width - panel1.Width) / 2;
  24. panel1.Top = (this.Height - panel1.Height) / 2;
  25. }
  26. private void button1_Click(object sender, EventArgs e)
  27. {
  28. var data = new TimeSpilte()
  29. {
  30. AMStartTime = dateTimePicker1.Value,
  31. AMEndTime = dateTimePicker4.Value,
  32. PMStartTime = dateTimePicker2.Value,
  33. PMEndTime = dateTimePicker5.Value,
  34. ATStartTime = dateTimePicker3.Value,
  35. ATEndTime = dateTimePicker6.Value
  36. };
  37. Task.Factory.StartNew(() =>
  38. {
  39. if (HKLibHelper.SetTime(data))
  40. {
  41. MessageLogNotify.GetInstance.Show("设置餐段时间成功");
  42. }
  43. else
  44. {
  45. MessageLogNotify.GetInstance.Show("设置时间段失败,请重试!");
  46. }
  47. });
  48. }
  49. }
  50. }