public ActionResult DeleteModule(int?id) { TestModuleService.EnableTracking(); var module = TestModuleService.GetByPK(id.Value); EditTestPermission(module.TestId); TestModuleService.DeleteAndSubmit(module); return(Json("ok")); }
public ActionResult EditModule(int testId, int?id) { var module = new TestModule(); if (id.HasValue) { EditTestPermission(testId); module = TestModuleService.GetByPK(id.Value); } else { module.TestId = testId; } return(BaseView( new PagePart(new ModuleEditView().Init(module, Url).Get().ToString()))); }
public ActionResult EditModule(TestModule model) { if (!LinqToSqlValidator.Validate(ModelState, model)) { return(ErrorJson()); } EditTestPermission(model.TestId); TestModuleService.EnableTracking(); if (model.Id == 0) { TestModuleService.InsertAndSubmit(model); return(UrlJson(Url.TestEdit().Urls.EditModule(model.TestId, model.Id))); } else { var module = TestModuleService.GetByPK(model.Id); module.Update(model, x => x.Name); TestModuleService.SubmitChanges(); } return(Json("ok")); }