protected void AreaRadioButton_SelectedIndexChanged(object sender, EventArgs e) { //Clear the Part Results Grid PartResultsGridView.DataSource = null; PartResultsGridView.DataBind(); PartResultUpdatePanel.Update(); //Clear the Machine Results Grid MachineResultsGridView.DataSource = null; MachineResultsGridView.DataBind(); MachineResultsUpdatePanel.Update(); AreaDisplayTypes displayType = (AreaDisplayTypes)System.Enum.Parse(typeof(AreaDisplayTypes), AreaRadioButton.SelectedValue); // AreaResultsGridView.Columns[1].HeaderText = "All " + MakePlural(displayType); using (var partManagementRepository = SharePointServiceLocator.GetCurrent().GetInstance <IPartManagementRepository>()) { if (displayType == AreaDisplayTypes.Category) { var categories = partManagementRepository.GetCategories(); var areaDtos = categories.Select(category => new AreaDTO { Title = category.Title, Id = category.Id.HasValue ? category.Id.Value : 0 }); ShowAreaResults(areaDtos); } if (displayType == AreaDisplayTypes.Department) { var departments = partManagementRepository.GetDepartments(); var areaDtos = departments.Select(department => new AreaDTO { Title = department.Title, Id = department.Id.HasValue ? department.Id.Value : 0 }); ShowAreaResults(areaDtos); } if (displayType == AreaDisplayTypes.Manufacturer) { var manufacturers = partManagementRepository.GetManufacturers(); var areaDtos = manufacturers.Select(manufacturer => new AreaDTO { Title = manufacturer.Title, Id = manufacturer.Id. HasValue ? manufacturer.Id. Value : 0 }); ShowAreaResults(areaDtos); } } }
public void ShowMachines(IEnumerable <MachineDTO> machineDtos) { MachineResultsGridView.DataSource = machineDtos; MachineResultsGridView.EmptyDataText = Constants.EmptyData.MachineResults; MachineResultsGridView.DataBind(); MachineResultsUpdatePanel.Update(); }
private void PartGoButton_Click(object sender, EventArgs eventArgs) { //Clear the Machine Results Grid MachineResultsGridView.DataSource = null; MachineResultsGridView.DataBind(); MachineResultsUpdatePanel.Update(); using (var partManagementRepository = SharePointServiceLocator.GetCurrent().GetInstance <IPartManagementRepository>()) { IEnumerable <PartInventoryDTO> partsData = partManagementRepository.GetPartsInventoryView(PartSearchTextBox.Text); ShowParts(partsData); } }
public void Update() { MachineResultsUpdatePanel.Update(); }