public void CreateUcControl() { try { UnitOfWork unitOfWork = new UnitOfWork(); this.TechSpecBindingSource.DataSource = unitOfWork.TechSpecsRepo.Paginate(m => m.OrderBy(x => x.Id), 20, 0); //this.OfficeBindingSource.DataSource = unitOfWork.OfficesRepo.Get(); //this.EmployeeBindingSource.DataSource = unitOfWork.EmployeesRepo.Get(); //this.EquipmentTypeBindingSource.DataSource = unitOfWork.EquipmentTypesRepo.Get(); //this.UnitTypeBindingSource.DataSource = unitOfWork.UnitTypesRepo.Get(); //this.AssignedToBindingSource.DataSource = unitOfWork.UsersRepo.Get(); Search(txtSearch.Text); TechSpecGrid.RefreshData(); } catch (Exception e) { MessageBox.Show(e.Message, "Load Tech Specs", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public void LoadDashboard() { try { PPEDel.Visible = false; UnitOfWork unitOfWork = new UnitOfWork(); this.TechSpecBindingSource.DataSource = unitOfWork.TechSpecsRepo.Paginate(m => m.OrderBy(x => x.Id), 20, 0, m => m.DocActions.Any(x => x.TableName == "TechSpec" && x.EndorsedTo == User.UserId)); //this.OfficeBindingSource.DataSource = unitOfWork.OfficesRepo.Get(); //this.EmployeeBindingSource.DataSource = unitOfWork.EmployeesRepo.Get(); //this.EquipmentTypeBindingSource.DataSource = unitOfWork.EquipmentTypesRepo.Get(); //this.UnitTypeBindingSource.DataSource = unitOfWork.UnitTypesRepo.Get(); //this.AssignedToBindingSource.DataSource = unitOfWork.UsersRepo.Get(); Search(txtSearch.Text); TechSpecGrid.RefreshData(); } catch (Exception e) { MessageBox.Show(e.Message, "Load Tech Specs", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }