Browse Source

bug

master
yibo 7 years ago
parent
commit
d2c00c850b
2 changed files with 8 additions and 7 deletions
  1. +7
    -7
      ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs
  2. +1
    -0
      ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs

+ 7
- 7
ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs View File

@ -27,7 +27,7 @@ namespace ButcherFactory.BO.LocalBL
return list;
var goodsBarCode = data.Select(x => new Tuple<long, string>(x.Goods_ID, x.BarCode));
list = InsertOrUpdate(workUnitID, batchID, goodsBarCode);
list = InsertOrUpdate(workUnitID, batchID, goodsBarCode, true);
var backInfo = data.Select(x => new ExtensionObj { LongExt1 = x.ID, DecimalExt1 = x.RowVersion });
RpcFacade.Call<int>(RpcPath + "SetPadDataSync", JsonConvert.SerializeObject(backInfo));
@ -37,10 +37,10 @@ namespace ButcherFactory.BO.LocalBL
public static List<CarcassInStore> InsertOrUpdate(long? workUnitID, long? batchID, long goodsID, string barCode)
{
var list = new List<Tuple<long, string>> { new Tuple<long, string>(goodsID, barCode) };
return InsertOrUpdate(workUnitID, batchID, list);
return InsertOrUpdate(workUnitID, batchID, list, false);
}
static List<CarcassInStore> InsertOrUpdate(long? workUnitID, long? batchID, IEnumerable<Tuple<long, string>> data)
static List<CarcassInStore> InsertOrUpdate(long? workUnitID, long? batchID, IEnumerable<Tuple<long, string>> data, bool fromPad)
{
var list = new List<CarcassInStore>();
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
@ -58,7 +58,7 @@ namespace ButcherFactory.BO.LocalBL
}
else
{
var entity = CreateCarcassInStore(workUnitID, batchID, item);
var entity = CreateCarcassInStore(workUnitID, batchID, item, fromPad);
entity.Goods_Name = GetGoodsName(item.Item1, session);
session.Insert(entity);
list.Add(entity);
@ -69,10 +69,10 @@ namespace ButcherFactory.BO.LocalBL
return list;
}
static CarcassInStore CreateCarcassInStore(long? workUnitID, long? batchID, Tuple<long, string> goodsCode)
static CarcassInStore CreateCarcassInStore(long? workUnitID, long? batchID, Tuple<long, string> goodsCode, bool fromPad)
{
var entity = new CarcassInStore();
entity.FromPad = true;
entity.FromPad = fromPad;
entity.WorkUnit_ID = workUnitID;
entity.ProductBatch_ID = batchID;
entity.UserID = AppContext.Worker.ID;
@ -196,7 +196,7 @@ namespace ButcherFactory.BO.LocalBL
{
var update = new DQUpdateDom(typeof(CarcassInStore));
update.Where.Conditions.Add(DQCondition.EQ("BarCode", obj.StringExt1));
update.Columns.Add(new DQUpdateColumn("Weight", obj.DecimalExt1));
update.Columns.Add(new DQUpdateColumn("BeforeWeight", obj.DecimalExt1));
session.ExecuteNonQuery(update);
}


+ 1
- 0
ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs View File

@ -145,6 +145,7 @@ namespace ButcherFactory.CarcassInStore_
var c = sender as UButton;
var list = CarcassInStoreBL.InsertOrUpdate(workUnitID, batchID, (long)c.Tag, uScanPanel1.TextBox.Text);
AfterUpdateOrInsert(list);
uScanPanel1.TextBox.Text = string.Empty;
};
flowLayoutPanel1.Controls.Add(btn);
}


Loading…
Cancel
Save