protected void LoadGridViewEmployees() { EmployeeCS emp = new EmployeeCS(); GridViewEmployees.DataSource = emp.GetEmployees(); GridViewEmployees.DataBind(); }
protected void ButtonSearch_Click(object sender, EventArgs e) { var deptId = Convert.ToInt32(DropDownListDepts.SelectedValue); DataSet result = DAL.GetEmployeeByDept(deptId); GridViewEmployees.DataSource = result; GridViewEmployees.DataBind(); }
protected void LoadEmployeesGrid() { using (SalesSystem.DataClassesSalesDataContext context = new DataClassesSalesDataContext()) { var employeeRole = (from empRol in context.vw_Custom_SelectEmployeeRoles select empRol).ToList(); GridViewEmployees.DataSource = employeeRole; GridViewEmployees.DataBind(); } }
protected void ButtonSearch_Click(object sender, EventArgs e) { using (SalesSystem.DataClassesSalesDataContext context = new DataClassesSalesDataContext()) { var result = (from searchRes in context.vw_Custom_SelectEmployeeRoles where (searchRes.RoleRate.ToString().Contains(TextBoxSearch.Text)) || (searchRes.EmployeeName.Contains(TextBoxSearch.Text)) || (searchRes.EmployeeSurname.Contains(TextBoxSearch.Text)) || (searchRes.RoleDescription.Contains(TextBoxSearch.Text)) select new { searchRes.EmployeeID, searchRes.EmployeeName, searchRes.EmployeeSurname, searchRes.RoleDescription, searchRes.RoleRate }); GridViewEmployees.DataSource = result; GridViewEmployees.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } string employeeId = RouteData.Values["id"] as string; if (employeeId == "*" || string.IsNullOrEmpty(employeeId)) { GridViewEmployees.DataSource = Repository.GetEmployees(); GridViewEmployees.DataBind(); DetailsViewEmployee.Visible = false; } else { var employees = Repository.GetEmployees(employeeId); DetailsViewEmployee.DataSource = employees; DetailsViewEmployee.DataBind(); GridViewEmployees.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { NorthwindEntities context = new NorthwindEntities(); var employees = context.Employees.Select(x => new { Id = x.EmployeeID, FirstName = x.FirstName, LastName = x.LastName, }).ToList(); GridViewEmployees.DataSource = employees; GridViewEmployees.DataBind(); RepeaterEmployees.DataSource = context.Employees.ToList(); RepeaterEmployees.DataBind(); ListViewEmployees.DataSource = context.Employees.ToList(); ListViewEmployees.DataBind(); } }
private void LoadEmployees() { GridViewEmployees.DataSource = employee.LoadEmployee("Telefones", "Empresa", DropDownListCompany.SelectedItem.Value); GridViewEmployees.DataBind(); }