예제 #1
0
        private void Create(LeasedAssetInput leasedAssetInput)
        {
            var leasedAssetEntity = ObjectMapper.Map <LeasedAsset>(leasedAssetInput);

            SetAuditInsert(leasedAssetEntity);
            leasedAssetRepository.Insert(leasedAssetEntity);
            CurrentUnitOfWork.SaveChanges();
        }
예제 #2
0
 public void CreateOrEditLeasedAsset(LeasedAssetInput leasedAssetInput)
 {
     if (leasedAssetInput.Id == 0)
     {
         Create(leasedAssetInput);
     }
     else
     {
         Update(leasedAssetInput);
     }
 }
예제 #3
0
        private void Update(LeasedAssetInput leasedAssetInput)
        {
            var leasedAssetEntity = leasedAssetRepository.GetAll().Where(x => !x.IsDelete).SingleOrDefault(x => x.Id == leasedAssetInput.Id);

            if (leasedAssetEntity == null)
            {
            }
            ObjectMapper.Map(leasedAssetInput, leasedAssetEntity);
            SetAuditEdit(leasedAssetEntity);
            leasedAssetRepository.Update(leasedAssetEntity);
            CurrentUnitOfWork.SaveChanges();
        }
예제 #4
0
 public void CreateOrEditLeasedAsset([FromBody] LeasedAssetInput input)
 {
     leasedAssetAppService.CreateOrEditLeasedAsset(input);
 }