public ActionResult Create(DataElement dataElement)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _dataElementRepository.AddDataElement(dataElement);
             return RedirectToAction("Index");
         }
         catch
         {
             return View(dataElement);
         }
     }
     else
     {
         return View(dataElement);
     }
 }
Пример #2
0
		private void detach_DataElements(DataElement entity)
		{
			this.SendPropertyChanging();
			entity.DataType = null;
		}
Пример #3
0
		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();
 }