Exemplo n.º 1
0
        public PagedListModel <QEboardSumModel> GteQEboardSumDetailData(string Projects, int PageNumber, int PageSize)
        {
            var totalCount            = 0;
            var result                = NoticeRepository.GetQEboardSumDetailData(Projects);
            var OneDirectTarget       = 100.0;
            var OneDirectTargetActual = 100.0;
            var TwoDirectTarget       = 100.0;
            var TwoDirectTargetActual = 100.0;

            foreach (var item in result)
            {
                OneDirectTarget       *= item.OneTargetYield.Equals(0) ? 1 : item.OneTargetYield;
                OneDirectTargetActual *= item.OneYield.Equals(0) ? 1 : item.OneYield;
                TwoDirectTarget       *= item.SecondTargetYield.Equals(0) ? 1 : item.SecondTargetYield;
                TwoDirectTargetActual *= item.SecondYield.Equals(0) ? 1 : item.SecondYield;
            }

            foreach (var item in result)
            {
                item.OneDirectTarget       = OneDirectTarget.ToString("F2") + '%';
                item.OneDirectTargetActual = OneDirectTargetActual.ToString("F2") + '%';
                item.TwoDirectTarget       = TwoDirectTarget.ToString("F2") + '%';
                item.TwoDirectTargetActual = TwoDirectTargetActual.ToString("F2") + '%';
            }
            totalCount = result.Count;
            result     = result.Skip(PageSize * PageNumber).Take(PageSize).ToList();
            return(new PagedListModel <QEboardSumModel>(totalCount, result));
        }