Example #1
0
        static void Main(string[] args)
        {
            Koli[] koliler = new Koli[15];
            veriEkle(koliler);
            DepolamaMakine makine = new DepolamaMakine(koliler);

            Console.Read();
        }
        public void dbKaydet(Koli koli)
        {
            const string connectionString = "mongodb://localhost:27017";

            var client = new MongoClient(connectionString);
            var database = client.GetDatabase("fabric");
            var collection = database.GetCollection<BsonDocument>("koliInfo");

            Console.WriteLine("DB kaydedildi:"+koli.cipsturu.ToString()+" miktar:"+koli.birKoliCipsmiktar);
            var doc = new BsonDocument
            {
                {"Date:",DateTime.Now },
                {"koliCipsMiktari",koli.birKoliCipsmiktar },
                {"koliCipsTuru",koli.cipsturu.ToBsonDocument() }
            };
            
            collection.InsertOne(doc);
            Console.WriteLine();
                
        }
 public Koli uret(string marka, int gramaj, string tur, int miktar)
 {
     koli = new Koli(marka, gramaj, tur, miktar);
     return(koli);
 }
 public Koli uret()
 {
     koli = new Koli();
     return(koli);
 }