Ejemplo n.º 1
0
        /// <summary>
        /// 查询用户是否已经加入支付圈
        /// </summary>
        protected void IsSign()
        {
            int    accountType          = Utils.GetInt(Request.QueryString["accountType"]); //接口类型
            string currentUserCompanyId = SiteUserInfo.CompanyID;                           //当前用户的公司ID

            //判断接口类型是否有效
            if (accountType < 1 || accountType > 7)//无效
            {
                Utils.ResponseMeg(false, "无效的接口类型");
                return;
            }

            //接口类型
            EyouSoft.Model.TicketStructure.TicketAccountType ticketAccountType =
                (EyouSoft.Model.TicketStructure.TicketAccountType)accountType;

            EyouSoft.IBLL.TicketStructure.ITicketCompanyAccount bll =
                EyouSoft.BLL.TicketStructure.TicketCompanyAccount.CreateInstance();

            EyouSoft.Model.TicketStructure.TicketCompanyAccount model =
                bll.GetModel(currentUserCompanyId, ticketAccountType);

            //判断是否已经绑定过当前接口类型的帐户信息
            if (model == null)//没有绑定过
            {
                Response.Clear();
                Response.Write("{isBind:false}");
                Response.End();
            }

            Response.Clear();
            if (!model.IsSign)                                                             //没有进行过签约
            {
                string qianyueUrl = GetQianYueUrl(ticketAccountType, model.AccountNumber); //获取用于签约的URL

                Response.Write("{isBind:true,isSign:" + model.IsSign.ToString().ToLower() + ",accountNumber:'" + model.AccountNumber + "',qianyueurl:'" + Server.UrlEncode(qianyueUrl) + "'}");
            }
            else//进行过签约
            {
                Response.Write("{isBind:true,isSign:true,accountNumber:'" + model.AccountNumber + "'}");
            }


            Response.End();
        }