Example #1
0
        public ActionResult ModifyGoods(GoodsViewModel model)
        {
            if (ModelState.IsValid)
            {
                //创建数据
                Goods data = new Goods();
                data.Id = model.Id;
                data.Name = model.Name;
                data.TypeId = model.TypeId;
                data.GoodsNo = model.GoodsNo;
                data.SpecModel = model.SpecModel;
                data.GWeight = model.GWeight;
                data.Grade = model.Grade;
                data.Brand = model.Brand;
                data.PieceWeight = model.PieceWeight;
                data.Packing = model.Packing;
                data.Remark = model.Remark;

                //保存数据
                string strErrText;
                DDSystem dd = new DDSystem();
                if (dd.UpdateGoods(data, LoginAccountId, LoginStaffName, out strErrText))
                {
                    return Json(string.Empty);
                }
                else
                {
                    return Json(strErrText);
                }
            }
            return View(model);
        }