Пример #1
0
        private void OnOrderStyleAdd(object sender, EventArgs eventArgs)
        {
            if (listBox_order_available.SelectedIndex == -1)
            {
                return;
            }
            MaidOrderStyleData orderStyle =
                (MaidOrderStyleData)listBox_order_available.Items[listBox_order_available.SelectedIndex];

            listBox_order_available.Items.RemoveAt(listBox_order_available.SelectedIndex);
            listBox_order_selected.Items.Add(orderStyle);
        }
Пример #2
0
        private void MoveUpSelectedOrderStyle(object sender, EventArgs eventArgs)
        {
            if (listBox_order_selected.SelectedIndex <= 0)
            {
                return;
            }
            int selectedIndex             = listBox_order_selected.SelectedIndex;
            MaidOrderStyleData orderStyle = (MaidOrderStyleData)listBox_order_selected.Items[selectedIndex];

            listBox_order_selected.Items.RemoveAt(selectedIndex);
            listBox_order_selected.Items.Insert(selectedIndex - 1, orderStyle);
            listBox_order_selected.SelectedIndex = selectedIndex - 1;
        }
Пример #3
0
        private void MoveDownSelectedOrderStyle(object sender, EventArgs eventArgs)
        {
            if (listBox_order_selected.SelectedIndex == -1 ||
                listBox_order_selected.SelectedIndex >= listBox_order_selected.Items.Count - 1)
            {
                return;
            }
            int selectedIndex             = listBox_order_selected.SelectedIndex;
            MaidOrderStyleData orderStyle = (MaidOrderStyleData)listBox_order_selected.Items[selectedIndex];

            listBox_order_selected.Items.RemoveAt(selectedIndex);
            listBox_order_selected.Items.Insert(selectedIndex + 1, orderStyle);
            listBox_order_selected.SelectedIndex = selectedIndex + 1;
        }
Пример #4
0
        private void OnOrderStyleRemove(object sender, EventArgs eventArgs)
        {
            if (listBox_order_selected.SelectedIndex == -1)
            {
                return;
            }
            MaidOrderStyleData orderStyle =
                (MaidOrderStyleData)listBox_order_selected.Items[listBox_order_selected.SelectedIndex];

            listBox_order_selected.Items.RemoveAt(listBox_order_selected.SelectedIndex);
            listBox_order_available.Items.Add(orderStyle);
            if (listBox_order_selected.Items.Count <= 1)
            {
                button_order_remove.Enabled = false;
            }
        }