Initial commit

This commit is contained in:
GuiNerd
2019-11-27 18:42:43 -03:00
commit 5fd7176543
1714 changed files with 171249 additions and 0 deletions

34
SitePi/Models/Bot.cs Normal file
View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using SitePi.Models;
namespace SitePi.Models
{
public class Bot
{
[Key]
public int Id { get; set; }
[Required]
public string Name { get; set; }
public int UserId { get; set; }
public User User { get; set; }
[Required]
public string FileBytes { get; set; }
[Required]
public string FileName { get; set; }
public float PercentageA { get; set; }
public float PercentageB { get; set; }
public float PercentageC { get; set; }
public float PercentageD { get; set; }
}
}

26
SitePi/Models/Choice.cs Normal file
View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using SitePi.Models;
namespace SitePi.Models
{
public class Choice
{
[Key]
public int Id { get; set; }
[Required]
public string Text { get; set; }
public int QuestionId { get; set; }
public Question Question { get; set; }
public int ProfileId { get; set; }
public Profile Profile { get; set; }
}
}

View File

@ -0,0 +1,11 @@
using System;
namespace SitePi.Models
{
public class ErrorViewModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
}

19
SitePi/Models/Profile.cs Normal file
View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using SitePi.Models;
namespace SitePi.Models
{
public class Profile
{
[Key]
public int Id { get; set; }
[Required]
public string Name { get; set; }
}
}

25
SitePi/Models/Question.cs Normal file
View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using SitePi.Models;
namespace SitePi.Models
{
public class Question
{
[Key]
public int Id { get; set; }
[Required]
public string Text { get; set; }
public int QuizId { get; set; }
public Quiz Quiz { get; set; }
public List<Choice> Choices { get; set; }
}
}

22
SitePi/Models/Quiz.cs Normal file
View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using SitePi.Models;
namespace SitePi.Models
{
public class Quiz
{
[Key]
public int Id { get; set; }
[Required]
public string Name { get; set; }
public List<Question> Questions { get; set; }
}
}

41
SitePi/Models/Responds.cs Normal file
View File

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using SitePi.Models;
namespace SitePi.Models
{
public class Responds
{
[Key]
public int Id { get; set; }
public int UserId { get; set; }
public User User { get; set; }
public int QuizId { get; set; }
public Quiz Quiz { get; set; }
public string Profile_1 { get; set; }
public string Profile_2 { get; set; }
public string Profile_3 { get; set; }
public string Profile_4 { get; set; }
public string Profile_5 { get; set; }
public string Profile_6 { get; set; }
public string Profile_7 { get; set; }
public string Profile_8 { get; set; }
public string Profile_9 { get; set; }
}
}

37
SitePi/Models/User.cs Normal file
View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using SitePi.Models;
namespace SitePi.Models
{
public class User
{
[Key]
public int Id { get; set; }
[Required(ErrorMessage = "This field is required.")]
[RegularExpression("^[a-zA-Z0-9-_]*$", ErrorMessage = "That value is not allowed.")]
[StringLength(25, MinimumLength = 5, ErrorMessage = "The user name must be at least 5 characters long.")]
public string Name { get; set; }
[Required(ErrorMessage = "This field is required.")]
[MaxLength(100)]
[RegularExpression(@"^([a-z0-9_\.\+-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$", ErrorMessage = "Please enter a valid email address.")]
[DataType(DataType.EmailAddress)]
public string Email { get; set; }
[Required(ErrorMessage = "This field is required.")]
[StringLength(45, MinimumLength = 8, ErrorMessage = "The password must be at least 8 characters long.")]
public string PasswordHash { get; set; }
[NotMapped]
[Required(ErrorMessage = "This field is required.")]
[Compare("PasswordHash", ErrorMessage = "The passwords do not match.")]
public string PasswordConfirm { get; set; }
}
}