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(); if (DialogSetup.cam_setting.changeshift.shift_byhand == 1) { this.radioButton_byhand.Checked = true; this.radioButton_time.Checked = false; } else if (DialogSetup.cam_setting.changeshift.shift_time == 1) { this.radioButton_time.Checked = true; this.radioButton_byhand.Checked = false; } } private void Change_shift_Load(object sender, EventArgs e) { //if (DialogSetup.cam_setting.changeshift.shift_byhand == 1) //{ // this.radioButton_byhand.Checked = true; // this.radioButton_time.Checked = false; //} //else if (DialogSetup.cam_setting.changeshift.shift_time == 1) //{ // this.radioButton_time.Checked = true; // this.radioButton_byhand.Checked = false; //} this.radioButton_byhand.Checked = DialogSetup.cam_setting.changeshift.shift_byhand == 1 ? true: false; this.radioButton_time.Checked = DialogSetup.cam_setting.changeshift.shift_time == 1 ? true : false; 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) { DialogSetup.cam_setting.changeshift.shift_byhand = Convert.ToInt32(this.radioButton_byhand.Checked); DialogSetup.cam_setting.changeshift.shift_time = Convert.ToInt32(this.radioButton_time.Checked); } else if (this.radioButton_byhand.Checked) { DialogSetup.cam_setting.changeshift.shift_byhand = Convert.ToInt32(this.radioButton_byhand.Checked); DialogSetup.cam_setting.changeshift.shift_time = Convert.ToInt32(this.radioButton_time.Checked); } 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) { DialogSetup.cam_setting.changeshift.shift_byhand = Convert.ToInt32(this.radioButton_byhand.Checked); DialogSetup.cam_setting.changeshift.shift_time = Convert.ToInt32(this.radioButton_time.Checked); } 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) { DialogSetup.cam_setting.changeshift.shift_byhand = Convert.ToInt32(this.radioButton_byhand.Checked); DialogSetup.cam_setting.changeshift.shift_time = Convert.ToInt32(this.radioButton_time.Checked); } //DialogSetup.cam_setting.changeshift.shift_time = 1; //DialogSetup.cam_setting.changeshift.shift_byhand = 0; } } }