private void button2_Click(object sender, EventArgs e)
        {
            label1.Text = "Buna ziua," + GlobalUsers.GlobalCurier.Prenume;
            label2.Text = "Masina: " + CuriermanController.GetCarByID(GlobalUsers.GlobalCurier.ID).Numar;
            label3.Text = "Model: " + CuriermanController.GetCarByID(GlobalUsers.GlobalCurier.ID).Model;


            listBox1.Items.Clear();

            commandlist = CuriermanController.GetLDs(GlobalUsers.GlobalCurier.ID);

            foreach (LivrareDepozit c in commandlist)
            {
                string format = "#" + c.Comanda + "  Adresa Ridicare:" + c.AdresaExp + "  Depozit destinatie:" + c.Depozit + "  Status:" + c.Status;
                listBox1.Items.Add(format);
            }
            listBox2.Items.Clear();

            commandlistc = CuriermanController.GetLCs(GlobalUsers.GlobalCurier.ID);

            foreach (LivrareDepozit c in commandlistc)
            {
                string format = "#" + c.Comanda + "  Depozit Ridicare:" + c.Depozit + "  Adresa Destinatie:" + c.AdresaExp + " Status:" + c.Status;
                listBox2.Items.Add(format);
            }
        }
        public CurierMenuForm()
        {
            InitializeComponent();
            label1.Text = "Buna ziua," + GlobalUsers.GlobalCurier.Prenume;
            label2.Text = "Masina: " + CuriermanController.GetCarByID(GlobalUsers.GlobalCurier.ID).Numar;
            label3.Text = "Model: " + CuriermanController.GetCarByID(GlobalUsers.GlobalCurier.ID).Model;


            listBox1.Items.Clear();

            commandlist = CuriermanController.GetLDs(GlobalUsers.GlobalCurier.ID);

            foreach (LivrareDepozit c in commandlist)
            {
                string format = "#" + c.Comanda + "  Adresa Ridicare:" + c.AdresaExp + "  Depozit destinatie:" + c.Depozit + "  Status:" + c.Status;
                listBox1.Items.Add(format);
            }
            listBox2.Items.Clear();

            commandlistc = CuriermanController.GetLCs(GlobalUsers.GlobalCurier.ID);

            foreach (LivrareDepozit c in commandlistc)
            {
                string format = "#" + c.Comanda + "  Depozit Ridicare:" + c.Depozit + "  Adresa Destinatie:" + c.AdresaExp + " Status:" + c.Status;
                listBox2.Items.Add(format);
            }
        }
Пример #3
0
        private void OK_Click(object sender, EventArgs e)
        {
            GlobalUsers.GlobalCurier = CuriermanController.GetCurierByID(Int32.Parse(textBox1.Text));

            if (GlobalUsers.GlobalCurier == null)
            {
                MessageBox.Show("Wrong ID");
                return;
            }
            new CurierMenuForm().Show();
        }
        private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            comboBox1.Enabled = true;
            button3.Enabled   = true;

            if (listBox2.SelectedIndex < 0)
            {
                return;
            }
            listBox1.ClearSelected();

            Console.WriteLine(listBox2.SelectedIndex);
            LivrareDepozit cc = commandlistc[listBox2.SelectedIndex];

            label6.Text  = "ID: " + cc.Comanda;
            label7.Text  = "Depozit: " + DepozitController.GetDepozitByID(cc.Depozit).Adresa;
            label8.Text  = "Adresa: " + cc.AdresaExp;
            label10.Text = "Status: " + CuriermanController.StatusToText(cc.Status);
        }