private RowCell GetRowCell(ScheduleBody scheduleBody, ColumnCell columnCell, IList<RowCell> rowCellList, DateTime dateTimeNow)
        {
            RowCell rowCell = new RowCell();
            var q = rowCellList.Where(r => r.OrderNo == scheduleBody.OrderNo && r.Sequence == scheduleBody.Sequence
                                            && r.ScheduleType == columnCell.ScheduleType
                                            && (columnCell.EndDate < dateTimeNow ? r.EndDate < dateTimeNow : r.EndDate == columnCell.EndDate));

            if (q != null && q.Count() > 0)
            {
                rowCell = q.First();
                rowCell.OrderQty = q.Sum(oq => oq.OrderQty);
                rowCell.ShippedQty = q.Sum(oq => oq.ShippedQty);
                if (rowCell.EndDate < dateTimeNow && rowCell.OrderQty == rowCell.ShippedQty)
                {
                    rowCell.OrderQty = 0;
                    rowCell.ShippedQty = 0;
                }
            }
            else
            {
                rowCell.OrderNo = scheduleBody.OrderNo;
                rowCell.Sequence = scheduleBody.Sequence;
                rowCell.ScheduleType = columnCell.ScheduleType;
                rowCell.EndDate = columnCell.EndDate;
                rowCell.OrderQty = 0;
                rowCell.ShippedQty = 0;
            }
            return rowCell;
        }
 private RowCell GetRowCell(ScheduleBody scheduleBody, ColumnCell columnCell, IList<RowCell> rowCellList)
 {
     RowCell rowCell = new RowCell();
     var q = rowCellList.Where(r => r.OrderNo == scheduleBody.OrderNo && r.Sequence == scheduleBody.Sequence
                                     && r.ScheduleType == columnCell.ScheduleType && r.EndDate == columnCell.EndDate);
     if (q.ToList() != null && q.ToList().Count > 0)
     {
         rowCell = q.ToList().First();
     }
     else
     {
         rowCell.OrderNo = scheduleBody.OrderNo;
         rowCell.Sequence = scheduleBody.Sequence;
         rowCell.ScheduleType = columnCell.ScheduleType;
         rowCell.EndDate = columnCell.EndDate;
         rowCell.OrderQty = 0;
         rowCell.ShippedQty = 0;
     }
     return rowCell;
 }