public bool UpdateUnit(UnitMasterVM unitVM)
 {
     try
     {
         if (unitVM != null)
         {
             tblUnitMaster unit = _UnitRepository.GetById(unitVM.UnitId);
             unit.Unit         = unitVM.Unit;
             unit.abbreviation = unitVM.abbreviation;
             unit.UnitId       = unitVM.UnitId;
             unit.IsDeleted    = false;
             _UnitRepository.Update(unit);
             _unitOfWork.Complete();
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public bool DeleteUnit(int id)
 {
     try
     {
         tblUnitMaster unit = _UnitRepository.GetById(id);
         unit.IsDeleted = true;
         _UnitRepository.Update(unit);
         _unitOfWork.Complete();
         return(true);
     }
     catch (Exception e)
     {
         throw e;
     }
 }