public ScheduleController(IScheduleService scheduleService,
                           ITermService termService,
                           IMappingService mappingService,
                           ICollegeService collegeService,
                           IEducationalGroupService educationalGroupService,
                           IProfessorService professorService,
                           IEducationalClassService educationalClassService,
                           IStudentEducationalClassService studentEducationalClassService,
                           IProfessorScoreService professorScoreService,
                           IIndicatorService indicatorService,
                           IMappingTypeService mappingTypeService,
                           IUniversityLevelMappingService universityLevelMappingService,
                           IEducationalGroupScoreService educationalGroupScoreService,
                           ILogService logService,
                           ILogTypeService logTypeService,
                           IUserService userService)
 {
     _scheduleService                = scheduleService;
     _termService                    = termService;
     _mappingService                 = mappingService;
     _collegeService                 = collegeService;
     _educationalGroupService        = educationalGroupService;
     _professorService               = professorService;
     _educationalClassService        = educationalClassService;
     _studentEducationalClassService = studentEducationalClassService;
     _professorScoreService          = professorScoreService;
     _indicatorService               = indicatorService;
     _logService                    = logService;
     _logTypeService                = logTypeService;
     _mappingTypeService            = mappingTypeService;
     _userService                   = userService;
     _universityLevelMappingService = universityLevelMappingService;
     _educationalGroupScoreService  = educationalGroupScoreService;
 }
 public ProfessorController(
     IProfessorService professorService
     , IProfessorScoreService professorScoreService
     , IEducationalGroupService educationalGroupService
     , ICollegeService collegeService
     , ITermService termService
     , IIndicatorService indicatorService
     , IRoleAccessService roleAccessService
     , IUserRoleService userRoleService
     , ILogService logService
     , IEducationalClassService educationalClassService
     )
 {
     _professorService        = professorService;
     _professorScoreService   = professorScoreService;
     _educationalGroupService = educationalGroupService;
     _collegeService          = collegeService;
     _termService             = termService;
     _indicatorService        = indicatorService;
     _roleAccessService       = roleAccessService;
     _userRoleService         = userRoleService;
     _reportService           = new DapperService(educationalGroupService);
     _logService = logService;
     _educationalClassService = educationalClassService;
 }
 public InternationalManagerController(IRequestService requestService
                                       , IStudentDocService studentDocService
                                       , ICollegeService collegeService
                                       , IFieldForForeignService fieldForForeignService
                                       , ICountryService countryService
                                       , ICandidateFieldService condidateService
                                       , IStudentService studentService
                                       , IPersonService personService
                                       , IRelatedPersonService relatedPersonService
                                       , IAddressService addressService
                                       , IEducationDegreeService educationDegreeService
                                       , ICitizenShipService citizenShipService
                                       , INewStudentService newStudentService
                                       , ISidaFieldService sidaFieldService
                                       , IUserLogService userLogService)
 {
     _requestService         = requestService;
     _studentDocService      = studentDocService;
     _collegeService         = collegeService;
     _fieldForForeignService = fieldForForeignService;
     _countryService         = countryService;
     _condidateService       = condidateService;
     _studentService         = studentService;
     _personService          = personService;
     _relatedPersonService   = relatedPersonService;
     _addressService         = addressService;
     _educationDegreeService = educationDegreeService;
     _citizenShipService     = citizenShipService;
     _newStudentService      = newStudentService;
     _sidaFieldService       = sidaFieldService;
     _userLogService         = userLogService;
 }
 public CollegeController(
     ICollegeService CollegeService,
     NotificationHandler notifications,
     IMapper mapper) : base(notifications)
 {
     _CollegeService = CollegeService;
     _mapper         = mapper;
 }
예제 #5
0
 public UserController(IUserService UserService, IDepartmentService departmentService,
                       ICollegeService companyService, IRoleAuthorService roleAuthorService, IHostingEnvironment hostingEnvironment)
 {
     _departmentService  = departmentService;
     _UserService        = UserService;
     _companyService     = companyService;
     _roleAuthorService  = roleAuthorService;
     _hostingEnvironment = hostingEnvironment;
 }
        //دانشکده-Add Or Update
        public static void SyncAddOrUpdateColleges(ICollegeService collegeService, ILogService logService, ILogTypeService logTypeService, IUserService userService, User user)
        {
            var colleges = ClientHelper.GetValue <College>(StaticValue.CollegeRelativeAddress);

            //2.log
            SyncService.LogSync(logService, logTypeService, userService, user, (int)LogTypeValue.دریافت_دانشکده_از_سرویس);


            var resualt = new Dictionary <string, int>();
            var counter = 1;

            colleges.ForEach(x =>
            {
                if (x != null)
                {
                    if (x.CollegeCode == null || x.CollegeCode == 0 || string.IsNullOrEmpty(x.Name))
                    {
                        resualt.Add($"{x.Name}-{x.CollegeCode}-{counter}", 4);
                    }
                    var r = collegeService.AddOrUpdate(x);
                    resualt.Add($"{x.Name}-{x.CollegeCode}-{counter}", r);
                }
                ++counter;
            });


            var added            = resualt.Count(x => x.Value == 1);
            var updatetd         = resualt.Count(x => x.Value == 2);
            var warrning         = resualt.Count(x => x.Value == 3);
            var notFounded       = resualt.Count(x => x.Value == 4);
            var stringWarrning   = string.Empty;
            var stringNotFounded = string.Empty;

            foreach (var s in resualt.Where(x => x.Value == 3).Select(x => x.Key))
            {
                stringWarrning += $"تعداد {warrning}" + " || " + s + " | ";
            }
            foreach (var s in resualt.Where(x => x.Value == 3).Select(x => x.Key))
            {
                stringNotFounded += $"تعداد {notFounded}" + " || " + s + " | ";
            }

            stringWarrning   = !string.IsNullOrEmpty(stringWarrning.Trim()) ? stringWarrning : "بدون مشکل";
            stringNotFounded = !string.IsNullOrEmpty(stringNotFounded.Trim()) ? stringNotFounded : "بدون مشکل";

            SyncService.LogSync(logService, logTypeService, userService, user, (int)LogTypeValue.دانشکده_اضافه_گردید, $"تعداد {added}");
            SyncService.LogSync(logService, logTypeService, userService, user, (int)LogTypeValue.دانشکده_آپدیت_گردید, $"تعداد {updatetd}");
            SyncService.LogSync(logService, logTypeService, userService, user, (int)LogTypeValue.عملیات_ناموفق_در_بروزرسانی_دانشکده, stringWarrning);
            SyncService.LogSync(logService, logTypeService, userService, user, (int)LogTypeValue.عملیات_ناموفق_به_دلیل_عدم_وجود_حداقل_یک_مقدار_از_دانشکده, stringNotFounded);


            //return resualt;
        }
예제 #7
0
        public PagesController(
            ITermService termService
            , ICollegeService collegeService
            , IEducationalGroupService educationalGroupService
            , IProfessorService professorService
            , IRoleService roleService
            , IRoleAccessService roleAccessService
            , IAccessService accessService
            , IUserRoleService userRoleService
            , IMappingService mappingService
            , IIndicatorService indicatorService
            , IUniversityLevelMappingService universityLevelMappingService
            , IUserService userService
            , IScheduleService scheduleService


            , IEducationalClassService educationalClassService
            , IStudentEducationalClassService studentEducationalClassService
            , IProfessorScoreService professorScoreService
            , IMappingTypeService mappingTypeService
            , IEducationalGroupScoreService educationalGroupScoreService
            , ILogService logService
            , ILogTypeService logTypeService
            , IServiceUsersMappingService serviceUsersMappingService
            )
        {
            _termService                   = termService;
            _collegeService                = collegeService;
            _educationalGroupService       = educationalGroupService;
            _professorService              = professorService;
            _roleService                   = roleService;
            _roleAccessService             = roleAccessService;
            _accessService                 = accessService;
            _userRoleService               = userRoleService;
            _mappingService                = mappingService;
            _indicatorService              = indicatorService;
            _universityLevelMappingService = universityLevelMappingService;
            _userService                   = userService;
            _scheduleService               = scheduleService;
            _logService                     = logService;
            _logTypeService                 = logTypeService;
            _educationalClassService        = educationalClassService;
            _studentEducationalClassService = studentEducationalClassService;
            _professorScoreService          = professorScoreService;
            _mappingTypeService             = mappingTypeService;
            _educationalGroupScoreService   = educationalGroupScoreService;
            _serviceUsersMappingService     = serviceUsersMappingService;
            //SyncService.RunAll(termService, mappingService, collegeService, educationalGroupService
            //    , professorService, educationalClassService, studentEducationalClassService, professorScoreService
            //    , indicatorService, mappingTypeService, universityLevelMappingService, educationalGroupScoreService
            //    , logService, logTypeService, userService);
            //var lastUpdate = _logService.LastUpdate();
        }
예제 #8
0
 public officeController(ICollegeService _collegeService, IDepartmentService _depertmentService,
                         IStudentService _studentService, ICourseService _courseService,
                         ILecturerService _lecturerService, IReplyService _replyService,
                         ICommentService _commentService, IStudyService _studyService)
 {
     this._collegeService    = _collegeService;
     this._departmentService = _depertmentService;
     this._studentService    = _studentService;
     this._courseService     = _courseService;
     this._lecturerService   = _lecturerService;
     this._replyService      = _replyService;
     this._commentService    = _commentService;
     this._studyService      = _studyService;
 }
        //دانشکده-Remove
        public static Dictionary <string, string> SyncRemoveColleges(ICollegeService collegeService)
        {
            var colleges = ClientHelper.GetValue <College>(StaticValue.CollegeRelativeAddress);

            var resualt = new Dictionary <string, string>();
            var counter = 1;

            colleges.ForEach(x =>
            {
                if (x != null)
                {
                    var r = collegeService.Remove(x);
                    resualt.Add($"{x.Name}-{counter}", r.GetDeleteResualt());
                    ++counter;
                }
            });
            return(resualt);
        }
 public CollegeController(
     ICollegeService collegeService
     , ICollegeScoreService collegeScoreService
     , IEducationalGroupService educationalGroupService
     , ITermService termService
     , IRoleAccessService roleAccessService
     , IUserRoleService userRoleService
     , ILogService logService
     )
 {
     _collegeService          = collegeService;
     _collegeScoreService     = collegeScoreService;
     _educationalGroupService = educationalGroupService;
     _termService             = termService;
     _reportService           = new DapperService(educationalGroupService);
     _roleAccessService       = roleAccessService;
     _userRoleService         = userRoleService;
     _logService = logService;
 }
        public static void Run(ICollegeService collegeService, ILogService logService, ILogTypeService logTypeService, IUserService userService, User user)
        {
            //The order of the execution on the commands is important
            //First-remove
            //Second-addOrUpdate

            //1.log
            SyncService.LogSync(logService, logTypeService, userService, user, (int)LogTypeValue.شروع_سینک_دانشکده);


            //var remove = SyncRemoveColleges(collegeService);
            SyncAddOrUpdateColleges(collegeService, logService, logTypeService, userService, user);

            //var resualt = new ReturnValue
            //{
            //    //Remove = remove,
            //    AddOrUpdate = addOrUpdate
            //};
            //return resualt;
        }
예제 #12
0
 public EducationController(IUserService IUserService, IEducationService IEducationService, IClassService IClassService, ICollegeService ICollegeService, IDisciplineService IDisciplineService,
                            IEducationCategoryService IEducationCategoryService, ISpecializationService ISpecializationService, IUniversityService IUniversityService, IEducationCategoryUniversityBoardMappingService IEducationCategoryUniversityBoardMappingService)
 {
     this._IUserService      = IUserService;
     this._IEducationService = IEducationService;
     _educationDetails       = new EmployeeEducationDetail();
     this._IClassService     = IClassService;
     _class = new Master_Class();
     this._ICollegeService = ICollegeService;
     _college = new Master_College();
     this._IDisciplineService = IDisciplineService;
     _discipline = new Master_Discipline();
     this._IEducationCategoryService = IEducationCategoryService;
     _educationCategory           = new Master_EducationCategory();
     this._ISpecializationService = ISpecializationService;
     _specialization          = new Master_Specialization();
     this._IUniversityService = IUniversityService;
     _university = new Master_University();
     this._IEducationCategoryUniversityBoardMappingService = IEducationCategoryUniversityBoardMappingService;
     _educationCategoryUniversityBoardMapping = new EducationCategoryUniversityBoardMapping();
 }
 public EducationalGroupController(
     IEducationalGroupService educationalGroupService
     , ITermService termService
     , IIndicatorService indicatorService
     , IEducationalGroupScoreService educationalGroupScoreService
     , IScoreService scoreService
     , ICollegeService collegeService
     , IRoleAccessService roleAccessService
     , IUserRoleService userRoleService
     , ILogService logService
     )
 {
     _educationalGroupService      = educationalGroupService;
     _termService                  = termService;
     _indicatorService             = indicatorService;
     _educationalGroupScoreService = educationalGroupScoreService;
     _scoreService                 = scoreService;
     _collegeService               = collegeService;
     _reportService                = new DapperService(educationalGroupService);
     _roleAccessService            = roleAccessService;
     _userRoleService              = userRoleService;
     _logService = logService;
 }
예제 #14
0
 public CollegeController(ICollegeService _collegeService, ICommonDataService _commonDataService)
 {
     this._collegeService    = _collegeService;
     this._commonDataService = _commonDataService;
 }
 public CollegeController(ICollegeService collegeService)
 {
     _collegeService = collegeService;
 }
예제 #16
0
 public CollegeController(ICollegeService colleges)
 {
     Colleges = colleges;
 }
        public static void RunAll(
            ITermService termService,
            IMappingService mappingService,
            ICollegeService collegeService,
            IEducationalGroupService educationalGroupService,
            IProfessorService professorService,
            IEducationalClassService educationalClassService,
            IStudentEducationalClassService studentEducationalClassService,
            IProfessorScoreService professorScoreService,
            IIndicatorService indicatorService,
            IMappingTypeService mappingTypeService,
            IUniversityLevelMappingService universityLevelMappingService,
            IEducationalGroupScoreService educationalGroupScoreService,
            ILogService logService,
            ILogTypeService logTypeService,
            IUserService userService,
            string termCode)
        {
            //The order of the execution on the commands is important


            var user = userService.Get(x => x.Username.ToLower() == "Sync".ToLower());

            if (string.IsNullOrEmpty(termCode))
            {
                termCode = ClientHelper.GetScalarValue <string>(StaticValue.CurrentTerm);
            }



            //TermSync.SyncAddOrUpdateTerms(termService, logService, logTypeService, userService, user);
            //MappingSync.Run(mappingService, logService, logTypeService, userService, user);
            //CollegeSync.Run(collegeService, logService, logTypeService, userService, user);
            //ProfessorSync.SyncAddOrUpdateProfessor(professorService, logService, logTypeService, userService, user, termCode);
            //EducationalGroupSync.SyncAddOrUpdateEducationalGroup(educationalGroupService, logService, logTypeService, userService, user, termCode);
            EducationalClassSync.Run(educationalClassService, logService, logTypeService, userService, user, termCode);
            StudentEducationalClassSync.Run(studentEducationalClassService, logService, logTypeService, userService, user, termCode);

            ProfessorSync.SyncProfessorRemoveScore(professorService, logService, logTypeService, userService, user, termCode);

            ProfessorSync.SyncProfessorAddScore(professorService, professorScoreService, indicatorService, termService,
                                                mappingService, mappingTypeService, educationalClassService, universityLevelMappingService,
                                                logService, logTypeService, userService, user, termCode);

            EducationalGroupSync.SyncEducationalGroupRemoveScore(educationalGroupService
                                                                 , logService, logTypeService, userService, user, termCode);

            EducationalGroupSync.SyncEducationalGroupAddScore(educationalGroupService, educationalGroupScoreService,
                                                              indicatorService, termService, professorService, professorScoreService, educationalClassService
                                                              , logService, logTypeService, userService, user, termCode);


            var groupManagerScores     = indicatorService.Get(w => w.CountOfType == ("g" + (int)IndicatorGroupName.ضریب_مدیر_گروه) && w.IsActive == true).Scores.Select(s => s.Id).ToList();
            var groupmanagerGroupScore = educationalGroupScoreService.GetMany(g => groupManagerScores.Contains(g.Score.Id) && g.Term.TermCode == termCode)
                                         .Select(s => s.EducationalGroup.EducationalGroupCode);
            var groupManagerReCalculateList = educationalGroupService
                                              .GetMany(w => !groupmanagerGroupScore.Contains(w.EducationalGroupCode) && w.Term.TermCode == termCode && w.IsActive == true).ToList();

            if (groupManagerReCalculateList.Count() > 0)
            {
                var professores = ClientHelper.GetValue <ProfessorSyncModel>(StaticValue.ProfessorRelativeAddress + $"/{termCode}");
                var reCalcProfs = professores.Where(w => groupManagerReCalculateList.Where(ww => ww.GroupManger != null).Select(s => s.GroupManger.ProfessorCode).Contains(w.ProfessoreCode)).ToList();
                foreach (var item in reCalcProfs)
                {
                    ProfessorSync.SyncGroupManagerProfessorScores(professorService, professorScoreService, indicatorService, termService, mappingService, mappingTypeService
                                                                  , educationalClassService, universityLevelMappingService, item, logService, logTypeService, userService, user, educationalGroupService);
                }

                var groups       = ClientHelper.GetValue <GroupSyncModel>(StaticValue.GroupRelativeAddress + $"/{termCode}");
                var reCalcGroups = groups.Where(w => groupManagerReCalculateList.Where(ww => ww.GroupManger != null).Select(s => s.EducationalGroupCode).Contains(w.EducationalGroupCode)).ToList();
                foreach (var item in reCalcGroups)
                {
                    EducationalGroupSync.SyncGroupManagerEducationalGroupScores(educationalGroupService, educationalGroupScoreService, indicatorService, termService
                                                                                , professorService, professorScoreService, item, educationalClassService, logService, logTypeService, userService, user);
                }
            }
        }
 public CollegeAppService(IMapper mapper, ICollegeService collegeService, IEnvironmentService environmentService)
 {
     _collegeService     = collegeService;
     _mapper             = mapper;
     _environmentService = environmentService;
 }
 public CollegeController(ICollegeService collegeService, IHostingEnvironment hostingEnvironment)
 {
     _collegeService     = collegeService;
     _hostingEnvironment = hostingEnvironment;
 }