Exemplo n.º 1
0
        public ActionResult saverequiredetail()
        {
            string      no     = WebRequest.GetString("no", true);
            string      type   = WebRequest.GetString("type", true);
            string      remark = WebRequest.GetString("remark", true);
            ReturnValue r      = new ReturnValue()
            {
                status = false
            };
            List <PurchaseRequireDetailModel> temp = (List <PurchaseRequireDetailModel>)SessionHelper.GetSession("NE" + no + Masterpage.CurrUser.staffid);

            if (temp == null || temp.Count < 1)
            {
                r.message = "不存在申请明细";
            }
            else
            {
                if (type == "add")
                {
                    string backno = purchaseService.AddRequire("", Masterpage.CurrUser.staffid, Masterpage.CurrUser.depId, 0, remark);
                    if (backno == "")
                    {
                        r.message = "申请单生成失败";
                    }
                    else
                    {
                        r = purchaseService.SaveRequirDetail(backno, temp, remark);
                    }
                }
                else if (type == "edit")
                {
                    r = purchaseService.SaveRequirDetail(no, temp, remark);
                }
            }
            SessionHelper.Del("NE" + no + Masterpage.CurrUser.staffid);
            return(Json(r, JsonRequestBehavior.AllowGet));
        }