コメント |
[[手順1]]
@DIV
※ 更新用の SQL を作成している部分の変更
※ 更新前に存在チェックしている SELECT 文に、削除フラグの処理を追加する
A) @C:red(修正)
@DIV
$upd->set( 'update 商品マスタ' );
$upd->set( 'set' );
$upd->set( '商品名', $_POST['sname'], 1 );
$upd->add( '商品区分', $_POST['In24'], 1 );
$upd->add( '更新日', 'sysdate', 3 );
$upd->add( '在庫評価単価', $_POST['In25'], 2 );
$upd->add( '販売単価', $_POST['In26'], 2 );
$upd->add( '商品分類', $_POST['In27'], 1 );
$upd->add( '備考', $_POST['In29'], 1 );
$upd->set( 'where 商品コード',$_POST['scode'], 1 );
@END
※ 管理者と商品分類では参照時の仕様が違うので、余計なイベントをとりあえず外して処理する
@DIV
<INPUT
<?= $READONLY ?>
type=text
name=In27
value="<?= $_POST['In27'] ?>"
maxlength="3"
size="5"
onKeydown='nextField("In28");'
> <SPAN style='color:silver'>(In27)</SPAN>
@END
B) @C:red(新規)
@DIV
$upd->set('insert into 商品マスタ');
$upd->set('(商品コード');
$upd->add( '商品名' );
$upd->add( '商品区分' );
$upd->add( '作成日' );
$upd->add( '更新日' );
$upd->add( '在庫評価単価' );
$upd->add( '販売単価' );
$upd->add( '商品分類' );
$upd->add( '備考' );
$upd->set( ')' );
$upd->set( ' values(' );
$upd->set( $_POST['scode'], 1 );
$upd->add( $_POST['sname'], 1 );
$upd->add( $_POST['In24'], 1 );
$upd->add( 'sysdate', 3 );
$upd->add( 'sysdate', 3 );
$upd->add( $_POST['In25'], 2 );
$upd->add( $_POST['In26'], 2 );
$upd->add( $_POST['In27'], 1 );
$upd->add( $_POST['In29'], 1 );
$upd->set( ')' );
@END
C) @C:red(削除)
@DIV
$upd->set( 'update 商品マスタ' );
$upd->set( 'set' );
$upd->set( "削除フラグ = 'D'");
$upd->set( 'where 商品コード',$_POST['scode'], 1 );
@END
@END |