Esempio n. 1
0
        private void Delete()
        {
            int universityId = int.Parse(Helper.GetParameterFromRequest("universityId"));

            //判断高校下是否存在专业
            IEntityRepository Repo      = factory.Create("major");
            IMajorRepository  majorRepo = Repo as IMajorRepository;
            int count = majorRepo.GetCountInUniversity(universityId);

            if (count > 0)
            {
                Helper.ResponseError(605);
                return;
            }

            //删除高校
            Repo = factory.Create("university");
            int result = Repo.Delete(universityId);

            if (string.IsNullOrEmpty(Repo.ErrorMessage))
            {
                Helper.Response("1");
            }
            else
            {
                Helper.ResponseError(Repo.ErrorMessage);
            }
        }
 public ManagingStudentService()
 {
     studentRepository      = new StudentRepository();
     rankingRepository      = new RankingRepository();
     learningModeRepository = new LearningModeRepository();
     majorRepository        = new MajorRepository();
     ethnicRepository       = new EthnicRepository();
 }
Esempio n. 3
0
 public ProjectServices(IProjectRepository projectRepository, IMajorRepository majorRepository, IClassRepository classRepository, IPeriodRepository periodRepository, ISectionProjectRepository sectionProjectRepository)
 {
     _projectRepository        = projectRepository;
     _majorRepository          = majorRepository;
     _classRepository          = classRepository;
     _periodRepository         = periodRepository;
     _sectionProjectRepository = sectionProjectRepository;
 }
Esempio n. 4
0
 public FacultiesServices(IFacultyRepository facultyRepository, IMajorRepository majorRepository, IProjectRepository projectRepository, IStudentRepository studentRepository)
 {
     _facultyRepository = facultyRepository;
     _majorRepository   = majorRepository;
     _projectRepository = projectRepository;
     _studentRepository = studentRepository;
     Periods            = new List <int>();
     Periods.Add(1);
     Periods.Add(2);
     Periods.Add(3);
     Periods.Add(5);
 }
Esempio n. 5
0
 public ProjectController(ApplicationDbContext context, IMapper mapper, IUnitOfWork unitOfWork,
                          IProjectRepository projectRepository, IMajorRepository majorRepository,
                          IHostingEnvironment host, IExcelRepository excelRepository, ILecturerRepository lecturerRepository)
 {
     this.context           = context;
     this.mapper            = mapper;
     this.unitOfWork        = unitOfWork;
     this.projectRepository = projectRepository;
     this.majorRepository   = majorRepository;
     this.host               = host;
     this.excelRepository    = excelRepository;
     this.lecturerRepository = lecturerRepository;
 }
Esempio n. 6
0
 public GroupController(IMapper mapper, IUnitOfWork unitOfWork,
                        IGroupRepository groupRepository, ILecturerRepository lecturerRepository,
                        IProjectRepository projectRepository, IMajorRepository majorRepository,
                        IQuarterRepository quarterRepository, IEnrollmentRepository enrollmentRepository)
 {
     this.mapper               = mapper;
     this.unitOfWork           = unitOfWork;
     this.groupRepository      = groupRepository;
     this.lecturerRepository   = lecturerRepository;
     this.projectRepository    = projectRepository;
     this.majorRepository      = majorRepository;
     this.quarterRepository    = quarterRepository;
     this.enrollmentRepository = enrollmentRepository;
 }
Esempio n. 7
0
 public LecturerController(ApplicationDbContext context, IMapper mapper,
                           ILecturerRepository lecturerRepository, IUnitOfWork unitOfWork,
                           UserManager <ApplicationUser> userManager, IMajorRepository majorRepository,
                           IHostingEnvironment host, IExcelRepository excelRepository)
 {
     this.userManager        = userManager;
     this.context            = context;
     this.mapper             = mapper;
     this.lecturerRepository = lecturerRepository;
     this.majorRepository    = majorRepository;
     this.unitOfWork         = unitOfWork;
     this.host            = host;
     this.excelRepository = excelRepository;
 }
Esempio n. 8
0
 public StudentController(IHubContext <PMSHub> hubContext, ApplicationDbContext context,
                          IMapper mapper, IStudentRepository studentRepository,
                          IUnitOfWork unitOfWork, UserManager <ApplicationUser> userManager,
                          IMajorRepository majorRepository, IHostingEnvironment host, IExcelRepository excelRepository)
 {
     this.userManager       = userManager;
     this.context           = context;
     this.mapper            = mapper;
     this.studentRepository = studentRepository;
     this.majorRepository   = majorRepository;
     this.unitOfWork        = unitOfWork;
     this.hubContext        = hubContext;
     this.host            = host;
     this.excelRepository = excelRepository;
 }
Esempio n. 9
0
 public ProjectServices(IProjectRepository projectRepository, ISectionRepository sectionRepository,
                        IStudentRepository studentRepository, ITextDocumentServices textDocumentServices, IMajorRepository majorRepository, IClassRepository classRepository, IPeriodRepository periodRepository, ISectionProjectRepository sectionProjectRepository)
 {
     _projectRepository        = projectRepository;
     _sectionRepository        = sectionRepository;
     _studentRepository        = studentRepository;
     _textDocumentServices     = textDocumentServices;
     _majorRepository          = majorRepository;
     _classRepository          = classRepository;
     _periodRepository         = periodRepository;
     _sectionProjectRepository = sectionProjectRepository;
     _periods.Add(1);
     _periods.Add(2);
     _periods.Add(3);
     _periods.Add(5);
 }
Esempio n. 10
0
        private void GetList()
        {
            IEntityRepository Repo      = factory.Create("major");
            IMajorRepository  MajorRepo = Repo as IMajorRepository;
            string            majorName = Helper.GetParameterFromRequest("majorName");
            int      universityId       = int.Parse(Helper.GetParameterFromRequest("universityId"));
            Entities entities           = MajorRepo.GetList(majorName, universityId);

            if (string.IsNullOrEmpty(Repo.ErrorMessage))
            {
                Helper.Response(entities.Serialize());
            }
            else
            {
                Helper.ResponseError(Repo.ErrorMessage);
            }
        }
Esempio n. 11
0
        private void GetListInRecurit()
        {
            int companyId               = int.Parse(Helper.GetParameterFromRequest("companyId"));
            int year                    = int.Parse(Helper.GetParameterFromRequest("year"));
            int universityId            = int.Parse(Helper.GetParameterFromRequest("universityId"));
            IEntityRepository Repo      = factory.Create("major");
            IMajorRepository  MajorRepo = Repo as IMajorRepository;
            Entities          entities  = MajorRepo.GetList(companyId, year, universityId);

            if (string.IsNullOrEmpty(Repo.ErrorMessage))
            {
                Helper.Response(entities.Serialize());
            }
            else
            {
                Helper.ResponseError(Repo.ErrorMessage);
            }
        }
 public CollegeService(IMajorRepository majorRepository, IMajorCollegeRepository majorCollegeRepository, ICollegeRepository collegeRepository)
 {
     this._majorRepository        = majorRepository;
     this._majorCollegeRepository = majorCollegeRepository;
     this._collegeRepository      = collegeRepository;
 }
Esempio n. 13
0
 public MajorService(IMajorRepository majorRepository)
 {
     _majorRepository = majorRepository;
 }
Esempio n. 14
0
 public MajorController(ILogger <MajorController> logger, IMajorRepository majorRepository)
 {
     this.logger          = logger;
     this.majorRepository = majorRepository;
 }
Esempio n. 15
0
 public MajorsController(IMapper mapper, IMajorRepository repository, IUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
     this.repository = repository;
     this.mapper     = mapper;
 }
Esempio n. 16
0
 public MajorCache(ICacheManagerProvider cacheManagerProvider, IMajorRepository repository)
     : base(cacheManagerProvider.GetCacheManager(), repository, "Major")
 {
 }
Esempio n. 17
0
 public MajorsController(IMajorRepository majorRepository, IGradeRepository gradeRepository)
 {
     _majorRepository = majorRepository;
     _gradeRepository = gradeRepository;
 }
Esempio n. 18
0
 public MajorService(IMapper mapper, IMajorRepository majorRepository) : base(mapper)
 {
     _majorRepository = majorRepository;
 }
Esempio n. 19
0
 public MajorBusinessLogic(IMajorRepository majorRepository)
 {
     this.majorRepository = majorRepository;
 }
Esempio n. 20
0
 public MajorService(IMajorCache majorCache, IMajorRepository majorRepository)
 {
     this._majorCache      = majorCache;
     this._majorRepository = majorRepository;
 }
 public MajorsController(
     IMajorRepository majorRepository)
 {
     _majorRepository = majorRepository;
 }
Esempio n. 22
0
        private IMajorRepository _repo;   // ISubjectRepository class의 객체 _repo 생성.


        // 의존성 주입: ISubjectRepository의 인스턴스를 SubjectRepository의 인스턴스로
        // Startup.cs에서 설정한 DI를 생성자를 이용하여 받는 코드 구현이다.
        public MajorController(IMajorRepository repo) // private _repo에 데이터를 넣는 메소드.
        {
            _repo = repo;
        }
Esempio n. 23
0
 public MajorsServices(IMajorRepository majorRepository)
 {
     _majorRepository = majorRepository;
 }