レコードの作成(C =作成)、データベースからのレコードデータの読み取り(R =読み取り)、データベースからのレコードの更新(U =更新)、および削除に使用できる簡単なフォームを作成したいと思います。データベースからのレコード(D =削除)。ExtJSの例のようにPHPを使用したくありません。ASP.NETでWCFまたはHTTPハンドラー(* .ashxファイル)を使用したいと思います。誰かがこれのコードを手伝ってくれますか?データベースアクセスの詳細は必要ありません。クライアントコードの側面と、サーバーコードメソッドで使用する必要のあるパラメーターと戻り値のタイプを取得するのに苦労しています。
このアーキテクチャを模倣したいのですが、Ext JSクライアントコードを使用します:http: //www.codeproject.com/Articles/283976/CRUD-Create-Read-Update-Delete
また、WCFを選択した場合、SOAPではなくRESTを使用しています:http:
//www.dotnetcurry.com/ShowArticle.aspx? ID = 728
Amazon.comでWebアプリケーション用のExtJS4クックブックを注文しましたが、2か月間入荷待ちです。
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>...</title>
<!-- ExtJS -->
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<script type="text/javascript" src="../../ext-all.js"></script>
<!-- Shared -->
<link rel="stylesheet" type="text/css" href="../shared/example.css" />
<!-- GC -->
<!-- Example -->
<script type="text/javascript" src="dynamic.js"></script>
</head>
<body>
<h1>CRUD example with Ext JS 4 dynamic form</h1>
</body>
</html>
JavaScript
Ext.require([
//'Ext.form.*',
//'Ext.layout.container.Column',
//'Ext.tab.Panel'
'*'
]);
Ext.onReady(function () {
Ext.QuickTips.init();
var bd = Ext.getBody();
/*
* ================ Simple form =======================
*/
bd.createChild({ tag: 'h2', html: 'Form 1 - Very Simple' });
var required = '<span style="color:red;font-weight:bold" data-qtip="Required">*</span>';
var simple = Ext.widget({
xtype: 'form',
layout: 'form',
collapsible: true,
id: 'simpleForm',
url: 'save-form.php',
frame: true,
title: 'Simple Form',
bodyPadding: '5 5 0',
width: 350,
fieldDefaults: {
msgTarget: 'side',
labelWidth: 75
},
defaultType: 'textfield',
items: [{
fieldLabel: 'First Name',
afterLabelTextTpl: required,
name: 'first',
allowBlank: false
}, {
fieldLabel: 'Last Name',
afterLabelTextTpl: required,
name: 'last'
}, {
fieldLabel: 'Company',
name: 'company'
}, {
fieldLabel: 'Email',
afterLabelTextTpl: required,
name: 'email',
vtype: 'email'
}, {
fieldLabel: 'DOB',
name: 'dob',
xtype: 'datefield'
}, {
fieldLabel: 'Age',
name: 'age',
xtype: 'numberfield',
minValue: 0,
maxValue: 100
}, {
xtype: 'timefield',
fieldLabel: 'Time',
name: 'time',
minValue: '8:00am',
maxValue: '6:00pm'
}],
buttons: [{
text: 'Save'
}, {
text: 'Cancel'
}]
});
simple.render(document.body);
});