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);
        }
Exemplo n.º 2
0
        public static List <LivrareDepozit> GetLDs(int id)
        {
            List <LivrareDepozit> commandlist = new List <LivrareDepozit>();

            using (SqlConnection connection = new SqlConnection(SqlConnectionDB.ConnectionString))
            {
                string     oString = @"Select Comanda.id,Livraredepozit.depozitid,Client.adresa,Client.telefon,Client.nume,Livraredepozit.status
                                FROM Comanda

                                    INNER JOIN Client ON Client.id = Comanda.expeditorid

                                    INNER JOIN Livraredepozit ON Livraredepozit.comandaid = Comanda.id
                                WHERE Livraredepozit.curierid = @cid AND Livraredepozit.status <> 2";
                SqlCommand oCmd    = new SqlCommand(oString, connection);
                oCmd.Parameters.AddWithValue("@cid", id);
                connection.Open();
                using (SqlDataReader oReader = oCmd.ExecuteReader())
                {
                    if (oReader != null)
                    {
                        while (oReader.Read())
                        {
                            LivrareDepozit newcomanda = new LivrareDepozit();
                            newcomanda.Comanda    = Int32.Parse(oReader["id"].ToString());
                            newcomanda.Depozit    = Int32.Parse(oReader["depozitid"].ToString());
                            newcomanda.AdresaExp  = oReader["adresa"].ToString();
                            newcomanda.NumeExp    = oReader["telefon"].ToString();
                            newcomanda.TelefonExp = oReader["nume"].ToString();
                            newcomanda.Status     = Int32.Parse(oReader["status"].ToString());
                            commandlist.Add(newcomanda);
                        }
                    }

                    connection.Close();
                }
            }

            return(commandlist);
        }
Exemplo n.º 3
0
        public static List <LivrareDepozit> GetLCs(int id)
        {
            List <LivrareDepozit> commandlist = new List <LivrareDepozit>();

            using (SqlConnection connection = new SqlConnection(SqlConnectionDB.ConnectionString))
            {
                string oString = @"Select Livrareclient.comandaid,Livraredepozit.depozitid,Comanda.adresa_destinatie,Livrareclient.status
                                    FROM Livrareclient 
	                                    INNER JOIN Livraredepozit ON Livraredepozit.comandaid = Livrareclient.comandaid 
	                                    INNER JOIN Comanda ON Comanda.id = Livrareclient.comandaid
                                    WHERE Livrareclient.curierid = @cid AND Livrareclient.status <> 4";

                SqlCommand oCmd = new SqlCommand(oString, connection);
                oCmd.Parameters.AddWithValue("@cid", id);
                connection.Open();
                using (SqlDataReader oReader = oCmd.ExecuteReader())
                {
                    if (oReader != null)
                    {
                        while (oReader.Read())
                        {
                            LivrareDepozit newcomanda = new LivrareDepozit();
                            newcomanda.Comanda   = Int32.Parse(oReader["comandaid"].ToString());
                            newcomanda.Depozit   = Int32.Parse(oReader["depozitid"].ToString());
                            newcomanda.AdresaExp = oReader["adresa_destinatie"].ToString();
                            newcomanda.Status    = Int32.Parse(oReader["status"].ToString());

                            commandlist.Add(newcomanda);
                        }
                    }

                    connection.Close();
                }
            }

            return(commandlist);
        }