Improve Event management
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user