public ActionResult Edit(int ServerId, int DeviceId) { try { this._provider = new DeviceConfigService(DomainSession.GetAlarmConfigForContextWithDeviceId(this.HttpContext, ServerId), DeviceId); AlarmSystemDeviceModel model = new AlarmSystemDeviceModel(this._provider.Get()); model.ServerId = ServerId; return(View(model)); } catch (Exception e) { } return(View()); }
public async Task <ActionResult> Edit(AlarmSystemDeviceModel model) { try { this._provider = new DeviceConfigService(DomainSession.GetAlarmConfigForContextSession(this.HttpContext)); if (ModelState.IsValid) { var res = (_provider.Update(model.Device)); model.Result = StatusResponseGenerator.GetStatusResponseResultForReturnParam(res); } } catch (Exception e) { model.Result = StatusResponseGenerator.GetRequestResponseCriticalError(); } return(View(model)); }