Browse Source

BindDetai 移到锁外面

master
luanhui 8 years ago
parent
commit
5c5df282e1
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      WeighAndGrading/GradeFrom.cs

+ 9
- 1
WeighAndGrading/GradeFrom.cs View File

@ -945,6 +945,7 @@ namespace WeighAndGrading
//点级别 //点级别
void AddDetail(CTuple<long, string, short, string> livestock) void AddDetail(CTuple<long, string, short, string> livestock)
{ {
lock (_obj) lock (_obj)
{ {
var currentRow = livestock.Item3 == 0 ? tangEntity : maoEntity; var currentRow = livestock.Item3 == 0 ? tangEntity : maoEntity;
@ -1001,9 +1002,14 @@ namespace WeighAndGrading
// LocalGradeAndWeightBL.Insert(entity); 改成调用方法 方便加锁 // LocalGradeAndWeightBL.Insert(entity); 改成调用方法 方便加锁
LocalGradeAndWeightBLInsert(entity); LocalGradeAndWeightBLInsert(entity);
// noWeightList.Enqueue(entity); // 添加的掉猪明细不加入到没有称重队列 // noWeightList.Enqueue(entity); // 添加的掉猪明细不加入到没有称重队列
//这里绑定界面 东旭说不应该放到锁了 不知道怎么改
BindDetailGrid(); BindDetailGrid();
} }
if (currentRow != null) if (currentRow != null)
{ {
currentRow.Already = currentRow.Already + 1; currentRow.Already = currentRow.Already + 1;
@ -1096,13 +1102,15 @@ namespace WeighAndGrading
LocalGradeAndWeightBLInsert(entity); LocalGradeAndWeightBLInsert(entity);
noLivestockList.Enqueue(entity); noLivestockList.Enqueue(entity);
BindDetailGrid();
// SetlblSucessVisibleTrue(); // SetlblSucessVisibleTrue();
// SetlblSucessVisibleFalse(); // SetlblSucessVisibleFalse();
} }
} }
BindDetailGrid();
} }
private void cancelBtn_Click(object sender, EventArgs e) private void cancelBtn_Click(object sender, EventArgs e)


Loading…
Cancel
Save