public void UpdateUsedGood(UsedGoodViewModel usedGood)
 {
     UsedGood entity = _usedGoodRepository.GetById<int>(usedGood.Id);
     Map(usedGood, entity);
     _usedGoodRepository.Update(entity);
     _unitOfWork.SaveChanges();
 }
 public void InsertUsedGood(UsedGoodViewModel usedGood)
 {
     usedGood.Status = (int)DbConstant.DefaultDataStatus.Active;
     UsedGood entity = new UsedGood();
     Map(usedGood, entity);
     _usedGoodRepository.Add(entity);
     _unitOfWork.SaveChanges();
 }
 public void DeleteUsedGood(UsedGoodViewModel usedGood)
 {
     UsedGood selectedUsedGood = _usedGoodRepository.GetById<int>(usedGood.Id);
     _usedGoodRepository.Delete(selectedUsedGood);
     _unitOfWork.SaveChanges();
 }
 public override void RefreshDataView()
 {
     if (!bgwMain.IsBusy)
     {
         MethodBase.GetCurrentMethod().Info("Fecthing UsedGood data...");
         _selectedUsedGood = null;
         FormHelpers.CurrentMainForm.UpdateStatusInformation("Memuat data barang bekas...", false);
         bgwMain.RunWorkerAsync();
     }
 }