public void UpDateState(DeviceStateModel state) { using (var dbContext = new DKLManagerDbContext()) { dbContext.Update <DeviceStateModel>(state); } }
public void InsertState(DeviceStateModel state) { using (var dbContext = new DKLManagerDbContext()) { dbContext.Insert <DeviceStateModel>(state); } }
public ActionResult Create(FormCollection collection) { var model = new DeviceStateModel(); this.TryUpdateModel <DeviceStateModel>(model); this.IDKLManagerService.InsertDeviceState(model); return(this.RefreshParent()); }
public ActionResult Create(FormCollection collection) { var model = new DeviceStateModel(); try { this.TryUpdateModel <DeviceStateModel>(model); this.IDKLManagerService.InsertDeviceState(model); } catch (Exception ex) { return(Back(ex.Message)); } return(this.RefreshParent()); }
public ActionResult Create() { var model = new DeviceStateModel(); return(View("Edit", model)); }