示例#1
0
        public CollegeStat(ICollegeRepository repository, CollegeInfo info,
                           IInfrastructureRepository infrastructureRepository)
        {
            CollegeRegion region = repository.GetRegion(info.Id);

            Name = info.Name;
            ExpectedSubscribers = info.ExpectedSubscribers;
            Area = region.Area;
            Id   = region.AreaId;
            UpdateStats(infrastructureRepository);
        }
        private void UpdateRegion(int id, double area, string message, CollegeInfo info, RegionType type)
        {
            CollegeRegion region = _repository.GetRegion(id);

            if (region == null)
            {
                info.CollegeRegion = new CollegeRegion
                {
                    Area       = area,
                    Info       = message,
                    RegionType = type
                };
            }
            else
            {
                region.Area       = area;
                region.Info       = message;
                region.RegionType = type;
            }
        }