bookManageAdd: function () {
top.MainFrameJS.confirm = true;
var action = getQueryString("Action");
var url = "";
if (action == "add") {
url = "../BookManage/BookManageListAdd";
}
if (action == "edit") {
var id = getQueryString("ID");
url = "../BookManage/BookManageListUpdate?ID=" + id;
}
//日期只输入空格问题--暂时处理
if ($("#PublisherDate").datebox("getValue").indexOf(" ") != -1) {
showTipsMsg('出版日期必须为日期格式', 4000, 'w');
return false;
}
var PostParam = { 'BOOKMANAGE': JSON.stringify({
'NAME': escape($("#Name").val()),
'UNITNAMEID': $("#UnitName").combotree('getValue'),
'UNITNAME': $("#UnitName").combotree('getText'),
'TYPE': $("#Type").val(),
'AUTHOR': $("#Author").val(),
'ISBN': $("#ISBN").val(),
'PUBLISHER': $("#Publisher").val(),
'PUBLISHERDATE': $("#PublisherDate").datebox("getValue"),
'STORAGE': $("#Storage").val(),
'Number': $("#Number").val(),
'PRICE': $("#Price").val(),
'NUMBERRODUCTION': $("#Numberroduction").val(),
'LENDINGID': $("#LendingId").val(),
'LENDINGNAME': $("#LendingName").val(),
'STATUS': $("#Status").combobox('getValue'),
'BORROWERS': $("#Borrowers").val(),
'REMARK': $("#Remark").val()
})
}
getDataAsync(url,
"POST",
//{ 'BOOKMANAGE': JSON.stringify(BookManage.vmbook.data.$model) }
PostParam
,
function (Result) {
var obj = eval(Result);
if (obj == true) {
showTipsMsg('提交成功!', 4000, 's');
top.MainFrameJS.confirm = true;
top.MainFrameJS.closeWindow();
}
else {
showTipsMsg('提交失败!', 4000, 'e');
top.MainFrameJS.confirm = false;
}
}
);
},
/// <returns></returns>
public string BookManageListAdd()
{
BOOKMANAGE BOOKMANAGE = new BOOKMANAGE();
BOOKMANAGE = (BOOKMANAGE)JsonConvert.DeserializeObject(this.Request["BOOKMANAGE"].ToString(), typeof(BOOKMANAGE));
BOOKMANAGE.ID = Guid.NewGuid().ToString();
BOOKMANAGE.NAME = Server.UrlDecode(BOOKMANAGE.NAME);
BOOKMANAGE.UNITNAMEID = Server.UrlDecode(BOOKMANAGE.UNITNAMEID);
BOOKMANAGE.UNITNAME = Server.UrlDecode(BOOKMANAGE.UNITNAME);
BOOKMANAGE.TYPE = Server.UrlDecode(BOOKMANAGE.TYPE);
BOOKMANAGE.AUTHOR = Server.UrlDecode(BOOKMANAGE.AUTHOR);
BOOKMANAGE.ISBN = Server.UrlDecode(BOOKMANAGE.ISBN);
BOOKMANAGE.PUBLISHER = Server.UrlDecode(BOOKMANAGE.PUBLISHER);
BOOKMANAGE.PUBLISHERDATE = Server.UrlDecode(BOOKMANAGE.PUBLISHERDATE);
BOOKMANAGE.STORAGE = Server.UrlDecode(BOOKMANAGE.STORAGE);
BOOKMANAGE.Number = Server.UrlDecode(BOOKMANAGE.Number);
BOOKMANAGE.PRICE = Server.UrlDecode(BOOKMANAGE.PRICE);
BOOKMANAGE.NUMBERRODUCTION = Server.UrlDecode(BOOKMANAGE.NUMBERRODUCTION);
BOOKMANAGE.LENDINGID = Server.UrlDecode(BOOKMANAGE.LENDINGID);
BOOKMANAGE.LENDINGNAME = Server.UrlDecode(BOOKMANAGE.LENDINGNAME);
BOOKMANAGE.STATUS = Server.UrlDecode(BOOKMANAGE.STATUS);
BOOKMANAGE.BORROWERS = Server.UrlDecode(BOOKMANAGE.BORROWERS);
BOOKMANAGE.REMARK = Server.UrlDecode(BOOKMANAGE.REMARK);
BOOKMANAGE.USERNAME = UserData.GetUser().UserId;
BOOKMANAGE.REALNAME = UserData.GetUser().UserName;
BOOKMANAGE.RESPON = UserData.GetUser().RoleId;
BOOKMANAGE.RESPONID = UserData.GetUser().RoleId;
BOOKMANAGE.UNIT = UserData.GetUser().DepartmentName;
BOOKMANAGE.UNITID = UserData.GetUser().DepartmentId;
BOOKMANAGE.NOWTIMES = DateTime.Now;
BOOKMANAGE.QXSTRING = null;
bool IsSucess = BookManageBLL.BookManageAdd(BOOKMANAGE);
return JsonConvert.SerializeObject(IsSucess);
}