or
Help me please with a code sample , if you can .
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
//[AuthenticatingHeader]
public
partial
class
Account
{
[WebInvoke(Method =
"POST"
, UriTemplate =
"DeleteAccount?uniqueaccessid={uniqueaccessid}"
, BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat =
WebMessageFormat.Json)]
public
static
void
DeleteAccount(
string
uniqueaccessid,
string
accountId)
{
int
userid = Accessibility.GetUserId();
if
(userid > 0)
{
string
output = Tools.ServiceLayer.Account.DeleteAccount(Convert.ToInt32(accountId), Convert.ToInt32(userid)).ToString();
HttpContext.Current.Response.ContentType =
"application/json; charset=utf-8"
;
HttpContext.Current.Response.Write(output);
}
}
}
function
GetTransactionAccount(uniqueaccessid, accountId) {
var
jData = {};
jData.uniqueaccessid = uniqueaccessid;
jData.accountId = accountId;
$.ajax({
url: RestBaseURL +
"Account/"
DeleteAccount?uniqueaccessid=
" + uniqueaccessid + "
",
data: JSON.stringify(jData),
dataType:
"json"
,
type:
"POST"
,
async:
false
,
contentType:
"application/json; charset=utf-8"
,
cache:
false
,
success:
function
(response) {
alert(response);
},
failure:
function
() { alert(
"failed"
); }
});
}
var
changeaccid;
function
GetAccountInfo(uniqueaccessid) {
var
accid;
var
dataSourceobj =
new
kendo.data.DataSource({
transport: {
read:{
url:RestBaseURL +
"Cash/GetAccountInfo?uniqueaccessid="
+ uniqueaccessid +
""
,
dataType:
"json"
,
type:
"POST"
},
destroy:{
url: RestBaseURL +
"Account/DeleteAccount?uniqueaccessid="
+ uniqueaccessid ,
//url: RestBaseURL + "Account/DeleteAccount",
dataType:
"json"
,
type:
"POST"
},
parameterMap:
function
(options, type) {
if
(type ==
"destroy"
) {
return
{
'uniqueaccessid'
: uniqueaccessid,
'accountId'
: options.models[0].id
};
}
}
},
batch:
true
,
pageSize: 10,
schema: {
type:
"json"
,
model: {
fields: {
id : {type:
"number"
},
lender: { type:
"string"
},
id: { type:
"string"
},
rate: { type:
"number"
},
startingbalance: { type:
"number"
},
emergencyfund: { type:
"number"
},
startingdate: { type:
"date"
},
balance: { type:
"number"
}
}
}
}
});
$(
"#grid2"
).kendoGrid({
dataSource: dataSourceobj,
height: 130,
selectable:
"multiple"
,
change:
function
() {
changeaccid =
this
.dataItem(
this
.select()).id;
},
sortable:
true
,
resizable:
true
,
reorderable:
true
,
filterable:
true
,
columnMenu:
true
,
pageable:
true
,
columns: [
{ title:
""
,template: "<img src=
'images/ico/acc_on.png'
title='Green: Consider
for
Debt eliminator payoff. Red: Not consider
for
Debt eliminator payoff'/>
",width: "
25px"},
{ title:
"Id"
,field:
"id"
,width:
"30px"
},
{ title:
"Bank Name"
,field:
"lender"
,width:
"185px"
},
{ title:
"A/C Number"
,field :
"accountnumber"
,width:
"90px"
},
{ title:
"Interest Rate%"
,field:
"rate"
,format:
"{0:N}"
,width:
"110px"
},
{ title:
"Beg. Balance"
,field:
"startingbalance"
, format:
"{0:c}"
,width:
"95px"
},
{ title:
"Emerg. Fund"
,field:
"emergencyfund"
, format:
"{0:c}"
,width:
"95px"
},
{ title:
"Opening Date"
,field:
"startingdate"
,template:
'#= kendo.toString(startingdate,"MM/dd/yyyy") #'
,width:
"100px"
},
{ title:
"Balance"
, field:
"balance"
, format:
"{0:c}"
,width:
"70px"
},
//{ title:"Action", template: "<img src='images/ico/edit.png' title='Edit'/><img src='images/ico/delete.png'
title=
'Delete'
/>
",width: "
50px"}],
{title:
"Action"
, command: [
"edit"
,
"destroy"
], width:
"130px"
}],
editable:
"inline"
});
}
@(
Html.Kendo().Grid(Model)
.Name("Grid")
.ClientDetailTemplateId("inventoryTemplate")
.DataSource(ds => ds.Ajax()
.PageSize(200) // or .PageSize(20) if iPad
.Model(m =>
{
m.Id(p => p.StockID);
})
.Read(r => r.Action("Read", "Home"
))
)