Пример #1
0
        public BaseResponseModel <LoginOutPut> UserLogin(LoginModel loginModel)
        {
            string      errMsg      = string.Empty;
            LoginOutPut loginOutPut = new LoginOutPut();

            try
            {
                //验证提交数据合法性
                UserDataLegalityVerification(loginModel);
                loginOutPut = userService.UserLogin(loginModel);
            }
            catch (VerificationException ex)
            {
                loginOutPut.remindMsg = ex.Message;
            }
            catch (OperationException ex)
            {
                errMsg = ex.Message;
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
            }
            return(ResponsePack.Responsing(loginOutPut, errMeassage: errMsg));
        }
        public BaseResponseModel <OrderSubmitDto> SubmitOrderByCart(OrderSubmitInputDto orderSubmitInputDto)
        {
            OrderSubmitDto submitDto = new OrderSubmitDto();
            string         errMsg    = string.Empty;

            try
            {
                submitDto = orderService.SubmitOrderByCart(userDataContent.userID, orderSubmitInputDto.IDs, orderSubmitInputDto.ifSumbitAll);
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
            }
            return(ResponsePack.Responsing(submitDto, errMsg));
        }
        /// <summary>
        /// 获取商品数据 通过分类CD
        /// </summary>
        /// <param name="categoryCD"></param>
        /// <returns></returns>
        public BaseResponseModel <GoodsDataOutput> GetGoodsByCategoryCD(string categoryCD)
        {
            string          errMsg = string.Empty;
            GoodsDataOutput result = null;

            try
            {
                result = goodsService.GetGoodsByCategoryCD(categoryCD);
            }
            catch (VerificationException ex)
            {
                errMsg = ex.Message;
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
            }
            return(ResponsePack.Responsing(result, errMsg));
        }
        public BaseResponseModel <GoodsDetailOutput> GetGoodsDetail(int ID)
        {
            string            errMsg            = string.Empty;
            GoodsDetailOutput goodsDetailOutput = null;

            try
            {
                goodsDetailOutput = goodsService.GetGoodsDetail(ID);
            }
            catch (VerificationException ex)
            {
                errMsg = ex.Message;
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
            }

            return(ResponsePack.Responsing(goodsDetailOutput, errMsg));
        }
Пример #5
0
        public BaseResponseModel <bool> SendVerificationCode(string mobile)
        {
            bool   result = false;
            string errMsg = string.Empty;

            try
            {
                if (!IsMobilePhone(mobile))
                {
                    throw new VerificationException("手机号码不合法.");
                }
                result = SystemService.SendVerificationCode(mobile);
            }
            catch (VerificationException ex)
            {
                errMsg = ex.Message;
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
            }
            return(ResponsePack.Responsing(result, errMeassage: errMsg));
        }
 public BaseResponseModel <bool> RemoveCart(RemoveCartInput removeCartInput)
 {
     return(ResponsePack.Responsing(orderService.RemoveCart(userDataContent.userID, removeCartInput.goodsID, removeCartInput.ifRemoveAll)));
 }
 public BaseResponseModel <bool> AddToCart(AddCartInput addCart)
 {
     return(ResponsePack.Responsing(orderService.ADDToCart(userDataContent.userID, addCart.goodsID, addCart.goodsCount)));
 }
 public BaseResponseModel <OrderCartDto> GetUserCart()
 {
     return(ResponsePack.Responsing(orderService.GetUserCart(userDataContent.userID)));
 }
 public BaseResponseModel <OrderDataDto> GetOrderDetail(int baseID)
 {
     return(ResponsePack.Responsing(orderService.GetOrderDetail(baseID)));
 }
 public BaseResponseModel <List <OrderDataDto> > GetGetOrderList(string type)
 {
     return(ResponsePack.Responsing(orderService.GetOrderList(userDataContent.userID, type)));
 }
Пример #11
0
        public BaseResponseModel <AddressOutput> GetUserAddress()
        {
            var result = userService.GetAddress(userDataContent.userID);

            return(ResponsePack.Responsing(result));
        }
Пример #12
0
        public BaseResponseModel <UserDataOutput> GetUserData()
        {
            var user = userService.GetUser(userDataContent.userID);

            return(ResponsePack.Responsing(user));
        }
Пример #13
0
        public BaseResponseModel <bool> DeleteUserAddress(int addressID)
        {
            var result = userService.UserDeleteAddress(addressID, userDataContent.userID);

            return(ResponsePack.Responsing(result));
        }
Пример #14
0
        public BaseResponseModel <bool> ChangeUserAddress(UserAddress userAddress)
        {
            var result = userService.UserUpdateAddress(userAddress, userDataContent.userID);

            return(ResponsePack.Responsing(result));
        }