public void UpdateCauHinhThamSoThietBi(CreateOrEditCauHinhThamSoThietBi input)
        {
            //We can use Logger, it's defined in ApplicationService base class.
            //Logger.Info("Update Nhom VatTu " + input);
            //Retrieving a task entity with given id using standard Get method of repositories.
            var item = _repository.Get(input.Id);

            ObjectMapper.Map(input, item);
            //Not Use Auto Mapper
            //item.MA_LOAITHUOC = input.MA_LOAITHUOC;
            //item.MOTA = input.MOTA;
            //item.TENNHOM = input.TENNHOM;
            //We even do not call Update method of the repository.
            //Because an application service method is a 'unit of work' scope as default.
            //ABP automatically saves all changes when a 'unit of work' scope ends (without any exception).
        }
        public void CreateCauHinhThamSoThietBi(CreateOrEditCauHinhThamSoThietBi input)
        {
            //We can use Logger, it's defined in ApplicationService class.
            //Logger.Info("Creating a nhom vattu for input: " + input);
            //Creating a new Task entity with given input's properties
            var item = ObjectMapper.Map <CauHinhThamSoThietBi>(input);

            //Not use AutoMapper
            //CauHinhThamSoThietBi nhomVatTu = new CauHinhThamSoThietBi()
            //{
            //    TENNHOM = input.TENNHOM,
            //    MA_LOAITHUOC = input.MA_LOAITHUOC,
            //    MOTA = input.MOTA
            //};
            //Saving entity with standard Insert method of repositories.
            _repository.Insert(item);
        }
 public void CreateOrEditByIdThietBi(CreateOrEditCauHinhThamSoThietBi input)
 {
     try
     {
         if (input.Id == 0)
         {
             try
             {
                 var item = ObjectMapper.Map <CauHinhThamSoThietBi>(input);
                 _repository.Insert(item);
             }catch (Exception ex)
             {
             }
         }
         else
         {
             var item = _repository.Get(input.Id);
             ObjectMapper.Map(input, item);
         }
     }
     catch (Exception ex)
     {
     }
 }