예제 #1
0
 public HttpResponseMessage SaveSolutionAcLoadDetail(ACLoadDto acLoadDto)
 {
     return(CreateHttpResponse(() =>
     {
         return Request.CreateResponse(_solutionLoadProcessor.SaveSolutionACLoad(acLoadDto, UserID, UserName));
     }));
 }
예제 #2
0
 public ACLoadDto SaveSolutionACLoad(ACLoadDto acLoadDto, string userID, string userName)
 {
     if (acLoadDto.ID == 0)
     {
         return(AddSolutionACLoad(acLoadDto, userID, userName));
     }
     else
     {
         return(UpdateSolutionACLoad(acLoadDto, userID, userName));
     }
 }
예제 #3
0
        private ACLoadDto UpdateSolutionACLoad(ACLoadDto acLoadDto, string userID, string userName)
        {
            var solutionLoad = _acLoadRepository.Find(acLoadDto.ID);

            _addAcLoadDtoToEntityMapper.UpdateMap(acLoadDto, solutionLoad, userID, userName);

            solutionLoad.ModifiedDateTime = DateTime.UtcNow;
            solutionLoad.ModifiedBy       = userName;

            var solutionLoadDetail = _acLoadRepository.Update(solutionLoad);

            _acLoadRepository.Commit();

            return(new ACLoadDto
            {
                ID = solutionLoadDetail.ID,
                Description = solutionLoadDetail.Description
            });
        }