/// <summary>
        /// 删除人数统计
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public override bool Delete(Population entity)
        {
            // delete the records
            PopulationRecordBusiness recordBusiness = new PopulationRecordBusiness();

            recordBusiness.DeleteByPopulation(entity.Id);

            return(base.Delete(entity));
        }
        /// <summary>
        /// 获取学生人数
        /// </summary>
        /// <param name="id">人数统计ID</param>
        /// <returns></returns>
        public int GetStudentNumber(string id)
        {
            Poseidon.Core.BL.DictBusiness dictBusiness = new Poseidon.Core.BL.DictBusiness();
            var dictItems = dictBusiness.FindItems(EnergyConstant.StudentDictCode);

            PopulationRecordBusiness recordBusiness = new PopulationRecordBusiness();
            int number = recordBusiness.GetDetailsNumber(id, dictItems.Select(r => r.Value).ToList(), true);

            return(number);
        }
Beispiel #3
0
        /// <summary>
        /// 导入人数记录
        /// </summary>
        /// <param name="populationId">人数统计ID</param>
        /// <param name="departmentId">部门ID</param>
        /// <returns></returns>
        public List <StaffTarget> ImportPopulation(string populationId, string departmentId)
        {
            List <StaffTarget>       data       = new List <StaffTarget>();
            PopulationRecordBusiness prBusienss = new PopulationRecordBusiness();
            var popRecord = prBusienss.FindByDepartment(populationId, departmentId);

            if (popRecord == null)
            {
                return(data);
            }

            foreach (var item in popRecord.Details)
            {
                StaffTarget st = new StaffTarget();
                st.Name   = item.Name;
                st.Code   = item.Code;
                st.Number = item.Number;

                data.Add(st);
            }

            return(data);
        }