コード例 #1
0
        public BasicResponse <Jc_BInfo> GetDateAlarmRecordById(AlarmRecordGetDateIdRequest AlarmRecordRequest)
        {
            var alarmTable = _Repository.QueryTable("global_GetDateAlarmRecordById", new object[] { "KJ_DataAlarm" + AlarmRecordRequest.AlarmDate, AlarmRecordRequest.Id });

            BasicResponse <Jc_BInfo> response = new BasicResponse <Jc_BInfo>();

            if (alarmTable != null && alarmTable.Rows.Count > 0)
            {
                var alarmList = _Repository.ToEntityFromTable <Jc_BInfo>(alarmTable);
                response.Data = alarmList.FirstOrDefault();
            }

            return(response);
        }
コード例 #2
0
        /// <summary>
        /// 结束设备报警
        /// </summary>
        /// <returns></returns>
        private bool EndDeviceAlarm()
        {
            AlarmRecordGetDateIdRequest alarmgetByIdrequest = new AlarmRecordGetDateIdRequest
            {
                Id        = _alarmId,
                AlarmDate = _stime
            };
            var response = alarmRecordService.GetDateAlarmRecordById(alarmgetByIdrequest);

            if (response != null && response.IsSuccess && response.Data != null)
            {
                Jc_BInfo   alarmInfo   = response.Data;
                ClientItem _ClientItem = Basic.Framework.Data.PlatRuntime.Items[KeyConst.ClientItemKey] as ClientItem;
                if (_ClientItem != null)
                {
                    alarmInfo.Bz1 = _ClientItem.UserName;
                }
                //alarmInfo.Etime = DateTime.Now;
                alarmInfo.Bz2    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                alarmInfo.Remark = reasonEdit.Text;
                alarmInfo.Cs     = measureEdit.Text;

                Dictionary <string, object> updateItems = new Dictionary <string, object>();
                updateItems.Add("Bz1", alarmInfo.Bz1);
                updateItems.Add("Bz2", alarmInfo.Bz2);
                updateItems.Add("Remark", alarmInfo.Remark);
                updateItems.Add("Cs", alarmInfo.Cs);

                AlarmRecordUpdateProperitesRequest updateRequest = new AlarmRecordUpdateProperitesRequest()
                {
                    AlarmInfo   = alarmInfo,
                    UpdateItems = updateItems
                };
                var updateResponse = alarmRecordService.UpdateAlarmInfoProperties(updateRequest);
                if (updateResponse != null && updateResponse.IsSuccess)
                {
                    return(updateResponse.Data);
                }
            }
            return(false);
        }
コード例 #3
0
        public frmAlarmProcessDetail(int alarmType, string alarmId, string stime)
        {
            InitializeComponent();
            _alarmType         = alarmType;
            _alarmId           = alarmId;
            _stime             = stime;
            alarmRecordService = ServiceFactory.Create <IAlarmRecordService>();
            alarmHandleService = ServiceFactory.Create <IAlarmHandleService>();

            if (_alarmType == 1)
            {
                AlarmRecordGetDateIdRequest alarmgetByIdrequest = new AlarmRecordGetDateIdRequest
                {
                    Id        = _alarmId,
                    AlarmDate = _stime
                };
                var response = alarmRecordService.GetDateAlarmRecordById(alarmgetByIdrequest);
                if (response.IsSuccess && response.Data != null)
                {
                    reasonEdit.Text  = response.Data.Remark;
                    measureEdit.Text = response.Data.Cs;
                }
            }
            else if (_alarmType == 2)
            {
                AlarmHandleGetRequest getRequest = new AlarmHandleGetRequest
                {
                    Id = _alarmId
                };
                var getresponse = alarmHandleService.GetJC_AlarmHandleById(getRequest);
                if (getresponse.IsSuccess && getresponse.Data != null)
                {
                    reasonEdit.Text  = getresponse.Data.ExceptionReason;
                    measureEdit.Text = getresponse.Data.Handling;
                }
            }
        }