81 lines
2.5 KiB
C#
81 lines
2.5 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AIMS.OperationFront.UI
|
|
{
|
|
public partial class frmPersonSchedulOption : Form
|
|
{
|
|
public frmPersonSchedulOption()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public int month =0;
|
|
public int dayMax = 31;
|
|
public string[] shiftPlan = new string[1] { "" };
|
|
|
|
public int shiftPlanRow = 0;
|
|
public int shiftPlanColumn = 1;
|
|
public int selectedDay1 = 1;
|
|
public int selectedDay2 = 1;
|
|
public bool clearOthers = false;
|
|
|
|
private void btnExit_Click(object sender, EventArgs e)
|
|
{
|
|
this.DialogResult = DialogResult.Cancel;
|
|
this.Hide();
|
|
}
|
|
|
|
private void btnOK_Click(object sender, EventArgs e)
|
|
{
|
|
shiftPlanColumn = Convert.ToInt32(comboBox1.Text);
|
|
selectedDay1 = Convert.ToInt32(cbx1.Text);
|
|
selectedDay2 = Convert.ToInt32(cbx2.Text);
|
|
if (selectedDay1 > selectedDay2)
|
|
{
|
|
MessageBox.Show("日期选择不正确。", "提示信息");
|
|
return;
|
|
}
|
|
clearOthers = checkBox1.Checked;
|
|
this.DialogResult = DialogResult.OK;
|
|
this.Hide();
|
|
}
|
|
|
|
private void FrmScheduling2Option_Activated(object sender, EventArgs e)
|
|
{
|
|
this.DialogResult = DialogResult.None;
|
|
labelShifpPlan.Text = string.Join("|", shiftPlan);
|
|
int n = shiftPlan.Length;
|
|
string[] items = new string[n];
|
|
for(int i=0; i<n; i++)
|
|
{
|
|
items[i] = (i + 1).ToString();
|
|
}
|
|
comboBox1.Items.Clear();
|
|
comboBox1.Items.AddRange(items);
|
|
|
|
labelMonth.Text = month.ToString() + "月";
|
|
items = new string[dayMax];
|
|
for (int i = 1; i <= dayMax; i++)
|
|
{
|
|
items[i-1] = i.ToString();
|
|
}
|
|
cbx1.Items.Clear();
|
|
cbx1.Items.AddRange(items);
|
|
cbx2.Items.Clear();
|
|
cbx2.Items.AddRange(items);
|
|
|
|
comboBox1.Text = shiftPlanColumn.ToString();
|
|
cbx1.Text = selectedDay1.ToString();
|
|
cbx2.Text = dayMax.ToString();
|
|
this.BringToFront();
|
|
}
|
|
|
|
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
int index = Convert.ToInt32(comboBox1.Text) - 1;
|
|
labelShift.Text = shiftPlan[index];
|
|
}
|
|
}
|
|
}
|