public ActionResult Create(IncidentTypeData incidentType) { if (ModelState.IsValid) { _access.Insert(incidentType); return(RedirectToAction("Index")); } return(View(incidentType)); }
public void Effort_IncidentTypes_GetByPrimaryKey_Test() { int _id = _incidentTypeId; IncidentTypeData _row = _sut.GetByPrimaryKey(_id); Assert.IsNotNull(_row); Assert.AreEqual(_row.IncidentTypeId, _id); System.Diagnostics.Debug.WriteLine(_row.ToString()); }
public void Effort_IncidentTypes_DeleteFail_Test() { int _id = 2; int _actualCnt = _sut.Delete(_id); Assert.AreEqual(0, _actualCnt); IncidentTypeData _row = _sut.GetByPrimaryKey(_id); Assert.IsNotNull(_row); }
// /// <summary> /// GET: EmailTemplate/Create /// </summary> /// <returns></returns> public ActionResult Create() { IncidentTypeData _incidentType = _access.GetByShortDesc("Multiple"); if (_incidentType == null) { return(View()); } _incidentType.IncidentTypeId = 0; _incidentType.IncidentTypeShortDesc = ""; _incidentType.IncidentTypeDesc = ""; return(View(_incidentType)); }
// /// <summary> /// GET: EmailTemplate/Details/5 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IncidentTypeData _incidentType = _access.GetByPrimaryKey(id.Value); if (_incidentType == null) { return(HttpNotFound()); } return(View(_incidentType)); }
public void Effort_IncidentTypes_Update_Test() { int _id = _incidentTypeId; IncidentTypeData _row = _sut.GetByPrimaryKey(_id); _row.IncidentTypeDesc = "123456789 123456789"; int _rowCnt = _sut.Update(_row.IncidentTypeId, _row.IncidentTypeShortDesc, _row.IncidentTypeDesc, _row.IncidentTypeFromServer, _row.IncidentTypeSubjectLine, _row.IncidentTypeEmailTemplate, _row.IncidentTypeTimeTemplate, _row.IncidentTypeThanksTemplate, _row.IncidentTypeLogTemplate, _row.IncidentTypeTemplate); Assert.AreEqual(_rowCnt, 1); IncidentTypeData _new = _sut.GetByPrimaryKey(_id); System.Diagnostics.Debug.WriteLine(_new.ToString()); Assert.AreEqual(_row.IncidentTypeId, _new.IncidentTypeId); Assert.AreEqual(_row.IncidentTypeDesc, _new.IncidentTypeDesc); }