public static int GetOrderLinesCount( string orderNumber, string partNumber, int sort, int startIndex, int size ) { if (CurrentOrderLineTotals == null) { var filter = new OrderTracking.OrderLineAnalysisFilter(); if (!string.IsNullOrEmpty( orderNumber )) { filter.OrderIDs = new List<int> { Convert.ToInt32( orderNumber ) }; } if (!string.IsNullOrEmpty( partNumber )) { filter.PartNumbers = new List<string> { partNumber }; } filter.StatusIDs = new List<int> { OrderLineStatusUtil.StatusByte("InStock") /* поступил на склад */, OrderLineStatusUtil.StatusByte("ReceivedByClient") /* получен клиентом */}; CurrentOrderLineTotals = OrderTracking.GetOrderLinesCount( SiteContext.Current.CurrentClient.Profile.ClientId, filter ); } return CurrentOrderLineTotals.TotalCount; }
public static OrderLine[] GetOrderLines( DateTime? orderDateStart, DateTime? orderDateEnd, Decimal? partPriceStart, Decimal? partPriceEnd, string partName, string orderIDs, string custOrderNums, string partNumbers, string referenceIDs, string manufacturers, string preset, string statusIDs, int sort, int startIndex, int size) { if (CurrentOrderLines == null) { var filter = new OrderTracking.OrderLineAnalysisFilter(); filter.OrderDateStart = orderDateStart; filter.OrderDateEnd = orderDateEnd; filter.PartPriceStart = partPriceStart; filter.PartPriceEnd = partPriceEnd; filter.PartName = partName; if (!string.IsNullOrEmpty(orderIDs)) { filter.OrderIDs = orderIDs.Split(',').Select(s => int.Parse(s)).ToList<int>(); } if (!string.IsNullOrEmpty(custOrderNums)) { filter.CustOrderNums = custOrderNums.Split(',').ToList(); } if (!string.IsNullOrEmpty(partNumbers)) { filter.PartNumbers = partNumbers.Split(',').ToList(); } if (!string.IsNullOrEmpty(referenceIDs)) { filter.ReferenceIDs = referenceIDs.Split(',').ToList(); } if (!string.IsNullOrEmpty(manufacturers)) { filter.Manufacturers = manufacturers.Split(',').ToList(); } if (!string.IsNullOrEmpty(statusIDs)) { filter.StatusIDs = statusIDs.Split(',').Select(s => int.Parse(s)).ToList<int>(); } if (preset == "allworked") { filter.ComplexStatusFilter = OrderTracking.ComplexStatusFilter.NotCompleted; } else if (preset == "allclosed") { filter.ComplexStatusFilter = OrderTracking.ComplexStatusFilter.Completed; } else if (!string.IsNullOrEmpty(statusIDs)) { filter.StatusIDs = statusIDs.Split(',').Select(s => int.Parse(s)).ToList<int>(); } CurrentOrderLines = OrderTracking.GetOrderLines(SiteContext.Current.CurrentClient.Profile.ClientId, filter, (OrderTracking.OrderLineSortFields)sort, startIndex, size); } return CurrentOrderLines; }