Esempio n. 1
0
        public object getMemberToken(Dictionary <string, object> dicParas)
        {
            bool   isMember = false;
            string errMsg   = string.Empty;
            string storeId  = dicParas.ContainsKey("storeId") ? dicParas["storeId"].ToString() : string.Empty;

            try
            {
                MobileTokenModel mobileTokenModel = (MobileTokenModel)(dicParas[Constant.MobileTokenModel]);
                //获取终端号是否存在
                StoreCacheModel storeModel    = null;
                StoreBusiness   storeBusiness = new StoreBusiness();
                if (!storeBusiness.IsEffectiveStore(storeId, ref storeModel, out errMsg))
                {
                    return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, errMsg));
                }

                //是否注册会员
                MemberResponseModel memberResponseModel = null;
                System.Data.DataSet ds = null;
                if (storeModel.StoreType == 0)
                {
                    XCCloudService.BLL.IBLL.XCGame.IMemberService memberService = BLLContainer.Resolve <XCCloudService.BLL.IBLL.XCGame.IMemberService>(storeModel.StoreDBName);
                    var count = memberService.GetModels(p => p.Mobile.Equals(mobileTokenModel.Mobile, StringComparison.OrdinalIgnoreCase)).Count <XCCloudService.Model.XCGame.t_member>();
                    if (count == 0)
                    {
                        string         sql        = " exec RegisterMember @Mobile,@MemberPassword,@WXOpenID,@Return output ";
                        SqlParameter[] parameters = new SqlParameter[4];
                        parameters[0]           = new SqlParameter("@Mobile", mobileTokenModel.Mobile);
                        parameters[1]           = new SqlParameter("@MemberPassword", "888888");
                        parameters[2]           = new SqlParameter("@WXOpenID", "");
                        parameters[3]           = new SqlParameter("@Return", 0);
                        parameters[3].Direction = System.Data.ParameterDirection.Output;
                        ds = XCGameBLL.ExecuteQuerySentence(sql, storeModel.StoreDBName, parameters);
                    }
                    else
                    {
                        string         sql        = " exec GetMember @Mobile,@ICCardID";
                        SqlParameter[] parameters = new SqlParameter[2];
                        parameters[0] = new SqlParameter("@Mobile", mobileTokenModel.Mobile);
                        parameters[1] = new SqlParameter("@ICCardID", "0");
                        ds            = XCGameBLL.ExecuteQuerySentence(sql, storeModel.StoreDBName, parameters);
                    }
                    memberResponseModel             = Utils.GetModelList <MemberResponseModel>(ds.Tables[0])[0];
                    memberResponseModel.MemberState = MemberBusiness.GetMemberStateName(memberResponseModel.MemberState);
                    isMember = true;
                }
                else if (storeModel.StoreType == 1)
                {
                    XCCloudService.BLL.IBLL.XCCloudRS232.IMemberService memberService = BLLContainer.Resolve <XCCloudService.BLL.IBLL.XCCloudRS232.IMemberService>();
                    var count = memberService.GetModels(p => p.Mobile.Equals(mobileTokenModel.Mobile, StringComparison.OrdinalIgnoreCase)).Count <XCCloudService.Model.XCCloudRS232.t_member>();
                    if (count == 0)
                    {
                        string         sql        = " exec RegisterMember @Mobile,@MerchId,@MemberPassword,@WXOpenID,@Return output ";
                        SqlParameter[] parameters = new SqlParameter[5];
                        parameters[0]           = new SqlParameter("@Mobile", mobileTokenModel.Mobile);
                        parameters[1]           = new SqlParameter("@MerchId", storeId);
                        parameters[2]           = new SqlParameter("@MemberPassword", "888888");
                        parameters[3]           = new SqlParameter("@WXOpenID", "");
                        parameters[4]           = new SqlParameter("@Return", 0);
                        parameters[4].Direction = System.Data.ParameterDirection.Output;
                        ds = XCCloudRS232BLL.ExecuteQuerySentence(sql, parameters);
                    }
                    else
                    {
                        string         sql        = " exec GetMember @Mobile,@MerchId,@ICCardID";
                        SqlParameter[] parameters = new SqlParameter[3];
                        parameters[0] = new SqlParameter("@Mobile", mobileTokenModel.Mobile);
                        parameters[1] = new SqlParameter("@MerchId", storeId);
                        parameters[2] = new SqlParameter("@ICCardID", "0");
                        ds            = XCCloudRS232BLL.ExecuteQuerySentence(sql, parameters);
                    }
                    memberResponseModel             = Utils.GetModelList <MemberResponseModel>(ds.Tables[0])[0];
                    memberResponseModel.MemberState = "有效";
                    isMember = true;
                }
                else
                {
                    isMember = false;
                }

                //设置会员token
                string token = string.Empty;
                if (isMember)
                {
                    token = MemberTokenBusiness.SetMemberToken(storeId, mobileTokenModel.Mobile, memberResponseModel.MemberLevelName, storeModel.StoreName, memberResponseModel.ICCardID.ToString(), memberResponseModel.EndDate);
                }

                MemberTokenResponseModel memberTokenModel = new MemberTokenResponseModel(storeId, storeModel.StoreName, token, isMember, memberResponseModel);
                return(ResponseModelFactory <MemberTokenResponseModel> .CreateModel(isSignKeyReturn, memberTokenModel));
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 2
0
        public object getCustomCardInfo(Dictionary <string, object> dicParas)
        {
            string          errMsg     = string.Empty;
            StoreCacheModel storeModel = null;

            System.Data.DataSet ds = null;

            //获取token模式
            XCCloudManaUserTokenModel userTokenModel = (XCCloudManaUserTokenModel)(dicParas[Constant.XCGameManaUserToken]);
            //验证门店
            StoreBusiness storeBusiness = new StoreBusiness();

            if (!storeBusiness.IsEffectiveStore(userTokenModel.StoreId, ref storeModel, out errMsg))
            {
                return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, errMsg));
            }

            if (storeModel.StoreDBDeployType == 0)
            {
                string sql = @" select ICCardID,MemberName,Gender,convert(char(10),Birthday,120) as Birthday,CertificalID,Mobile,Balance,Point,a.Deposit,MemberState,Lottery,Note,convert(char(10),EndDate,120) as EndDate,MemberLevelName from t_member a left join t_memberlevel b on a.MemberLevelID = b.MemberLevelID 
                                where MemberLevelName = '黄牛卡' or  MemberLevelName = '收分卡' ";

                //如果是门店模式
                ds = XCGameBLL.ExecuteQuerySentence(sql, storeModel.StoreDBName, null);
                List <CattleMemberCardDetailModel> list = new List <CattleMemberCardDetailModel>();
                if (ds != null && ds.Tables.Count >= 1)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        CattleMemberCardDetailModel cattleMemberCardDetailModel = Utils.GetModelList <CattleMemberCardDetailModel>(ds.Tables[0])[i];
                        cattleMemberCardDetailModel.MemberState = MemberBusiness.GetMemberStateName(cattleMemberCardDetailModel.MemberState);
                        list.Add(cattleMemberCardDetailModel);
                    }
                    CattleMemberCardModel cardModel = new CattleMemberCardModel(storeModel.StoreID.ToString(), storeModel.StoreName, list);
                    return(ResponseModelFactory <CattleMemberCardModel> .CreateModel(isSignKeyReturn, cardModel));
                }
                else
                {
                    return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, ""));
                }
            }
            else if (storeModel.StoreDBDeployType == 1)
            {
                string sn = System.Guid.NewGuid().ToString().Replace("-", "");
                UDPSocketCommonQueryAnswerModel answerModel = null;
                string radarToken = string.Empty;
                if (DataFactory.SendDataCattleMemberCardQuery(sn, storeModel.StoreID.ToString(), storeModel.StorePassword, "0", out radarToken, out errMsg))
                {
                }
                else
                {
                    return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, errMsg));
                }

                answerModel = null;
                while (answerModel == null)
                {
                    //获取应答缓存数据
                    System.Threading.Thread.Sleep(1000);
                    answerModel = UDPSocketCommonQueryAnswerBusiness.GetAnswerModel(sn, 1);
                }

                if (answerModel != null)
                {
                    CattleMemberCardQueryResultNotifyRequestModel model1 = (CattleMemberCardQueryResultNotifyRequestModel)(answerModel.Result);
                    //移除应答缓存数据
                    UDPSocketCommonQueryAnswerBusiness.Remove(sn);

                    if (model1.Result_Code == "1")
                    {
                        List <CattleMemberCardDetailModel> list = new List <CattleMemberCardDetailModel>();
                        for (int i = 0; i < model1.Result_Data.Count; i++)
                        {
                            CattleMemberCardDetailModel detailModel = new CattleMemberCardDetailModel();
                            detailModel.ICCardID    = int.Parse(model1.Result_Data[i].ICCardId);
                            detailModel.MemberName  = model1.Result_Data[i].Name;
                            detailModel.MemberState = model1.Result_Data[i].MemberState;
                            detailModel.Mobile      = model1.Result_Data[i].Phone;
                            list.Add(detailModel);
                        }
                        CattleMemberCardModel cardModel = new CattleMemberCardModel(storeModel.StoreID.ToString(), storeModel.StoreName, list);
                        return(ResponseModelFactory <CattleMemberCardModel> .CreateModel(isSignKeyReturn, cardModel));
                    }
                    else
                    {
                        return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "查询数据出错"));
                    }
                }
                else
                {
                    return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "查询数据出错"));
                }
            }
            else
            {
                return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "查询数据出错"));
            }
        }
Esempio n. 3
0
        public object getInfo(Dictionary <string, object> dicParas)
        {
            try
            {
                string              errMsg     = string.Empty;
                StoreCacheModel     storeModel = null;
                System.Data.DataSet ds         = null;
                //获取token模式
                XCGameMemberTokenModel memberTokenModel = (XCGameMemberTokenModel)(dicParas[Constant.XCGameMemberTokenModel]);

                //验证门店
                StoreBusiness storeBusiness = new StoreBusiness();
                if (!storeBusiness.IsEffectiveStore(memberTokenModel.StoreId, ref storeModel, out errMsg))
                {
                    return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, errMsg));
                }
                //如果是门店模式
                if (storeModel.StoreType == 0)
                {
                    XCCloudService.BLL.IBLL.XCGame.IMemberService memberService = BLLContainer.Resolve <XCCloudService.BLL.IBLL.XCGame.IMemberService>(storeModel.StoreDBName);
                    var count = memberService.GetModels(p => p.Mobile.Equals(memberTokenModel.Mobile, StringComparison.OrdinalIgnoreCase)).Count <XCCloudService.Model.XCGame.t_member>();
                    if (count == 0)
                    {
                        string         sql        = " exec RegisterMember @Mobile,@MemberPassword,@WXOpenID,@Return output ";
                        SqlParameter[] parameters = new SqlParameter[4];
                        parameters[0]           = new SqlParameter("@Mobile", memberTokenModel.Mobile);
                        parameters[1]           = new SqlParameter("@MemberPassword", "888888");
                        parameters[2]           = new SqlParameter("@WXOpenID", "");
                        parameters[3]           = new SqlParameter("@Return", 0);
                        parameters[3].Direction = System.Data.ParameterDirection.Output;
                        ds = XCGameBLL.ExecuteQuerySentence(sql, storeModel.StoreDBName, parameters);
                        MemberResponseModel memberResponseModel = Utils.GetModelList <MemberResponseModel>(ds.Tables[0])[0];
                        memberResponseModel.MemberState = MemberBusiness.GetMemberStateName(memberResponseModel.MemberState);
                        string meberToken = MemberTokenBusiness.SetMemberToken(memberTokenModel.StoreId, memberTokenModel.Mobile, memberResponseModel.MemberLevelName, storeModel.StoreName, memberResponseModel.ICCardID.ToString(), memberResponseModel.EndDate);
                        RegisterMemberTokenResponseModel registerMemberTokenResponseModel = new RegisterMemberTokenResponseModel(memberTokenModel.StoreId, storeModel.StoreName, meberToken, memberResponseModel);
                        return(ResponseModelFactory <RegisterMemberTokenResponseModel> .CreateModel(isSignKeyReturn, registerMemberTokenResponseModel));
                    }
                    else
                    {
                        string         sql        = " exec GetMember @Mobile,@ICCardID";
                        SqlParameter[] parameters = new SqlParameter[2];
                        parameters[0] = new SqlParameter("@Mobile", memberTokenModel.Mobile);
                        parameters[1] = new SqlParameter("@ICCardID", "0");
                        ds            = XCGameBLL.ExecuteQuerySentence(sql, storeModel.StoreDBName, parameters);
                        RegisterMemberResponseModel registerMemberResponseModel = Utils.GetModelList <RegisterMemberResponseModel>(ds.Tables[0])[0];
                        registerMemberResponseModel.StoreId     = storeModel.StoreID.ToString();
                        registerMemberResponseModel.StoreName   = storeModel.StoreName;
                        registerMemberResponseModel.MemberState = MemberBusiness.GetMemberStateName(registerMemberResponseModel.MemberState);
                        return(ResponseModelFactory <RegisterMemberResponseModel> .CreateModel(isSignKeyReturn, registerMemberResponseModel));
                    }
                }
                //如果是商户模式
                else if (storeModel.StoreType == 1)
                {
                    XCCloudService.BLL.IBLL.XCCloudRS232.IMemberService memberService = BLLContainer.Resolve <XCCloudService.BLL.IBLL.XCCloudRS232.IMemberService>();
                    var count = memberService.GetModels(p => p.Mobile.Equals(memberTokenModel.Mobile, StringComparison.OrdinalIgnoreCase)).Count <XCCloudService.Model.XCCloudRS232.t_member>();
                    if (count == 0)
                    {
                        string         sql        = " exec RegisterMember @Mobile,@MerchId,@MemberPassword,@WXOpenID,@Return output ";
                        SqlParameter[] parameters = new SqlParameter[5];
                        parameters[0]           = new SqlParameter("@Mobile", memberTokenModel.Mobile);
                        parameters[1]           = new SqlParameter("@MerchId", storeModel.StoreID);
                        parameters[2]           = new SqlParameter("@MemberPassword", "888888");
                        parameters[3]           = new SqlParameter("@WXOpenID", "");
                        parameters[4]           = new SqlParameter("@Return", 0);
                        parameters[4].Direction = System.Data.ParameterDirection.Output;
                        ds = XCCloudRS232BLL.ExecuteQuerySentence(sql, parameters);
                        MemberResponseModel memberResponseModel = Utils.GetModelList <MemberResponseModel>(ds.Tables[0])[0];
                        memberResponseModel.MemberState = MemberBusiness.GetMemberStateName(memberResponseModel.MemberState);
                        string meberToken = MemberTokenBusiness.SetMemberToken(memberTokenModel.StoreId, memberTokenModel.Mobile, memberResponseModel.MemberLevelName, storeModel.StoreName, memberResponseModel.ICCardID.ToString(), memberResponseModel.EndDate);
                        RegisterMemberTokenResponseModel registerMemberTokenResponseModel = new RegisterMemberTokenResponseModel(memberTokenModel.StoreId, storeModel.StoreName, meberToken, memberResponseModel);
                        return(ResponseModelFactory <RegisterMemberTokenResponseModel> .CreateModel(isSignKeyReturn, registerMemberTokenResponseModel));
                    }
                    else
                    {
                        string         sql        = " exec GetMember @Mobile,@MerchId,@ICCardID";
                        SqlParameter[] parameters = new SqlParameter[3];
                        parameters[0] = new SqlParameter("@Mobile", memberTokenModel.Mobile);
                        parameters[1] = new SqlParameter("@MerchId", memberTokenModel.StoreId);
                        parameters[2] = new SqlParameter("@ICCardID", "0");
                        ds            = XCCloudRS232BLL.ExecuteQuerySentence(sql, parameters);
                        RegisterMemberResponseModel registerMemberResponseModel = Utils.GetModelList <RegisterMemberResponseModel>(ds.Tables[0])[0];
                        registerMemberResponseModel.StoreId     = storeModel.StoreID.ToString();
                        registerMemberResponseModel.StoreName   = storeModel.StoreName;
                        registerMemberResponseModel.MemberState = MemberBusiness.GetMemberStateName(registerMemberResponseModel.MemberState);
                        return(ResponseModelFactory <RegisterMemberResponseModel> .CreateModel(isSignKeyReturn, registerMemberResponseModel));
                    }
                }
                else
                {
                    return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "门店类型无效"));
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 4
0
        public object getInfo2(Dictionary <string, object> dicParas)
        {
            try
            {
                string              errMsg     = string.Empty;
                StoreCacheModel     storeModel = null;
                System.Data.DataSet ds         = null;

                //获取token模式
                XCCloudManaUserTokenModel userTokenModel = (XCCloudManaUserTokenModel)(dicParas[Constant.XCGameManaUserToken]);
                string icCardId = dicParas.ContainsKey("icCardId") ? dicParas["icCardId"].ToString() : string.Empty;

                //验证门店
                StoreBusiness storeBusiness = new StoreBusiness();
                if (!storeBusiness.IsEffectiveStore(userTokenModel.StoreId, ref storeModel, out errMsg))
                {
                    return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, errMsg));
                }

                if (storeModel.StoreDBDeployType == 0)
                {
                    //如果是门店模式
                    string         sql        = " exec GetMember @Mobile,@ICCardID";
                    SqlParameter[] parameters = new SqlParameter[2];
                    parameters[0] = new SqlParameter("@Mobile", "");
                    parameters[1] = new SqlParameter("@ICCardID", icCardId);
                    ds            = XCGameBLL.ExecuteQuerySentence(sql, storeModel.StoreDBName, parameters);
                    if (ds != null && ds.Tables.Count >= 1)
                    {
                        RegisterMemberResponseModel registerMemberResponseModel = Utils.GetModelList <RegisterMemberResponseModel>(ds.Tables[0])[0];
                        registerMemberResponseModel.StoreId     = storeModel.StoreID.ToString();
                        registerMemberResponseModel.StoreName   = storeModel.StoreName;
                        registerMemberResponseModel.MemberState = MemberBusiness.GetMemberStateName(registerMemberResponseModel.MemberState);
                        return(ResponseModelFactory <RegisterMemberResponseModel> .CreateModel(isSignKeyReturn, registerMemberResponseModel));
                    }
                    else
                    {
                        return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, ""));
                    }
                }
                else if (storeModel.StoreDBDeployType == 1)
                {
                    string sn = System.Guid.NewGuid().ToString().Replace("-", "");
                    UDPSocketCommonQueryAnswerModel answerModel = null;
                    string radarToken = string.Empty;
                    if (DataFactory.SendDataMemberQuery(sn, storeModel.StoreID.ToString(), storeModel.StorePassword, icCardId, out radarToken, out errMsg))
                    {
                    }
                    else
                    {
                        return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, errMsg));
                    }

                    answerModel = null;
                    while (answerModel == null)
                    {
                        //获取应答缓存数据
                        System.Threading.Thread.Sleep(1000);
                        answerModel = UDPSocketCommonQueryAnswerBusiness.GetAnswerModel(sn, 1);
                    }

                    if (answerModel != null)
                    {
                        MemberQueryResultNotifyRequestModel model = (MemberQueryResultNotifyRequestModel)(answerModel.Result);
                        //移除应答缓存数据
                        UDPSocketCommonQueryAnswerBusiness.Remove(sn);

                        if (model.Result_Code == "1")
                        {
                            RegisterMemberResponseModel registerMemberResponseModel = new RegisterMemberResponseModel();
                            registerMemberResponseModel.ICCardID        = int.Parse(model.Result_Data.ICCardID);
                            registerMemberResponseModel.MemberName      = model.Result_Data.MemberName;
                            registerMemberResponseModel.Gender          = model.Result_Data.Gender;
                            registerMemberResponseModel.Birthday        = model.Result_Data.Birthday;
                            registerMemberResponseModel.CertificalID    = model.Result_Data.CertificalID;
                            registerMemberResponseModel.Mobile          = model.Result_Data.Mobile;
                            registerMemberResponseModel.Balance         = Convert.ToInt32(model.Result_Data.Balance);
                            registerMemberResponseModel.Point           = Convert.ToInt32(model.Result_Data.Point);
                            registerMemberResponseModel.Deposit         = model.Result_Data.Deposit;
                            registerMemberResponseModel.MemberState     = model.Result_Data.MemberState;
                            registerMemberResponseModel.Lottery         = Convert.ToInt32(model.Result_Data.Lottery);
                            registerMemberResponseModel.Note            = model.Result_Data.Note;
                            registerMemberResponseModel.EndDate         = model.Result_Data.EndDate;
                            registerMemberResponseModel.MemberLevelName = model.Result_Data.MemberLevelName;
                            registerMemberResponseModel.StoreId         = storeModel.StoreID.ToString();
                            registerMemberResponseModel.StoreName       = storeModel.StoreName;
                            registerMemberResponseModel.MemberState     = MemberBusiness.GetMemberStateName(registerMemberResponseModel.MemberState);
                            return(ResponseModelFactory <RegisterMemberResponseModel> .CreateModel(isSignKeyReturn, registerMemberResponseModel));
                        }
                        else
                        {
                            return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "查询数据出错"));
                        }
                    }
                    else
                    {
                        return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "查询数据出错"));
                    }
                }
                else
                {
                    return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "门店设置错误"));
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 5
0
        public object register(Dictionary <string, object> dicParas)
        {
            try
            {
                string errMsg = string.Empty;
                string mobile = string.Empty;
                XCGameManaDeviceStoreType deviceStoreType;
                string storeId = dicParas.ContainsKey("storeId") ? dicParas["storeId"].ToString() : string.Empty;
                //验证手机token
                MobileTokenModel mobileTokenModel = (MobileTokenModel)(dicParas[Constant.MobileTokenModel]);
                mobile = mobileTokenModel.Mobile;
                //验证门店
                StoreCacheModel storeModel = null;
                StoreBusiness   store      = new StoreBusiness();
                if (!store.IsEffectiveStore(storeId, out deviceStoreType, ref storeModel, out errMsg))
                {
                    return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, errMsg));
                }

                string meberToken = string.Empty;
                if (deviceStoreType == XCGameManaDeviceStoreType.Store)
                {
                    XCCloudService.BLL.IBLL.XCGame.IMemberService memberService = BLLContainer.Resolve <XCCloudService.BLL.IBLL.XCGame.IMemberService>(storeModel.StoreDBName);
                    //获取手机号是否存在注册记录
                    var count = memberService.GetModels(p => p.Mobile.Equals(mobile, StringComparison.OrdinalIgnoreCase)).Count <XCCloudService.Model.XCGame.t_member>();
                    if (count == 0)
                    {
                        string         sql        = " exec RegisterMember @Mobile,@MemberPassword,@WXOpenID,@Return output ";
                        SqlParameter[] parameters = new SqlParameter[4];
                        parameters[0]           = new SqlParameter("@Mobile", mobile);
                        parameters[1]           = new SqlParameter("@MemberPassword", "888888");
                        parameters[2]           = new SqlParameter("@WXOpenID", "");
                        parameters[3]           = new SqlParameter("@Return", 0);
                        parameters[3].Direction = System.Data.ParameterDirection.Output;
                        System.Data.DataSet ds = XCGameBLL.ExecuteQuerySentence(sql, storeModel.StoreDBName, parameters);
                        MemberResponseModel memberResponseModel = Utils.GetModelList <MemberResponseModel>(ds.Tables[0])[0];
                        memberResponseModel.MemberState = MemberBusiness.GetMemberStateName(memberResponseModel.MemberState);
                        meberToken = MemberTokenBusiness.SetMemberToken(storeId, mobile, memberResponseModel.MemberLevelName, storeModel.StoreName, memberResponseModel.ICCardID.ToString(), memberResponseModel.EndDate);
                        RegisterMemberTokenResponseModel registerMemberTokenResponseModel = new RegisterMemberTokenResponseModel(storeId, storeModel.StoreName, meberToken, memberResponseModel);
                        return(ResponseModelFactory <RegisterMemberTokenResponseModel> .CreateModel(isSignKeyReturn, registerMemberTokenResponseModel));
                    }
                    else
                    {
                        //如果已注册,返回会员主要信息
                        string         sql        = " exec GetMember @Mobile,@ICCardID";
                        SqlParameter[] parameters = new SqlParameter[2];
                        parameters[0] = new SqlParameter("@Mobile", mobile);
                        parameters[1] = new SqlParameter("@ICCardID", "0");
                        System.Data.DataSet ds = XCGameBLL.ExecuteQuerySentence(sql, storeModel.StoreDBName, parameters);
                        MemberResponseModel memberResponseModel = Utils.GetModelList <MemberResponseModel>(ds.Tables[0])[0];
                        memberResponseModel.MemberState = MemberBusiness.GetMemberStateName(memberResponseModel.MemberState);
                        meberToken = MemberTokenBusiness.SetMemberToken(storeId, mobile, memberResponseModel.MemberLevelName, storeModel.StoreName, memberResponseModel.ICCardID.ToString(), memberResponseModel.EndDate);
                        RegisterMemberTokenResponseModel registerMemberTokenResponseModel = new RegisterMemberTokenResponseModel(storeId, storeModel.StoreName, meberToken, memberResponseModel);
                        return(ResponseModelFactory <RegisterMemberTokenResponseModel> .CreateModel(isSignKeyReturn, registerMemberTokenResponseModel));
                    }
                }
                else if (deviceStoreType == XCGameManaDeviceStoreType.Merch)
                {
                    XCCloudService.BLL.IBLL.XCCloudRS232.IMemberService memberService = BLLContainer.Resolve <XCCloudService.BLL.IBLL.XCCloudRS232.IMemberService>();
                    //获取手机号是否存在注册记录
                    var count = memberService.GetModels(p => p.Mobile.Equals(mobile, StringComparison.OrdinalIgnoreCase)).Count <XCCloudService.Model.XCCloudRS232.t_member>();
                    if (count == 0)
                    {
                        string         sql        = " exec RegisterMember @Mobile,@MerchId,@MemberPassword,@WXOpenID,@Return output ";
                        SqlParameter[] parameters = new SqlParameter[5];
                        parameters[0]           = new SqlParameter("@Mobile", mobile);
                        parameters[1]           = new SqlParameter("@MerchId", storeId);
                        parameters[2]           = new SqlParameter("@MemberPassword", "888888");
                        parameters[3]           = new SqlParameter("@WXOpenID", "");
                        parameters[4]           = new SqlParameter("@Return", 0);
                        parameters[4].Direction = System.Data.ParameterDirection.Output;
                        System.Data.DataSet ds = XCCloudRS232BLL.ExecuteQuerySentence(sql, parameters);
                        MemberResponseModel memberResponseModel = Utils.GetModelList <MemberResponseModel>(ds.Tables[0])[0];
                        memberResponseModel.MemberState = MemberBusiness.GetMemberStateName(memberResponseModel.MemberState);
                        meberToken = MemberTokenBusiness.SetMemberToken(storeId, mobile, memberResponseModel.MemberLevelName, storeModel.StoreName, memberResponseModel.ICCardID.ToString(), memberResponseModel.EndDate);
                        RegisterMemberTokenResponseModel registerMemberTokenResponseModel = new RegisterMemberTokenResponseModel(storeId, storeModel.StoreName, meberToken, memberResponseModel);
                        return(ResponseModelFactory <RegisterMemberTokenResponseModel> .CreateModel(isSignKeyReturn, registerMemberTokenResponseModel));
                    }
                    else
                    {
                        //如果已注册,返回会员主要信息
                        string         sql        = " exec GetMember @Mobile,@MerchId,@ICCardID";
                        SqlParameter[] parameters = new SqlParameter[3];
                        parameters[0] = new SqlParameter("@Mobile", mobile);
                        parameters[1] = new SqlParameter("@MerchId", storeId);
                        parameters[2] = new SqlParameter("@ICCardID", "0");
                        System.Data.DataSet ds = XCCloudRS232BLL.ExecuteQuerySentence(sql, parameters);
                        MemberResponseModel memberResponseModel = Utils.GetModelList <MemberResponseModel>(ds.Tables[0])[0];
                        memberResponseModel.MemberState = "使用中";
                        meberToken = MemberTokenBusiness.SetMemberToken(storeId, mobile, memberResponseModel.MemberLevelName, storeModel.StoreName, memberResponseModel.ICCardID.ToString(), memberResponseModel.EndDate);
                        RegisterMemberTokenResponseModel registerMemberTokenResponseModel = new RegisterMemberTokenResponseModel(storeId, storeModel.StoreName, meberToken, memberResponseModel);
                        return(ResponseModelFactory <RegisterMemberTokenResponseModel> .CreateModel(isSignKeyReturn, registerMemberTokenResponseModel));
                    }
                }
                else
                {
                    return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, "店号无效"));
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }