<?php
/**
 * Descriptions
 * @author yzxh24
 * @email yzxh24@gmail.com
 * @created 2011-10-08 15:55:29
 */
class UpdateAction extends BaseAction
{
    public function run()
    {
        //put your code here
        $model = $this->getController()->loadModel();

		// Uncomment the following line if AJAX validation is needed
		// $this->performAjaxValidation($model);

		if(isset($_POST['SoftContent']))
		{
			$model->attributes = $_POST['SoftContent'];
			if($model->save())
            {
				$this->getController()->redirect(array('list'));
            }
		}

        $platform = SoftPlatform::model()->findAll();
        $category = SoftCategory::model()->findAll(array('condition'=>'pid='.$model->type));

		$this->getController()->render('update',array(
			'model'=>$model,
            'platform' => $platform,
            'category' => $category,
		));
    }
}