Esempio n. 1
0
        public void AssignGuidanceSurveyToUser(User assigner, User evaluator, User evaluatee, int surveyID)
        {
            IMiteryaDBContext _context = contextBuilder.GetContext();

            _context.GuidanceUserSurveys.Add(
                new GuidanceUserSurvey
            {
                DateCreated          = DateTime.Today,
                UserCreated          = evaluator.Id,
                DateModified         = DateTime.Today,
                UserModified         = evaluator.Id,
                IsActive             = true,
                IsDeleted            = false,
                Id                   = new int(),
                AssignmentUserId     = assigner.Id,
                EvaluatedUserId      = evaluator.Id,
                StudentUserId        = evaluatee.Id,
                DfnGuidanceSurveyId  = surveyID,
                StudentTemperamentId = evaluatee.TemperamentTypeId != null ? (int)evaluatee.TemperamentTypeId : 0,
                SurveyState          = 1,
                AnswerId             = 0
            }
                );
            _context.SaveChanges();
        }
Esempio n. 2
0
        // Created to use on Mizac Testi functionality test.
        public void AddDummyMizacTestToUser(Guid solver, Guid solved)
        {
            IMiteryaDBContext _context = contextBuilder.GetContext();

            // Note: Student still needs approval.
            _context.Temperaments.Add(
                new Temperament
            {
                DateCreated         = DateTime.Today,
                UserCreated         = solver,
                DateModified        = DateTime.Today,
                UserModified        = solver,
                Id                  = new Guid(),
                UserOrgRoleId       = solved,
                SolverUserOrgRoleId = solver,
                MizacTestId         = new Guid(),
                Result              = "{ \"result\": true,\"data\": {\"id\": 113,\"testTypeId\": 3,\"mainTemperamentId\": 7, "
                                      + " \"wingMainTemperamentId\": 6, \"mainTemperamentTendencyId\": 2, "
                                      + " \"wingMainTemperamentTendencyId\": 2, \"code\": \"T7, K6, E 2,KE 2\", "
                                      + " \"title\": \"İliskilere Dönük DTM7 İliskilere Dönük DTM6\", "
                                      + " \"summary\": \"<p>dummy summary </p>\", \"description\": \"Description of T7, K6, E 2,KE 2\", "
                                      + " \"openTrendId\": 2, \"hiddenTrendId\": 2, \"basicMotivation\": \"Keşfetmenin Hazzını Arayış\"}, "
                                      + " \"message\": \"Success\" }",
                IsSelected = true
            }
                );
            _context.SaveChanges();
        }
Esempio n. 3
0
        public void SetTemperament(IMiteryaDBContext _context, Guid userId, int tempId)
        {
            var user = _context.Users.Find(userId);

            user.TemperamentTypeId = tempId;
            _context.Entry(user);
            _context.SaveChanges();
        }
 public OrganizationBuilder CreateOrganization(IMiteryaDBContext _context)
 {
     this._context = _context;
     this.organization.OrganTypeId = AppSettings.OrganizationTypeId.Organization;
     this.organization.ParentId    = this.organization.Id;
     _context.Organizations.Add(this.organization);
     _context.SaveChanges();
     return(this);
 }
        public List <Organization> AddSchoolWidthDefaultDepartments(Organization School, bool PreSchool, bool ElementerySchool, bool SecondarySchool, bool HighSchool, int?UserLimit)
        {
            List <Organization> organizations = new List <Organization>();
            var Classroom        = _context.OrganTypes.Where(x => x.Id == AppSettings.OrganizationTypeId.Classroom).FirstOrDefault();
            var SchoolTypeId     = AppSettings.OrganizationTypeId.School;
            var DepartmentTypeId = AppSettings.OrganizationTypeId.Department;

            var currentDepartmentsOfSchool = _context.Organizations.Include(x => x.Organizations1)
                                             .Where(x => x.ParentId == School.Id && x.IsActive && !x.IsDeleted).ToList();

            if (PreSchool)
            {
                organizations.AddRange(CreatePreSchoolWithDefault(School, Classroom, DepartmentTypeId));
            }

            if (ElementerySchool)
            {
                organizations.AddRange(CreateElementerySchoolWithDefault(School, Classroom, DepartmentTypeId));
            }

            if (SecondarySchool)
            {
                organizations.AddRange(CreateSecondarySchoolWithDefault(School, Classroom, DepartmentTypeId));
            }

            if (HighSchool)
            {
                organizations.AddRange(CreateHighSchoolWithDefault(School, Classroom, DepartmentTypeId));
            }

            SchoolSetting schoolSetting = _context.SchoolSettings.Where(a => a.SchoolId == School.Id).FirstOrDefault();

            _context.SchoolSettings.Add(new SchoolSetting {
                SchoolId = School.Id, SchoolUserLimit = UserLimit
            });
            _context.SaveChanges();
            return(organizations);
        }
Esempio n. 6
0
        public void AddDummySurveyTestToUser(Guid solver, Guid solved, int anketId)
        {
            IMiteryaDBContext _context = contextBuilder.GetContext();

            _context.HrUserSurveys.Add(
                new HrUserSurvey
            {
                DateCreated             = DateTime.Today,
                UserCreated             = solver,
                DateModified            = DateTime.Today,
                UserModified            = solver,
                IsActive                = true,
                IsDeleted               = false,
                Id                      = new int(),
                RatedUserId             = solved,
                EvaluatedUserId         = solver,
                SurveyId                = anketId,
                SurveyState             = 1,
                AnswerId                = 0,
                SurveyManipulationValue = 0
            }
                );
            _context.SaveChanges();
        }