@@ -2,6 +2,7 @@ | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | using Learun.Application.TwoDevelopment.EducationalAdministration; | ||||
using Learun.Util; | using Learun.Util; | ||||
using System.Data; | using System.Data; | ||||
using System.Linq; | |||||
using System.Web.Mvc; | using System.Web.Mvc; | ||||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | ||||
@@ -120,7 +121,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
public ActionResult GetFormUseData(string keyValue) | public ActionResult GetFormUseData(string keyValue) | ||||
{ | { | ||||
var TextBookInOutData = textbookInOutIBLL.GetEntity(keyValue); | var TextBookInOutData = textbookInOutIBLL.GetEntity(keyValue); | ||||
var TextBookInOutDetailData = textbookInOutIBLL.GetInOrOutEntity(TextBookInOutData.BookCode); | |||||
var TextBookInOutDetailData = textbookInOutIBLL.GetInOrOutEntity(TextBookInOutData.BookCode).OrderBy(x => x.CreateTime); | |||||
var jsonData = new | var jsonData = new | ||||
{ | { | ||||
TextBookInOut = TextBookInOutData, | TextBookInOut = TextBookInOutData, | ||||
@@ -161,7 +162,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
{ | { | ||||
entity.IsDel = 0; | entity.IsDel = 0; | ||||
entity.IsSubmit = 0; | entity.IsSubmit = 0; | ||||
entity.FinallyNum = 0; | |||||
entity.CreateTime = DateTime.Now; | entity.CreateTime = DateTime.Now; | ||||
entity.CrateUserID = loginUserInfo.userId; | entity.CrateUserID = loginUserInfo.userId; | ||||
} | } | ||||
@@ -50,7 +50,9 @@ var bootstrap = function ($, learun) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | learun.layerConfirm('是否确认删除该项!', function (res, index) { | ||||
if (res) { | if (res) { | ||||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/DeleteForm', { keyValue: NewkeyValue }, function () { | learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/DeleteForm', { keyValue: NewkeyValue }, function () { | ||||
refreshGirdData(); | |||||
var index = top.layer.getFrameIndex(window.name); | |||||
console.log('index', index); | |||||
top.layer.close(index); | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
@@ -101,8 +101,9 @@ var bootstrap = function ($, learun) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | learun.layerConfirm('是否确认删除该项!', function (res, index) { | ||||
if (res) { | if (res) { | ||||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/DeleteForm', { keyValue: NewkeyValue }, function () { | learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/DeleteForm', { keyValue: NewkeyValue }, function () { | ||||
refreshGirdData(); | |||||
learun.layerClose(window.name); | |||||
var index = top.layer.getFrameIndex(window.name); | |||||
console.log('index', index); | |||||
top.layer.close(index); | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
@@ -112,7 +113,7 @@ var bootstrap = function ($, learun) { | |||||
initData: function () { | initData: function () { | ||||
if (!!keyValue) { | if (!!keyValue) { | ||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?keyValue=' + keyValue, function (data) { | $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?keyValue=' + keyValue, function (data) { | ||||
for(var id in data) { | |||||
for (var id in data) { | |||||
if (!!data[id].length && data[id].length > 0) { | if (!!data[id].length && data[id].length > 0) { | ||||
$('#' + id).jfGridSet('refreshdata', data[id]); | $('#' + id).jfGridSet('refreshdata', data[id]); | ||||
} | } | ||||
@@ -136,13 +136,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
try | try | ||||
{ | { | ||||
List<TextbookInOutEntity> returnList = new List<TextbookInOutEntity>(); | List<TextbookInOutEntity> returnList = new List<TextbookInOutEntity>(); | ||||
TextbookInOutEntity InOutList = new TextbookInOutEntity(); | |||||
//TextbookInOutEntity InOutList = new TextbookInOutEntity(); | |||||
List<TextBookInEntity> InEntity = this.BaseRepository("CollegeMIS").FindList<TextBookInEntity>(x => x.InOutCode == keyValue).ToList(); | List<TextBookInEntity> InEntity = this.BaseRepository("CollegeMIS").FindList<TextBookInEntity>(x => x.InOutCode == keyValue).ToList(); | ||||
List<TextBookOutEntity> OutEntity = this.BaseRepository("CollegeMIS").FindList<TextBookOutEntity>(x => x.InOutCode == keyValue).ToList(); | List<TextBookOutEntity> OutEntity = this.BaseRepository("CollegeMIS").FindList<TextBookOutEntity>(x => x.InOutCode == keyValue).ToList(); | ||||
if (InEntity.Count() > 0 || OutEntity.Count() > 0) | if (InEntity.Count() > 0 || OutEntity.Count() > 0) | ||||
{ | { | ||||
for (int i = 0; i < InEntity.Count(); i++) | for (int i = 0; i < InEntity.Count(); i++) | ||||
{ | { | ||||
TextbookInOutEntity InOutList = new TextbookInOutEntity(); | |||||
InOutList.CKORRK = "入库"; | InOutList.CKORRK = "入库"; | ||||
InOutList.InorOut = InEntity[i].InOutCode; | InOutList.InorOut = InEntity[i].InOutCode; | ||||
InOutList.BookCode = InEntity[i].BookCode; | InOutList.BookCode = InEntity[i].BookCode; | ||||
@@ -154,6 +155,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
for (int j = 0; j < OutEntity.Count(); j++) | for (int j = 0; j < OutEntity.Count(); j++) | ||||
{ | { | ||||
TextbookInOutEntity InOutList = new TextbookInOutEntity(); | |||||
InOutList.CKORRK = "出库"; | InOutList.CKORRK = "出库"; | ||||
InOutList.InorOut = OutEntity[j].InOutCode; | InOutList.InorOut = OutEntity[j].InOutCode; | ||||
InOutList.BookCode = OutEntity[j].BookCode; | InOutList.BookCode = OutEntity[j].BookCode; | ||||
@@ -163,7 +165,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
InOutList.Remark = OutEntity[j].Remark; | InOutList.Remark = OutEntity[j].Remark; | ||||
returnList.Add(InOutList); | returnList.Add(InOutList); | ||||
} | } | ||||
returnList.OrderBy(x => x.CreateTime); | |||||
} | } | ||||
return returnList; | return returnList; | ||||
} | } | ||||