public function actionDelete($id)
 {
     if (!Unitofmeasure::isUnitofmeasureInUseById(intval($id))) {
         $unitofmeasures = Unitofmeasure::GetById(intval($id));
         ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($unitofmeasures);
         $unitofmeasures->delete();
     } else {
         Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'Not possible to delete. Unit Of Measure is already in use'));
     }
     $this->redirect(array($this->getId() . '/index'));
 }