Beispiel #1
0
        public void Insert(PassengerParam passengerParam)
        {
            try
            {
                new HttpClientHelper(UserInfoMapping.MapToUserInfo()).Post(
                    HttpUrlHelper.Post(AppConstant.RestUrl, "Passenger", "Insert"), passengerParam);



                MapToUserInfo(passengerParam);

                var user = new User()
                {
                    Id = passengerParam.UserParam.Id,
                    IsAuthenticated = true,
                    Password        = passengerParam.UserParam.Password,
                    Language        = passengerParam.UserParam.Language,
                    Mobile          = passengerParam.UserParam.Mobile
                };
                _userRepository.Insert(user);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Beispiel #2
0
        private void MapToUserInfo(PassengerParam passengerParam)
        {
            var userInfo = UserInfo.Instance;

            userInfo.Id              = passengerParam.UserParam.Id;
            userInfo.LastName        = passengerParam.LastName;
            userInfo.FirstName       = passengerParam.FirstName;
            userInfo.Password        = passengerParam.UserParam.Password;
            userInfo.Mobile          = passengerParam.UserParam.Mobile;
            userInfo.Email           = passengerParam.Email;
            userInfo.IsAuthenticated = passengerParam.UserParam.IsAuthenticated;
            userInfo.Language        = !string.IsNullOrEmpty(passengerParam.UserParam.Language) ? passengerParam.UserParam.Language : userInfo.Language;
        }
Beispiel #3
0
 public void Edit(PassengerParam passengerParam)
 {
     new HttpClientHelper(UserInfoMapping.MapToUserInfo()).Post(HttpUrlHelper.Post(AppConstant.RestUrl, "Passenger", "Update"), passengerParam);
     //var userInfo =  GetPassengerByMobile(passengerParam.UserParam.Mobile);
     MapToUserInfo(passengerParam);
 }