예제 #1
0
        /// <summary>
        /// Saves the basic details.
        /// </summary>
        /// <param name="basicDetailViewModel">The basic detail view model.</param>
        /// <returns>returns true or false </returns>
        public bool SaveBasicDetails(BasicDetailViewModel basicDetailViewModel)
        {
            UserModel userModel = new UserModel();

            if (basicDetailViewModel != null)
            {
                userModel.Id         = basicDetailViewModel.UserId;
                userModel.LanguageId = basicDetailViewModel.LanguageID;
            }

            return(this.syngentaSIPUnitOfWork.UserRepository.SaveBasicDetails(userModel));
        }
예제 #2
0
        public HttpResponseMessage SaveBasicDetails(BasicDetailViewModel basicDetailViewModel)
        {
            basicDetailViewModel.UserId = this.UserId;
            if (ModelState.IsValid)
            {
                var isRecordSaved = false;
                isRecordSaved = this.UserService.SaveBasicDetails(basicDetailViewModel);
                if (isRecordSaved)
                {
                    return(Request.CreateResponse(
                               HttpStatusCode.OK,
                               new ResponseModel()
                    {
                        TimeStamp = DateTime.UtcNow,
                        Message = "Successfully saved"
                    }));
                }
            }
            else
            {
                return(Request.CreateResponse(
                           HttpStatusCode.BadRequest,
                           new ResponseModel()
                {
                    TimeStamp = DateTime.UtcNow,
                    Message = "User Data id inaquate"
                }));
            }

            return(Request.CreateResponse(
                       HttpStatusCode.ExpectationFailed,
                       new ResponseModel()
            {
                TimeStamp = DateTime.UtcNow,
                Message = "user Basic details failed"
            }));
        }