public ActionResult UpdateLocations(SetRequest rq) { if (rq == null) { throw new ArgumentNullException("rq"); } if (!rq.ParentId.HasValue) { throw new ArgumentException("Request should have parentId"); } long pid = rq.ParentId.Value; if (pid <= 0) { throw new ArgumentException("parentId should be positive"); } if (rq.Edits != null) { foreach (var e in rq.ToPoco <LocationBaseDeviceMapping>()) { var data = new DeviceLocationMap { DeviceId = pid, LocationBaseId = e.LocationBaseId, Mapping = e.Mapping }; GeneralPersistense.Upsert(data); } } return(ListLocations(pid)); }
public ActionResult Set(SetRequest rq) { if (rq == null) { throw new ArgumentNullException("rq"); } rq.Persist <LocationBase>(LocationBase.Delete); return(Json(SetRequest.FromPoco(LocationPersistence.ListBases()), JsonRequestBehavior.AllowGet)); }
// // GET: /Location/ public ActionResult Index() { return(View("~/Views/LocationBases.cshtml", SetRequest.FromPoco(LocationPersistence.ListBases()))); }
public ActionResult ListLocations(long id) { return(Json(SetRequest.FromPoco(DevicePersistense.GetLocations(id)), JsonRequestBehavior.AllowGet)); }
// // GET: /Device/ public ActionResult Index() { return(View("~/Views/Devices.cshtml", SetRequest.FromPoco(DevicePersistense.List()))); }