110,896
社区成员
发帖
与我相关
我的任务
分享
protected void btnLeft_ServerClick(object sender, EventArgs e)
{
if (this.lstDept.SelectedIndex == -1)
{
return;
}
int index = this.lstDept.SelectedIndex;
this.lstManager.Items.Add(new ListItem(this.lstDept.SelectedItem.Text, this.lstDept.SelectedItem.Value));
this.lstDept.Items.RemoveAt(index);
if (index != 0 && index < this.lstDept.Items.Count)
{
this.lstDept.SelectedIndex = index;
}
else if (index != 0 && index == this.lstDept.Items.Count)
{
this.lstDept.SelectedIndex = index - 1;
}
else if (index == 0 && this.lstDept.Items.Count > 0)
{
this.lstDept.SelectedIndex = 0;
}
this.lstManager.SelectedIndex = this.lstManager.Items.Count - 1;
btnDisabledCheng();
}
protected void btnRight_ServerClick(object sender, EventArgs e)
{
if (this.lstManager.SelectedIndex == -1)
{
return;
}
int index = this.lstManager.SelectedIndex;
this.lstDept.Items.Add(new ListItem(this.lstManager.SelectedItem.Text, this.lstManager.SelectedItem.Value));
this.lstManager.Items.RemoveAt(index);
if (index != 0 && index < this.lstManager.Items.Count)
{
this.lstManager.SelectedIndex = index;
}
else if (index != 0 && index == this.lstManager.Items.Count)
{
this.lstManager.SelectedIndex = index - 1;
}
else if (index == 0 && this.lstManager.Items.Count > 0)
{
this.lstManager.SelectedIndex = 0;
}
this.lstDept.SelectedIndex = this.lstDept.Items.Count - 1;
btnDisabledCheng();
}
protected void btnLefts_ServerClick(object sender, EventArgs e)
{
if (this.lstDept.Items.Count == 0)
return;
for (int i = this.lstDept.Items.Count - 1; i >= 0; i--)
{
this.lstManager.Items.Add(new ListItem(this.lstDept.Items[i].Text, this.lstDept.Items[i].Value));
}
this.lstManager.SelectedIndex = this.lstManager.Items.Count - 1;
this.lstDept.Items.Clear();
btnDisabledCheng();
}
protected void btnRights_ServerClick(object sender, EventArgs e)
{
if (this.lstManager.Items.Count == 0)
return;
for (int i = this.lstManager.Items.Count - 1; i >= 0; i--)
{
this.lstDept.Items.Add(new ListItem(this.lstManager.Items[i].Text, this.lstManager.Items[i].Value));
}
this.lstDept.SelectedIndex = this.lstDept.Items.Count - 1;
this.lstManager.Items.Clear();
btnDisabledCheng();
}