using System; using System.Windows.Forms; namespace WindowsFormsApp2 { public partial class Change_shift : Form { public static Setting cam_setting = new Setting(); public Change_shift() { InitializeComponent(); } private void label1_Click(object sender, EventArgs e) { } private void Change_shift_Load(object sender, EventArgs e) { this.numericUpDown_A_hour.Value = DialogSetup.cam_setting.changeshift.Ah; this.numericUpDown_A_minute.Value = DialogSetup.cam_setting.changeshift.Am; this.numericUpDown_B_hour.Value = DialogSetup.cam_setting.changeshift.Bh; this.numericUpDown_B_minute.Value = DialogSetup.cam_setting.changeshift.Bm; this.numericUpDown_C_hour.Value = DialogSetup.cam_setting.changeshift.Ch; this.numericUpDown_C_minute.Value = DialogSetup.cam_setting.changeshift.Cm; } private void button_apply_Click(object sender, EventArgs e) { if (this.radioButton_time.Checked == true) { cam_setting.shift_byhand = 0; cam_setting.shift_time = 1; } else if (this.radioButton_byhand.Checked == true) { cam_setting.shift_byhand = 1; cam_setting.shift_time = 0; } DialogSetup.cam_setting.changeshift.Ah = Convert.ToInt32(this.numericUpDown_A_hour.Value); DialogSetup.cam_setting.changeshift.Am = Convert.ToInt32(this.numericUpDown_A_minute.Value); DialogSetup.cam_setting.changeshift.Bh = Convert.ToInt32(this.numericUpDown_B_hour.Value); DialogSetup.cam_setting.changeshift.Bm = Convert.ToInt32(this.numericUpDown_B_minute.Value); DialogSetup.cam_setting.changeshift.Ch = Convert.ToInt32(this.numericUpDown_C_hour.Value); DialogSetup.cam_setting.changeshift.Cm = Convert.ToInt32(this.numericUpDown_C_minute.Value); /// this.Close(); MessageBox.Show("请点击‘保存参数’按钮,进行保存设置", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); } private void radioButton_byhand_CheckedChanged(object sender, EventArgs e) { /// 点手动换班 A/B/C三班时间清0 if (this.radioButton_byhand.Checked) { this.radioButton_byhand.Checked = true; this.radioButton_time.Checked = false; } DialogSetup.cam_setting.changeshift.Ah = Convert.ToInt32(this.numericUpDown_A_hour.Minimum); DialogSetup.cam_setting.changeshift.Am = Convert.ToInt32(this.numericUpDown_A_minute.Minimum); DialogSetup.cam_setting.changeshift.Bh = Convert.ToInt32(this.numericUpDown_B_hour.Minimum); DialogSetup.cam_setting.changeshift.Bm = Convert.ToInt32(this.numericUpDown_B_minute.Minimum); DialogSetup.cam_setting.changeshift.Ch = Convert.ToInt32(this.numericUpDown_C_hour.Minimum); DialogSetup.cam_setting.changeshift.Cm = Convert.ToInt32(this.numericUpDown_C_minute.Minimum); this.Close(); MessageBox.Show("请点击‘保存参数’按钮,进行保存设置", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); } private void radioButton_time_CheckedChanged(object sender, EventArgs e) { /// 定时换班 if (this.radioButton_time.Checked) { this.radioButton_time.Checked = true; this.radioButton_byhand.Checked = false; } } } }