Example #1
0
        /// <summary>
        /// 查询电费
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        public static ElecQueryElecInfo QueryElec(string account)
        {
            SysBLL.Authcode = ElecLogin();
            ElecInterface      access = new ElecInterface();
            ElecQueryElecParam param  = new ElecQueryElecParam();

            param.authcode     = SysBLL.Authcode;;               // 认证码 not null
            param.servicename  = "DW001";                        //交易编号 not null
            param.trandateTime = SysBLL.getYYYYMMDDHHMMSSTime(); //交易时间  格式:YYYYMMDDHHMMSS
            param.reqsn        = SysBLL.getSerialNum();          //请求流水号 not null
            param.yhbh         = account;                        //用户名 not null
            param.loginId      = SysBLL.getCpuNo();              //交互终端的设备编号(用于自助终端) not null
            ElecQueryElecInfo info = access.ElecQueryElec(param);

            return(info);
        }
Example #2
0
        /// <summary>
        /// 电网查询电费接口
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public ElecQueryElecInfo ElecQueryElec(ElecQueryElecParam param)
        {
            ElecQueryElecInfo           elecQueryElecInfo = null;
            Dictionary <String, String> parameters        = new Dictionary <String, String>();

            parameters.Add("authcode", param.authcode);
            parameters.Add("servicename", param.servicename);
            parameters.Add("trandateTime", param.trandateTime);
            parameters.Add("reqsn", param.reqsn);
            parameters.Add("yhbh", param.yhbh);
            parameters.Add("loginId", param.loginId);

            string jsonText = HttpHelper.getHttp(SysConfigHelper.readerNode("ElecQueryElecName"), parameters, null);


            //反序列化JSON字符串,将JSON字符串转换成LIST列表
            elecQueryElecInfo = JsonConvert.DeserializeObject <ElecQueryElecInfo>(jsonText);

            return(elecQueryElecInfo);
        }