public ActionResult Create(ComplianceViolation complianceviolation) { if (ModelState.IsValid) { _repo.Add(complianceviolation); return RedirectToAction("Index"); } ViewBag.IdComplianceCode = new SelectList(_repo.ComplianceCodes, "IdComplianceCode", "NameComplianceCode", complianceviolation.IdComplianceCode); ViewBag.IdComplianceReason = new SelectList(_repo.ComplianceReasons, "IdComplianceReason", "NameComplianceReason", complianceviolation.IdComplianceReason); ViewBag.IdComplianceResult = new SelectList(_repo.ComplianceResults, "IdComplianceResult", "NameComplianceResult", complianceviolation.IdComplianceResult); ViewBag.IdMember = new SelectList(_repo.Members, "IdMember", "MemberNumber", complianceviolation.IdMember); return View(complianceviolation); }
public void Remove(ComplianceViolation complianceViolation) { _db.ComplianceViolations.Remove(complianceViolation); _db.SaveChanges(); }
public void Update(ComplianceViolation complianceViolation) { _db.Entry(complianceViolation).State = EntityState.Modified; _db.SaveChanges(); }
public void Add(ComplianceViolation complianceViolation) { _db.ComplianceViolations.Add(complianceViolation); _db.SaveChanges(); }