Example #1
0
        public Response saveCustomer([FromBody] User user)
        {
            var apiLoginClient = new Response {
                IsSuccess = false, Message = "Failed"
            };
            var retVal = (new JukeBox.BLL.Account()).SaveCustomer(
                new JukeBox.Data.Customer {
                FirstName        = user.FirstName,
                LastName         = user.LastName,
                CellPhone        = user.Telephone,
                DateCreated      = DateTime.Now,
                Email            = user.Email,
                BalanceAvailable = user.BalanceAvailable,
                CustomerID       = user.UserId,
                ClientPassword   = user.Password,
                ImageFilePath    = user.ImagePath
            });

            if (retVal == "Success")
            {
                apiLoginClient.IsSuccess = true;
                apiLoginClient.Message   = retVal;

                return(apiLoginClient);
            }
            apiLoginClient.IsSuccess = false;
            apiLoginClient.Message   = retVal;
            return(apiLoginClient);
        }
Example #2
0
        public User GeCustomer(UserRequest userRequest)
        {
            var apiLoginClient = new User();
            var clientId       = Convert.ToInt32(userRequest.ClientId);
            var retVal         = (new JukeBox.BLL.Account()).GetCustomerById(clientId);

            if (retVal != null)
            {
                apiLoginClient.Bind(retVal);
            }
            return(apiLoginClient);
        }