private void Create(TaiSanInput taiSanInput) { var taiSanEntity = ObjectMapper.Map <TaiSan>(taiSanInput); SetAuditInsert(taiSanEntity); taiSanRepository.Insert(taiSanEntity); CurrentUnitOfWork.SaveChanges(); }
public void CreateOrEditTaiSan(TaiSanInput taiSanInput) { if (taiSanInput.Id == 0) { Create(taiSanInput); } else { Update(taiSanInput); } }
private void Update(TaiSanInput taiSanInput) { var taiSanEntity = taiSanRepository.GetAll().Where(x => !x.IsDelete).SingleOrDefault(x => x.Id == taiSanInput.Id); if (taiSanEntity == null) { } ObjectMapper.Map(taiSanInput, taiSanEntity); SetAuditEdit(taiSanEntity); taiSanRepository.Update(taiSanEntity); CurrentUnitOfWork.SaveChanges(); }
public void CreateOrEditTaiSan([FromBody] TaiSanInput input) { taiSanAppservice.CreateOrEditTaiSan(input); }