private void button1_Click(object sender, EventArgs e) { _listTransaction = _passbook.GetTransaction(_loginUser.GetUsername); DataTable dt = new DataTable(); dt.Columns.AddRange(new DataColumn[4] { new DataColumn("Name", typeof(string)), new DataColumn("Amount", typeof(string)), new DataColumn("Transaction Type", typeof(string)), new DataColumn("Date", typeof(string)) }); foreach (TransactionData transactionData in _listTransaction) { dt.Rows.Add(transactionData.Name, transactionData.Amount, transactionData.Type, transactionData.Date); } this.dataGridView1.DataSource = dt; this.dataGridView1.AllowUserToAddRows = false; }
private static void NewMethod() { string username; string password; PassBookRepositry passnool = new PassBookRepositry(); passnool.GetTransaction("Mit"); // GetAllRecord g = new GetAllRecord(); // g.getData(); LoginRepositry login = new LoginRepositry(); Console.WriteLine("Enter the Username"); username = Console.ReadLine(); Console.WriteLine("Enter the Password"); password = Console.ReadLine(); login.LoginValidation(username, password); }