예제 #1
0
        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);
        }
예제 #2
0
 public void Remove(ComplianceViolation complianceViolation)
 {
     _db.ComplianceViolations.Remove(complianceViolation);
     _db.SaveChanges();
 }
예제 #3
0
 public void Update(ComplianceViolation complianceViolation)
 {
     _db.Entry(complianceViolation).State = EntityState.Modified;
     _db.SaveChanges();
 }
예제 #4
0
 public void Add(ComplianceViolation complianceViolation)
 {
     _db.ComplianceViolations.Add(complianceViolation);
     _db.SaveChanges();
 }