Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            var extracts = new RentalExtract();

            var dt = new DataTable();

            dt.Columns.Add("Date");
            dt.Columns.Add("Description");
            dt.Columns.Add("Amount");

            foreach (var transaction in extracts.GetTransactions().OrderBy(x => x.TransactionDate))
            {
                object[] row =
                {
                    transaction.TransactionDate.ToString("dd-MMM-yyyy"),
                    transaction.Description,
                    transaction.Amount.ToString("C2")
                };
                dt.Rows.Add(row);
            }



            dataGridView1.DataSource = dt;
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();
            var extracts = new RentalExtract();

            var dt = new DataTable();
            dt.Columns.Add("Date");
            dt.Columns.Add("Description");
            dt.Columns.Add("Amount");

            foreach (var transaction in extracts.GetTransactions().OrderBy(x => x.TransactionDate))
            {
                object[] row =
                {
                    transaction.TransactionDate.ToString("dd-MMM-yyyy"),
                    transaction.Description,
                    transaction.Amount.ToString("C2")
                };
                dt.Rows.Add(row);
            }

            dataGridView1.DataSource = dt;
        }
Ejemplo n.º 3
0
 private static void GetRental()
 {
     var rental = new RentalExtract();
 }