|
|
@ -81,14 +81,11 @@ namespace WeighAndGrading |
|
|
AddDetail(livestockTag); |
|
|
AddDetail(livestockTag); |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
if (modifyDetail.Technics != livestockTag.Item3) |
|
|
|
|
|
{ |
|
|
|
|
|
MessageBox.Show("工艺选择错误!请重新选择"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
modifyDetail.Livestock_ID = livestockTag.Item1; |
|
|
modifyDetail.Livestock_ID = livestockTag.Item1; |
|
|
modifyDetail.Livestock_Name = livestockTag.Item2; |
|
|
modifyDetail.Livestock_Name = livestockTag.Item2; |
|
|
GradeAndWeightRpc.UpdateLivestock(modifyDetail.ID, modifyDetail.Livestock_ID, modifyDetail.Livestock_Name); |
|
|
|
|
|
|
|
|
modifyDetail.Technics = livestockTag.Item3; |
|
|
|
|
|
modifyDetail.Technics_Name = livestockTag.Item3 == 0 ? "烫褪" : "毛剥"; |
|
|
|
|
|
GradeAndWeightRpc.UpdateLivestock(modifyDetail.ID, modifyDetail.Livestock_ID, modifyDetail.Livestock_Name, modifyDetail.Technics, modifyDetail.Technics_Name); |
|
|
historyGrid.Refresh(); |
|
|
historyGrid.Refresh(); |
|
|
modifyDetail = null; |
|
|
modifyDetail = null; |
|
|
modifyPanel.Hide(); |
|
|
modifyPanel.Hide(); |
|
|
@ -114,6 +111,8 @@ namespace WeighAndGrading |
|
|
var date = butcherTimeInput.Date.Value; |
|
|
var date = butcherTimeInput.Date.Value; |
|
|
list = GradeAndWeightRpc.GetGradeAndWeightList(date); |
|
|
list = GradeAndWeightRpc.GetGradeAndWeightList(date); |
|
|
BindDataGrid(); |
|
|
BindDataGrid(); |
|
|
|
|
|
tangRow = FindRowSetSelected(tangEntity); |
|
|
|
|
|
maoRow = FindRowSetSelected(maoEntity); |
|
|
dataGridView.Refresh(); |
|
|
dataGridView.Refresh(); |
|
|
details = GradeAndWeightRpc.GetDetails(date, 14); |
|
|
details = GradeAndWeightRpc.GetDetails(date, 14); |
|
|
BindDetailGrid(); |
|
|
BindDetailGrid(); |
|
|
@ -130,7 +129,6 @@ namespace WeighAndGrading |
|
|
row.DefaultCellStyle.BackColor = Color.YellowGreen; |
|
|
row.DefaultCellStyle.BackColor = Color.YellowGreen; |
|
|
} |
|
|
} |
|
|
dataGridView.ClearSelection(); |
|
|
dataGridView.ClearSelection(); |
|
|
tangRow = maoRow = null; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void BindDetailGrid() |
|
|
void BindDetailGrid() |
|
|
@ -373,6 +371,7 @@ namespace WeighAndGrading |
|
|
entity.Technics = livestock.Item3; |
|
|
entity.Technics = livestock.Item3; |
|
|
entity.Technics_Name = tech; |
|
|
entity.Technics_Name = tech; |
|
|
entity.Time = DateTime.Now; |
|
|
entity.Time = DateTime.Now; |
|
|
|
|
|
entity.Date = butcherTimeInput.Date.Value; |
|
|
if (details.Count == 14) |
|
|
if (details.Count == 14) |
|
|
details.RemoveAt(13); |
|
|
details.RemoveAt(13); |
|
|
details.Insert(0, entity); |
|
|
details.Insert(0, entity); |
|
|
@ -407,6 +406,7 @@ namespace WeighAndGrading |
|
|
entity.Index = maxIndex; |
|
|
entity.Index = maxIndex; |
|
|
entity.Weight = (entity.Weight ?? 0) + weight; |
|
|
entity.Weight = (entity.Weight ?? 0) + weight; |
|
|
entity.Time = DateTime.Now; |
|
|
entity.Time = DateTime.Now; |
|
|
|
|
|
entity.Date = butcherTimeInput.Date.Value; |
|
|
if (details.Count == 14) |
|
|
if (details.Count == 14) |
|
|
details.RemoveAt(13); |
|
|
details.RemoveAt(13); |
|
|
details.Insert(0, entity); |
|
|
details.Insert(0, entity); |
|
|
@ -432,7 +432,6 @@ namespace WeighAndGrading |
|
|
modifyPanel.Show(); |
|
|
modifyPanel.Show(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DataGridViewRow tangRow; |
|
|
DataGridViewRow tangRow; |
|
|
DataGridViewRow maoRow; |
|
|
DataGridViewRow maoRow; |
|
|
private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e) |
|
|
private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e) |
|
|
@ -487,18 +486,19 @@ namespace WeighAndGrading |
|
|
dataGridView.Refresh(); |
|
|
dataGridView.Refresh(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void FindRowSetSelected(GradeAndWeight tag) |
|
|
|
|
|
|
|
|
DataGridViewRow FindRowSetSelected(GradeAndWeight tag) |
|
|
{ |
|
|
{ |
|
|
if (tag == null) |
|
|
if (tag == null) |
|
|
return; |
|
|
|
|
|
|
|
|
return null; |
|
|
foreach (DataGridViewRow row in dataGridView.Rows) |
|
|
foreach (DataGridViewRow row in dataGridView.Rows) |
|
|
{ |
|
|
{ |
|
|
if ((long)row.Cells["D_OrderDetail_ID"].Value == tag.OrderDetail_ID && (string)row.Cells["D_Technics_Name"].Value == tag.Technics_Name) |
|
|
if ((long)row.Cells["D_OrderDetail_ID"].Value == tag.OrderDetail_ID && (string)row.Cells["D_Technics_Name"].Value == tag.Technics_Name) |
|
|
{ |
|
|
{ |
|
|
row.DefaultCellStyle.BackColor = dataGridView.RowsDefaultCellStyle.SelectionBackColor; |
|
|
row.DefaultCellStyle.BackColor = dataGridView.RowsDefaultCellStyle.SelectionBackColor; |
|
|
return; |
|
|
|
|
|
|
|
|
return row; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void discontBtn_Click(object sender, EventArgs e) |
|
|
private void discontBtn_Click(object sender, EventArgs e) |
|
|
|