Browse Source

bug

master
yibo 7 years ago
parent
commit
f2606347dd
3 changed files with 20 additions and 15 deletions
  1. +8
    -6
      ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs
  2. +8
    -6
      ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs
  3. +4
    -3
      ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs

+ 8
- 6
ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs View File

@ -72,7 +72,7 @@ namespace ButcherFactory.BO.LocalBL
var entity = CreateCarcassInStore(workUnitID, batchID, item, fromPad); var entity = CreateCarcassInStore(workUnitID, batchID, item, fromPad);
entity.Goods_Name = GetGoodsName(item.Item1, session); entity.Goods_Name = GetGoodsName(item.Item1, session);
if (batchID.HasValue) if (batchID.HasValue)
entity.RowIndex = GetRowIndex(session, batchID.Value);
entity.RowIndex = GetRowIndex(session, batchID.Value) + 1;
session.Insert(entity); session.Insert(entity);
list.Add(entity); list.Add(entity);
} }
@ -151,6 +151,7 @@ namespace ButcherFactory.BO.LocalBL
public static BindingList<CarcassInStore> GetLocalDataWithState(bool history) public static BindingList<CarcassInStore> GetLocalDataWithState(bool history)
{ {
var query = new DQueryDom(new JoinAlias(typeof(CarcassInStore))); var query = new DQueryDom(new JoinAlias(typeof(CarcassInStore)));
query.Columns.Add(DQSelectColumn.Field("RowIndex"));
query.Columns.Add(DQSelectColumn.Field("ID")); query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("BarCode")); query.Columns.Add(DQSelectColumn.Field("BarCode"));
query.Columns.Add(DQSelectColumn.Field("Goods_Name")); query.Columns.Add(DQSelectColumn.Field("Goods_Name"));
@ -173,13 +174,14 @@ namespace ButcherFactory.BO.LocalBL
{ {
var entity = new CarcassInStore(); var entity = new CarcassInStore();
result.Add(entity); result.Add(entity);
entity.ID = (long)reader[0];
entity.BarCode = (string)reader[1];
entity.Goods_Name = (string)reader[2];
entity.RowIndex = (int?)reader[0];
entity.ID = (long)reader[1];
entity.BarCode = (string)reader[2];
entity.Goods_Name = (string)reader[3];
if (history) if (history)
{ {
entity.Weight = (decimal)reader[3];
entity.BeforeWeight = (decimal?)reader[4];
entity.Weight = (decimal)reader[4];
entity.BeforeWeight = (decimal?)reader[5];
} }
} }
} }


+ 8
- 6
ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs View File

@ -29,7 +29,7 @@ namespace ButcherFactory.BO.LocalBL
entity.WorkUnit_ID = workUnitID; entity.WorkUnit_ID = workUnitID;
entity.BarCode = barCode; entity.BarCode = barCode;
entity.UserID = AppContext.Worker.ID; entity.UserID = AppContext.Worker.ID;
entity.RowIndex = GetRowIndex(session);
entity.RowIndex = GetRowIndex(session) + 1;
session.Insert(entity); session.Insert(entity);
isNew = true; isNew = true;
} }
@ -87,6 +87,7 @@ namespace ButcherFactory.BO.LocalBL
public static BindingList<CarcassTakeOut> GetLocalDataWithState(bool history) public static BindingList<CarcassTakeOut> GetLocalDataWithState(bool history)
{ {
var query = new DQueryDom(new JoinAlias(typeof(CarcassTakeOut))); var query = new DQueryDom(new JoinAlias(typeof(CarcassTakeOut)));
query.Columns.Add(DQSelectColumn.Field("RowIndex"));
query.Columns.Add(DQSelectColumn.Field("ID")); query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("BarCode")); query.Columns.Add(DQSelectColumn.Field("BarCode"));
query.Columns.Add(DQSelectColumn.Field("Goods_Name")); query.Columns.Add(DQSelectColumn.Field("Goods_Name"));
@ -105,11 +106,12 @@ namespace ButcherFactory.BO.LocalBL
{ {
var entity = new CarcassTakeOut(); var entity = new CarcassTakeOut();
result.Add(entity); result.Add(entity);
entity.ID = (long)reader[0];
entity.BarCode = (string)reader[1];
entity.Goods_Name = (string)reader[2];
entity.BeforeWeight = (decimal?)reader[3];
entity.Weight = (decimal?)reader[4];
entity.RowIndex = (int?)reader[0];
entity.ID = (long)reader[1];
entity.BarCode = (string)reader[2];
entity.Goods_Name = (string)reader[3];
entity.BeforeWeight = (decimal?)reader[4];
entity.Weight = (decimal?)reader[5];
} }
} }
} }


+ 4
- 3
ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs View File

@ -111,8 +111,6 @@ namespace ButcherFactory.CarcassInStore_
{ {
lock (_lock) lock (_lock)
{ {
if (errorWeight.HasValue && weight != 0 && weight < errorWeight)
SoundPalyUtil.PlaySound("Sounds\\wtl.wav");
this.Invoke(new Action(() => this.Invoke(new Action(() =>
{ {
var last = needSubmitedList.LastOrDefault(); var last = needSubmitedList.LastOrDefault();
@ -131,7 +129,10 @@ namespace ButcherFactory.CarcassInStore_
if (historyList.Any()) if (historyList.Any())
historyDataGrid.FirstDisplayedScrollingRowIndex = 0; historyDataGrid.FirstDisplayedScrollingRowIndex = 0;
historyDataGrid.Refresh(); historyDataGrid.Refresh();
SoundPalyUtil.PlaySound(SoundType.ShotSucc);
if (errorWeight.HasValue && weight != 0 && weight < errorWeight)
SoundPalyUtil.PlaySound("Sounds\\wtl.wav");
else
SoundPalyUtil.PlaySound(SoundType.ShotSucc);
} }
})); }));
} }


Loading…
Cancel
Save