Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult Delete(int? articleId, int? estimateId)
- {
- if(articleId == null || estimateId == null)
- {
- return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
- }
- Enroll enroll = db.Enrolls.Find(estimateId, articleId);
- if(enroll == null)
- {
- TempData["message"] = "Оценката не е намерена! Моля, опитайтено отново!";
- return RedirectToAction("NotFound", "Home");
- }
- db.Enrolls.Remove(enroll);
- db.SaveChanges();
- return RedirectToAction("Index", "Enrolls");
- }
Add Comment
Please, Sign In to add comment