Пример #1
0
        public BasicResponse <bool> UpdateDateAlarmRecord(AlarmRecordUpdateDateRequest AlarmRecordRequest)
        {
            List <Jc_BInfo> alarmInfos = new List <Jc_BInfo>();
            string          alarmDate  = AlarmRecordRequest.AlarmInfo.Stime.ToString("yyyyMM");

            alarmInfos.Add(AlarmRecordRequest.AlarmInfo);

            var alarmModels = ObjectConverter.CopyList <Jc_BInfo, Jc_BModel>(alarmInfos);
            BasicResponse <bool> resultResponse = new BasicResponse <bool>();

            if (_Repository.BulkUpdate("KJ_DataAlarm" + alarmDate, alarmModels, BuildDataColumn(columns), "ID"))
            {
                resultResponse.Data = true;
                //更新缓存
                var updateRequest = new AlarmCacheUpdateRequest
                {
                    AlarmInfo = AlarmRecordRequest.AlarmInfo
                };
                _alarmCacheService.UpdateAlarmCahce(updateRequest);
            }
            else
            {
                resultResponse.Data = false;
            }

            return(resultResponse);
        }
Пример #2
0
 public BasicResponse UpdateAlarmCahce(AlarmCacheUpdateRequest alarmCacheRequest)
 {
     AlarmCache.AlarmCacheInstance.UpdateItem(alarmCacheRequest.AlarmInfo);
     return(new BasicResponse());
 }