public ActionResult DeleteConfirmed(int id) { evaluation evaluation = db.evaluations.Find(id); db.evaluations.Remove(evaluation); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(evaluation eval) { HttpClient client = new HttpClient(); client.BaseAddress = new Uri("https://localhost:44337"); client.PostAsJsonAsync <evaluation>("api/evaluation", eval).ContinueWith((postTask) => postTask.Result.EnsureSuccessStatusCode()); return(RedirectToAction("Index")); }
public async Task AddEvaluationAsync(string publicationId, evaluation evaluation) { try { var path = BaseUrl.UrlCombine(Constants.JavaController.Evaluation.UrlCombine($"insert/{evaluation.author}/{evaluation.publicationId}")); await HttpHelper.Post(path, evaluation); } catch (Exception e) { throw new ProxyException(Constants.ExceptionMessages.DatabaseException, e); } }
public async Task AddEvalutionAsync(string publicationId, evaluation evaluation) { var status = await _publicationService.GetStatusAsync(publicationId); if (status != PublicationStatus.IN_REVIEW) { throw new ValidationException("Invalid current publication status"); } ValidateEvaluaionFile(XmlUtility.Serialize(evaluation)); await _reviewDataAccess.AddEvaluationAsync(publicationId, evaluation); }
// GET: evaluations/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } evaluation evaluation = db.evaluations.Find(id); if (evaluation == null) { return(HttpNotFound()); } return(View(evaluation)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } evaluation evaluation = db.evaluations.Find(id); if (evaluation == null) { return(HttpNotFound()); } ViewBag.coursetitle = new SelectList(db.courses, "title", "title"); ViewBag.courseid = new SelectList(db.courses, "Id", "title", evaluation.courseid); ViewBag.studentid = new SelectList(db.students, "Id", "FirstName", evaluation.studentid); return(View(evaluation)); }
public ActionResult Create([Bind(Include = "Id,coursetitle,studentname,studentid,courseid,a1,a2,a3,a4,b1,b2,b3,b4,b5,b6,c1,c2,d1,d2,e1,e2")] evaluation evaluation) { evaluation.courseid = (db.courses.Single(c => c.title == evaluation.coursetitle)).Id; var sid = int.Parse(IdentityExtensions.GetSchoolId(User.Identity)); var currstudent = db.students.Single(s => s.Id == sid); evaluation.studentname = currstudent.FirstName + " " + currstudent.LastName; evaluation.studentid = currstudent.Id; if (ModelState.IsValid) { db.evaluations.Add(evaluation); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.courseid = new SelectList(db.courses, "Id", "title", evaluation.courseid); ViewBag.studentid = new SelectList(db.students, "Id", "FirstName", evaluation.studentid); return(View(evaluation)); }