领料录入

文献种类:项目研发技术文献;
开发工具与关键技术: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);
    }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值