Browse Source

修改。

master
yibo 8 years ago
parent
commit
24dd4186dd
18 changed files with 888 additions and 229 deletions
  1. +2
    -3
      BO/BO.csproj
  2. +17
    -0
      BO/BO/BaseInfo/BodyDiscontItem.cs
  3. +1
    -0
      BO/BO/Bill/WeightBill/WeightBill.cs
  4. +1
    -1
      BO/Utils/AfterLoginUtil.cs
  5. +21
    -1
      BO/Utils/BillRpc/GradeAndWeightRpc.cs
  6. +8
    -2
      BO/Utils/BillRpc/HouseAndSanctionRpc.cs
  7. +8
    -2
      BO/Utils/BillRpc/OrderDetailRpc.cs
  8. +1
    -0
      BO/Utils/BillRpc/WeightBillRpc.cs
  9. +176
    -64
      QualityAndOrder/QualityOrderForm.Designer.cs
  10. +45
    -4
      QualityAndOrder/QualityOrderForm.cs
  11. +47
    -3
      QualityAndOrder/QualityOrderFormForTab2.cs
  12. +154
    -0
      WeighAndGrading/BodyDiscontSetting.Designer.cs
  13. +69
    -0
      WeighAndGrading/BodyDiscontSetting.cs
  14. +129
    -0
      WeighAndGrading/BodyDiscontSetting.resx
  15. +163
    -140
      WeighAndGrading/GradeFrom.Designer.cs
  16. +36
    -8
      WeighAndGrading/GradeFrom.cs
  17. +1
    -1
      WeighAndGrading/GradeSettingFrom.Designer.cs
  18. +9
    -0
      WeighAndGrading/WeighAndGrading.csproj

+ 2
- 3
BO/BO.csproj View File

@ -54,6 +54,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BO\BackRpcObj.cs" />
<Compile Include="BO\BaseInfo\BodyDiscontItem.cs" />
<Compile Include="BO\Bill\GradeAndWeight\GradeAndWeight.cs" />
<Compile Include="BO\Bill\GradeAndWeight\GradeAndWeight_Detail.cs" />
<Compile Include="BO\Bill\OrderDetail\NeedOrderEntity.cs" />
@ -86,9 +87,7 @@
<Compile Include="Utils\ServerUrlConfig.cs" />
<Compile Include="Utils\XmlUtil.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="BO\BaseInfo\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


+ 17
- 0
BO/BO/BaseInfo/BodyDiscontItem.cs View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BO.BO.BaseInfo
{
public class BodyDiscontItem
{
public long ID { get; set; }
public string Name { get; set; }
public decimal? Discont { get; set; }
}
}

+ 1
- 0
BO/BO/Bill/WeightBill/WeightBill.cs View File

@ -11,6 +11,7 @@ namespace BO.BO
[Serializable]
public class WeightBill
{
public int RowVersion { get; set; }
public long ID { get; set; }
public long? B3ID { get; set; }


+ 1
- 1
BO/Utils/AfterLoginUtil.cs View File

@ -26,7 +26,7 @@ namespace BO.Utils
//#if !debug
// static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>(){new Tuple<string,string>("排宰员",@"ButcherOrder"),
//new Tuple<string,string>("过磅员",@"ButcherWeight"),
// new Tuple<string,string>("验质员",@"QualityAndOrder"),new Tuple<string,string>("定级员",@"WeighAndGrading")};
// new Tuple<string,string>("验质员",@"QualityAndOrder"),new Tuple<string,string>("定级员",@"WeighAndGrading")};
//#endif


+ 21
- 1
BO/Utils/BillRpc/GradeAndWeightRpc.cs View File

@ -1,4 +1,5 @@
using BO.BO.Bill;
using BO.BO.BaseInfo;
using BO.BO.Bill;
using Forks.JsonRpc.Client;
using System;
using System.Collections.Generic;
@ -45,5 +46,24 @@ namespace BO.Utils.BillRpc
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/SetGradeFinish";
RpcFacade.Call<int>(method, orderDetailID, technics);
}
public static List<BodyDiscontItem> GetBodyDiscontItem()
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/GetBodyDiscontItemSetting";
var json = RpcFacade.Call<string>(method);
return serializer.Deserialize<List<BodyDiscontItem>>(json);
}
public static void SaveBodyDiscontItem(List<CTuple<long, decimal?>> list)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/SaveBodyDiscontItemSetting";
RpcFacade.Call<int>(method, serializer.Serialize(list));
}
public static void UpdateWeight(long id, decimal? weight)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/UpdateWeight";
RpcFacade.Call<int>(method, id, weight);
}
}
}

+ 8
- 2
BO/Utils/BillRpc/HouseAndSanctionRpc.cs View File

@ -12,13 +12,19 @@ namespace BO.Utils.BillRpc
public static class HouseAndSanctionRpc
{
static JavaScriptSerializer serializer = new JavaScriptSerializer();
public static List<HouseAndSanctionList> GetHouseAndSanctionList(DateTime date)
public static List<HouseAndSanctionList> GetHouseAndSanctionList(DateTime date, int pageSize, int pageNumber)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/HouseAndSanctionRpc/GetHouseAndSanctionList";
var json = RpcFacade.Call<string>(method, date);
var json = RpcFacade.Call<string>(method, date, pageSize, pageNumber);
return serializer.Deserialize<List<HouseAndSanctionList>>(json);
}
public static int GetMaxPageNumber(DateTime date, int pageSize)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/HouseAndSanctionRpc/GetMaxPageNumber";
return RpcFacade.Call<int>(method, date, pageSize);
}
public static void UpdateInsertHouseAndSanction(HouseAndSanctionEdit bo)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/HouseAndSanctionRpc/UpdateInsertHouseAndSanction";


+ 8
- 2
BO/Utils/BillRpc/OrderDetailRpc.cs View File

@ -35,14 +35,20 @@ namespace BO.Utils.BillRpc
return RpcFacade.Call<int>(method, date);
}
public static List<OrderDetail> GetOrderDetail()
public static List<OrderDetail> GetOrderDetail(DateTime date, int pageSize, int pageNumber)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetOrderDetail";
var result = RpcFacade.Call<string>(method);
var result = RpcFacade.Call<string>(method, date, pageSize, pageNumber);
result = result.ESerializeDateTime();
return serializer.Deserialize<List<OrderDetail>>(result);
}
public static int GetMaxPageNumber(DateTime date, int pageSize)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetMaxPageNumber";
return RpcFacade.Call<int>(method, date, pageSize);
}
public static void Insert(List<CTuple<long, int>> update, OrderDetail insert)
{
insert.AccountingUnit_ID = ButcherAppContext.Context.UserConfig.AccountingUnit_ID;


+ 1
- 0
BO/Utils/BillRpc/WeightBillRpc.cs View File

@ -42,6 +42,7 @@ namespace BO.Utils.BillRpc
var json = RpcFacade.Call<string>(method, serializer.Serialize(bo), s);
var result = serializer.Deserialize<BackRpcObj>(json);
bo.ID = result.ID;
bo.RowVersion += 1;
foreach (var d in result.DetailBack)
{
switch (d.Flag)


+ 176
- 64
QualityAndOrder/QualityOrderForm.Designer.cs View File

@ -42,6 +42,10 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
this.uTabControl1 = new BWP.WinFormControl.UTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this._1LastPageBtn = new System.Windows.Forms.Button();
this._1NextPageBtn = new System.Windows.Forms.Button();
this._1PrePageBtn = new System.Windows.Forms.Button();
this._1FirstPageBtn = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.uTabControl2 = new BWP.WinFormControl.UTabControl();
this.tabPage3 = new System.Windows.Forms.TabPage();
@ -69,10 +73,21 @@
this.label1 = new System.Windows.Forms.Label();
this.keyBoardPanel = new System.Windows.Forms.FlowLayoutPanel();
this.weightBillGrid = new BWP.WinFormControl.UDataGridView();
this.W_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_AlreadyHouse = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Employee_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.syncBtn = new System.Windows.Forms.Button();
this.testTimeInput = new BWP.WinFormControl.UDatePicker();
this.label20 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this._2LastPageBtn = new System.Windows.Forms.Button();
this._2NextPageBtn = new System.Windows.Forms.Button();
this._2PrePageBtn = new System.Windows.Forms.Button();
this._2FirstPageBtn = new System.Windows.Forms.Button();
this.panel3 = new System.Windows.Forms.Panel();
this.showHidden = new System.Windows.Forms.RadioButton();
this.showAvailable = new System.Windows.Forms.RadioButton();
@ -107,13 +122,6 @@
this.tab2SyncBtn = new System.Windows.Forms.Button();
this.tab2DateSelect = new BWP.WinFormControl.UDatePicker();
this.label4 = new System.Windows.Forms.Label();
this.W_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_AlreadyHouse = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Employee_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.panel1.SuspendLayout();
@ -145,6 +153,10 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this._1LastPageBtn);
this.tabPage1.Controls.Add(this._1NextPageBtn);
this.tabPage1.Controls.Add(this._1PrePageBtn);
this.tabPage1.Controls.Add(this._1FirstPageBtn);
this.tabPage1.Controls.Add(this.panel1);
this.tabPage1.Controls.Add(this.inHouseNumberLabel);
this.tabPage1.Controls.Add(this.label2);
@ -166,6 +178,50 @@
this.tabPage1.Text = "验质分圈";
this.tabPage1.UseVisualStyleBackColor = true;
//
// _1LastPageBtn
//
this._1LastPageBtn.Font = new System.Drawing.Font("宋体", 15F);
this._1LastPageBtn.Location = new System.Drawing.Point(375, 467);
this._1LastPageBtn.Name = "_1LastPageBtn";
this._1LastPageBtn.Size = new System.Drawing.Size(75, 36);
this._1LastPageBtn.TabIndex = 48;
this._1LastPageBtn.Text = "尾页";
this._1LastPageBtn.UseVisualStyleBackColor = true;
this._1LastPageBtn.Click += new System.EventHandler(this._1LastPageBtn_Click);
//
// _1NextPageBtn
//
this._1NextPageBtn.Font = new System.Drawing.Font("宋体", 15F);
this._1NextPageBtn.Location = new System.Drawing.Point(270, 467);
this._1NextPageBtn.Name = "_1NextPageBtn";
this._1NextPageBtn.Size = new System.Drawing.Size(75, 36);
this._1NextPageBtn.TabIndex = 47;
this._1NextPageBtn.Text = "下页";
this._1NextPageBtn.UseVisualStyleBackColor = true;
this._1NextPageBtn.Click += new System.EventHandler(this._1NextPageBtn_Click);
//
// _1PrePageBtn
//
this._1PrePageBtn.Font = new System.Drawing.Font("宋体", 15F);
this._1PrePageBtn.Location = new System.Drawing.Point(161, 467);
this._1PrePageBtn.Name = "_1PrePageBtn";
this._1PrePageBtn.Size = new System.Drawing.Size(75, 36);
this._1PrePageBtn.TabIndex = 46;
this._1PrePageBtn.Text = "上页";
this._1PrePageBtn.UseVisualStyleBackColor = true;
this._1PrePageBtn.Click += new System.EventHandler(this._1PrePageBtn_Click);
//
// _1FirstPageBtn
//
this._1FirstPageBtn.Font = new System.Drawing.Font("宋体", 15F);
this._1FirstPageBtn.Location = new System.Drawing.Point(52, 467);
this._1FirstPageBtn.Name = "_1FirstPageBtn";
this._1FirstPageBtn.Size = new System.Drawing.Size(75, 36);
this._1FirstPageBtn.TabIndex = 45;
this._1FirstPageBtn.Text = "首页";
this._1FirstPageBtn.UseVisualStyleBackColor = true;
this._1FirstPageBtn.Click += new System.EventHandler(this._1FirstPageBtn_Click);
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -476,10 +532,65 @@
this.weightBillGrid.RowsDefaultCellStyle = dataGridViewCellStyle6;
this.weightBillGrid.RowTemplate.Height = 40;
this.weightBillGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.weightBillGrid.Size = new System.Drawing.Size(452, 401);
this.weightBillGrid.Size = new System.Drawing.Size(452, 387);
this.weightBillGrid.TabIndex = 34;
this.weightBillGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.weightBillGrid_CellClick);
//
// W_ID
//
this.W_ID.DataPropertyName = "ID";
this.W_ID.HeaderText = "ID";
this.W_ID.Name = "W_ID";
this.W_ID.ReadOnly = true;
this.W_ID.Visible = false;
//
// W_AlreadyHouse
//
this.W_AlreadyHouse.DataPropertyName = "AlreadyHouse";
this.W_AlreadyHouse.HeaderText = "AlreadyHouse";
this.W_AlreadyHouse.Name = "W_AlreadyHouse";
this.W_AlreadyHouse.ReadOnly = true;
this.W_AlreadyHouse.Visible = false;
//
// W_B3ID
//
this.W_B3ID.DataPropertyName = "B3ID";
this.W_B3ID.HeaderText = "磅单号";
this.W_B3ID.Name = "W_B3ID";
this.W_B3ID.ReadOnly = true;
this.W_B3ID.Width = 80;
//
// W_Employee_Name
//
this.W_Employee_Name.DataPropertyName = "Employee_Name";
this.W_Employee_Name.HeaderText = "业务员";
this.W_Employee_Name.Name = "W_Employee_Name";
this.W_Employee_Name.ReadOnly = true;
this.W_Employee_Name.Width = 80;
//
// W_Supplier_Name
//
this.W_Supplier_Name.DataPropertyName = "Supplier_Name";
this.W_Supplier_Name.HeaderText = "供应商";
this.W_Supplier_Name.Name = "W_Supplier_Name";
this.W_Supplier_Name.ReadOnly = true;
//
// W_Number
//
this.W_Number.DataPropertyName = "Number";
this.W_Number.HeaderText = "头数";
this.W_Number.Name = "W_Number";
this.W_Number.ReadOnly = true;
this.W_Number.Width = 65;
//
// W_HouseNames
//
this.W_HouseNames.DataPropertyName = "HouseNames";
this.W_HouseNames.HeaderText = "圈舍";
this.W_HouseNames.Name = "W_HouseNames";
this.W_HouseNames.ReadOnly = true;
this.W_HouseNames.Width = 105;
//
// syncBtn
//
this.syncBtn.Font = new System.Drawing.Font("宋体", 15F);
@ -517,6 +628,10 @@
//
// tabPage2
//
this.tabPage2.Controls.Add(this._2LastPageBtn);
this.tabPage2.Controls.Add(this._2NextPageBtn);
this.tabPage2.Controls.Add(this._2PrePageBtn);
this.tabPage2.Controls.Add(this._2FirstPageBtn);
this.tabPage2.Controls.Add(this.panel3);
this.tabPage2.Controls.Add(this.panel2);
this.tabPage2.Controls.Add(this.closeBtn2);
@ -535,6 +650,50 @@
this.tabPage2.Text = "排宰顺序";
this.tabPage2.UseVisualStyleBackColor = true;
//
// _2LastPageBtn
//
this._2LastPageBtn.Font = new System.Drawing.Font("宋体", 15F);
this._2LastPageBtn.Location = new System.Drawing.Point(375, 467);
this._2LastPageBtn.Name = "_2LastPageBtn";
this._2LastPageBtn.Size = new System.Drawing.Size(75, 36);
this._2LastPageBtn.TabIndex = 52;
this._2LastPageBtn.Text = "尾页";
this._2LastPageBtn.UseVisualStyleBackColor = true;
this._2LastPageBtn.Click += new System.EventHandler(this._2LastPageBtn_Click);
//
// _2NextPageBtn
//
this._2NextPageBtn.Font = new System.Drawing.Font("宋体", 15F);
this._2NextPageBtn.Location = new System.Drawing.Point(270, 467);
this._2NextPageBtn.Name = "_2NextPageBtn";
this._2NextPageBtn.Size = new System.Drawing.Size(75, 36);
this._2NextPageBtn.TabIndex = 51;
this._2NextPageBtn.Text = "下页";
this._2NextPageBtn.UseVisualStyleBackColor = true;
this._2NextPageBtn.Click += new System.EventHandler(this._2NextPageBtn_Click);
//
// _2PrePageBtn
//
this._2PrePageBtn.Font = new System.Drawing.Font("宋体", 15F);
this._2PrePageBtn.Location = new System.Drawing.Point(161, 467);
this._2PrePageBtn.Name = "_2PrePageBtn";
this._2PrePageBtn.Size = new System.Drawing.Size(75, 36);
this._2PrePageBtn.TabIndex = 50;
this._2PrePageBtn.Text = "上页";
this._2PrePageBtn.UseVisualStyleBackColor = true;
this._2PrePageBtn.Click += new System.EventHandler(this._2PrePageBtn_Click);
//
// _2FirstPageBtn
//
this._2FirstPageBtn.Font = new System.Drawing.Font("宋体", 15F);
this._2FirstPageBtn.Location = new System.Drawing.Point(52, 467);
this._2FirstPageBtn.Name = "_2FirstPageBtn";
this._2FirstPageBtn.Size = new System.Drawing.Size(75, 36);
this._2FirstPageBtn.TabIndex = 49;
this._2FirstPageBtn.Text = "首页";
this._2FirstPageBtn.UseVisualStyleBackColor = true;
this._2FirstPageBtn.Click += new System.EventHandler(this._2FirstPageBtn_Click);
//
// panel3
//
this.panel3.Controls.Add(this.showHidden);
@ -805,7 +964,7 @@
this.orderGrid.RowsDefaultCellStyle = dataGridViewCellStyle12;
this.orderGrid.RowTemplate.Height = 40;
this.orderGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.orderGrid.Size = new System.Drawing.Size(540, 397);
this.orderGrid.Size = new System.Drawing.Size(540, 371);
this.orderGrid.TabIndex = 38;
this.orderGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.orderGrid_CellClick);
//
@ -917,61 +1076,6 @@
this.label4.TabIndex = 35;
this.label4.Text = "日期:";
//
// W_ID
//
this.W_ID.DataPropertyName = "ID";
this.W_ID.HeaderText = "ID";
this.W_ID.Name = "W_ID";
this.W_ID.ReadOnly = true;
this.W_ID.Visible = false;
//
// W_AlreadyHouse
//
this.W_AlreadyHouse.DataPropertyName = "AlreadyHouse";
this.W_AlreadyHouse.HeaderText = "AlreadyHouse";
this.W_AlreadyHouse.Name = "W_AlreadyHouse";
this.W_AlreadyHouse.ReadOnly = true;
this.W_AlreadyHouse.Visible = false;
//
// W_B3ID
//
this.W_B3ID.DataPropertyName = "B3ID";
this.W_B3ID.HeaderText = "磅单号";
this.W_B3ID.Name = "W_B3ID";
this.W_B3ID.ReadOnly = true;
this.W_B3ID.Width = 80;
//
// W_Employee_Name
//
this.W_Employee_Name.DataPropertyName = "Employee_Name";
this.W_Employee_Name.HeaderText = "业务员";
this.W_Employee_Name.Name = "W_Employee_Name";
this.W_Employee_Name.ReadOnly = true;
this.W_Employee_Name.Width = 80;
//
// W_Supplier_Name
//
this.W_Supplier_Name.DataPropertyName = "Supplier_Name";
this.W_Supplier_Name.HeaderText = "供应商";
this.W_Supplier_Name.Name = "W_Supplier_Name";
this.W_Supplier_Name.ReadOnly = true;
//
// W_Number
//
this.W_Number.DataPropertyName = "Number";
this.W_Number.HeaderText = "头数";
this.W_Number.Name = "W_Number";
this.W_Number.ReadOnly = true;
this.W_Number.Width = 65;
//
// W_HouseNames
//
this.W_HouseNames.DataPropertyName = "HouseNames";
this.W_HouseNames.HeaderText = "圈舍";
this.W_HouseNames.Name = "W_HouseNames";
this.W_HouseNames.ReadOnly = true;
this.W_HouseNames.Width = 105;
//
// QualityOrderForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -1079,6 +1183,14 @@
private System.Windows.Forms.DataGridViewTextBoxColumn W_Supplier_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn W_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn W_HouseNames;
private System.Windows.Forms.Button _1LastPageBtn;
private System.Windows.Forms.Button _1NextPageBtn;
private System.Windows.Forms.Button _1PrePageBtn;
private System.Windows.Forms.Button _1FirstPageBtn;
private System.Windows.Forms.Button _2LastPageBtn;
private System.Windows.Forms.Button _2NextPageBtn;
private System.Windows.Forms.Button _2PrePageBtn;
private System.Windows.Forms.Button _2FirstPageBtn;


+ 45
- 4
QualityAndOrder/QualityOrderForm.cs View File

@ -338,10 +338,8 @@ namespace QualityAndOrder
{
GetDataFromUI();
HouseAndSanctionRpc.UpdateInsertHouseAndSanction(Dmo);
var entity = weightBills.First(x => x.ID == Dmo.ID);
entity.HouseNames = string.Join(",", Dmo.HouseDetails.Select(x => x.LiveColonyHouse_Name));
entity.Number = Dmo.Number;
Dmo = null;
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value, 9, tab1PageNumber);
BindWeightBillGrid();
BindNumberLabel();
ResetTab1Controls();
@ -349,7 +347,7 @@ namespace QualityAndOrder
private void syncBtn_Click(object sender, EventArgs e)
{
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value);
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value, 9, 1);
BindWeightBillGrid();
//BindNumberLabel();
//tab1SyncThread = new Thread(StartQuery) { IsBackground = true };
@ -531,6 +529,49 @@ namespace QualityAndOrder
btn.BackColor = btnUnSelectBackColor;
btn.ForeColor = btnUnSelectForeColor;
}
static int tab1PageNumber = 1;
private void _1FirstPageBtn_Click(object sender, EventArgs e)
{
if (tab1PageNumber != 1)
{
tab1PageNumber = 1;
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value, 9, tab1PageNumber);
BindWeightBillGrid();
}
}
private void _1PrePageBtn_Click(object sender, EventArgs e)
{
if (tab1PageNumber != 1)
{
tab1PageNumber -= 1;
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value, 9, tab1PageNumber);
BindWeightBillGrid();
}
}
private void _1NextPageBtn_Click(object sender, EventArgs e)
{
if (tab1PageNumber != HouseAndSanctionRpc.GetMaxPageNumber(testTimeInput.Date.Value, 9))
{
tab1PageNumber += 1;
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value, 9, tab1PageNumber);
BindWeightBillGrid();
}
}
private void _1LastPageBtn_Click(object sender, EventArgs e)
{
var max = HouseAndSanctionRpc.GetMaxPageNumber(testTimeInput.Date.Value, 9);
if (tab1PageNumber != max)
{
tab1PageNumber = max;
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value, 9, tab1PageNumber);
BindWeightBillGrid();
}
}
}
class SanctionSplit3Part


+ 47
- 3
QualityAndOrder/QualityOrderFormForTab2.cs View File

@ -77,7 +77,7 @@ namespace QualityAndOrder
{
needOrderList = OrderDetailRpc.GetNeedOrderWeightBill(tab2DateSelect.Date.Value, GetSelectType());
BindPreOrderGrid();
orderList = OrderDetailRpc.GetOrderDetail();
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, 1);
BindOrderGrid();
if (tb2SyncThread == null)
{
@ -180,8 +180,8 @@ namespace QualityAndOrder
order.WeightBill_ID = entity.WeightBill_ID;
order.B3WeighBill_ID = entity.B3ID;
var needUpdate = ReOrder(order, true);
orderList.Add(order);
OrderDetailRpc.Insert(needUpdate, order);
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);
BindOrderGrid();
needOrderList.Remove(entity);
BindPreOrderGrid();
@ -235,6 +235,8 @@ namespace QualityAndOrder
orderList.Remove(entity);
var list = ReOrder(entity, false);
OrderDetailRpc.Delete(list, entity.ID);
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);
BindOrderGrid();
}
else
OrderDetailRpc.UpdateNumber(entity.ID, entity.PlanNumber);
@ -263,7 +265,6 @@ namespace QualityAndOrder
return result;
}
bool? GetSelectType()
{
bool? type = null;
@ -279,5 +280,48 @@ namespace QualityAndOrder
needOrderList = OrderDetailRpc.GetNeedOrderWeightBill(tab2DateSelect.Date.Value, GetSelectType());
BindPreOrderGrid();
}
static int tab2PageNumber = 1;
private void _2FirstPageBtn_Click(object sender, EventArgs e)
{
if (tab2PageNumber != 1)
{
tab2PageNumber = 1;
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);
BindOrderGrid();
}
}
private void _2PrePageBtn_Click(object sender, EventArgs e)
{
if (tab2PageNumber != 1)
{
tab2PageNumber -= 1;
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);
BindOrderGrid();
}
}
private void _2NextPageBtn_Click(object sender, EventArgs e)
{
if (tab2PageNumber != OrderDetailRpc.GetMaxPageNumber(tab2DateSelect.Date.Value, 8))
{
tab2PageNumber += 1;
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);
BindOrderGrid();
}
}
private void _2LastPageBtn_Click(object sender, EventArgs e)
{
var max = OrderDetailRpc.GetMaxPageNumber(tab2DateSelect.Date.Value, 8);
if (tab2PageNumber != max)
{
tab2PageNumber = max;
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);
BindOrderGrid();
}
}
}
}

+ 154
- 0
WeighAndGrading/BodyDiscontSetting.Designer.cs View File

@ -0,0 +1,154 @@
namespace WeighAndGrading
{
partial class BodyDiscontSetting
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.uDataGridView1 = new BWP.WinFormControl.UDataGridView();
this.closeBtn = new System.Windows.Forms.Button();
this.saveBtn = new System.Windows.Forms.Button();
this.S_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_Discont = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).BeginInit();
this.SuspendLayout();
//
// uDataGridView1
//
this.uDataGridView1.AllowUserToAddRows = false;
this.uDataGridView1.AllowUserToDeleteRows = false;
this.uDataGridView1.AllowUserToResizeColumns = false;
this.uDataGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.uDataGridView1.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.S_ID,
this.S_Name,
this.S_Discont});
this.uDataGridView1.Location = new System.Drawing.Point(16, 12);
this.uDataGridView1.MultiSelect = false;
this.uDataGridView1.Name = "uDataGridView1";
this.uDataGridView1.ReadOnly = true;
this.uDataGridView1.RowHeadersVisible = false;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.uDataGridView1.RowTemplate.Height = 40;
this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.uDataGridView1.Size = new System.Drawing.Size(320, 300);
this.uDataGridView1.TabIndex = 0;
this.uDataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.uDataGridView1_CellClick);
//
// closeBtn
//
this.closeBtn.Font = new System.Drawing.Font("宋体", 15F);
this.closeBtn.Location = new System.Drawing.Point(189, 326);
this.closeBtn.Name = "closeBtn";
this.closeBtn.Size = new System.Drawing.Size(75, 35);
this.closeBtn.TabIndex = 21;
this.closeBtn.Text = "关闭";
this.closeBtn.UseVisualStyleBackColor = true;
this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click);
//
// saveBtn
//
this.saveBtn.Font = new System.Drawing.Font("宋体", 15F);
this.saveBtn.Location = new System.Drawing.Point(83, 326);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(75, 35);
this.saveBtn.TabIndex = 20;
this.saveBtn.Text = "保存";
this.saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
//
// S_ID
//
this.S_ID.DataPropertyName = "ID";
this.S_ID.HeaderText = "ID";
this.S_ID.Name = "S_ID";
this.S_ID.ReadOnly = true;
this.S_ID.Visible = false;
//
// S_Name
//
this.S_Name.DataPropertyName = "Name";
this.S_Name.HeaderText = "扣重项";
this.S_Name.Name = "S_Name";
this.S_Name.ReadOnly = true;
this.S_Name.Width = 120;
//
// S_Discont
//
this.S_Discont.DataPropertyName = "Discont";
dataGridViewCellStyle3.Format = "#0.######";
this.S_Discont.DefaultCellStyle = dataGridViewCellStyle3;
this.S_Discont.HeaderText = "扣重";
this.S_Discont.Name = "S_Discont";
this.S_Discont.ReadOnly = true;
this.S_Discont.Width = 170;
//
// BodyDiscontSetting
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(354, 381);
this.ControlBox = false;
this.Controls.Add(this.closeBtn);
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.uDataGridView1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "BodyDiscontSetting";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "胴体扣重设置";
((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private BWP.WinFormControl.UDataGridView uDataGridView1;
private System.Windows.Forms.Button closeBtn;
private System.Windows.Forms.Button saveBtn;
private System.Windows.Forms.DataGridViewTextBoxColumn S_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn S_Discont;
}
}

+ 69
- 0
WeighAndGrading/BodyDiscontSetting.cs View File

@ -0,0 +1,69 @@
using BO;
using BO.BO.BaseInfo;
using BO.Utils.BillRpc;
using BWP.WinFormControl;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WeighAndGrading
{
public partial class BodyDiscontSetting : Form
{
List<BodyDiscontItem> list;
public BodyDiscontSetting()
{
InitializeComponent();
list = GradeAndWeightRpc.GetBodyDiscontItem().OrderBy(x => x.ID).ToList();
uDataGridView1.DataSource = list;
uDataGridView1.Refresh();
}
bool changed = false;
private void saveBtn_Click(object sender, EventArgs e)
{
var list = new List<CTuple<long, decimal?>>();
foreach (DataGridViewRow row in uDataGridView1.Rows)
{
var entity = row.DataBoundItem as BodyDiscontItem;
list.Add(new CTuple<long, decimal?>(entity.ID, entity.Discont));
}
GradeAndWeightRpc.SaveBodyDiscontItem(list);
if (!changed)
changed = true;
MessageBox.Show("保存成功!");
}
private void closeBtn_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
this.Close();
}
private void uDataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex == -1)
return;
if (e.ColumnIndex == uDataGridView1.ColumnCount - 1)
{
var keyBoard = new NumberPad();
if (keyBoard.ShowDialog() == true)
{
if (string.IsNullOrEmpty(keyBoard.Result))
return;
decimal v;
if (decimal.TryParse(keyBoard.Result, out v))
uDataGridView1.CurrentRow.Cells["S_Discont"].Value = v;
else
throw new Exception("扣重输入不正确");
}
}
}
}
}

+ 129
- 0
WeighAndGrading/BodyDiscontSetting.resx View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="S_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="S_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="S_Discont.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

+ 163
- 140
WeighAndGrading/GradeFrom.Designer.cs View File

@ -31,10 +31,10 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.label1 = new System.Windows.Forms.Label();
this.syncBtn = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
@ -49,19 +49,6 @@
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.label12 = new System.Windows.Forms.Label();
this.historyGrid = new BWP.WinFormControl.UDataGridView();
this.enableWeight = new System.Windows.Forms.CheckBox();
this.isPrintCheckBox = new System.Windows.Forms.CheckBox();
this.printBtn = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.lblChengZhong = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.dataGridView = new BWP.WinFormControl.UDataGridView();
this.butcherTimeInput = new BWP.WinFormControl.UDatePicker();
this.closeBtn = new System.Windows.Forms.Button();
this.configBtn = new System.Windows.Forms.Button();
this.stateLabel = new System.Windows.Forms.Label();
this.modifyPanel = new System.Windows.Forms.Panel();
this.cancelBtn = new System.Windows.Forms.Button();
this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -69,6 +56,13 @@
this.H_Livestock_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Time = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.enableWeight = new System.Windows.Forms.CheckBox();
this.isPrintCheckBox = new System.Windows.Forms.CheckBox();
this.printBtn = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.lblChengZhong = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.dataGridView = new BWP.WinFormControl.UDataGridView();
this.D_OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Technics = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Finish = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -77,6 +71,14 @@
this.D_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Already = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_FinishBtn = new System.Windows.Forms.DataGridViewButtonColumn();
this.butcherTimeInput = new BWP.WinFormControl.UDatePicker();
this.closeBtn = new System.Windows.Forms.Button();
this.configBtn = new System.Windows.Forms.Button();
this.stateLabel = new System.Windows.Forms.Label();
this.modifyPanel = new System.Windows.Forms.Panel();
this.cancelBtn = new System.Windows.Forms.Button();
this.discontBtn = new System.Windows.Forms.Button();
this.discontPanel = new System.Windows.Forms.FlowLayoutPanel();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
@ -198,7 +200,7 @@
this.groupBox3.Controls.Add(this.historyGrid);
this.groupBox3.Location = new System.Drawing.Point(826, 175);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(438, 680);
this.groupBox3.Size = new System.Drawing.Size(422, 680);
this.groupBox3.TabIndex = 11;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "记录";
@ -239,7 +241,7 @@
this.H_Livestock_Name,
this.H_Weight,
this.H_Time});
this.historyGrid.Location = new System.Drawing.Point(6, 36);
this.historyGrid.Location = new System.Drawing.Point(0, 36);
this.historyGrid.MultiSelect = false;
this.historyGrid.Name = "historyGrid";
this.historyGrid.ReadOnly = true;
@ -248,10 +250,67 @@
this.historyGrid.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.historyGrid.RowTemplate.Height = 40;
this.historyGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.historyGrid.Size = new System.Drawing.Size(426, 627);
this.historyGrid.Size = new System.Drawing.Size(409, 597);
this.historyGrid.TabIndex = 0;
this.historyGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.historyGrid_CellClick);
//
// H_ID
//
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "ID";
this.H_ID.Name = "H_ID";
this.H_ID.ReadOnly = true;
this.H_ID.Visible = false;
//
// H_Livestock_ID
//
this.H_Livestock_ID.HeaderText = "Livestock_ID";
this.H_Livestock_ID.Name = "H_Livestock_ID";
this.H_Livestock_ID.ReadOnly = true;
this.H_Livestock_ID.Visible = false;
//
// H_Index
//
this.H_Index.DataPropertyName = "Index";
this.H_Index.HeaderText = "序号";
this.H_Index.Name = "H_Index";
this.H_Index.ReadOnly = true;
this.H_Index.Width = 65;
//
// H_Technics
//
this.H_Technics.DataPropertyName = "Technics_Name";
this.H_Technics.HeaderText = "工艺";
this.H_Technics.Name = "H_Technics";
this.H_Technics.ReadOnly = true;
this.H_Technics.Width = 65;
//
// H_Livestock_Name
//
this.H_Livestock_Name.DataPropertyName = "Livestock_Name";
this.H_Livestock_Name.HeaderText = "级别";
this.H_Livestock_Name.Name = "H_Livestock_Name";
this.H_Livestock_Name.ReadOnly = true;
this.H_Livestock_Name.Width = 90;
//
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle3.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle3;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
this.H_Weight.Width = 70;
//
// H_Time
//
this.H_Time.DataPropertyName = "Time";
this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true;
this.H_Time.Width = 110;
//
// enableWeight
//
this.enableWeight.AutoCheck = false;
@ -358,6 +417,69 @@
this.dataGridView.TabIndex = 4;
this.dataGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_CellClick);
//
// D_OrderDetail_ID
//
this.D_OrderDetail_ID.DataPropertyName = "OrderDetail_ID";
this.D_OrderDetail_ID.HeaderText = "OrderDetail_ID";
this.D_OrderDetail_ID.Name = "D_OrderDetail_ID";
this.D_OrderDetail_ID.ReadOnly = true;
this.D_OrderDetail_ID.Visible = false;
//
// D_Technics
//
this.D_Technics.DataPropertyName = "Technics";
this.D_Technics.HeaderText = "Technics";
this.D_Technics.Name = "D_Technics";
this.D_Technics.ReadOnly = true;
this.D_Technics.Visible = false;
//
// D_Finish
//
this.D_Finish.DataPropertyName = "Finish";
this.D_Finish.HeaderText = "Finish";
this.D_Finish.Name = "D_Finish";
this.D_Finish.ReadOnly = true;
this.D_Finish.Visible = false;
//
// D_Order
//
this.D_Order.DataPropertyName = "Order";
this.D_Order.HeaderText = "屠宰顺序";
this.D_Order.Name = "D_Order";
this.D_Order.ReadOnly = true;
//
// D_Technics_Name
//
this.D_Technics_Name.DataPropertyName = "Technics_Name";
this.D_Technics_Name.HeaderText = "工艺";
this.D_Technics_Name.Name = "D_Technics_Name";
this.D_Technics_Name.ReadOnly = true;
this.D_Technics_Name.Width = 80;
//
// D_Number
//
this.D_Number.DataPropertyName = "Number";
this.D_Number.HeaderText = "头数";
this.D_Number.Name = "D_Number";
this.D_Number.ReadOnly = true;
this.D_Number.Width = 80;
//
// D_Already
//
this.D_Already.DataPropertyName = "Already";
this.D_Already.HeaderText = "已宰";
this.D_Already.Name = "D_Already";
this.D_Already.ReadOnly = true;
this.D_Already.Width = 80;
//
// D_FinishBtn
//
this.D_FinishBtn.HeaderText = "完毕";
this.D_FinishBtn.Name = "D_FinishBtn";
this.D_FinishBtn.ReadOnly = true;
this.D_FinishBtn.Text = "完毕";
this.D_FinishBtn.UseColumnTextForButtonValue = true;
//
// butcherTimeInput
//
this.butcherTimeInput.BackColor = System.Drawing.Color.White;
@ -375,7 +497,7 @@
// closeBtn
//
this.closeBtn.Font = new System.Drawing.Font("宋体", 15F);
this.closeBtn.Location = new System.Drawing.Point(1156, 12);
this.closeBtn.Location = new System.Drawing.Point(1217, 12);
this.closeBtn.Name = "closeBtn";
this.closeBtn.Size = new System.Drawing.Size(102, 43);
this.closeBtn.TabIndex = 33;
@ -386,11 +508,11 @@
// configBtn
//
this.configBtn.Font = new System.Drawing.Font("宋体", 15F);
this.configBtn.Location = new System.Drawing.Point(1036, 12);
this.configBtn.Location = new System.Drawing.Point(971, 12);
this.configBtn.Name = "configBtn";
this.configBtn.Size = new System.Drawing.Size(102, 43);
this.configBtn.TabIndex = 34;
this.configBtn.Text = "设置";
this.configBtn.Text = "设置";
this.configBtn.UseVisualStyleBackColor = true;
this.configBtn.Click += new System.EventHandler(this.configBtn_Click);
//
@ -403,14 +525,13 @@
this.stateLabel.Name = "stateLabel";
this.stateLabel.Size = new System.Drawing.Size(289, 20);
this.stateLabel.TabIndex = 35;
this.stateLabel.Text = "您正在修改序号为 1000 的等级";
this.stateLabel.Text = "您正在修改序号为 1000 的信息";
//
// modifyPanel
//
this.modifyPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.modifyPanel.Controls.Add(this.cancelBtn);
this.modifyPanel.Controls.Add(this.stateLabel);
this.modifyPanel.Location = new System.Drawing.Point(826, 107);
this.modifyPanel.Location = new System.Drawing.Point(813, 107);
this.modifyPanel.Name = "modifyPanel";
this.modifyPanel.Size = new System.Drawing.Size(438, 56);
this.modifyPanel.TabIndex = 36;
@ -428,131 +549,31 @@
this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click);
//
// H_ID
//
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "ID";
this.H_ID.Name = "H_ID";
this.H_ID.ReadOnly = true;
this.H_ID.Visible = false;
//
// H_Livestock_ID
//
this.H_Livestock_ID.HeaderText = "Livestock_ID";
this.H_Livestock_ID.Name = "H_Livestock_ID";
this.H_Livestock_ID.ReadOnly = true;
this.H_Livestock_ID.Visible = false;
//
// H_Index
//
this.H_Index.DataPropertyName = "Index";
this.H_Index.HeaderText = "序号";
this.H_Index.Name = "H_Index";
this.H_Index.ReadOnly = true;
this.H_Index.Width = 65;
//
// H_Technics
//
this.H_Technics.DataPropertyName = "Technics_Name";
this.H_Technics.HeaderText = "工艺";
this.H_Technics.Name = "H_Technics";
this.H_Technics.ReadOnly = true;
this.H_Technics.Width = 65;
//
// H_Livestock_Name
//
this.H_Livestock_Name.DataPropertyName = "Livestock_Name";
this.H_Livestock_Name.HeaderText = "级别";
this.H_Livestock_Name.Name = "H_Livestock_Name";
this.H_Livestock_Name.ReadOnly = true;
this.H_Livestock_Name.Width = 90;
//
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle3.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle3;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
this.H_Weight.Width = 70;
//
// H_Time
//
this.H_Time.DataPropertyName = "Time";
this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true;
this.H_Time.Width = 110;
//
// D_OrderDetail_ID
//
this.D_OrderDetail_ID.DataPropertyName = "OrderDetail_ID";
this.D_OrderDetail_ID.HeaderText = "OrderDetail_ID";
this.D_OrderDetail_ID.Name = "D_OrderDetail_ID";
this.D_OrderDetail_ID.ReadOnly = true;
this.D_OrderDetail_ID.Visible = false;
//
// D_Technics
//
this.D_Technics.DataPropertyName = "Technics";
this.D_Technics.HeaderText = "Technics";
this.D_Technics.Name = "D_Technics";
this.D_Technics.ReadOnly = true;
this.D_Technics.Visible = false;
//
// D_Finish
//
this.D_Finish.DataPropertyName = "Finish";
this.D_Finish.HeaderText = "Finish";
this.D_Finish.Name = "D_Finish";
this.D_Finish.ReadOnly = true;
this.D_Finish.Visible = false;
//
// D_Order
//
this.D_Order.DataPropertyName = "Order";
this.D_Order.HeaderText = "屠宰顺序";
this.D_Order.Name = "D_Order";
this.D_Order.ReadOnly = true;
// discontBtn
//
// D_Technics_Name
this.discontBtn.Font = new System.Drawing.Font("宋体", 15F);
this.discontBtn.Location = new System.Drawing.Point(1095, 12);
this.discontBtn.Name = "discontBtn";
this.discontBtn.Size = new System.Drawing.Size(102, 43);
this.discontBtn.TabIndex = 37;
this.discontBtn.Text = "扣重项";
this.discontBtn.UseVisualStyleBackColor = true;
this.discontBtn.Click += new System.EventHandler(this.discontBtn_Click);
//
this.D_Technics_Name.DataPropertyName = "Technics_Name";
this.D_Technics_Name.HeaderText = "工艺";
this.D_Technics_Name.Name = "D_Technics_Name";
this.D_Technics_Name.ReadOnly = true;
this.D_Technics_Name.Width = 80;
//
// D_Number
// discontPanel
//
this.D_Number.DataPropertyName = "Number";
this.D_Number.HeaderText = "头数";
this.D_Number.Name = "D_Number";
this.D_Number.ReadOnly = true;
this.D_Number.Width = 80;
//
// D_Already
//
this.D_Already.DataPropertyName = "Already";
this.D_Already.HeaderText = "已宰";
this.D_Already.Name = "D_Already";
this.D_Already.ReadOnly = true;
this.D_Already.Width = 80;
//
// D_FinishBtn
//
this.D_FinishBtn.HeaderText = "完毕";
this.D_FinishBtn.Name = "D_FinishBtn";
this.D_FinishBtn.ReadOnly = true;
this.D_FinishBtn.Text = "完毕";
this.D_FinishBtn.UseColumnTextForButtonValue = true;
this.discontPanel.Location = new System.Drawing.Point(1258, 182);
this.discontPanel.Name = "discontPanel";
this.discontPanel.Size = new System.Drawing.Size(71, 656);
this.discontPanel.TabIndex = 33;
//
// GradeFrom
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1276, 865);
this.ClientSize = new System.Drawing.Size(1337, 865);
this.Controls.Add(this.discontPanel);
this.Controls.Add(this.discontBtn);
this.Controls.Add(this.modifyPanel);
this.Controls.Add(this.configBtn);
this.Controls.Add(this.closeBtn);
@ -637,5 +658,7 @@
private System.Windows.Forms.DataGridViewTextBoxColumn D_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Already;
private System.Windows.Forms.DataGridViewButtonColumn D_FinishBtn;
private System.Windows.Forms.Button discontBtn;
private System.Windows.Forms.FlowLayoutPanel discontPanel;
}
}

+ 36
- 8
WeighAndGrading/GradeFrom.cs View File

@ -57,6 +57,7 @@ namespace WeighAndGrading
dataGridView.DataSource = null;
historyGrid.AutoGenerateColumns = false;
AddLivestockBtn();
BuildDiscontPanel();
weightPort = new SerialPort();
this.FormClosing += delegate
{
@ -114,7 +115,7 @@ namespace WeighAndGrading
list = GradeAndWeightRpc.GetGradeAndWeightList(date);
BindDataGrid();
dataGridView.Refresh();
details = GradeAndWeightRpc.GetDetails(date, 15);
details = GradeAndWeightRpc.GetDetails(date, 14);
BindDetailGrid();
if (details.Any())
maxIndex = details.First().Index;
@ -372,8 +373,8 @@ namespace WeighAndGrading
entity.Technics = livestock.Item3;
entity.Technics_Name = tech;
entity.Time = DateTime.Now;
if (details.Count == 15)
details.RemoveAt(14);
if (details.Count == 14)
details.RemoveAt(13);
details.Insert(0, entity);
GradeAndWeightRpc.UpdateOrInsertDetail(entity, true);
tempList.Enqueue(entity);
@ -395,7 +396,7 @@ namespace WeighAndGrading
if (tempList.TryPeek(out first) && first.Weight == null)
{
tempList.TryDequeue(out first);
first.Weight = weight;
first.Weight = (first.Weight ?? 0) + weight;
GradeAndWeightRpc.UpdateOrInsertDetail(first);
historyGrid.Refresh();
}
@ -404,10 +405,10 @@ namespace WeighAndGrading
maxIndex++;
var entity = new GradeAndWeight_Detail();
entity.Index = maxIndex;
entity.Weight = weight;
entity.Weight = (entity.Weight ?? 0) + weight;
entity.Time = DateTime.Now;
if (details.Count == 15)
details.RemoveAt(14);
if (details.Count == 14)
details.RemoveAt(13);
details.Insert(0, entity);
GradeAndWeightRpc.UpdateOrInsertDetail(entity);
tempList.Enqueue(entity);
@ -427,7 +428,7 @@ namespace WeighAndGrading
if (e.RowIndex < 0)
return;
modifyDetail = historyGrid.Rows[e.RowIndex].DataBoundItem as GradeAndWeight_Detail;
stateLabel.Text = string.Format("您正在修改序号为 {0} 的等级", modifyDetail.Index);
stateLabel.Text = string.Format("您正在修改序号为 {0} 的信息", modifyDetail.Index);
modifyPanel.Show();
}
@ -499,5 +500,32 @@ namespace WeighAndGrading
}
}
}
private void discontBtn_Click(object sender, EventArgs e)
{
if (new BodyDiscontSetting().ShowDialog() == DialogResult.OK)
BuildDiscontPanel();
}
void BuildDiscontPanel()
{
var disconts = GradeAndWeightRpc.GetBodyDiscontItem().Where(x => x.Discont > 0).OrderBy(x => x.ID);
discontPanel.Controls.Clear();
foreach (var item in disconts)
{
var btn = new Button() { Name = "_D" + item.ID, Text = item.Name, Tag = item.Discont, Size = new Size(70, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { Left = 0, Right = 0, Top = 10, Bottom = 10 }, Font = new Font("宋体", 15) };
btn.Click += (sender, e) =>
{
if (modifyDetail == null)
throw new Exception("请先选择要扣重的记录");
modifyDetail.Weight = (modifyDetail.Weight ?? 0) - Convert.ToDecimal(btn.Tag);
GradeAndWeightRpc.UpdateWeight(modifyDetail.ID, modifyDetail.Weight);
historyGrid.Refresh();
modifyDetail = null;
modifyPanel.Hide();
};
discontPanel.Controls.Add(btn);
}
}
}
}

+ 1
- 1
WeighAndGrading/GradeSettingFrom.Designer.cs View File

@ -185,6 +185,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(354, 381);
this.ControlBox = false;
this.Controls.Add(this.discont);
this.Controls.Add(this.format);
this.Controls.Add(this.label6);
@ -200,7 +201,6 @@
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "GradeSettingFrom";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "称重设置";


+ 9
- 0
WeighAndGrading/WeighAndGrading.csproj View File

@ -50,6 +50,12 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="BodyDiscontSetting.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BodyDiscontSetting.Designer.cs">
<DependentUpon>BodyDiscontSetting.cs</DependentUpon>
</Compile>
<Compile Include="GradeContext.cs" />
<Compile Include="GradeFrom.cs">
<SubType>Form</SubType>
@ -67,6 +73,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="BodyDiscontSetting.resx">
<DependentUpon>BodyDiscontSetting.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GradeFrom.resx">
<DependentUpon>GradeFrom.cs</DependentUpon>
</EmbeddedResource>


Loading…
Cancel
Save