public function actionCreate()
 {
     $model = new Localidad();
     if (isset($_POST['Localidad'])) {
         $model->setAttributes($_POST['Localidad']);
         $model->nombre = strtoupper($model->nombre);
         if (isset($_POST['Localidad']['idprovincia0'])) {
             $model->idprovincia0 = $_POST['Localidad']['idprovincia0'];
         }
         try {
             if ($model->save()) {
                 $this->setFlash('notice', array('title' => 'Mensaje', 'content' => 'Se grabó correctamente.'));
                 $this->redirect(array('manage'));
             }
         } catch (Exception $e) {
             $model->addError('', $e->getMessage());
         }
     } elseif (isset($_GET['Localidad'])) {
         $model->attributes = $_GET['Localidad'];
     }
     $this->render('create', array('model' => $model));
 }