コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int status         = -1;
            int updatedcommand = -1;

            if (listBox1.SelectedIndex != -1)  //Am selectat LIVRAREDEPOZIT
            {
                if (comboBox1.SelectedIndex == 0)
                {
                    status = 1;
                }
                if (comboBox1.SelectedIndex == 1)
                {
                    status = 2;
                }
                updatedcommand = commandlist[listBox1.SelectedIndex].Comanda;
            }

            if (listBox2.SelectedIndex != -1) //Am selectat LIVRARECLIENT
            {
                if (comboBox1.SelectedIndex == 2)
                {
                    status = 3;
                }
                if (comboBox1.SelectedIndex == 3)
                {
                    status = 4;
                }
                updatedcommand = commandlistc[listBox2.SelectedIndex].Comanda;
            }


            if (status != -1)
            {
                DeliveryController.UpdateCommand(updatedcommand, status); // trebuie implementanta
                MessageBox.Show(updatedcommand.ToString() + "||" + status.ToString());
            }
            else
            {
                MessageBox.Show("Nu poti efectua");
            }
        }