private void LoadStaff() { StaffDAO d = new StaffDAO(); DataSet set = d.GetAllStaffSalaryInfo(); tabStaff.Rows.Clear(); DataRow newRow; foreach (DataRow r in set.Tables[0].Rows) { newRow = tabStaff.NewRow(); newRow["PersonName"] = r["PersonName"]; newRow["StaffId"] = r["StaffId"]; newRow["StaffNumber"] = r["StaffNumber"]; newRow["PostName"] = r["PostName"]; newRow["PostSalary"] = r["PostBaseSalary"]; newRow["PerformanceLevel"] = r["PerformanceLevel"]; newRow["PerformanceSalary"] = 0; newRow["BenefitLevel"] = r["BenefitLevel"]; newRow["BenefitSalary"] = 0; newRow["AttendanceSalary"] = r["AttendanceSalary"]; newRow["SenioritySalary"] = r["SenioritySalary"]; newRow["ReissueSalary"] = 0; newRow["SalaryTotal"] = 0; tabStaff.Rows.Add(newRow); } gridCtrl.DataSource = tabStaff; }
private void LoadStaff() { StaffDAO d = new StaffDAO(); DataSet set = d.GetAllStaffSalaryInfo(); gridCtrl.DataSource = set.Tables[0]; }