public ViewCOSEMMethod GetCosemMethod(Int64 id, Guid userId) { Trace.Assert(_db != null); ObjectSet <ViewCOSEMMethod> os = _db.ViewCOSEMMethod; ViewCOSEMMethod result = os.Single(t => (t.ID == id) && ((t.DataOwnerID == userId) || t.Standard)); return(result); }
public ViewResult Details(long id /*method identifier*/) { try { ViewCOSEMMethod viewcosemmethod = _cosemMethodRepository.GetCosemMethod(id, GetUserId()); ViewBag.COSEMClassID = viewcosemmethod.COSEMClassID; return(View(viewcosemmethod)); } catch (Exception e) { ExceptionMessageToViewBag(e); return(View("Error")); } }
public ActionResult DeleteConfirmed(long id) { try { ViewCOSEMMethod viewcosemmethod = _cosemMethodRepository.GetCosemMethod(id, GetUserId()); _cosemMethodRepository.DeleteCosemMethod(id, GetUserId()); return(RedirectToAction("Index/" + viewcosemmethod.COSEMClassID.ToString(CultureInfo.InvariantCulture))); } catch (Exception e) { ExceptionMessageToViewBag(e); return(View("Error")); } }
public ActionResult Delete(long id) { try { ViewCOSEMMethod viewcosemmethod = _cosemMethodRepository.GetCosemMethod(id, GetUserId()); ViewBag.COSEMClassID = viewcosemmethod.COSEMClassID; return(View(viewcosemmethod)); } catch (Exception e) { ExceptionMessageToViewBag(e); return(View("Error")); } }
public ActionResult Create(long id /*COSEM-class identifier*/) { try { var v = new ViewCOSEMMethod { COSEMClassID = id }; return(View(v)); } catch (Exception e) { ExceptionMessageToViewBag(e); return(View("Error")); } }
public ActionResult Edit(long id /*method identifier*/) { try { Guid userId = GetUserId(); ViewCOSEMMethod viewcosemmethod = _cosemMethodRepository.GetCosemMethod(id, userId); ViewBag.COSEMClassID = viewcosemmethod.COSEMClassID; return(View(viewcosemmethod)); } catch (Exception e) { ExceptionMessageToViewBag(e); return(View("Error")); } }
public ActionResult Create(ViewCOSEMMethod viewcosemmethod) { try { if (viewcosemmethod == null) { throw new Exception("object should not be null"); } if (ModelState.IsValid) { _cosemMethodRepository.AddCosemMethod(viewcosemmethod, GetUserId()); return(RedirectToAction("Index/" + viewcosemmethod.COSEMClassID.ToString(CultureInfo.InvariantCulture))); } ViewBag.COSEMClassID = viewcosemmethod.COSEMClassID; return(View(viewcosemmethod)); } catch (Exception e) { ExceptionMessageToViewBag(e); return(View("Error")); } }
public void UpdateCosemMethod(ViewCOSEMMethod viewCosemMethodtype, Guid userId) { }
public void AddCosemMethod(ViewCOSEMMethod viewCosemMethod, Guid userId) { CosemMethodRowAffected++; }
public void UpdateCosemMethod(ViewCOSEMMethod viewCosemMethodtype, Guid userId) { Trace.Assert(_db != null); Trace.Assert(viewCosemMethodtype != null); _db.UpdateCOSEMMethod(viewCosemMethodtype.ID, viewCosemMethodtype.COSEMClassID, viewCosemMethodtype.Name, viewCosemMethodtype.Mandatory, userId); }
public void AddCosemMethod(ViewCOSEMMethod viewCosemMethod, Guid userId) { Trace.Assert(_db != null); Trace.Assert(viewCosemMethod != null); _db.AddCOSEMMethod(viewCosemMethod.COSEMClassID, viewCosemMethod.Name, viewCosemMethod.Mandatory, userId); }