public void Display() // Display Method is a common method to bind the Student details in datagridview after save,update and delete operation perform. { using (FinancialManagementEntities _entity = new FinancialManagementEntities()) { List <Account> accounts = new List <Account>(); accounts = _entity.Accounts.ToList(); dgvAccounts.DataSource = accounts; } }
public bool SaveAccountDetail(Account acc) // calling SaveStudentMethod for insert a new record { bool result = false; using (FinancialManagementEntities _entity = new FinancialManagementEntities()) { _entity.Accounts.Add(acc); _entity.SaveChanges(); result = true; } return(result); }