Browse Source

调整。

master
yibo 8 years ago
parent
commit
44823197d2
7 changed files with 228 additions and 64 deletions
  1. +8
    -2
      B3ButcherManageClient.sln
  2. +1
    -0
      BO/BO.csproj
  3. +25
    -0
      BO/BO/Bill/OrderDetail/DropPigOrderList.cs
  4. +8
    -0
      BO/Utils/BillRpc/OrderDetailRpc.cs
  5. +67
    -54
      DropPigReOrder/ReOrderForm.Designer.cs
  6. +113
    -5
      DropPigReOrder/ReOrderForm.cs
  7. +6
    -3
      DropPigReOrder/ReOrderForm.resx

+ 8
- 2
B3ButcherManageClient.sln View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2002
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BO", "BO\BO.csproj", "{8968F14A-C7C7-4751-96CE-B114FBFD65EF}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BO", "BO\BO.csproj", "{8968F14A-C7C7-4751-96CE-B114FBFD65EF}"
EndProject EndProject
@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ByProductWeight", "ByProduc
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Distribution", "Distribution\Distribution.csproj", "{054F5E88-9AF0-430F-990E-17B8B268D59A}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Distribution", "Distribution\Distribution.csproj", "{054F5E88-9AF0-430F-990E-17B8B268D59A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DropPigReOrder", "DropPigReOrder\DropPigReOrder.csproj", "{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -103,6 +105,10 @@ Global
{054F5E88-9AF0-430F-990E-17B8B268D59A}.Debug|Any CPU.Build.0 = Debug|Any CPU {054F5E88-9AF0-430F-990E-17B8B268D59A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{054F5E88-9AF0-430F-990E-17B8B268D59A}.Release|Any CPU.ActiveCfg = Release|Any CPU {054F5E88-9AF0-430F-990E-17B8B268D59A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{054F5E88-9AF0-430F-990E-17B8B268D59A}.Release|Any CPU.Build.0 = Release|Any CPU {054F5E88-9AF0-430F-990E-17B8B268D59A}.Release|Any CPU.Build.0 = Release|Any CPU
{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE


+ 1
- 0
BO/BO.csproj View File

@ -72,6 +72,7 @@
<Compile Include="BO\Bill\GradeAndWeight\DetailLastIndex.cs" /> <Compile Include="BO\Bill\GradeAndWeight\DetailLastIndex.cs" />
<Compile Include="BO\Bill\GradeAndWeight\GradeAndWeight_Detail.cs" /> <Compile Include="BO\Bill\GradeAndWeight\GradeAndWeight_Detail.cs" />
<Compile Include="BO\Bill\GradeAndWeight\WeightData.cs" /> <Compile Include="BO\Bill\GradeAndWeight\WeightData.cs" />
<Compile Include="BO\Bill\OrderDetail\DropPigOrderList.cs" />
<Compile Include="BO\Bill\OrderDetail\HurryRecord.cs" /> <Compile Include="BO\Bill\OrderDetail\HurryRecord.cs" />
<Compile Include="BO\Bill\OrderDetail\NeedOrderEntity.cs" /> <Compile Include="BO\Bill\OrderDetail\NeedOrderEntity.cs" />
<Compile Include="BO\Bill\OrderDetail\OrderDetail.cs" /> <Compile Include="BO\Bill\OrderDetail\OrderDetail.cs" />


+ 25
- 0
BO/BO/Bill/OrderDetail/DropPigOrderList.cs View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BO.BO.Bill
{
public class DropPigOrderList
{
public long? B3WeighBill_ID { get; set; }
public long OrderDetail_ID { get; set; }
public int Order { get; set; }
public int HotFadeNumber { get; set; }
public int PlanNumber { get; set; }
public int MaoNumber { get { return PlanNumber - HotFadeNumber; } }
public bool IsDrop { get; set; }
}
}

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

@ -147,5 +147,13 @@ namespace BO.Utils.BillRpc
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetFinishNumbers"; const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetFinishNumbers";
return RpcFacade.Call<int>(method, date); return RpcFacade.Call<int>(method, date);
} }
public static List<DropPigOrderList> GetDropPigOrderList(DateTime date)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/DropPigRpc/GetDropPigOrderList";
var result = RpcFacade.Call<string>(method, date);
result = result.ESerializeDateTime();
return serializer.Deserialize<List<DropPigOrderList>>(result);
}
} }
} }

+ 67
- 54
DropPigReOrder/ReOrderForm.Designer.cs View File

@ -28,9 +28,9 @@
/// </summary> /// </summary>
private void InitializeComponent() 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 dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
this.syncBtn = new System.Windows.Forms.Button(); this.syncBtn = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.uDatePicker1 = new BWP.WinFormControl.UDatePicker(); this.uDatePicker1 = new BWP.WinFormControl.UDatePicker();
@ -40,12 +40,13 @@
this.uTextBoxWithPad1 = new BWP.WinFormControl.UTextBoxWithPad(); this.uTextBoxWithPad1 = new BWP.WinFormControl.UTextBoxWithPad();
this.uTextBoxWithPad2 = new BWP.WinFormControl.UTextBoxWithPad(); this.uTextBoxWithPad2 = new BWP.WinFormControl.UTextBoxWithPad();
this.OkBtn = new System.Windows.Forms.Button(); this.OkBtn = new System.Windows.Forms.Button();
this.updateBtn = new System.Windows.Forms.Button();
this.ExistBtn = new System.Windows.Forms.Button();
this.vScrollBar1 = new System.Windows.Forms.VScrollBar(); this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
this.D_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_IsDrop = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.D_Order = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_B3WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_TangNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_B3WeighBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_HotFadeNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_MaoNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.D_MaoNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_PlanNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.D_PlanNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.orderGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.orderGridView)).BeginInit();
@ -60,6 +61,7 @@
this.syncBtn.TabIndex = 11; this.syncBtn.TabIndex = 11;
this.syncBtn.Text = "同步数据"; this.syncBtn.Text = "同步数据";
this.syncBtn.UseVisualStyleBackColor = true; this.syncBtn.UseVisualStyleBackColor = true;
this.syncBtn.Click += new System.EventHandler(this.syncBtn_Click);
// //
// label1 // label1
// //
@ -91,36 +93,39 @@
this.orderGridView.AllowUserToDeleteRows = false; this.orderGridView.AllowUserToDeleteRows = false;
this.orderGridView.AllowUserToResizeColumns = false; this.orderGridView.AllowUserToResizeColumns = false;
this.orderGridView.AllowUserToResizeRows = false; this.orderGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.orderGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.orderGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7;
this.orderGridView.BackgroundColor = System.Drawing.Color.White; this.orderGridView.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.orderGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.orderGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8;
this.orderGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.orderGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.orderGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.orderGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.D_ID,
this.D_OrderDetail_ID,
this.D_IsDrop,
this.D_Order, this.D_Order,
this.D_B3WeightBill_ID,
this.D_TangNumber,
this.D_B3WeighBill_ID,
this.D_HotFadeNumber,
this.D_MaoNumber, this.D_MaoNumber,
this.D_PlanNumber}); this.D_PlanNumber});
this.orderGridView.Location = new System.Drawing.Point(16, 78); this.orderGridView.Location = new System.Drawing.Point(16, 78);
this.orderGridView.MultiSelect = false; this.orderGridView.MultiSelect = false;
this.orderGridView.Name = "orderGridView"; this.orderGridView.Name = "orderGridView";
this.orderGridView.RowHeadersVisible = false; this.orderGridView.RowHeadersVisible = false;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.orderGridView.RowsDefaultCellStyle = dataGridViewCellStyle3;
this.orderGridView.RowTemplate.Height = 23;
dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.orderGridView.RowsDefaultCellStyle = dataGridViewCellStyle9;
this.orderGridView.RowTemplate.Height = 60;
this.orderGridView.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.orderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.orderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.orderGridView.Size = new System.Drawing.Size(547, 521); this.orderGridView.Size = new System.Drawing.Size(547, 521);
this.orderGridView.TabIndex = 13; this.orderGridView.TabIndex = 13;
this.orderGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.orderGridView_CellClick);
// //
// label2 // label2
// //
@ -163,7 +168,7 @@
// OkBtn // OkBtn
// //
this.OkBtn.Font = new System.Drawing.Font("宋体", 15F); this.OkBtn.Font = new System.Drawing.Font("宋体", 15F);
this.OkBtn.Location = new System.Drawing.Point(666, 328);
this.OkBtn.Location = new System.Drawing.Point(758, 280);
this.OkBtn.Name = "OkBtn"; this.OkBtn.Name = "OkBtn";
this.OkBtn.Size = new System.Drawing.Size(108, 41); this.OkBtn.Size = new System.Drawing.Size(108, 41);
this.OkBtn.TabIndex = 16; this.OkBtn.TabIndex = 16;
@ -171,16 +176,16 @@
this.OkBtn.UseVisualStyleBackColor = true; this.OkBtn.UseVisualStyleBackColor = true;
this.OkBtn.Click += new System.EventHandler(this.OkBtn_Click); this.OkBtn.Click += new System.EventHandler(this.OkBtn_Click);
// //
// updateBtn
// ExistBtn
// //
this.updateBtn.Font = new System.Drawing.Font("宋体", 15F);
this.updateBtn.Location = new System.Drawing.Point(838, 328);
this.updateBtn.Name = "updateBtn";
this.updateBtn.Size = new System.Drawing.Size(108, 41);
this.updateBtn.TabIndex = 17;
this.updateBtn.Text = "更新";
this.updateBtn.UseVisualStyleBackColor = true;
this.updateBtn.Click += new System.EventHandler(this.updateBtn_Click);
this.ExistBtn.Font = new System.Drawing.Font("宋体", 15F);
this.ExistBtn.Location = new System.Drawing.Point(900, 8);
this.ExistBtn.Name = "ExistBtn";
this.ExistBtn.Size = new System.Drawing.Size(108, 41);
this.ExistBtn.TabIndex = 17;
this.ExistBtn.Text = "退出";
this.ExistBtn.UseVisualStyleBackColor = true;
this.ExistBtn.Click += new System.EventHandler(this.existBtn_Click);
// //
// vScrollBar1 // vScrollBar1
// //
@ -189,12 +194,19 @@
this.vScrollBar1.Size = new System.Drawing.Size(40, 521); this.vScrollBar1.Size = new System.Drawing.Size(40, 521);
this.vScrollBar1.TabIndex = 53; this.vScrollBar1.TabIndex = 53;
// //
// D_ID
// D_OrderDetail_ID
// //
this.D_ID.DataPropertyName = "ID";
this.D_ID.HeaderText = "ID";
this.D_ID.Name = "D_ID";
this.D_ID.Visible = false;
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.Visible = false;
//
// D_IsDrop
//
this.D_IsDrop.DataPropertyName = "IsDrop";
this.D_IsDrop.HeaderText = "IsDrop";
this.D_IsDrop.Name = "D_IsDrop";
this.D_IsDrop.Visible = false;
// //
// D_Order // D_Order
// //
@ -202,19 +214,19 @@
this.D_Order.HeaderText = "序号"; this.D_Order.HeaderText = "序号";
this.D_Order.Name = "D_Order"; this.D_Order.Name = "D_Order";
// //
// D_B3WeightBill_ID
// D_B3WeighBill_ID
// //
this.D_B3WeightBill_ID.DataPropertyName = "B3WeightBill_ID";
this.D_B3WeightBill_ID.HeaderText = "磅单号";
this.D_B3WeightBill_ID.Name = "D_B3WeightBill_ID";
this.D_B3WeightBill_ID.Width = 110;
this.D_B3WeighBill_ID.DataPropertyName = "B3WeighBill_ID";
this.D_B3WeighBill_ID.HeaderText = "磅单号";
this.D_B3WeighBill_ID.Name = "D_B3WeighBill_ID";
this.D_B3WeighBill_ID.Width = 110;
// //
// D_TangNumber
// D_HotFadeNumber
// //
this.D_TangNumber.DataPropertyName = "TangNumber";
this.D_TangNumber.HeaderText = "烫褪头数";
this.D_TangNumber.Name = "D_TangNumber";
this.D_TangNumber.Width = 110;
this.D_HotFadeNumber.DataPropertyName = "HotFadeNumber";
this.D_HotFadeNumber.HeaderText = "烫褪头数";
this.D_HotFadeNumber.Name = "D_HotFadeNumber";
this.D_HotFadeNumber.Width = 110;
// //
// D_MaoNumber // D_MaoNumber
// //
@ -236,7 +248,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1020, 617); this.ClientSize = new System.Drawing.Size(1020, 617);
this.Controls.Add(this.vScrollBar1); this.Controls.Add(this.vScrollBar1);
this.Controls.Add(this.updateBtn);
this.Controls.Add(this.ExistBtn);
this.Controls.Add(this.OkBtn); this.Controls.Add(this.OkBtn);
this.Controls.Add(this.uTextBoxWithPad2); this.Controls.Add(this.uTextBoxWithPad2);
this.Controls.Add(this.uTextBoxWithPad1); this.Controls.Add(this.uTextBoxWithPad1);
@ -268,12 +280,13 @@
private BWP.WinFormControl.UTextBoxWithPad uTextBoxWithPad1; private BWP.WinFormControl.UTextBoxWithPad uTextBoxWithPad1;
private BWP.WinFormControl.UTextBoxWithPad uTextBoxWithPad2; private BWP.WinFormControl.UTextBoxWithPad uTextBoxWithPad2;
private System.Windows.Forms.Button OkBtn; private System.Windows.Forms.Button OkBtn;
private System.Windows.Forms.Button updateBtn;
private System.Windows.Forms.Button ExistBtn;
private System.Windows.Forms.VScrollBar vScrollBar1; private System.Windows.Forms.VScrollBar vScrollBar1;
private System.Windows.Forms.DataGridViewTextBoxColumn D_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_OrderDetail_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_IsDrop;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Order; private System.Windows.Forms.DataGridViewTextBoxColumn D_Order;
private System.Windows.Forms.DataGridViewTextBoxColumn D_B3WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_TangNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn D_B3WeighBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_HotFadeNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn D_MaoNumber; private System.Windows.Forms.DataGridViewTextBoxColumn D_MaoNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn D_PlanNumber; private System.Windows.Forms.DataGridViewTextBoxColumn D_PlanNumber;
} }

+ 113
- 5
DropPigReOrder/ReOrderForm.cs View File

@ -1,4 +1,6 @@
using BO.Utils;
using BO.BO.Bill;
using BO.Utils;
using BO.Utils.BillRpc;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
@ -25,7 +27,8 @@ namespace DropPigReOrder
} }
private delegate void InvokeHandler(); private delegate void InvokeHandler();
Thread syncWork;
List<DropPigOrderList> list;
Thread syncThread;
public ReOrderForm() public ReOrderForm()
{ {
InitializeComponent(); InitializeComponent();
@ -34,19 +37,124 @@ namespace DropPigReOrder
orderGridView.DataSource = null; orderGridView.DataSource = null;
this.FormClosing += delegate this.FormClosing += delegate
{ {
if (syncWork != null && syncWork.IsAlive)
syncWork.Abort();
if (syncThread != null && syncThread.IsAlive)
syncThread.Abort();
}; };
} }
private void syncBtn_Click(object sender, EventArgs e)
{
if (syncThread == null || !syncThread.IsAlive)
{
syncThread = new Thread(SyncTask);
syncThread.Start();
syncBtn.BackColor = Color.FromArgb(15, 215, 107);
syncBtn.ForeColor = Color.White;
}
else
{
syncThread.Abort();
syncBtn.BackColor = Color.FromKnownColor(KnownColor.Control);
syncBtn.ForeColor = Color.FromKnownColor(KnownColor.ControlText);
}
}
private void SyncTask()
{
while (true)
{
this.Invoke(new InvokeHandler(delegate()
{
BindOrderGrid();
}));
Thread.Sleep(5000);
}
}
DropPigOrderList lastSelect;
void BindOrderGrid()
{
list = OrderDetailRpc.GetDropPigOrderList(uDatePicker1.Date.Value);
orderGridView.DataSource = list.OrderBy(x => x.Order).ToList();
if (lastSelect == null && orderGridView.CurrentRow != null)
{
lastSelect = orderGridView.CurrentRow.DataBoundItem as DropPigOrderList;
}
foreach (DataGridViewRow row in orderGridView.Rows)
{
if ((bool)row.Cells["D_IsDrop"].Value)
row.DefaultCellStyle.BackColor = Color.Red;
if (lastSelect != null && lastSelect.Order == (int)row.Cells["D_Order"].Value)
{
lastSelect = row.DataBoundItem as DropPigOrderList;
if (lastSelect.IsDrop)
row.DefaultCellStyle.BackColor = Color.Red;
row.DefaultCellStyle.BackColor = orderGridView.RowsDefaultCellStyle.SelectionBackColor;
}
}
InitScrollBar1();
orderGridView.ClearSelection();
try
{
if (roll != -1)
orderGridView.FirstDisplayedScrollingRowIndex = roll;
}
catch
{
roll = -1;
}
orderGridView.Refresh();
}
int roll = -1;
private void InitScrollBar1()
{
vScrollBar1.Maximum = (orderGridView.RowCount - orderGridView.DisplayedRowCount(false) + 30) * orderGridView.RowTemplate.Height;
vScrollBar1.Minimum = 0;
vScrollBar1.SmallChange = orderGridView.RowTemplate.Height;
vScrollBar1.LargeChange = orderGridView.RowTemplate.Height * 30;
this.vScrollBar1.Scroll += (sender, e) =>
{
roll = e.NewValue / orderGridView.RowTemplate.Height;
orderGridView.FirstDisplayedScrollingRowIndex = roll;
};
}
private void OkBtn_Click(object sender, EventArgs e) private void OkBtn_Click(object sender, EventArgs e)
{ {
if (lastSelect == null)
throw new Exception("请选选择掉猪的行记录");
}
private void existBtn_Click(object sender, EventArgs e)
{
this.Close();
} }
private void updateBtn_Click(object sender, EventArgs e)
private void orderGridView_CellClick(object sender, DataGridViewCellEventArgs e)
{ {
if (e.RowIndex == -1)
return;
var entity = orderGridView.CurrentRow.DataBoundItem as DropPigOrderList;
if (lastSelect != null)
{
foreach (DataGridViewRow row in orderGridView.Rows)
{
if (lastSelect.Order == (int)row.Cells["D_Order"].Value)
{
if (lastSelect.IsDrop)
row.DefaultCellStyle.BackColor = Color.Red;
else
row.DefaultCellStyle.BackColor = orderGridView.RowsDefaultCellStyle.BackColor;
break;
}
}
}
lastSelect = entity;
if (lastSelect.IsDrop)
orderGridView.CurrentRow.DefaultCellStyle.SelectionBackColor = Color.Red;
orderGridView.Refresh();
} }
} }
} }

+ 6
- 3
DropPigReOrder/ReOrderForm.resx View File

@ -117,16 +117,19 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="D_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="D_OrderDetail_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_IsDrop.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="D_Order.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="D_Order.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="D_B3WeightBill_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="D_B3WeighBill_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="D_TangNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="D_HotFadeNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="D_MaoNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="D_MaoNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">


Loading…
Cancel
Save