前臺選擇
function Resultdata2(jsondata) { var listRecord = new Array(); if (jsondata instanceof Ext.data.Store) { Ext.each(jsondata.data.items, function (record) {
listRecord.push(record.data);
}); }//decode return Ext.encode(listRecord); } 提交代碼
var selectedRecords = contract_selectItem_gridBudget.getSelections();
var storedata = Resultdata2(selectedRecords); Ext.Ajax.request({ url: 'AjaxPage/WooYuSuan/ContYusuanManager.aspx?cmd=savedata', method: 'POST', params: { contId: contract_htbuild_gethtid, data: storedata },
success: function (response, options) { if (response.responseText = "OK") { Ext.MessageBox.hide(); woo.util.wooAlert("保存成功!"); _store.reload(); } } }) //后臺代碼
var Rows = PageUtility.GetRequestString("data");
var isupdate = PageUtility.GetRequestBoolean("isupdate"); var json = JsonObject.Parse(Rows); for (int i = 0; i < json.Count; i++) { var info2 = new Woo.Model.WOO_CONT_YUSUAN();
var json0 = json[i]; var jsonobj = json0 as JsonObject; if (jsonobj != null) { //預算ID
info2.YUSUAN_ID = Convert.ToInt32((jsonobj["ID"] as JsonPrimitive).Value); //事業(yè)部ID info2.SHIYEBU_ID = Convert.ToInt32((jsonobj["SHIYEBU_ID"] as JsonPrimitive).Value); info2.YEAR = Convert.ToInt32((jsonobj["YEAR"] as JsonPrimitive).Value); info2.CONT_ID = contID == 0 ? Woo.Utility.LoginUtility.GetCurrentUserID() : contID; info2.AMOUNT = Convert.ToDecimal((jsonobj["AMOUNT"] as JsonPrimitive).Value); //info2.ZHANYONG_AMOUNT = Convert.ToDecimal((jsonobj["ZHANYONG_AMOUNT"] as JsonPrimitive).Value); //info2.YUSUAN_YUE = Convert.ToDecimal((jsonobj["YUSUAN_YUE"] as JsonPrimitive).Value); info2.ZHANYONG_AMOUNT = 0; //執(zhí)行添加到數(shù)據庫方法
Woo.BLL.WooContract.ContYuSuan.Insert(info2); } } |
|