对比新文件 |
| | |
| | | 锘縰sing System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public partial class AreaInfoService : ServiceBase<Dt_AreaInfo, IAreaInfoRepository>, IAreaInfoService |
| | | { |
| | | public AreaInfoService(IAreaInfoRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | public IAreaInfoRepository Repository => BaseDal; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | | { |
| | | Dt_AreaInfo areaInfo = saveModel.MainData.DicToModel<Dt_AreaInfo>(); |
| | | return base.AddData(areaInfo); |
| | | } |
| | | |
| | | public override WebResponseContent UpdateData(Dt_AreaInfo entity) |
| | | { |
| | | return base.UpdateData(entity); |
| | | } |
| | | |
| | | public override WebResponseContent DeleteData(object[] keys) |
| | | { |
| | | return base.DeleteData(keys); |
| | | } |
| | | |
| | | public WebResponseContent AreaEnableStatus(int[] keys) |
| | | { |
| | | List<Dt_AreaInfo> areaInfos = Repository.QueryData(x => keys.Contains(x.Id)); |
| | | areaInfos.ForEach(x => |
| | | { |
| | | x.AreaStatus = EnableEnum.Enable.ObjToInt(); |
| | | }); |
| | | Repository.UpdateData(areaInfos); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent AreaDisableStatus(int[] keys) |
| | | { |
| | | List<Dt_AreaInfo> areaInfos = Repository.QueryData(x => keys.Contains(x.Id)); |
| | | areaInfos.ForEach(x => |
| | | { |
| | | x.AreaStatus = EnableEnum.Disable.ObjToInt(); |
| | | }); |
| | | Repository.UpdateData(areaInfos); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent AreaEnableStatus(int key) |
| | | { |
| | | return AreaEnableStatus(new int[] { key }); |
| | | } |
| | | |
| | | public WebResponseContent AreaDisableStatus(int key) |
| | | { |
| | | return AreaDisableStatus(new int[] { key }); |
| | | } |
| | | } |
| | | } |