Skip to content

Commit

Permalink
The application loads data.db automatically when the window form is s…
Browse files Browse the repository at this point in the history
…hown.
  • Loading branch information
me1237guy committed Sep 13, 2021
1 parent e69d443 commit dca84a9
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 6 deletions.
Binary file modified ReportApp/.vs/ReportApp/v15/.suo
Binary file not shown.
Binary file modified ReportApp/.vs/ReportApp/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified ReportApp/.vs/ReportApp/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
1 change: 1 addition & 0 deletions ReportApp/ReportApp/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 30 additions & 6 deletions ReportApp/ReportApp/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ReportApp.Model;
using ReportApp.Service;

namespace ReportApp
{
public partial class Form1 : Form
{
DAOService daoService = new DAOService();
public Form1()
{
InitializeComponent();


LoadData();

}
private void LoadData()
{
// reset dataGridView1
dataGridView1.Columns.Clear();

// request the database
var orders = daoService.GetOrder();
dataGridView1.DataSource = null;
dataGridView1.DataSource = orders.ToList();
dataGridView1.Columns[0].Width = this.Width + 800;

// set ReadOnly property
for (int i = 1; i < dataGridView1.Columns.Count; i++)
{
dataGridView1.Columns[i].ReadOnly = true;
}
// display how many rows of Number that it has
this.label1.Text = dataGridView1.Rows.Count.ToString();
}
private void Form1_Load(object sender, EventArgs e)
{

}
}
}
Binary file modified ReportApp/ReportApp/bin/Release/ReportApp.exe
Binary file not shown.
Binary file modified ReportApp/ReportApp/bin/Release/ReportApp.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ReportApp/ReportApp/obj/Release/ReportApp.exe
Binary file not shown.
Binary file modified ReportApp/ReportApp/obj/Release/ReportApp.pdb
Binary file not shown.

0 comments on commit dca84a9

Please sign in to comment.