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<string> data { get; set; }
|
public int type { get; set; }
|
}
|
public partial class dt_stationinfoService
|
{
|
/// <summary>
|
/// 设置缓存架禁用启用
|
/// </summary>
|
/// <param name="json"></param>
|
/// <returns></returns>
|
public WebResponseContent SetStationEnable(object json)
|
{
|
WebResponseContent webResponse = new WebResponseContent();
|
try
|
{
|
var data = JsonConvert.DeserializeObject<Parm>(json.ToString());
|
var res = FreeDB.DB.Update<dt_stationinfo>()
|
.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;
|
}
|
}
|
}
|