コード例 #1
0
        public ResultModifyAddress IsReg(QueryUserExists query)
        {
            var result = new ResultModifyAddress {
                Exception = new MyException()
            };

            try
            {
                var realSsid = new EncryDecry().Md5Decrypt(query.Ssid);
                var arr      = GetSession(realSsid);
                if (arr.Length < 3)
                {
                    result.Exception.Exmsg   = "not found";
                    result.Exception.Success = true;
                    return(result);
                }
                var findIt = _user.SearchUser(arr.GetValue(2).ToString());
                if (findIt != null)
                {
                    result.Address = _userInfo.GeTbUserInfos($"{findIt.Id}")?[0].Address;
                }
                result.Exception.Success = true;
                return(result);
            }
            catch (Exception ex)
            {
                AppLogger.Error($"{ex.Message} {ex.StackTrace}");
                result.Exception.Success = false;
            }
            return(result);
        }
コード例 #2
0
        private bool CheckRecommenUser(string name, string phone, ref string err)
        {
            var result   = true;
            var userInfo = _userInfo.GeTbUserInfos(name);

            if (userInfo == null)
            {
                err    = "1";
                result = false;
            }
            if (userInfo.Count == 0)
            {
                err    = "1";
                result = false;
            }
            if (!phone.Equals(userInfo[0].Phone1))
            {
                err    = "2";
                result = false;
            }
            var findIt = _userRecommend.IsExists(name);

            if (findIt != null)
            {
                err    = "3";
                result = false;
            }
            return(result);
        }
コード例 #3
0
        public ResultPayGoods GetPayGoodsList(QueryPayGood query)
        {
            var result = new ResultPayGoods {
                Exception = new MyException(), GoodsList = new List <PayGoodsList>()
            };

            try
            {
                var realSsid = GetRealSsid(query.Ssid);
                if (string.IsNullOrEmpty(realSsid))
                {
                    throw new Exception(IndexShow.客户端被篡改.ToString());
                }
                var sessionArr = GetSession(realSsid);
                if (sessionArr == null)
                {
                    throw new Exception(IndexShow.redis失效了.ToString());
                }
                if (sessionArr.Length == 3)
                {
                    realSsid = sessionArr.GetValue(2).ToString();
                }
                var cartGo = _userCartgo.GetUserCartgoInfo(realSsid);
                if (sessionArr.Length == 3)
                {
                    var userInfo = _userInfo.GeTbUserInfos(sessionArr.GetValue(2).ToString());
                    result.Phone   = new EncryDecryPhone().Md5Decrypt(userInfo?[0].Phone1);
                    result.Address = userInfo?[0].Address;
                }
                var payFee = 0m;
                foreach (var item in cartGo)
                {
                    result.GoodsList.Add(new PayGoodsList
                    {
                        GoodsName  = item.GoodsName,
                        GoodsPrice = $"{item.CurPrice}×{item.BuyCnt}={item.TotalPrice}",
                        GoodsCode  = item.StockCode
                    });
                    payFee += item.TotalPrice;
                }
                result.PayFee            = $"{payFee}";
                result.Exception.Success = true;
            }
            catch (Exception ex)
            {
                result.Exception.Success = false;
                result.Exception.Exmsg   = ex.Message;
            }
            return(result);
        }