public ActionResult <JudgeModel> Postjudge(JudgeModel judge) { if (judges.AddJudge(judge)) { return(judge); } return(BadRequest()); }
private void App_OnStartup(object sender, StartupEventArgs e) { var judgeMainWindow = new JudgeMainWindow(); var judgeModel = new JudgeModel(); var presenter = new PresenterJudgeMainWindow(judgeMainWindow, judgeModel); judgeMainWindow.DataContext = judgeModel; judgeMainWindow.Show(); }
public JudgeMainWindow() { JudgeModel.judgeLoggingInit(); InitializeComponent(); tb_adminIP.Text = Properties.Settings.Default.ip; foreach (var tab in tabControl.Items) { (tab as TabItem).Visibility = Visibility.Collapsed; } }
public bool CreateNewJudgeParticipant(ContestModel contest, JudgeModel judge) { JudgeParticipantModel entry = new JudgeParticipantModel(); entry.Contest = contest; //Foreign key entry.Judge = judge; //Foreign key db.judgeParticipant.Add(entry); db.SaveChanges(); if (db.judgeParticipant.Contains(entry)) { return(true); } return(false); }
public Judger() { sandbox = new Sandbox(); problemModel = new ProblemModel(); userModel = new UserModel(); judgeModel = new JudgeModel(); compilerManager = new CompilerManager(); checker = new Checker(); workSpace = FS.JudgeWorkspace; FS.WriteAllBytes(FS.RunEXE, Properties.Resources.run_PCMS2); FS.WriteAllBytes(FS.InvokeDLL, Properties.Resources.invoke2_PCMS2); FS.WriteAllBytes(FS.CompilerTemplates, Properties.Resources.compilerTemplates); FS.CleanAppData(); }
public bool AddJudge(JudgeModel newJudge) { db.judges.Add(newJudge); db.SaveChanges(); return(true); }