Exemple #1
0
        private void Create(ThietBiKemTheoInput tbktInput)
        {
            var tbktEntity = ObjectMapper.Map <ThietBiKemTheo>(tbktInput);

            SetAuditInsert(tbktEntity);
            tbktRepository.Insert(tbktEntity);
            CurrentUnitOfWork.SaveChanges();
        }
Exemple #2
0
 public void CreateOrEditThietBiKemTheo(ThietBiKemTheoInput tbktInput)
 {
     if (tbktInput.Id == 0)
     {
         Create(tbktInput);
     }
     else
     {
         Update(tbktInput);
     }
 }
Exemple #3
0
        private void Update(ThietBiKemTheoInput tbktInput)
        {
            var tbktEntity = tbktRepository.GetAll().Where(x => !x.IsDelete).SingleOrDefault(x => x.Id == tbktInput.Id);

            if (tbktEntity == null)
            {
            }
            ObjectMapper.Map(tbktInput, tbktEntity);
            SetAuditEdit(tbktEntity);
            tbktRepository.Update(tbktEntity);
            CurrentUnitOfWork.SaveChanges();
        }
Exemple #4
0
 public void CreateOrEditThietBiKemTheo([FromBody] ThietBiKemTheoInput input)
 {
     tbktAppService.CreateOrEditThietBiKemTheo(input);
 }