|
|
|
@ -57,6 +57,18 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static void InsertPackage(CarcassSaleOut_Detail detail) |
|
|
|
{ |
|
|
|
var gInfo = GetGoodsInfo(detail.Goods_ID.Value); |
|
|
|
detail.Goods_Name = gInfo.Item1; |
|
|
|
detail.Goods_Code = gInfo.Item2; |
|
|
|
using (var session = DmoSession.New()) |
|
|
|
{ |
|
|
|
session.Insert(detail); |
|
|
|
session.Commit(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static bool BarCodeUsed(string barCode) |
|
|
|
{ |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(CarcassSaleOut_Detail))); |
|
|
|
@ -184,7 +196,7 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
|
|
|
|
public static void SubmitDetails(IEnumerable<CarcassSaleOut_Detail> details, SaleOutStore_Detail detail) |
|
|
|
{ |
|
|
|
var arr = details.Select(x => new WeightRecord { Flag = 0, ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Weight, SecondNumber = x.Number, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode }); |
|
|
|
var arr = details.Select(x => new WeightRecord { Flag = x.BarCode.StartsWith("P") ? -1 : 0, ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Weight, SecondNumber = x.Number, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode }); |
|
|
|
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); |
|
|
|
var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json); |
|
|
|
using (var session = DmoSession.New()) |
|
|
|
@ -222,12 +234,12 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
delete.EExecute(); |
|
|
|
} |
|
|
|
|
|
|
|
public static void AddAndUpdate(CarcassSaleOut_Detail detail) |
|
|
|
public static void AddAndUpdate(CarcassSaleOut_Detail detail, int flag) |
|
|
|
{ |
|
|
|
using (var session = DmoSession.New()) |
|
|
|
{ |
|
|
|
session.Insert(detail); |
|
|
|
var arr = new List<WeightRecord> { new WeightRecord { Flag = 0, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Weight, SecondNumber = detail.Number } }; |
|
|
|
var arr = new List<WeightRecord> { new WeightRecord { Flag = flag, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Weight, SecondNumber = detail.Number } }; |
|
|
|
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID); |
|
|
|
var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json); |
|
|
|
|
|
|
|
|