Ejemplo n.º 1
0
        //protected override void SetLines(Worksheet ws, string sSelItems, string sSelTypeIDs, long lGxID, int nStartYear, int nEndYear)
        //{
        //    ArrayList arrNames = new ArrayList(); ArrayList arrValues = new ArrayList(); ArrayList arrSigns = new ArrayList();
        //    arrNames.Add("bmk.DelFlag"); arrValues.Add(false); arrSigns.Add(SIGN.Equal);
        //    arrNames.Add("bmk.YearCode"); arrValues.Add(nStartYear); arrSigns.Add(SIGN.GreaterThanOrEqual);
        //    arrNames.Add("bmk.YearCode"); arrValues.Add(nEndYear); arrSigns.Add(SIGN.LessThanOrEqual);
        //    arrNames.Add("bmk.GxID"); arrValues.Add(lGxID); arrSigns.Add(SIGN.Equal);

        //    int nItemPos;
        //    int nRowNumX;
        //    int nRowNumY;
        //    ArrayList ItemKeys;
        //    ArrayList arrItems;
        //    SetLinesPre(ws, sSelItems, sSelTypeIDs, out nItemPos, out nRowNumX, out nRowNumY, out ItemKeys, out arrItems);

        //    var tempMan = new tddTableManage();
        //    _DFSSetLine(nItemPos, nRowNumX, nRowNumY, ws, ItemKeys, arrItems, arrNames, arrValues, arrSigns,tempMan);
        //}

        //protected override int _DFSSetLine(int nItemPos, int nRowNumX, int nRowNumY, Worksheet ws, ArrayList ItemKeys, ArrayList arrItems, ArrayList arrNames, ArrayList arrValues, ArrayList arrSigns,object tempMan)
        //{
        //     return _DFSSetLine1(nItemPos, nRowNumX, nRowNumY, ws, ItemKeys, arrItems, arrNames, arrValues, arrSigns,tempMan);
        //}

        protected override int _SetLineCore(int nItemPos, int nRowNumX, Worksheet ws, ArrayList ItemKeys, ArrayList arrItems, ArrayList arrNowNames, ArrayList arrNowValues, ArrayList arrNowSigns, int nRowNowNumY, long ReportTypeID)
        {
            tddTableManage tddMan = new tddTableManage();

            if (nItemPos == ItemKeys.Count - 1)
            {
                Expression <Func <T_tdd, bool> > where = GetAndLambdaExpression <T_tdd>(arrNowNames, arrNowValues, arrNowSigns);
                int count = tddMan.GetRecordCount(where);
                clsExcelApp.SetCellValue(ws, nRowNumX, 1, nRowNumX - 3);    //序号
                clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumY, count); //录取人数
                nRowNumX++;
                if (nItemPos == 0)
                {
                    nUnitRow1 = nRowNumX;
                }
                else if (nItemPos == 1)
                {
                    nUnitRow2 = nRowNumX;
                }
                else if (nItemPos == 2)
                {
                    nUnitRow3 = nRowNumX;
                }
            }
            else
            {
                nRowNumX = DFSSetLine(nItemPos + 1, nRowNumX, nRowNowNumY, ws, ItemKeys, arrItems, arrNowNames, arrNowValues, arrNowSigns, ReportTypeID);
            }

            UnitCellCore(nItemPos, nRowNumX, ws, ItemKeys);
            return(nRowNumX);
        }
Ejemplo n.º 2
0
        protected override int _SetLineCore(int nItemPos, int nRowNumX, Worksheet ws, ArrayList ItemKeys, ArrayList arrItems, ArrayList arrNowNames, ArrayList arrNowValues, ArrayList arrNowSigns, int nRowNowNumY, long ReportTypeID)
        {
            tddTableManage tddMan = new tddTableManage();

            if (nItemPos == ItemKeys.Count - 1)
            {
                double maxScore = 0; // 最高分
                double minScore = 0; // 最低分
                double sumScore = 0; // 所有人的总分
                double aveScore = 0; //平均分
                Expression <Func <T_tdd, bool> > where = GetAndLambdaExpression <T_tdd>(arrNowNames, arrNowValues, arrNowSigns);
                int          count = tddMan.GetRecordCount(where);
                List <T_tdd> list  = tddMan.GetRecord(where);
                clsExcelApp.SetCellValue(ws, nRowNumX, 1, nRowNumX - 3);    //序号
                clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumY, count); //录取人数
                if (list != null && list.Count > 0)
                {
                    minScore = maxScore = list[0].Tzcj;
                    foreach (T_tdd l in list)
                    {
                        if (l.Tzcj < minScore)
                        {
                            minScore = l.Tzcj;
                        }
                        if (l.Tzcj > maxScore)
                        {
                            maxScore = l.Tzcj;
                        }
                        sumScore += l.Tzcj;
                    }
                    aveScore = sumScore / count;
                }

                clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumY + 1, maxScore); //最高分
                clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumY + 2, minScore); //最低分
                clsExcelApp.SetCellValue(ws, nRowNumX, nRowNowNumY + 3, aveScore); //平均分

                nRowNumX++;
                if (nItemPos == 0)
                {
                    nUnitRow1 = nRowNumX;
                }
                else if (nItemPos == 1)
                {
                    nUnitRow2 = nRowNumX;
                }
                else if (nItemPos == 2)
                {
                    nUnitRow3 = nRowNumX;
                }
            }
            else
            {
                nRowNumX = DFSSetLine(nItemPos + 1, nRowNumX, nRowNowNumY, ws, ItemKeys, arrItems, arrNowNames, arrNowValues, arrNowSigns, ReportTypeID);
            }

            UnitCellCore(nItemPos, nRowNumX, ws, ItemKeys);
            return(nRowNumX);
        }