Exemplo n.º 1
0
 public IndexModel(HumanErrorProjectContext context, IOptions <ViewOptions> options)
 {
     Context     = context;
     Assignments = context.Set <Assignment>();
     Models      = context.Set <MarkovModel>();
     Options     = options.Value;
 }
Exemplo n.º 2
0
 public RegisterModel(HumanErrorProjectContext context, SignInManager <IdentityUser> signInManager, UserManager <IdentityUser> userManager)
 {
     Context       = context;
     SignInManager = signInManager;
     UserManager   = userManager;
     Students      = Context.Set <Student>();
 }
Exemplo n.º 3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              UserManager <IdentityUser> userManager,
                              RoleManager <IdentityRole> roleManager,
                              HumanErrorProjectContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }

            app.UseCookiePolicy();
            app.UseAuthentication();
            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();
            app.UseHangfireServer();
            app.UseHangfireDashboard("/hangfire", new DashboardOptions());

            app.UseHangfireDashboard();
            app.UseMvc();

            Seed(userManager, roleManager, context).Wait();
        }
 public StudentsModel(HumanErrorProjectContext context, IOptions <ViewOptions> options)
 {
     Context       = context;
     CourseClasses = context.Set <CourseClass>();
     Students      = context.Set <Student>();
     Options       = options.Value;
 }
 public DetailsModel(IEngineService engineService, HumanErrorProjectContext context)
 {
     EngineService  = engineService;
     Context        = context;
     PreAssignments = context.Set <PreAssignment>();
     Assignments    = context.Set <Assignment>();
 }
 public DetailsModel(HumanErrorProjectContext context, ColorHelper colorHelper)
 {
     Context      = context;
     MarkovModels = context.Set <MarkovModel>();
     Snapshots    = context.Set <Snapshot>();
     ColorHelper  = colorHelper;
 }
Exemplo n.º 7
0
 public StateModel(HumanErrorProjectContext context, ColorHelper colorHelper)
 {
     Context         = context;
     MarkovModels    = context.Set <MarkovModel>();
     Snapshots       = context.Set <Snapshot>();
     SurveyQuestions = context.Set <SurveyQuestion>();
     ColorHelper     = colorHelper;
 }
Exemplo n.º 8
0
        public async Task Seed(UserManager <IdentityUser> userManager, RoleManager <IdentityRole> roleManager,
                               HumanErrorProjectContext context)
        {
            if (await roleManager.FindByNameAsync(IdentityRoleConstants.Admin) == null)
            {
                await roleManager.CreateAsync(new IdentityRole(IdentityRoleConstants.Admin));
            }

            if (await roleManager.FindByNameAsync(IdentityRoleConstants.Student) == null)
            {
                await roleManager.CreateAsync(new IdentityRole(IdentityRoleConstants.Student));
            }

            var cobe = "*****@*****.**";

            if (await userManager.FindByNameAsync(cobe) == null)
            {
                var user = new IdentityUser()
                {
                    UserName = cobe,
                    Email    = cobe,
                };

                var result = await userManager.CreateAsync(user, "Human3rr0rPr0j3ct");

                if (result.Succeeded)
                {
                    await userManager.AddClaimAsync(user, new Claim(ClaimTypes.Role, IdentityRoleConstants.Admin));

                    await userManager.AddToRoleAsync(user, IdentityRoleConstants.Admin);
                }
            }

            var lucas = "*****@*****.**";

            if (await userManager.FindByNameAsync(lucas) == null)
            {
                var user = new IdentityUser()
                {
                    UserName = lucas,
                    Email    = lucas
                };


                var result = await userManager.CreateAsync(user, "Human3rr0rPr0j3ct");

                if (result.Succeeded)
                {
                    await userManager.AddClaimAsync(user, new Claim(ClaimTypes.Role, IdentityRoleConstants.Admin));

                    await userManager.AddToRoleAsync(user, IdentityRoleConstants.Admin);
                }
            }
        }
 public StudentRepository(HumanErrorProjectContext context) : base(context)
 {
 }
Exemplo n.º 10
0
 public CreateModel(HumanErrorProjectContext context, IEngineService engineService)
 {
     Context       = context;
     Assignments   = context.Set <Assignment>();
     EngineService = engineService;
 }
 public DetailsModel(HumanErrorProjectContext context)
 {
     Context   = context;
     Snapshots = context.Set <Snapshot>();
 }
Exemplo n.º 12
0
 public DeleteModel(HumanErrorProjectContext context)
 {
     Context         = context;
     SurveyQuestions = context.Set <SurveyQuestion>();
 }
 public MethodDeclarationsModel(HumanErrorProjectContext context)
 {
     Context     = context;
     Assignments = context.Set <Assignment>();
 }
Exemplo n.º 14
0
 public CreateModel(HumanErrorProjectContext context, IEngineService engineService)
 {
     Context       = context;
     CourseClasses = context.Set <CourseClass>();
     EngineService = engineService;
 }
 public AssignmentRepository(HumanErrorProjectContext context) : base(context)
 {
 }
Exemplo n.º 16
0
 public AbstractSyntaxTreesModel(HumanErrorProjectContext context)
 {
     Context     = context;
     Assignments = context.Set <Assignment>();
 }
Exemplo n.º 17
0
 public IndexModel(HumanErrorProjectContext context, IOptions <ViewOptions> options)
 {
     CourseClasses = context.Set <CourseClass>();
     Options       = options.Value;
 }
Exemplo n.º 18
0
 public DeleteModel(DeleteHelper deleteHelper, HumanErrorProjectContext context)
 {
     DeleteHelper   = deleteHelper;
     Context        = context;
     PreAssignments = context.Set <PreAssignment>();
 }
Exemplo n.º 19
0
 public ProgressModel(HumanErrorProjectContext context)
 {
     Context     = context;
     Students    = context.Set <Student>();
     Assignments = context.Set <Assignment>();
 }
 public SurveysModel(HumanErrorProjectContext context)
 {
     Context         = context;
     Assignments     = context.Set <Assignment>();
     SurveyQuestions = context.Set <SurveyQuestion>();
 }
Exemplo n.º 21
0
 public IndexModel(HumanErrorProjectContext context, IOptions <ViewOptions> options)
 {
     Context  = context;
     Students = context.Set <Student>();
     Options  = options.Value;
 }
Exemplo n.º 22
0
 public DeleteModel(HumanErrorProjectContext context, DeleteHelper deleteHelper)
 {
     Context      = context;
     DeleteHelper = deleteHelper;
     MarkovModels = context.Set <MarkovModel>();
 }
Exemplo n.º 23
0
 public DeleteModel(HumanErrorProjectContext context)
 {
     Context       = context;
     CourseClasses = context.Set <CourseClass>();
 }
Exemplo n.º 24
0
 public IndexModel(HumanErrorProjectContext context, IOptions <ViewOptions> options, IEmailService emailService)
 {
     Students     = context.Set <Student>();
     Options      = options.Value;
     EmailService = emailService;
 }
Exemplo n.º 25
0
 public IndexModel(HumanErrorProjectContext context)
 {
     Context     = context;
     Assignments = context.Set <Assignment>();
 }
 public TestResultsModel(HumanErrorProjectContext context)
 {
     Context     = context;
     Assignments = context.Set <Assignment>();
 }
Exemplo n.º 27
0
 public SubmitModel(HumanErrorProjectContext context)
 {
     Context            = context;
     SurveyQuestionsSet = context.Set <SurveyQuestion>();
     Surveys            = context.Set <Survey>();
 }
Exemplo n.º 28
0
 public ReviewModel(HumanErrorProjectContext context)
 {
     Context = context;
     Surveys = context.Set <Survey>();
 }
 public BagOfWordsModel(HumanErrorProjectContext context)
 {
     Context     = context;
     Assignments = context.Set <Assignment>();
 }
Exemplo n.º 30
0
 public EditModel(HumanErrorProjectContext context)
 {
     Context  = context;
     Students = context.Set <Student>();
 }