<?php
/**
 * Descriptions
 * @author yzxh24
 * @email yzxh24@gmail.com
 * @created 2010-07-12 13:51:25
 */
class UpdateAction extends BaseAction
{
    public function run()
    {
        //put your code here
        $model = Sale::model()->findByPk($_GET['id']);

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

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

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