public Object AllSubmissions(SubmissionFormData data) { var ctx = new OjDBContext(); var subs = ctx.Submissions.Where(x => true); return(SubmissionResponseData.MapTo(subs)); }
public IHttpActionResult ProgrammingLanguages(SubmissionFormData data) { var context = new OjDBContext(); IEnumerable <ProgrammingLanguage> languages = context.ProgrammingLanguages.OrderBy(x => x.Name); return(Ok(ProgrammingLanguageData.MapTo(languages))); }
public FormDataValidationResult Validate() { var context = new OjDBContext(); FormDataValidationResult result = new FormDataValidationResult(); if (UserName.IsEmpty()) { result.AddErrorMessage("UserName Required"); } else if (UserName.Length < 4) { result.AddErrorMessage("UserName is too short"); } else if (context.Users.FirstOrDefault(x => x.UserName == UserName) != null) { result.AddErrorMessage("UserName is already taken"); } if (Email.IsEmpty()) { result.AddErrorMessage("Email is Required"); } else if (!(Email.Contains("@") && Email.Contains("."))) { result.AddErrorMessage("Email is invalid"); } if (Password.IsEmpty()) { result.AddErrorMessage("Password must is required"); } else if (Password.Length < 8) { result.AddErrorMessage("Password must be atleast 8 characters long"); } if (Password != ConfirmPassword) { result.AddErrorMessage("Passwords do not match"); } return(result); }
public AnnouncementRepository() { this.context = new OjDBContext(); }
public AnnouncementRepository(OjDBContext context) { this.context = context; }
public SubmissionRepository(OjDBContext context) { this.context = context; }
public SubmissionRepository() { context = new OjDBContext(); }
public UserRepository(OjDBContext context) { this.context = context; }
public UserRepository() { this.context = new OjDBContext(); }
public ContestSubmissionRepository() { this.context = new OjDBContext(); this.contest_service = new ContestService(); }
public ContestRepository(OjDBContext context) { this.context = context; }
public ContestRepository() { this.context = new OjDBContext(); }
public ProblemRepository(OjDBContext context) { this.context = context; }
public ProblemRepository() { this.context = new OjDBContext(); }