public void Reload() { try { CalculatorSalariesBO aCalculatorSalariesBO = new CalculatorSalariesBO(); SystemUsersBO aSystemUsersBO = new SystemUsersBO(); List<CalculatorSalaryEN> aListCalculatorSalary = new List<CalculatorSalaryEN>(); List<CalculatorSalaries> aListTemp = aCalculatorSalariesBO.Select_All(); CalculatorSalaryEN aCalculatorSalary; for( int i =1; i<aListTemp.Count;i++) { aCalculatorSalary = new CalculatorSalaryEN(); aCalculatorSalary.SetValue(aListTemp[i]); aCalculatorSalary.SystemUser = aSystemUsersBO.Select_ByID(aListTemp[i].IDSystemUser).Name; aListCalculatorSalary.Add(aCalculatorSalary); } dgvCalculatorSalaries.DataSource = aListCalculatorSalary.Where(a=>a.Disable == false).ToList(); dgvCalculatorSalaries.RefreshDataSource(); } catch (Exception ex) { MessageBox.Show("frmLst_CalculatorSalaries.Reload\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ReloadGridView(int IDSystemUser) { List<CalculatorSalaryEN> aListCalculatorSalary = new List<CalculatorSalaryEN>(); List<CalculatorSalaries> aListTemp = aCalculatorSalariesBO.Select_ByIDSystemUser(IDSystemUser); CalculatorSalaryEN aCalculatorSalary; for (int i = 0; i < aListTemp.Count; i++) { aCalculatorSalary = new CalculatorSalaryEN(); aCalculatorSalary.SetValue(aListTemp[i]); aCalculatorSalary.SystemUser = aSystemUsersBO.Select_ByID(aListTemp[i].IDSystemUser).Name; aListCalculatorSalary.Add(aCalculatorSalary); } dgvCaculatorSalaries.DataSource = aListCalculatorSalary.OrderBy(a => a.ID); dgvCaculatorSalaries.RefreshDataSource(); }