Improve Event management

This commit is contained in:
Roland Schneider
2019-01-15 07:28:43 +01:00
parent e3b6bc08a7
commit 8decd1bc79
15 changed files with 695 additions and 278 deletions

View File

@@ -110,12 +110,12 @@ class EventController extends Controller
* @param integer $id
* @return mixed
* @throws NotFoundHttpException
* @throws \yii\db\StaleObjectException
* @throws \yii\db\Exception
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
$manager = new EventRegistrationManager();
$manager->deleteEvent($this->findModel($id));
return $this->redirect(['index']);
}
@@ -141,12 +141,35 @@ class EventController extends Controller
throw $ex;
}
}
/**
* @param $id
* @return \yii\web\Response
* @throws \yii\db\Exception
*/
public function actionDeleteRegistration($id)
{
$eventRegistrationManager = new EventRegistrationManager();
$db = \Yii::$app->db;
$tx = $db->beginTransaction();
try{
$registration = $eventRegistrationManager->loadRegistration($id);
$eventRegistrationManager->deleteRegistration($registration);
$tx->commit();
return $this->redirect(['view', 'id' => $registration->id_event]);
}catch (\Exception $ex){
$tx->rollBack();
throw $ex;
}
}
/**
* @param $id
* @return string|\yii\web\Response
* @throws NotFoundHttpException
* @throws \yii\db\Exception
*/
public function actionRegisterCard($id)
public function actionReserveCard($id)
{
$event = $this->findModel($id);