Ejemplo n.º 1
0
        public static int DoGetPayPrarms(out List <CommonData.PayPrarmsData> paylist, out string retmsg)
        {
            int res = -1;

            try
            {
                WRAliPay.AliPayWebService ws = new WRAliPay.AliPayWebService();
                RecvRes retres = TransRes(ws.GetRenewalPriceInfo());
                retmsg = retres.Description;
                if (retres.IsOK)
                {
                    if (!string.IsNullOrEmpty(retres.ExtData))
                    {
                        string jsondata = retres.ExtData;
                        paylist = JsonDeal.JsonData2PayInfolist(jsondata);
                        res     = 0;
                    }
                    else
                    {
                        throw new Exception("accpect PayPrarmData is null");
                    }
                }
                else
                {
                    paylist = null;
                }
            }
            catch (Exception ex)
            {
                retmsg  = ex.Message;
                paylist = null;
                throw;
            }
            return(res);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 设置客户端参数
        /// </summary>
        /// <param name="Key"></param>
        /// <param name="Value"></param>
        /// <param name="retmsg"></param>
        /// <returns></returns>
        public static int DoSetConfigInfo(Dictionary <Global.ConfigInfo, string> configlist, out string retmsg)
        {
            int res = -1;

            try
            {
                string jsonStr = JsonDeal.ConfigInfolist2JsonData(configlist);
                WRAliPay.AliPayWebService ws = new WRAliPay.AliPayWebService();
                RecvRes retres = TransRes(ws.SetNetConfigInfo(jsonStr));
                retmsg = retres.Description;
                if (retres.IsOK)
                {
                    //配置成功
                    res = 0;
                }
                else
                {
                    throw new Exception("配置参数失败");
                }
            }
            catch (Exception ex)
            {
                retmsg = ex.Message;
                throw;
            }
            return(res);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 更新文件列表
        /// </summary>
        /// <param name="retmsg"></param>
        /// <param name="filedata"></param>
        /// <returns></returns>
        public static int DoUpdateFileList(string account, out string retmsg, out CommonData.FileData filedata)
        {
            int res = -1;

            try
            {
                WRFileUpdate.UpdateFileWebService ws = new WRFileUpdate.UpdateFileWebService();
                RecvRes retres = TransRes(ws.GetUpdateFileList(account));
                retmsg   = retres.Description;
                filedata = null;

                if (retres.IsOK)
                {
                    if (!string.IsNullOrEmpty(retres.ExtData))
                    {
                        string jsondata = retres.ExtData;
                        filedata = JsonDeal.JsonData2FileData(jsondata);
                        res      = 0;
                    }
                    else
                    {
                        throw new Exception("accpect extData is null");
                    }
                }
            }
            catch (Exception ex)
            {
                filedata = null;

                retmsg = ex.Message;
                throw;
            }
            return(res);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取客户端参数配置
        /// </summary>
        /// <param name="configlist"></param>
        /// <param name="retmsg"></param>
        /// <returns></returns>
        public static int DoGetConfiginfo(out Dictionary <Global.ConfigInfo, string> configlist, out string retmsg)
        {
            int res = -1;

//#if DEBUG
//            configlist = new Dictionary<Global.ConfigInfo, string>();
//            configlist.Add(Global.ConfigInfo.FtpPath, "39.108.188.162");
//            configlist.Add(Global.ConfigInfo.InitAddr, "");
//            configlist.Add(Global.ConfigInfo.WebAddAddr, "www.baidu.com");
//            configlist.Add(Global.ConfigInfo.YeMeiMsg, "维修秘籍");
//            retmsg = "调试状态,获取客户端参数配置返回成功!";
//            res = 0;
//            return res;
//#endif
            try
            {
                WRAliPay.AliPayWebService ws = new WRAliPay.AliPayWebService();
                RecvRes retres = TransRes(ws.GetNetConfigInfo());
                retmsg = retres.Description;
                if (retres.IsOK)
                {
                    //string jsonStr = JsonDeal.JsonData2ConfigInfolist(Global.ConfigInfoList);
                    if (!string.IsNullOrEmpty(retres.ExtData))
                    {
                        string jsondata = retres.ExtData;
                        configlist = JsonDeal.JsonData2ConfigInfolist(jsondata);
                        res        = 0;
                    }
                    else
                    {
                        throw new Exception("accpect ConfigData is null");
                    }
                    res = 0;
                }
                else
                {
                    configlist = null;
                }
            }
            catch (Exception ex)
            {
                retmsg     = ex.Message;
                configlist = null;
                throw;
            }
            return(res);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 根据账号获取用户信息(若账号为空,获取全部用户信息)
        /// </summary>
        /// <param name="account"></param>
        /// <param name="retmsg"></param>
        /// <param name="userList">返回的用户信息列表</param>
        /// <returns></returns>
        public static int DoGetInfoByAccount(string account, out string retmsg, out List <CommonData.UserMsgData> userList)
        {
            int res = -1;

            try
            {
                WRLogin.LoginWebService ws = new WRLogin.LoginWebService();
                RecvRes retres             = TransRes(ws.GetInfoByAccount(account));
                retmsg = retres.Description;
                //userList = null;
                if (retres.IsOK)
                {
                    if (!string.IsNullOrEmpty(retres.ExtData))
                    {
                        string jsondata = retres.ExtData;
                        userList = JsonDeal.JsonData2UserMsgListData(jsondata);
                        res      = 0;
                    }
                    else
                    {
                        throw new Exception("accpect extData is null");
                    }
                    res = 0;
                }
                else
                {
                    userList = null;
                }
            }
            catch (Exception ex)
            {
                retmsg   = ex.Message;
                userList = null;
                throw;
            }
            return(res);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取所有权限文件夹名称
        /// </summary>
        /// <param name="data"></param>
        /// <param name="retmsg"></param>
        /// <returns></returns>
        public static int DoGetFilePermissionList(out List <CommonData.FilePermission> FilePermission, out string retmsg)
        {
            int res = -1;

            try
            {
                FilePermission = null;
                WRFileUpdate.UpdateFileWebService ws = new WRFileUpdate.UpdateFileWebService();
                RecvRes retres = TransRes(ws.GetFilePermissionList());
                retmsg = retres.Description;
                if (retres.IsOK)
                {
                    FilePermission = JsonDeal.JsonData2FilePermissionlist(retres.ExtData);
                    res            = 0;
                }
            }
            catch (Exception ex)
            {
                FilePermission = null;
                retmsg         = ex.Message;
                throw;
            }
            return(res);
        }