예제 #1
0
파일: RocniTeplota.cs 프로젝트: pecarm/Cv8
        public override string ToString()
        {
            string temperatures = "";

            foreach (double number in MesicniTeploty)
            {
                if (number <= -10)
                {
                    temperatures = temperatures + " " + number + ";";
                }
                else if (number < 0)
                {
                    temperatures = temperatures + "  " + number + ";";
                }
                else if (number < 10)
                {
                    temperatures = temperatures + "   " + number + ";";
                }
                else
                {
                    temperatures = temperatures + "  " + number + ";";
                }
            }
            temperatures.TrimEnd(';');
            return(Rok.ToString() + ":" + temperatures);
        }
예제 #2
0
        public void Plyty_uzytkownika_Show()
        {
            int ID = Program.ID_zalogowanego;

            string Plyta, Zespol, Gatunek;
            int    Rok, Sciezki, Ocena, ID_Plyta;

            string GetDane_plyty =
                "Select Plyta.Nazwa, Zespol.Nazwa, Gatunek.Nazwa, Plyta.Rok_wydania, Plyta.Ilosc_sciezek, Ocena.Ocena, Ocena.ID_plyta " +
                "from Ocena " +
                "inner join Plyta on Plyta.ID_plyta = Ocena.ID_plyta " +
                "inner join Zespol on Zespol.ID_zespol = Plyta.ID_zespol " +
                "inner join Gatunek on Gatunek.ID_gatunek = Plyta.ID_gatunek " +
                "where Ocena.ID_user = " + ID;

            SqlDataReader Data = Connect(TypeOfAction.Select, GetDane_plyty);

            while (Data.Read())
            {
                Plyta    = Data.GetString(0);
                Zespol   = Data.GetString(1);
                Gatunek  = Data.GetString(2);
                Rok      = Data.GetInt32(3);
                Sciezki  = Data.GetInt32(4);
                Ocena    = Data.GetInt32(5);
                ID_Plyta = Data.GetInt32(6);

                MOcenyList.Items.Add(new ListViewItem(new[] { ID_Plyta.ToString(), Plyta, Zespol, Gatunek, Rok.ToString(), Sciezki.ToString(), Ocena.ToString() }));
            }
            Data.Close();
        }