文献种类:项目研发技术文献;
开发工具与关键技术:VS MVC
作者: 吴新洋 ;年级:1801 ;撰写时间:2019 年 7 月 15 日
文献编号: 归档时间: 年 月 日
《餐饮管理系统——“后台数据”模块》项目研发阶段性总结
作者:吴新洋
本次任务完成时间:2019年7月8日~2019年7月18日
开发工具与关键技术:
完成模块功能:领料录入
function XZcg() {
var pzr = $("#XzPzr").val();//批准人
var DepartmentName = $("#DepartmentName").val();//部门
var IndentEntrepot = $("#XzEntrepot").val();//仓库
var jbr = $("#XzJbr").val();//经办人
var IndentOdd = $("#Xzcgd [name=‘CGOdd’]").val();//领料号
var IndentTime = $("#Xzcgd [name=‘IndentTime’]").val();//采购时间
var tab = layuiTable.checkStatus(‘tabXz’);//原料表格
var checkStatus = layuiTable.checkStatus(‘tabXz’);
if (checkStatus.data.length > 0) {
var RowCargoIds = “”;
var InRE = “”;
var InCount = “”;
for (var i = 0; i < checkStatus.data.length; i++) {
InRE += $("[name=‘InRE’]").eq(i).val() + “;”; InCount += $("[name=‘InCount’]").eq(i).val() + “;”;
RowCargoIds += checkStatus.data[i].RowCargoID + “;”;}
InRE = InRE.substring(0, InRE.length - 1);
InCount = InCount.substring(0, InCount.length - 1);
RowCargoIds = RowCargoIds.substring(0, RowCargoIds.length - 1);
$.post(“InsertDetail”,{
RowCargoIds: RowCargoIds,
DepartmentID: DepartmentName,
PzrID: pzr,
JbrID: jbr,
EntrepotID: IndentEntrepot,
LliaoDate: IndentTime,
DanHao: IndentOdd,
InCount: InCount,
InRE: InRE,
}, function (data) {
if (data.State) {
layer.msg(data.Text, { icon: 0 });
} else {
layer.msg(data.Text, { icon: 0 });
}
}, ‘json’);
} }
public ActionResult InsertDetail(string RowCargoIds, string InRE, string InCount, int DepartmentID,
int PzrID, int JbrID, int EntrepotID,
S_Demand pwDemand, S_LliaoID pwLliaoID)
{
ReturnJson returnJson = new ReturnJson();
int Success = 0;//成功
if (!string.IsNullOrEmpty(InCount) &&
!string.IsNullOrEmpty(InRE) && !string.IsNullOrEmpty(RowCargoIds))
{
string[] RowCargoIDs = RowCargoIds.Split(';'); //分割原料ID
string[] Count = InCount.Split(';'); //根据分号分割采购数量
string[] IndentRemark = InRE.Split(';'); //分割采购备注
for (int i = 0; i < RowCargoIDs.Length; i++){
pwDemand.RowCargoID = Convert.ToInt32(RowCargoIDs[i]);//原材料ID
pwDemand.LliaoCount = Count[i];//进货数量
pwDemand.DemandNum = IndentRemark[i];//备注
S_Inventory S = myModels.S_Inventory.Where(m => m.EntrepotID == EntrepotID && m.RowCargoID == pwDemand.RowCargoID).Single();
int SS = Convert.ToInt32(S.InventoryCount);
SS = Convert.ToInt32(S.InventoryCount) - Convert.ToInt32(pwDemand.LliaoCount);
S.InventoryCount = SS.ToString();
myModels.Entry(S).State = EntityState.Modified;
myModels.S_Demand.Add(pwDemand);
myModels.SaveChanges();
pwLliaoID.DemandID = pwDemand.DemandID;
myModels.S_LliaoID.Add(pwLliaoID);
myModels.SaveChanges();
returnJson.State = false;
returnJson.Text = "领料成功!";
} }
else
{
returnJson.State = false;
returnJson.Text = "请填写完整!";
}
return Json(returnJson, JsonRequestBehavior.AllowGet);
}