<?php
/**
 * Descriptions
 * @author yzxh24
 * @email yzxh24@gmail.com
 * @created 2012-02-02 14:00:06
 */
class UpdateAction extends BaseAction
{
    public function run()
    {
        //put your code here
        $model = BookManage::model()->findByPk(Yii::app()->request->getQuery('id'));

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

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