public List<string> RemoveExtensionOrder(List<string> orderIDs) { using (FBCommonBLL fbCommonBLL = new FBCommonBLL()) { List<string> listResult = new List<string>(); fbCommonBLL.BeginTransaction(); QueryExpression qe = new QueryExpression(); qe.Operation = QueryExpression.Operations.Equal; qe.PropertyName = "ORDERID"; orderIDs.ForEach(item => { qe.PropertyValue = item; List<T_FB_EXTENSIONALORDER> list = fbCommonBLL.GetEntities<T_FB_EXTENSIONALORDER>(qe); list.ForEach(entity => { // 只能删除未提交的单据 if (((int)entity.CHECKSTATES) != (int)CheckStates.UnSubmit) { listResult.Add(item); } else { fbCommonBLL.Remove(entity); } }); }); return listResult; } }
private List<DebtInfo> GetDebtInfo(QueryExpression qe) { using (FBCommonBLL bll = new FBCommonBLL()) { List<DebtInfo> result = new List<DebtInfo>(); qe.Include = new string[] { typeof(T_FB_BORROWAPPLYDETAIL).Name }; qe.OrderBy = new string[] { "PLANREPAYDATE" }; List<T_FB_BORROWAPPLYMASTER> list = bll.GetEntities<T_FB_BORROWAPPLYMASTER>(qe); list = list.OrderBy(item => item.PLANREPAYDATE).ToList(); result = list.CreateList(item => { DebtInfo debtInfo = new DebtInfo(); decimal? deblt = item.T_FB_BORROWAPPLYDETAIL.Sum(detail => { return detail.UNREPAYMONEY; }); debtInfo.Debt = deblt == null ? 0 : deblt.Value; debtInfo.EmployeeID = item.OWNERID; debtInfo.OrderType = "T_FB_BORROWAPPLYMASTER"; debtInfo.OrderCode = item.BORROWAPPLYMASTERCODE; return debtInfo; }); return result; } }