public ActionResult ModifyShipmentBill(ShipmentBillViewModel model) { List<ShipmentBillGoods> listGoods = new List<ShipmentBillGoods>(); foreach (ShipmentBillGoodsViewModel m in model.Goods) { ShipmentBillGoods g = new ShipmentBillGoods(); g.Id = m.Id; g.ShipmentBillId = m.ShipmentBillId; g.GoodsId = m.GoodsId; g.GoodsName = m.GoodsName; g.GoodsNo = m.GoodsNo; g.Brand = m.Brand; g.SpecModel = m.SpecModel; g.GWeight = m.GWeight; g.Grade = m.Grade; g.PieceWeight = m.PieceWeight; g.Packing = m.Packing; g.BatchNo = m.BatchNo; g.Location = m.Location; g.Packages = m.Packages; g.Tunnages = m.Tunnages; g.Piles = m.Piles; g.TenThousands = m.TenThousands; g.ProductionDate = m.ProductionDate; g.EnterWarehouseBillId = m.EnterWarehouseBillId; g.EnterWarehouseBillNo = m.EnterWarehouseBillNo; listGoods.Add(g); } string strErrText; DeliverSystem deliver = new DeliverSystem(); if (deliver.UpdateShipmentBill(model.Id, model.TransportCharges, listGoods, LoginAccountId, LoginStaffName, out strErrText)) { return Json(string.Empty); } else { return Json(strErrText); } }
/// <summary> /// 修改出仓单货物数据 /// </summary> /// <param name="data"></param> /// <param name="nOpStaffId"></param> /// <param name="strOpStaffName"></param> /// <param name="strErrText"></param> /// <returns></returns> public bool UpdateShipmentBillGoods(ShipmentBillGoods data, long nOpStaffId, string strOpStaffName, out string strErrText) { //创建存储过程参数 SqlParameter[] Params = { MakeParam(ID_PARAM, SqlDbType.BigInt, 8, ParameterDirection.Input, (object)data.Id), MakeParam(SHIPMENTBILLID_PARAM, SqlDbType.BigInt, 8, ParameterDirection.Input, (object)data.ShipmentBillId), MakeParam(GOODSID_PARAM, SqlDbType.BigInt, 8, ParameterDirection.Input, (object)data.GoodsId), MakeParam(GOODSNO_PARAM, SqlDbType.NVarChar, 20, ParameterDirection.Input, (object)data.GoodsNo), MakeParam(BATCHNO_PARAM, SqlDbType.NVarChar, 20, ParameterDirection.Input, (object)data.BatchNo), MakeParam(PACKING_PARAM, SqlDbType.NVarChar, 10, ParameterDirection.Input, (object)data.Packing??string.Empty), MakeParam(LOCATION_PARAM, SqlDbType.NVarChar, 10, ParameterDirection.Input, (object)data.Location), MakeParam(PACKAGES_PARAM, SqlDbType.Int, 4, ParameterDirection.Input, (object)data.Packages), MakeParam(PIECEWEIGHT_PARAM, SqlDbType.Decimal, 13, ParameterDirection.Input, (object)data.PieceWeight), MakeParam(TUNNAGES_PARAM, SqlDbType.Decimal, 13, ParameterDirection.Input, (object)data.Tunnages), MakeParam(PILES_PARAM, SqlDbType.Decimal, 13, ParameterDirection.Input, (object)data.Piles), MakeParam(TENTHOUSANDS_PARAM, SqlDbType.Decimal, 13, ParameterDirection.Input, (object)data.TenThousands), MakeParam(PRODUCTIONDATE_PARAM, SqlDbType.NVarChar, 10, ParameterDirection.Input, (object)data.ProductionDate), MakeParam(ENTERWAREHOUSEBILLID_PARAM, SqlDbType.BigInt, 8, ParameterDirection.Input, (object)data.EnterWarehouseBillId), MakeParam(OPSTAFFID_PARAM, SqlDbType.BigInt, 8, ParameterDirection.Input, (object)nOpStaffId), MakeParam(OPSTAFFNAME_PARAM, SqlDbType.NVarChar, 50, ParameterDirection.Input, (object)strOpStaffName), }; if (Execute("UpdateShipmentBillGoods", Params, out strErrText) >= 0) return true; else return false; }