public Structure AddStructure(Structure structure) { _db.Structure.InsertOnSubmit(structure); _db.SubmitChanges(); return structure; }
public Structure UpdateStructure(Structure structure) { Structure oldStructure = LoadStructure(structure.StructureID.Value); oldStructure.StructureName = structure.StructureName; _db.SubmitChanges(); return structure; }
public ActionResult Create(Structure structure) { try { _structureRepository.AddStructure(structure); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Edit(Structure structure) { // TODO: Add update logic here structure = new Structure{ StructureID = 1, StructureName = "test", StructureParentID = null}; if (!TryUpdateModel(structure, new[] { "StructureID", "StructureName" })) { } //UpdateModel(structure); _structureRepository.UpdateStructure(structure); return RedirectToAction("Index"); }