| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using SqlSugar.Extensions; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_ISystemRepository; |
| | | using WIDESEAWCS_ISystemServices; |
| | |
| | | |
| | | namespace WIDESEAWCS_SystemServices |
| | | { |
| | | |
| | | public class Dt_StationinfoService : ServiceBase<Dt_Stationinfo, IDt_StationinfoRepository>, IDt_StationinfoService |
| | | { |
| | | public class Parm |
| | | { |
| | | public List<string> data { get; set; } |
| | | public bool type { get; set; } |
| | | } |
| | | public Dt_StationinfoService(IDt_StationinfoRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | public WebResponseContent SetStationEnable(object parm) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var data = JsonConvert.DeserializeObject<Parm>(parm.ToString()); |
| | | var res = BaseDal.QueryFirst(x => data.data.Contains(x.Id.ToString())); |
| | | res.Enable = data.type.ObjToBool(); |
| | | var isTrue = BaseDal.UpdateData(res); |
| | | if (isTrue) |
| | | { |
| | | content.OK("ç¼åæ¶ç¶ææ´æ°æå"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |