private void RefreshGridView() { Employee emp = new Employee(); eList = emp.GetAllEmployee(); // using gridview to bind to the list of employee objects GvEmployee.Visible = true; GvEmployee.DataSource = eList; GvEmployee.DataBind(); }
protected void btnAdd_Click(object sender, EventArgs e) { if (Page.IsValid) { EmployeeBLL.AddEmployee( tbNRIC.Text, tbName.Text, Convert.ToDateTime(tbBirthDate.Text), ddlDepartment.SelectedValue, Convert.ToDouble(tbMonthlyWage.Text)); GvEmployee.DataSource = EmployeeBLL.GetAll(); GvEmployee.DataBind(); } }