/// <summary> /// 删除数据 /// </summary> /// <param name="keyValue">主键</param> public void RemoveForm(string keyValue) { try { service.RemoveForm(keyValue); RabbitMQHelper rh = RabbitMQHelper.CreateInstance(); SendData sd = new SendData(); sd.DataName = "RemoveDevice"; sd.EntityString = keyValue; rh.SendMessage(JsonConvert.SerializeObject(sd)); } catch (Exception) { throw; } }
/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, KbsdeviceEntity entity) { try { service.SaveForm(keyValue, entity); RabbitMQHelper rh = RabbitMQHelper.CreateInstance(); SendData sd = new SendData(); if (keyValue == "") { sd.DataName = "AddDevice"; } else { sd.DataName = "UpdateDevice"; } sd.EntityString = JsonConvert.SerializeObject(entity); rh.SendMessage(JsonConvert.SerializeObject(sd)); } catch (Exception) { throw; } }