using Newtonsoft.Json; using System; using System.Collections.Generic; using WIDESEA_Common.DBHelper; using WIDESEA_Core.Utilities; using WIDESEA_Entity.DomainModels; namespace WIDESEA_Services.Services { public class Parm { public List data { get; set; } public int type { get; set; } } public partial class dt_stationinfoService { /// /// 设置缓存架禁用启用 /// /// /// public WebResponseContent SetStationEnable(object json) { WebResponseContent webResponse = new WebResponseContent(); try { var data = JsonConvert.DeserializeObject(json.ToString()); var res = FreeDB.DB.Update() .Set(t => t.enable, data.type == 1) .Where(t => data.data.Contains(t.id.ToString())) .ExecuteAffrows(); if (res <= 0) { throw new Exception("操作失败!"); } webResponse.OK(); } catch (Exception ex) { webResponse.Error(ex.Message); } return webResponse; } } }