Add() 공개 메소드

public Add ( OOP1.Product product ) : void
product OOP1.Product
리턴 void
예제 #1
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id = 2, CategoryId = 5, UnitsInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };

            // case sensitive - C# küçük büyük harf duyarlıdır
            //PascalCase    //camelCase  -- isimlendirmede büyük küçük harf kullanımları
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #2
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id = 2, CategoryId = 5, UnitsInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };

            //PascalCase (classın ilk harfi büyük yazılır) //camelCase
            //case sensitive büyük-küçük harf duyarlı
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #3
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id          = 1;
            product1.CategoryId  = 2;
            product1.ProductName = "Masa";
            product1.UnitPrice   = 500;
            product1.UnitInStock = 3;

            Product product2 = new Product {
                Id          = 2, CategoryId = 5, UnitInStock = 5,
                ProductName = "Kalem", UnitPrice = 35
            };
            // ProductManager productManager;    (ProductManager cinsinde productManager değişkeni)
            // string isim;                      (string cinsinde isim değişkeni)
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #4
0
        static void Main(string[] args)
        {
            //1.Yazım şekli
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoriyId  = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;
            //2.yazım şekli
            Product product2 = new Product {
                Id           = 2, CategoriyId = 5,
                UnitsInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };

            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #5
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            //Bu şekilde de yazabiliriz.
            Product product2 = new Product {
                Id = 5, CategoryId = 2, UnitsInStock = 5, UnitPrice = 35, ProductName = "Kalem"
            };

            //class        //isim
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #6
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 1500;


            Product product2 = new Product {
                Id          = 2, CategoryId = 5,
                ProductName = "kalem", UnitPrice = 5, UnitsInStock = 32
            };

            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #7
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id        = 2, CategoryId = 5, ProductName = "Avize",
                UnitPrice = 100, UnitsInStock = 5
            };
            //PascalCase   //camelCase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            Console.WriteLine(product1.ProductName);
        }
예제 #8
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id          = 1;
            product1.CategoryId  = 2;
            product1.ProductName = "masa";
            product1.UnitPrice   = 500;
            product1.UnitInStock = 3;

            //farklı bir yazım tipi
            Product product2 = new Product {
                Id = 2, CategoryId = 5, UnitInStock = 5, ProductName = "kalem", UnitPrice = 35
            };


            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #9
0
파일: Program.cs 프로젝트: mst453/KampIntro
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.ProductName  = "Masa";
            product1.CatogoryId   = 2;
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id            = 2, CatogoryId = 5, UnitsInStock = 5
                , ProductName = "kalem", UnitPrice = 35
            };                                       // C# a ueni gelen özellik!!!!

            //pascalcase       //camelcase
            ProductManager productmanager = new ProductManager();

            productmanager.Add(product1);
        }
예제 #10
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnıtPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id = 2, CategoryId = 5, UnitsInStock = 5, ProductName = "Kalem", UnıtPrice = 35
            };

            //PascalCase    //camelcase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            Console.WriteLine(product1.ProductName); //referans tip olduğu için product1 in product name i değişir.
        }
예제 #11
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id          = 1;
            product1.CategoryId  = 2;
            product1.ProductName = "Masa";
            product1.UnitPrice   = 500;
            product1.UnitInStock = 3;

            Product product2 = new Product {
                Id          = 2, CategoryId = 5, UnitInStock = 5,
                ProductName = "Kalem", UnitPrice = 35
            };

            //Classlar PascalCase  //isimlendirmeler camelCase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #12
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Table";
            product1.UnitPrice    = 150;
            product1.UnitsInStock = 3;


            Product product2 = new Product {
                Id = 1, CategoryId = 5, ProductName = "Pen", UnitsInStock = 20, UnitPrice = 29.90
            };


            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #13
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2; //2 bizim için Mobilya kategorisi olsun.
            product1.ProductName  = "Katlanır Masa";
            product1.UnitPrice    = 500.00;
            product1.UnitsInStock = 3;

            //farklı bir nesne yaratma yöntemi!
            Product product2 = new Product {
                Id          = 2, CategoryId = 5, UnitPrice = 15,
                ProductName = "Tükenmez Kalem", UnitsInStock = 70
            };

            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #14
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Table";
            product1.UnitPrice    = 550;
            product1.UnitsInStock = 9;

            Product product2 = new Product
            {
                Id           = 2, CategoryId = 2, ProductName = "Chair", UnitPrice = 300,
                UnitsInStock = 5
            };

            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #15
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 150;
            product1.UnitsInStock = 7;

            Product product2 = new Product {
                Id = 2, CategoryId = 3, ProductName = "Kalem", UnitPrice = 35, UnitsInStock = 14
            };

            ProductManager productManager = new ProductManager();

            productManager.Add(product1);

            productManager.Topla(1, 2);
        }
예제 #16
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.ID           = 1;
            product1.CategoryID   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                ID = 2, CategoryID = 5, UnitsInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };                                                                                                                  //Alternative object creation method.

            // PascalCase  //camelCase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            productManager.Update(product1);
        }
예제 #17
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2; //Ornagin mobilya kategorisinin id degeri 2 olsun
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 599.99;
            product1.UnitsInStock = 10; //stokta 10 tane var

            //Bir baska obje olusturma yontemi(normal paranter degiz suslu parantez kullandik)
            Product product2 = new Product {
                Id = 2, CategoryId = 3, ProductName = "Bilgisayar", UnitPrice = 3999, UnitsInStock = 5
            };

            //Product manager
            ProductManager productManager = new ProductManager();

            productManager.Add();
        }
예제 #18
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id          = 1;
            product1.CategoryId  = 2;
            product1.ProductName = "masa";
            product1.UnitPrice   = 500;
            product1.UnitInStock = 5;

            Product product2 = new Product {
                Id = 2, CategoryId = 5, ProductName = "kalem", UnitPrice = 10, UnitInStock = 15,
            };

            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            productManager.UpDate(product1);
            Console.ReadLine();
        }
예제 #19
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 5;

            Product product2 = new Product {
                id = 2, CategoryId = 5, ProductName = "Kalem", UnitPrice = 500, UnitsInStock = 5
            };

            ProductManager productManager = new ProductManager();

            productManager.Add(product1);

            //int, double,
        }
예제 #20
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id          = 1;
            product1.CategoryId  = 2;
            product1.ProductName = "Masa";
            product1.UnitPrice   = 500;
            product1.UnitInStock = 3;

            Product product2 = new Product {
                Id = 2, CategoryId = 5, UnitInStock = 5, ProductName = "Kalem", UnitPrice = 35,
            };


            //PascalCase   //camelCase
            ProductManager productManager = new ProductManager();//ProductManager türündeki productManager yeni bir ProductManagerdır demek

            productManager.Add(product1);
        }
예제 #21
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id = 2, CategoryId = 5, UnitsInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };                                                                                                    //üstteki yazımın bir başka şeklidir.

            //PascalCase    //camelCase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            Console.WriteLine(product1.ProductName);
        }
예제 #22
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            // Farklı bir ürün tanımlama özelliği !
            Product product2 = new Product {
                Id = 2, CategoryId = 5, UnitsInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };

            //PascalCase    //camelCase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #23
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id          = 1;
            product1.CategoryId  = 2;
            product1.ProductName = "Masa";
            product1.UnitPrice   = 500;
            product1.UnitInStock = 3;

            //yukarıdaki ile aynı işlemi tek satırda aşağıdaki gibi yazabiliriz.
            Product product2 = new Product {
                Id = 2, CategoryId = 5, UnitInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };

            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            Console.WriteLine(product1.ProductName);
        }
예제 #24
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id = 2, ProductName = "Kalem", CategoryId = 5, UnitsInStock = 5, UnitPrice = 20
            };
            // İki şekilde de tanımlayabiliyoruz
            // case sensitive = Büyük küçük harf duyarlılığı
            // PascalCase   // camelCase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #25
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id          = 1;
            product1.CategoryId  = 2;
            product1.ProductName = "Table";
            product1.UnitPrice   = 500;
            product1.UnitInStock = 3;

            Product product2 = new Product {
                Id          = 2, CategoryId = 5, UnitInStock = 5,
                ProductName = "Pen", UnitPrice = 35
            };

            //PascalCase   //camelCase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
        }
예제 #26
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id = 2, CategoryId = 5, UnitsInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };

            //PascalCase   //camelCase
            //Case sensitive
            ProductManager productmanager = new ProductManager();

            productmanager.Add(product1);
        }
예제 #27
0
파일: Program.cs 프로젝트: slmerdm/OOP1
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id           = 2, CategoryId = 5,
                UnitsInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };

            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            Console.WriteLine(product1.ProductName);
        }
예제 #28
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id           = 1;
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;

            Product product2 = new Product {
                Id           = 2, CategoryId = 5,
                UnitsInStock = 5, ProductName = "Kalem", UnitPrice = 35
            };

            //PascalCase //camelCase
            //case sensitive
            ProductManager productManager = new ProductManager();

            //heap                          //stack
            productManager.Add(product1); //101 adres
            Console.WriteLine(product1.ProductName);

            /*
             * productManager.Topla2(3, 6);
             * int toplamaSonucu = productManager.Topla(3, 6);
             * Console.WriteLine(toplamaSonucu*2);
             */



            /*
             * int sayi = 100;
             * productManager.BiseyYap(sayi);
             * Console.WriteLine(sayi);
             */


            //int-double-bool... değer tip
            //diziler-class-abstract class-interface... referans tip
        }
예제 #29
0
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id          = 1;
            product1.CategoryId  = 2;
            product1.ProductName = "Masa";
            product1.UnitPrice   = 500;
            product1.UnitInStock = 3;

            Product product2 = new Product
            {
                Id          = 2,
                CategoryId  = 5,
                UnitInStock = 4,
                ProductName = "Kalem",
                UnitPrice   = 35
            };
            //PascalCase   //camelCase
            ProductManager productManager = new ProductManager();

            productManager.Add(product1);
            Console.WriteLine(product1.ProductName); //kamera



            /* productManager.Topla2(3, 6); //returne ihtiyacım var çünkü sonucu tekrar kullanmam gerekebilir.
             *
             * int toplamaSonucu = productManager.Topla(3, 6); //burada topla fonksiyonunu kullanarak tekrar sonucu kullanabildik
             * Console.WriteLine(toplamaSonucu*2);
             *
             *
             * // int sayi = 100;
             * //productManager.BiseyYap(sayi); //sayının sadece değerini yolluyoruz. sayı tanımıyla baglantımız bitiyor.
             * // Console.WriteLine(sayi); //100
             *
             * //int,doble,bool... değer tiplerde atamalar tamamen değeri üzerinde olur.
             * //diziler,class,abstract class, interface... referans tiplerde atamalar referansın adresiyle yapılır.
             *
             */
        }
예제 #30
0
        //main, ekran görevi görür. manager classı iş yapan classdır.
        static void Main(string[] args)
        {
            Product product1 = new Product();

            product1.Id = 1;
            //numara 2 mobilyaya denk geliyor yani kategorisini gösteriyor. daha sonra kategorisi değişebilir, kodu değil veri kaynağını değiştiririz.
            product1.CategoryId   = 2;
            product1.ProductName  = "Masa";
            product1.UnitPrice    = 500;
            product1.UnitsInStock = 3;
            //bunu bir yukarıdaki gibi bir de aşağıdaki gibi oluşturabiliriz.
            //direkt classın hemen yanında, alanları yukarıdaki gibi ayrı ayrı yazmadan direkt yazabiliriz.
            Product product2 = new Product {
                Id = 2, CategoryId = 5, ProductName = "Kalem", UnitsInStock = 5, UnitPrice = 35
            };

            //PascalCase    camelCase
            ProductManager productManager = new ProductManager();

            // ='in sağ tarafı stack; sol tarafı heap.
            //yukarıdaki satırın anlamı: ProductManager türündeki productManager yeni bir referans numarası almış ProductManager'dır.
            //string isim = "Engin"
            productManager.Add(product1);
            //bunu yazınca product1'i ProductManager'a gönderecek.
            Console.WriteLine(product1.ProductName);


            productManager.Topla2(3, 6);

            int toplamaSonucu = productManager.Topla(3, 6);

            Console.WriteLine(toplamaSonucu * 2);
            //şöyle de çalışır:
            Console.WriteLine(productManager.Topla(3, 6) * 2);


            int sayi = 100;

            productManager.BiseyYap(sayi);
            Console.WriteLine(sayi);
        }