Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            List <Order> orders = new Order().GetOrders();

            dataGridView1.DataSource = null;
            dataGridView1.DataSource = orders
                                       .Select(x => x.OrderDate)
                                       .ToList();
        }
Beispiel #2
0
 private void btnTumSiparisler_Click(object sender, EventArgs e)
 {
    
     List<Order> orders = new Order().GetOrders();
     //dataGridView1.DataSource= o.GetOrders();
     var gorunen = orders.Select(satir => new
     {
         SiparisNo = satir.OrderID,
         Tarih = satir.OrderDate,
         Musteri = satir.Customer.ContactName,
     });
     dataGridView1.DataSource = null;
     dataGridView1.DataSource = gorunen.ToList();
 }
Beispiel #3
0
        private void siparis_hepsi_Click(object sender, EventArgs e)
        {
            List <Order> orders = new Order().GetOrders();

            //tek bir alan seçilecekse
            //  var gorunen = orders.Select(satir => satir.EmployeeID);

            //birden fazla alan seçilecekse
            var gorunen = orders.Select(satir => new {
                SiparisNo = satir.OrderID,
                Tarih     = satir.OrderDate,
                Musteri   = satir.Customer.ContactName
            });

            dataGridView1.DataSource = null;
            dataGridView1.DataSource = gorunen.ToList();
        }