using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using Telerik.Web.UI;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;


public class GuidTestCollection 
{
    public GuidTestCollection()
    { 
    }

    public int SelectCount()
    {       
        return 100;
    }

    public List<Order> Select()
    {
        return GetData();
    }

    private List<Order> GetData()
    {
        SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);
        SqlDataAdapter sqlDataAdapter = new SqlDataAdapter("SELECT Top(100) * FROM Orders", sqlConnection);
        DataTable table = new DataTable();
        sqlDataAdapter.Fill(table);
        List<Order> orders = new List<Order>();
        for (int i = 0, j = table.Rows.Count; i < j; i++)
        {
            orders.Add(new Order { OrderID = Convert.ToInt32(table.Rows[i]["OrderID"]),
                                   CustomerID = Convert.ToString(table.Rows[i]["CustomerID"]),                     
                                   OrderDate = Convert.ToDateTime(table.Rows[i]["OrderDate"])
            });
        }
        return orders;
    }    

    public void UpdateTable(Order order)
    {
        //TODO: Implement the update of the edited row, passed as parameter
    }   
}

