/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     //if (Yii::app()->user->checkAccess('AgendaCitasCedi_TiposFabricante_Crear')) {
     $model = new TiposFabricante();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     $fecha = strftime("%Y-%m-%d-%H-%M-%S", time());
     $model->FechaGraba = $fecha;
     $model->FechaModifica = $fecha;
     $model->IdUsuarioGraba = Yii::app()->user->id;
     $model->IdUsuarioModifica = Yii::app()->user->id;
     if (isset($_POST['TiposFabricante'])) {
         $model->attributes = $_POST['TiposFabricante'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->IdTipoFabricante));
         }
     }
     $this->render('create', array('model' => $model));
     /*} else {
               $this->render('//site/error', array(
               'code' => '101',
               'message' => Yii::app()->params ['accessError']
               ));
       }*/
 }