コード例 #1
0
        private void PrekesIvedimas()
        {
            Console.WriteLine("Iveskite prekes duomenis");
            Console.WriteLine("Iveskite Pavadima");
            var pavadinimas = Console.ReadLine();

            var naujaPreke = new Preke()
            {
                Pavadimas = pavadinimas
            };

            PrekiuOperacijos.PrekesPirkimas(naujaPreke);
        }
コード例 #2
0
 private void PrekiuKatalogas()
 {
     Console.WriteLine("-------Prekiu Katalogas----------");
     foreach (var preke in PrekiuOperacijos.PrekiuKatalogas())
     {
         var pType = preke.GetType();
         var props = pType.GetProperties();
         foreach (PropertyInfo prp in props)
         {
             string propertyName  = prp.Name;
             string propertyValue = prp.GetValue(preke, new object[] { }).ToString();
             Console.Write(propertyName + ": " + propertyValue + ";  ");
         }
         Console.WriteLine();
     }
 }