Ejemplo n.º 1
0
        public static DataTable GetListEnumAlarmType()
        {
            List <EnumcodeInfo> list = new List <EnumcodeInfo>();
            string    sql            = string.Empty;
            DataTable dt             = new DataTable();

            try
            {
                var request = new GetEnumcodeByEnumTypeIdRequest()
                {
                    EnumTypeId = "6"
                };
                var response = alarmService.GetEnumcodeByEnumTypeId(request);
                if (response.Data != null)
                {
                    dt = response.Data;
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error("ClientAlarmServer-GetListEnumAlarmType-发生异常 " + ex.Message);
            }
            return(dt);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据EnumTypeId获取Enumcode
        /// </summary>
        /// <param name="alarmRequest"></param>
        /// <returns></returns>
        public BasicResponse <DataTable> GetEnumcodeByEnumTypeId(GetEnumcodeByEnumTypeIdRequest alarmRequest)
        {
            var response = new BasicResponse <DataTable>();

            if (string.IsNullOrWhiteSpace(alarmRequest.EnumTypeId))
            {
                response.Code    = -100;
                response.Message = "参数错误!";
                return(response);
            }
            try
            {
                var datatable = _Repository.GetEnumcodeByEnumTypeId(alarmRequest.EnumTypeId);
                response.Data = datatable;
            }
            catch (Exception ex)
            {
                response.Code    = -100;
                response.Message = ex.Message;
                this.ThrowException("根据EnumTypeId获取Enumcode", ex);
            }

            return(response);
        }
        public BasicResponse <DataTable> GetEnumcodeByEnumTypeId(GetEnumcodeByEnumTypeIdRequest alarmRequest)
        {
            var responsestr = HttpClientHelper.Post(Webapi + "/v1/alarm/getenumcode?token=" + Token, JSONHelper.ToJSONString(alarmRequest));

            return(JSONHelper.ParseJSONString <BasicResponse <DataTable> >(responsestr));
        }
Ejemplo n.º 4
0
 public BasicResponse <DataTable> GetEnumcodeByEnumTypeId(GetEnumcodeByEnumTypeIdRequest alarmRequest)
 {
     return(alarmService.GetEnumcodeByEnumTypeId(alarmRequest));
 }