Browse Source

修改。

master
yibo 8 years ago
parent
commit
3311b69022
3 changed files with 16 additions and 14 deletions
  1. +2
    -2
      BO/Utils/BillRpc/GradeAndWeightRpc.cs
  2. +3
    -1
      QualityAndOrder/QualityOrderFormForTab2.cs
  3. +11
    -11
      WeighAndGrading/GradeFrom.cs

+ 2
- 2
BO/Utils/BillRpc/GradeAndWeightRpc.cs View File

@ -35,10 +35,10 @@ namespace BO.Utils.BillRpc
detail.ID = RpcFacade.Call<long>(method, serializer.Serialize(detail), fillTechnics); detail.ID = RpcFacade.Call<long>(method, serializer.Serialize(detail), fillTechnics);
} }
public static void UpdateLivestock(long id, long liveStockID, string liveStockName)
public static void UpdateLivestock(long id, long liveStockID, string liveStockName, short technics, string technicsName)
{ {
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/UpdateLivestock"; const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/UpdateLivestock";
RpcFacade.Call<int>(method, id, liveStockID, liveStockName);
RpcFacade.Call<int>(method, id, liveStockID, liveStockName, technics, technicsName);
} }
public static void SetGradeFinish(long orderDetailID, short technics) public static void SetGradeFinish(long orderDetailID, short technics)


+ 3
- 1
QualityAndOrder/QualityOrderFormForTab2.cs View File

@ -170,15 +170,17 @@ namespace QualityAndOrder
{ {
var currentOrder = 0; var currentOrder = 0;
if (orderGrid.CurrentRow != null) if (orderGrid.CurrentRow != null)
currentOrder = (int)orderGrid.CurrentRow.Cells["O_Order"].Value + 1;
currentOrder = (int)orderGrid.CurrentRow.Cells["O_Order"].Value;
else else
currentOrder = OrderDetailRpc.GetMaxOrder(tab2DateSelect.Date.Value); currentOrder = OrderDetailRpc.GetMaxOrder(tab2DateSelect.Date.Value);
currentOrder++;
var order = new OrderDetail(); var order = new OrderDetail();
order.Order = currentOrder; order.Order = currentOrder;
order.LiveColonyHouse_Name = entity.HouseNames; order.LiveColonyHouse_Name = entity.HouseNames;
order.PlanNumber = entity.LastNumber; order.PlanNumber = entity.LastNumber;
order.WeightBill_ID = entity.WeightBill_ID; order.WeightBill_ID = entity.WeightBill_ID;
order.B3WeighBill_ID = entity.B3ID; order.B3WeighBill_ID = entity.B3ID;
order.Date = tab2DateSelect.Date.Value;
var needUpdate = ReOrder(order, true); var needUpdate = ReOrder(order, true);
OrderDetailRpc.Insert(needUpdate, order); OrderDetailRpc.Insert(needUpdate, order);
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber); orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);


+ 11
- 11
WeighAndGrading/GradeFrom.cs View File

@ -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)


Loading…
Cancel
Save