Example #1
0
 public string AddBomOrder(BomOrder model)
 {
     return _BomRepository.AddBomOrder(model);
 }
Example #2
0
        public ActionResult saveorderone(BomOrder model, string type)
        {
            ReturnValue r = new ReturnValue() { status = false };
            List<V_BomOrderDetailModel> temp = (List<V_BomOrderDetailModel>)SessionHelper.GetSession("BD1" + model.bomOrderNo + Masterpage.CurrUser.staffid);
            if (temp == null || temp.Count < 1)
            {
                r.message = "不存在BOM订单明细";
            }
            else if (!model.supplierId.HasValue || model.supplierId.Value == 0)
            {
                r.message = "未选择客户";
            }
            else
            {
                if (type == "add")
                {
                    model.createDate = DateTime.Now;
                    model.depId = Masterpage.CurrUser.depId;
                    model.staffId = Masterpage.CurrUser.staffid;
                    model.status = 0;
                    model.isover = 0;
                    model.valid = true;
                    string backno = bomService.AddBomOrder(model);
                    if (backno == "")
                    {
                        r.message = "BOM订单生成失败";
                    }
                    else
                    {
                        r = bomService.SaveBomOrderDetail(backno, temp, model.deportStaff, model.remark);
                    }
                }
                else if (type == "edit")
                {
                    r = bomService.SaveBomOrderDetail(model.bomOrderNo, temp, model.deportStaff, model.remark);

                }
            }
            SessionHelper.Del("BD1" + model.bomOrderNo + Masterpage.CurrUser.staffid);
            return Json(r, JsonRequestBehavior.AllowGet);
        }