public ActionResult Create(DataElement dataElement) { if (ModelState.IsValid) { try { _dataElementRepository.AddDataElement(dataElement); return RedirectToAction("Index"); } catch { return View(dataElement); } } else { return View(dataElement); } }
private void detach_DataElements(DataElement entity) { this.SendPropertyChanging(); entity.DataType = null; }
private void attach_DataElements(DataElement entity) { this.SendPropertyChanging(); entity.DataSource = this; }
public void UpdateDataElement(DataElement dataElement) { db.SubmitChanges(); }
public void DeleteDataElement(DataElement dataElement) { db.DataElements.DeleteOnSubmit(dataElement); db.SubmitChanges(); }
public void AddDataElement(DataElement dataElement) { db.DataElements.InsertOnSubmit(dataElement); db.SubmitChanges(); }