コード例 #1
0
        public IList <RandomExamCountStatistic> GetCountWithOrg(int SuitRange, int OrgID, DateTime DateFrom, DateTime DateTo, int railSystemId, int style)
        {
            IList <RandomExamCountStatistic> objList = new List <RandomExamCountStatistic>();
            Database db = DatabaseFactory.CreateDatabase();

            //DbCommand dbCommand = db.GetStoredProcCommand("USP_EXAM_GRADE_Org_Count");

            string    sqlCommand = "USP_EXAM_GRADE_Org_Count";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_random_exam_suitrange", DbType.Int32, SuitRange);
            db.AddInParameter(dbCommand, "p_random_exam_orgid", DbType.Int32, OrgID);
            db.AddInParameter(dbCommand, "p_random_exam_dateFrom", DbType.DateTime, DateFrom);
            db.AddInParameter(dbCommand, "p_random_exam_dateTo", DbType.DateTime, DateTo);
            db.AddInParameter(dbCommand, "p_rail_system_id", DbType.Int32, railSystemId);
            db.AddInParameter(dbCommand, "p_exam_style", DbType.Int32, style);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    RandomExamCountStatistic obj = CreateModelObject(dataReader);

                    objList.Add(obj);
                }
            }
            return(objList);
        }
コード例 #2
0
        public IList <RandomExamCountStatistic> GetCountWithOrg(int SuitRange, int OrgID, DateTime DateFrom, DateTime DateTo, int railSystemId, int style)
        {
            IList <RandomExamCountStatistic> objList = dal.GetCountWithOrg(SuitRange, OrgID, DateFrom, DateTo, railSystemId, style);

            if (SuitRange == 1)
            {
                int sumExamCount     = 0;
                int sumEmployeeCount = 0;

                foreach (RandomExamCountStatistic statistic in objList)
                {
                    sumExamCount     += statistic.ExamCount;
                    sumEmployeeCount += statistic.EmployeeCount;
                }
                RandomExamCountStatistic obj = new RandomExamCountStatistic();
                obj.OrgID         = 0;
                obj.OrgName       = "ºÏ¼Æ";
                obj.ExamCount     = sumExamCount;
                obj.EmployeeCount = sumEmployeeCount;
                objList.Add(obj);
            }

            return(objList);
        }