public Defect EditDefect(Defect defect) { BugSquasherDB bsDB = new BugSquasherDB(); bsDB.Entry(defect).State = System.Data.Entity.EntityState.Modified; bsDB.SaveChanges(); return defect; }
public Defect SaveDefect(Defect defect) { defect.dateSubmitted = DateTime.Now; BugSquasherDB bsDB = new BugSquasherDB(); bsDB.Defects.Add(defect); bsDB.SaveChanges(); return defect; }
public ActionResult EditDefect(Defect defect, string BtnSubmit) { if (ModelState.IsValid) { DefectBusinessLayer defectBL = new DefectBusinessLayer(); defectBL.EditDefect(defect); return RedirectToAction("Index", "Defect", new { id = defect.id }); } return new EmptyResult(); }
public ActionResult SaveDefect(Defect defect, string BtnSubmit) { switch (BtnSubmit) { case "Save Defect": DefectBusinessLayer defectBL = new DefectBusinessLayer(); defectBL.SaveDefect(defect); return RedirectToAction("Index", "Defect", new { id = defect.id }); case "Cancel": return RedirectToAction("Index"); } return new EmptyResult(); }
public DefectViewModel(Defect defect, List<Comment> comments) { this.id = defect.id; this.assignedToUserId = defect.assignedToUserId; this.title = defect.title; this.description = defect.description; this.severity = defect.severity; this.priority = defect.priority; this.difficulty = defect.difficulty; this.estimatedHours = defect.estimatedHours; this.regression = defect.regression; this.dateSubmitted = defect.dateSubmitted; this.analysis = defect.analysis; this.comments = comments; }