private int GetMaxMSReturnNumber(WCFDataEntities context) { List<int> stringList = (from p in context.ReturnReports where p.MSReturnNumber != null select p.MSReturnNumber).Cast<int>().ToList(); if (stringList == null || stringList.Count == 0) return 1; else { int result = stringList.Max(); result++; return result; } }
private List<ProductKeyInfo> GetProductKeyInfoes(WCFDataEntities context, List<long> productKeyInfoIds) { return context.ProductKeyInfoes.Where(k => productKeyInfoIds.Contains(k.ProductKeyID)).ToList(); }
private int GetMaxFulfillmentNumber(WCFDataEntities context) { List<int> stringList = (from p in context.ProductKeyInfoes where p.FulfillmentNumber != null select p.FulfillmentNumber).Cast<int>().ToList(); if (stringList == null || stringList.Count == 0) return 1; else { int result = stringList.Max(); result++; return result; } }