protected void LoadData(string key) { List <ReimbursementStandard> list = ReimbursementStandard.GetAll(); //根据权限过滤 list = list.FindAll(a => a.员工信息 != null && AccessController.CheckPayGroup(a.员工信息.薪资组)); list = list.OrderBy(a => a.员工信息.员工序号).ToList(); if (string.IsNullOrEmpty(key) == false) { list = list.FindAll(a => a.姓名.Contains(key)); } //如果不显示历史记录 if (chk显示历史记录.Checked == false) { List <ReimbursementStandard> tempList = new List <ReimbursementStandard>(); foreach (ReimbursementStandard item in list) { //只需要最后生效的记录 DateTime date = list.FindAll(a => a.效).Max(a => a.生效日期); if (item.生效日期 == date) { tempList.Add(item); } } list = tempList; } gridControl1.DataSource = list; gridControl1.RefreshDataSource(); gridView1.ExpandAllGroups(); }
private void BecomeEffective(ReimbursementStandardInput input) { ReimbursementStandard m = new ReimbursementStandard(); ReimbursementStandard found = ReimbursementStandard.GetReimbursementStandard(input.员工编号, input.项目, input.生效日期); if (found != null) { m = found; } input.CopyWatchMember(m); m.效 = true; ReimbursementStandardInput anotherInput = input.另一人录入的记录 as ReimbursementStandardInput; m.录入人 = input.录入人 + " " + anotherInput.录入人; m.录入时间 = input.生效时间; m.Save(); }