예제 #1
0
        public Structure AddStructure(Structure structure)
        {
            _db.Structure.InsertOnSubmit(structure);
            _db.SubmitChanges();

            return structure;
        }
예제 #2
0
        public Structure UpdateStructure(Structure structure)
        {
            Structure oldStructure = LoadStructure(structure.StructureID.Value);

            oldStructure.StructureName = structure.StructureName;

            _db.SubmitChanges();

            return structure;
        }
예제 #3
0
        public ActionResult Create(Structure structure)
        {
            try
            {
                _structureRepository.AddStructure(structure);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
예제 #4
0
        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");
        }