function CoursewareOffShelf(o) {
alert(o.id);
$.ajax(
{
type: "post",
url: "AjaxCoursewareOffShelf.aspx",
data: {
"ApplicationId": o.id,
"ApplicationTypeId":2
},
success: function (data, textStatus)
{
var j = eval(data);
$.each(j, function (i, item) {
var count = item.count;
if (count > 0) {
var _mkingCount = $('#<%=lbShelfed.ClientID %>').html();
var _mkingCurrentCount = (_mkingCount - 1);
$('#<%=lbShelfed.ClientID %>').html(_mkingCurrentCount);
divShelfed_click();
}
else {
alert("课件下架申请失败!");
}
})
},
complete: function (XMLHttpRequest, textStatus)
{
//HileLoading();
},
error: function () {
//alert("请求出错");
}
});
}
AjaxCoursewareOffShelf.aspx:
Response.ContentType ="application/json";
int count = -1;
string ApplicationId = (Request["ApplicationId"] == null || Request["ApplicationId"] == "") ? null : Request["ApplicationId"];
string ApplicationTypeId = (Request["ApplicationTypeId"] == null || Request["ApplicationTypeId"] == "") ? null : Request["ApplicationTypeId"];
if (ApplicationTypeId != null && ApplicationId != null)
{
int _applicationId = Convert.ToInt32(ApplicationId);
int _applicationTypeId = Convert.ToInt32(ApplicationTypeId);
EProductApplicationBLL ebl = new EProductApplicationBLL();
count=ebl.OffShelfApplication(_applicationId, _applicationTypeId);
}
Response.Write("[{ \"count\":\"" + count.ToString() + "\"}]");
alert(o.id);
$.ajax(
{
type: "post",
url: "AjaxCoursewareOffShelf.aspx",
data: {
"ApplicationId": o.id,
"ApplicationTypeId":2
},
success: function (data, textStatus)
{
var j = eval(data);
$.each(j, function (i, item) {
var count = item.count;
if (count > 0) {
var _mkingCount = $('#<%=lbShelfed.ClientID %>').html();
var _mkingCurrentCount = (_mkingCount - 1);
$('#<%=lbShelfed.ClientID %>').html(_mkingCurrentCount);
divShelfed_click();
}
else {
alert("课件下架申请失败!");
}
})
},
complete: function (XMLHttpRequest, textStatus)
{
//HileLoading();
},
error: function () {
//alert("请求出错");
}
});
}
AjaxCoursewareOffShelf.aspx:
Response.ContentType ="application/json";
int count = -1;
string ApplicationId = (Request["ApplicationId"] == null || Request["ApplicationId"] == "") ? null : Request["ApplicationId"];
string ApplicationTypeId = (Request["ApplicationTypeId"] == null || Request["ApplicationTypeId"] == "") ? null : Request["ApplicationTypeId"];
if (ApplicationTypeId != null && ApplicationId != null)
{
int _applicationId = Convert.ToInt32(ApplicationId);
int _applicationTypeId = Convert.ToInt32(ApplicationTypeId);
EProductApplicationBLL ebl = new EProductApplicationBLL();
count=ebl.OffShelfApplication(_applicationId, _applicationTypeId);
}
Response.Write("[{ \"count\":\"" + count.ToString() + "\"}]");