Browse Source

修改。

master
yibo 8 years ago
parent
commit
d68817dc18
11 changed files with 248 additions and 437 deletions
  1. +3
    -3
      BO/Utils/AfterLoginUtil.cs
  2. +2
    -8
      BO/Utils/BillRpc/HouseAndSanctionRpc.cs
  3. +18
    -19
      BO/Utils/BillRpc/OrderDetailRpc.cs
  4. +1
    -1
      ButcherManageClient/Login.cs
  5. +12
    -1
      ButcherOrder/ButcherOrderForm.Designer.cs
  6. +14
    -0
      ButcherOrder/ButcherOrderForm.cs
  7. +0
    -36
      ButcherOrder/ButcherOrderForm.resx
  8. +151
    -231
      QualityAndOrder/QualityOrderForm.Designer.cs
  9. +13
    -42
      QualityAndOrder/QualityOrderForm.cs
  10. +32
    -94
      QualityAndOrder/QualityOrderFormForTab2.cs
  11. +2
    -2
      WeighAndGrading/GradeContext.cs

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

@ -25,8 +25,8 @@ namespace BO.Utils
//#endif
//#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>("过磅员",@"ButcherWeight"),
new Tuple<string,string>("验质员",@"QualityAndOrder"),new Tuple<string,string>("定级员",@"WeighAndGrading")};
//#endif
@ -36,7 +36,7 @@ namespace BO.Utils
if (first == null)
throw new Exception("未注册的角色");
//#if debug
// var filePath = string.Format("{0}.dll", first.Item2);
//var filePath = string.Format("{0}.dll", first.Item2);
//#endif
//#if !debug
var filePath = Path.Combine(Application.StartupPath, string.Format("{0}.dll", first.Item2));


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

@ -12,19 +12,13 @@ namespace BO.Utils.BillRpc
public static class HouseAndSanctionRpc
{
static JavaScriptSerializer serializer = new JavaScriptSerializer();
public static List<HouseAndSanctionList> GetHouseAndSanctionList(DateTime date, int pageSize, int pageNumber)
public static List<HouseAndSanctionList> GetHouseAndSanctionList(DateTime date)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/HouseAndSanctionRpc/GetHouseAndSanctionList";
var json = RpcFacade.Call<string>(method, date, pageSize, pageNumber);
var json = RpcFacade.Call<string>(method, date);
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";


+ 18
- 19
BO/Utils/BillRpc/OrderDetailRpc.cs View File

@ -21,40 +21,39 @@ namespace BO.Utils.BillRpc
return serializer.Deserialize<List<NeedOrderEntity>>(result);
}
public static NeedOrderEntity GetBackWeightBillInfo(long weightId, long orerID)
public static int GetLastNumber(long weightId, long orerID)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetBackWeightBillInfo";
var result = RpcFacade.Call<string>(method, weightId, orerID);
result = result.ESerializeDateTime();
return serializer.Deserialize<NeedOrderEntity>(result);
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetLastNumber";
return RpcFacade.Call<int>(method, weightId, orerID);
}
public static int GetMaxOrder(DateTime date)
public static int GetMaxOrder()
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetMaxOrder";
return RpcFacade.Call<int>(method, date);
return RpcFacade.Call<int>(method, DateTime.Today);
}
public static List<OrderDetail> GetOrderDetail(DateTime date, int pageSize, int pageNumber)
public static int GetCurrentOrder(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetOrderDetail";
var result = RpcFacade.Call<string>(method, date, pageSize, pageNumber);
result = result.ESerializeDateTime();
return serializer.Deserialize<List<OrderDetail>>(result);
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetCurrentOrder";
return RpcFacade.Call<int>(method, id);
}
public static int GetMaxPageNumber(DateTime date, int pageSize)
public static List<OrderDetail> GetOrderDetail(int? minOrder = null)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetMaxPageNumber";
return RpcFacade.Call<int>(method, date, pageSize);
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetOrderDetail";
var result = RpcFacade.Call<string>(method, DateTime.Today, minOrder);
result = result.ESerializeDateTime();
return serializer.Deserialize<List<OrderDetail>>(result);
}
public static void Insert(List<CTuple<long, int>> update, OrderDetail insert)
public static void Insert(OrderDetail insert)
{
insert.AccountingUnit_ID = ButcherAppContext.Context.UserConfig.AccountingUnit_ID;
insert.Creator = ButcherAppContext.Context.UserConfig.UserName;
insert.Date = DateTime.Today;
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/Insert";
insert.ID = RpcFacade.Call<long>(method, serializer.Serialize(update), serializer.Serialize(insert));
insert.ID = RpcFacade.Call<long>(method, serializer.Serialize(insert));
}
public static void UpdateNumber(long id, int number)
@ -69,10 +68,10 @@ namespace BO.Utils.BillRpc
RpcFacade.Call<int>(method, id, "IsHurryButcher", flag);
}
public static void Delete(List<CTuple<long, int>> update, long id)
public static void Delete(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/Delete";
RpcFacade.Call<int>(method, serializer.Serialize(update), id);
RpcFacade.Call<int>(method, id);
}
public static void ChangeShowType(long weightBillID, bool show)


+ 1
- 1
ButcherManageClient/Login.cs View File

@ -123,7 +123,7 @@ namespace ButcherManageClient
private void Login_Load(object sender, EventArgs e)
{
AutoUpdate();
//AutoUpdate();
}
}
}

+ 12
- 1
ButcherOrder/ButcherOrderForm.Designer.cs View File

@ -50,6 +50,7 @@
this.HotFadeNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.updateBtn = new System.Windows.Forms.DataGridViewButtonColumn();
this.viewBtn = new System.Windows.Forms.DataGridViewButtonColumn();
this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
((System.ComponentModel.ISupportInitialize)(this.secondOrderGridView)).BeginInit();
this.SuspendLayout();
//
@ -193,8 +194,9 @@
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.secondOrderGridView.RowsDefaultCellStyle = dataGridViewCellStyle3;
this.secondOrderGridView.RowTemplate.Height = 40;
this.secondOrderGridView.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.secondOrderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.secondOrderGridView.Size = new System.Drawing.Size(595, 569);
this.secondOrderGridView.Size = new System.Drawing.Size(573, 569);
this.secondOrderGridView.TabIndex = 12;
this.secondOrderGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.secondOrderGridView_CellClick);
//
@ -262,11 +264,19 @@
this.viewBtn.UseColumnTextForButtonValue = true;
this.viewBtn.Width = 130;
//
// vScrollBar1
//
this.vScrollBar1.Location = new System.Drawing.Point(603, 91);
this.vScrollBar1.Name = "vScrollBar1";
this.vScrollBar1.Size = new System.Drawing.Size(40, 569);
this.vScrollBar1.TabIndex = 51;
//
// ButcherOrderForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1020, 690);
this.Controls.Add(this.vScrollBar1);
this.Controls.Add(this.secondOrderGridView);
this.Controls.Add(this.okBtn);
this.Controls.Add(this.keyPanel);
@ -310,5 +320,6 @@
private System.Windows.Forms.DataGridViewTextBoxColumn HotFadeNumber;
private System.Windows.Forms.DataGridViewButtonColumn updateBtn;
private System.Windows.Forms.DataGridViewButtonColumn viewBtn;
private System.Windows.Forms.VScrollBar vScrollBar1;
}
}

+ 14
- 0
ButcherOrder/ButcherOrderForm.cs View File

@ -99,6 +99,7 @@ namespace ButcherOrder
}
else
orderLabel.Text = "0";
InitScrollBar1();
secondOrderGridView.Refresh();
}
@ -161,5 +162,18 @@ namespace ButcherOrder
}
}
}
private void InitScrollBar1()
{
vScrollBar1.Maximum = (secondOrderGridView.RowCount - secondOrderGridView.DisplayedRowCount(false) + 30) * secondOrderGridView.RowTemplate.Height;
vScrollBar1.Minimum = 0;
vScrollBar1.SmallChange = secondOrderGridView.RowTemplate.Height;
vScrollBar1.LargeChange = secondOrderGridView.RowTemplate.Height * 30;
this.vScrollBar1.Scroll += (sender, e) =>
{
secondOrderGridView.FirstDisplayedScrollingRowIndex = e.NewValue / secondOrderGridView.RowTemplate.Height;
Application.DoEvents();
};
}
}
}

+ 0
- 36
ButcherOrder/ButcherOrderForm.resx View File

@ -117,39 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="syncBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="orderLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="existBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="numberInput.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="keyPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="okBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="uDatePicker1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="secondOrderGridView.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -174,7 +141,4 @@
<metadata name="viewBtn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

+ 151
- 231
QualityAndOrder/QualityOrderForm.Designer.cs View File

@ -37,16 +37,13 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = 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.vScrollBar1 = new System.Windows.Forms.VScrollBar();
this.panel1 = new System.Windows.Forms.Panel();
this.uTabControl2 = new BWP.WinFormControl.UTabControl();
this.tabPage3 = new System.Windows.Forms.TabPage();
@ -85,10 +82,8 @@
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.vScrollBar3 = new System.Windows.Forms.VScrollBar();
this.vScrollBar2 = new System.Windows.Forms.VScrollBar();
this.panel3 = new System.Windows.Forms.Panel();
this.showHidden = new System.Windows.Forms.RadioButton();
this.showAvailable = new System.Windows.Forms.RadioButton();
@ -99,6 +94,17 @@
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.preOrderGrid = new BWP.WinFormControl.UDataGridView();
this.P_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Show = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_AlreadyNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_LastNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_WeighTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_OKBtn = new System.Windows.Forms.DataGridViewButtonColumn();
this.P_Hidden = new System.Windows.Forms.DataGridViewButtonColumn();
this.orderGrid = new BWP.WinFormControl.UDataGridView();
this.O_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.O_IsHurryButcher = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -112,17 +118,6 @@
this.tab2SyncBtn = new System.Windows.Forms.Button();
this.tab2DateSelect = new BWP.WinFormControl.UDatePicker();
this.label4 = new System.Windows.Forms.Label();
this.P_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Show = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_AlreadyNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_LastNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_WeighTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_OKBtn = new System.Windows.Forms.DataGridViewButtonColumn();
this.P_Hidden = new System.Windows.Forms.DataGridViewButtonColumn();
this.uTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.panel1.SuspendLayout();
@ -154,10 +149,7 @@
//
// 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.vScrollBar1);
this.tabPage1.Controls.Add(this.panel1);
this.tabPage1.Controls.Add(this.inHouseNumberLabel);
this.tabPage1.Controls.Add(this.label2);
@ -179,49 +171,12 @@
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);
// vScrollBar1
//
this.vScrollBar1.Location = new System.Drawing.Point(458, 77);
this.vScrollBar1.Name = "vScrollBar1";
this.vScrollBar1.Size = new System.Drawing.Size(40, 403);
this.vScrollBar1.TabIndex = 50;
//
// panel1
//
@ -534,8 +489,9 @@
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.weightBillGrid.RowsDefaultCellStyle = dataGridViewCellStyle6;
this.weightBillGrid.RowTemplate.Height = 40;
this.weightBillGrid.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.weightBillGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.weightBillGrid.Size = new System.Drawing.Size(452, 387);
this.weightBillGrid.Size = new System.Drawing.Size(433, 403);
this.weightBillGrid.TabIndex = 34;
this.weightBillGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.weightBillGrid_CellClick);
//
@ -597,7 +553,7 @@
// syncBtn
//
this.syncBtn.Font = new System.Drawing.Font("宋体", 15F);
this.syncBtn.Location = new System.Drawing.Point(233, 9);
this.syncBtn.Location = new System.Drawing.Point(277, 9);
this.syncBtn.Name = "syncBtn";
this.syncBtn.Size = new System.Drawing.Size(94, 56);
this.syncBtn.TabIndex = 33;
@ -611,7 +567,7 @@
this.testTimeInput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.testTimeInput.Date = new System.DateTime(2017, 9, 8, 0, 0, 0, 0);
this.testTimeInput.Font = new System.Drawing.Font("宋体", 15F);
this.testTimeInput.Location = new System.Drawing.Point(80, 19);
this.testTimeInput.Location = new System.Drawing.Point(124, 19);
this.testTimeInput.Name = "testTimeInput";
this.testTimeInput.Size = new System.Drawing.Size(135, 30);
this.testTimeInput.TabIndex = 32;
@ -623,18 +579,16 @@
//
this.label20.AutoSize = true;
this.label20.Font = new System.Drawing.Font("宋体", 14F);
this.label20.Location = new System.Drawing.Point(21, 25);
this.label20.Location = new System.Drawing.Point(23, 25);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(66, 19);
this.label20.Size = new System.Drawing.Size(104, 19);
this.label20.TabIndex = 31;
this.label20.Text = "日期:";
this.label20.Text = "过磅日期:";
//
// 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.vScrollBar3);
this.tabPage2.Controls.Add(this.vScrollBar2);
this.tabPage2.Controls.Add(this.panel3);
this.tabPage2.Controls.Add(this.panel2);
this.tabPage2.Controls.Add(this.closeBtn2);
@ -653,49 +607,19 @@
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);
// vScrollBar3
//
this.vScrollBar3.Location = new System.Drawing.Point(1334, 93);
this.vScrollBar3.Name = "vScrollBar3";
this.vScrollBar3.Size = new System.Drawing.Size(40, 663);
this.vScrollBar3.TabIndex = 54;
//
// vScrollBar2
//
this.vScrollBar2.Location = new System.Drawing.Point(538, 93);
this.vScrollBar2.Name = "vScrollBar2";
this.vScrollBar2.Size = new System.Drawing.Size(40, 388);
this.vScrollBar2.TabIndex = 53;
//
// panel3
//
@ -715,7 +639,6 @@
this.showHidden.Name = "showHidden";
this.showHidden.Size = new System.Drawing.Size(67, 24);
this.showHidden.TabIndex = 2;
this.showHidden.TabStop = true;
this.showHidden.Text = "隐藏";
this.showHidden.UseVisualStyleBackColor = true;
this.showHidden.CheckedChanged += new System.EventHandler(this.showRadio_CheckedChanged);
@ -723,6 +646,7 @@
// showAvailable
//
this.showAvailable.AutoSize = true;
this.showAvailable.Checked = true;
this.showAvailable.Font = new System.Drawing.Font("宋体", 15F);
this.showAvailable.Location = new System.Drawing.Point(32, 9);
this.showAvailable.Name = "showAvailable";
@ -741,7 +665,6 @@
this.showAll.Name = "showAll";
this.showAll.Size = new System.Drawing.Size(67, 24);
this.showAll.TabIndex = 0;
this.showAll.TabStop = true;
this.showAll.Text = "全部";
this.showAll.UseVisualStyleBackColor = true;
this.showAll.CheckedChanged += new System.EventHandler(this.showRadio_CheckedChanged);
@ -835,11 +758,106 @@
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.preOrderGrid.RowsDefaultCellStyle = dataGridViewCellStyle10;
this.preOrderGrid.RowTemplate.Height = 40;
this.preOrderGrid.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.preOrderGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.preOrderGrid.Size = new System.Drawing.Size(769, 663);
this.preOrderGrid.Size = new System.Drawing.Size(743, 663);
this.preOrderGrid.TabIndex = 38;
this.preOrderGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.preOrderGrid_CellClick);
//
// P_WeightBill_ID
//
this.P_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.P_WeightBill_ID.HeaderText = "WeightBill_ID";
this.P_WeightBill_ID.Name = "P_WeightBill_ID";
this.P_WeightBill_ID.ReadOnly = true;
this.P_WeightBill_ID.Visible = false;
//
// P_Show
//
this.P_Show.DataPropertyName = "Show";
this.P_Show.HeaderText = "Show";
this.P_Show.Name = "P_Show";
this.P_Show.ReadOnly = true;
this.P_Show.Visible = false;
//
// P_B3ID
//
this.P_B3ID.DataPropertyName = "B3ID";
this.P_B3ID.HeaderText = "磅单号";
this.P_B3ID.Name = "P_B3ID";
this.P_B3ID.ReadOnly = true;
this.P_B3ID.Width = 80;
//
// P_Supplier_Name
//
this.P_Supplier_Name.DataPropertyName = "Supplier_Name";
this.P_Supplier_Name.HeaderText = "供应商";
this.P_Supplier_Name.Name = "P_Supplier_Name";
this.P_Supplier_Name.ReadOnly = true;
this.P_Supplier_Name.Width = 80;
//
// P_HouseNames
//
this.P_HouseNames.DataPropertyName = "HouseNames";
this.P_HouseNames.HeaderText = "圈舍";
this.P_HouseNames.Name = "P_HouseNames";
this.P_HouseNames.ReadOnly = true;
this.P_HouseNames.Width = 95;
//
// P_Number
//
this.P_Number.DataPropertyName = "Number";
this.P_Number.HeaderText = "总头数";
this.P_Number.Name = "P_Number";
this.P_Number.ReadOnly = true;
this.P_Number.Width = 80;
//
// P_AlreadyNumber
//
this.P_AlreadyNumber.DataPropertyName = "AlreadyNumber";
this.P_AlreadyNumber.HeaderText = "已排";
this.P_AlreadyNumber.Name = "P_AlreadyNumber";
this.P_AlreadyNumber.ReadOnly = true;
this.P_AlreadyNumber.Width = 65;
//
// P_LastNumber
//
this.P_LastNumber.DataPropertyName = "LastNumber";
this.P_LastNumber.HeaderText = "剩余";
this.P_LastNumber.Name = "P_LastNumber";
this.P_LastNumber.ReadOnly = true;
this.P_LastNumber.Width = 65;
//
// P_WeighTime
//
this.P_WeighTime.DataPropertyName = "WeighTime";
dataGridViewCellStyle9.Format = "MM/dd HH:mm";
dataGridViewCellStyle9.NullValue = null;
this.P_WeighTime.DefaultCellStyle = dataGridViewCellStyle9;
this.P_WeighTime.HeaderText = "过磅时间";
this.P_WeighTime.Name = "P_WeighTime";
this.P_WeighTime.ReadOnly = true;
this.P_WeighTime.Width = 105;
//
// P_OKBtn
//
this.P_OKBtn.HeaderText = "排宰";
this.P_OKBtn.Name = "P_OKBtn";
this.P_OKBtn.ReadOnly = true;
this.P_OKBtn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.P_OKBtn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.P_OKBtn.Text = "排宰";
this.P_OKBtn.UseColumnTextForButtonValue = true;
this.P_OKBtn.Width = 85;
//
// P_Hidden
//
this.P_Hidden.HeaderText = "隐藏";
this.P_Hidden.Name = "P_Hidden";
this.P_Hidden.ReadOnly = true;
this.P_Hidden.Text = "隐藏";
this.P_Hidden.Width = 85;
//
// orderGrid
//
this.orderGrid.AllowUserToAddRows = false;
@ -877,8 +895,9 @@
dataGridViewCellStyle13.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.orderGrid.RowsDefaultCellStyle = dataGridViewCellStyle13;
this.orderGrid.RowTemplate.Height = 40;
this.orderGrid.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.orderGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.orderGrid.Size = new System.Drawing.Size(540, 371);
this.orderGrid.Size = new System.Drawing.Size(513, 388);
this.orderGrid.TabIndex = 38;
this.orderGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.orderGrid_CellClick);
//
@ -958,7 +977,7 @@
// tab2SyncBtn
//
this.tab2SyncBtn.Font = new System.Drawing.Font("宋体", 15F);
this.tab2SyncBtn.Location = new System.Drawing.Point(233, 9);
this.tab2SyncBtn.Location = new System.Drawing.Point(277, 9);
this.tab2SyncBtn.Name = "tab2SyncBtn";
this.tab2SyncBtn.Size = new System.Drawing.Size(94, 56);
this.tab2SyncBtn.TabIndex = 37;
@ -972,7 +991,7 @@
this.tab2DateSelect.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tab2DateSelect.Date = new System.DateTime(2017, 9, 8, 0, 0, 0, 0);
this.tab2DateSelect.Font = new System.Drawing.Font("宋体", 15F);
this.tab2DateSelect.Location = new System.Drawing.Point(80, 19);
this.tab2DateSelect.Location = new System.Drawing.Point(124, 19);
this.tab2DateSelect.Name = "tab2DateSelect";
this.tab2DateSelect.Size = new System.Drawing.Size(135, 30);
this.tab2DateSelect.TabIndex = 36;
@ -984,105 +1003,11 @@
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("宋体", 14F);
this.label4.Location = new System.Drawing.Point(21, 25);
this.label4.Location = new System.Drawing.Point(23, 25);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(66, 19);
this.label4.Size = new System.Drawing.Size(104, 19);
this.label4.TabIndex = 35;
this.label4.Text = "日期:";
//
// P_WeightBill_ID
//
this.P_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.P_WeightBill_ID.HeaderText = "WeightBill_ID";
this.P_WeightBill_ID.Name = "P_WeightBill_ID";
this.P_WeightBill_ID.ReadOnly = true;
this.P_WeightBill_ID.Visible = false;
//
// P_Show
//
this.P_Show.DataPropertyName = "Show";
this.P_Show.HeaderText = "Show";
this.P_Show.Name = "P_Show";
this.P_Show.ReadOnly = true;
this.P_Show.Visible = false;
//
// P_B3ID
//
this.P_B3ID.DataPropertyName = "B3ID";
this.P_B3ID.HeaderText = "磅单号";
this.P_B3ID.Name = "P_B3ID";
this.P_B3ID.ReadOnly = true;
this.P_B3ID.Width = 80;
//
// P_Supplier_Name
//
this.P_Supplier_Name.DataPropertyName = "Supplier_Name";
this.P_Supplier_Name.HeaderText = "供应商";
this.P_Supplier_Name.Name = "P_Supplier_Name";
this.P_Supplier_Name.ReadOnly = true;
this.P_Supplier_Name.Width = 80;
//
// P_HouseNames
//
this.P_HouseNames.DataPropertyName = "HouseNames";
this.P_HouseNames.HeaderText = "圈舍";
this.P_HouseNames.Name = "P_HouseNames";
this.P_HouseNames.ReadOnly = true;
this.P_HouseNames.Width = 95;
//
// P_Number
//
this.P_Number.DataPropertyName = "Number";
this.P_Number.HeaderText = "总头数";
this.P_Number.Name = "P_Number";
this.P_Number.ReadOnly = true;
this.P_Number.Width = 80;
//
// P_AlreadyNumber
//
this.P_AlreadyNumber.DataPropertyName = "AlreadyNumber";
this.P_AlreadyNumber.HeaderText = "已排";
this.P_AlreadyNumber.Name = "P_AlreadyNumber";
this.P_AlreadyNumber.ReadOnly = true;
this.P_AlreadyNumber.Width = 65;
//
// P_LastNumber
//
this.P_LastNumber.DataPropertyName = "LastNumber";
this.P_LastNumber.HeaderText = "剩余";
this.P_LastNumber.Name = "P_LastNumber";
this.P_LastNumber.ReadOnly = true;
this.P_LastNumber.Width = 65;
//
// P_WeighTime
//
this.P_WeighTime.DataPropertyName = "WeighTime";
dataGridViewCellStyle9.Format = "MM/dd HH:mm";
dataGridViewCellStyle9.NullValue = null;
this.P_WeighTime.DefaultCellStyle = dataGridViewCellStyle9;
this.P_WeighTime.HeaderText = "过磅时间";
this.P_WeighTime.Name = "P_WeighTime";
this.P_WeighTime.ReadOnly = true;
this.P_WeighTime.Width = 105;
//
// P_OKBtn
//
this.P_OKBtn.HeaderText = "排宰";
this.P_OKBtn.Name = "P_OKBtn";
this.P_OKBtn.ReadOnly = true;
this.P_OKBtn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.P_OKBtn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.P_OKBtn.Text = "排宰";
this.P_OKBtn.UseColumnTextForButtonValue = true;
this.P_OKBtn.Width = 85;
//
// P_Hidden
//
this.P_Hidden.HeaderText = "隐藏";
this.P_Hidden.Name = "P_Hidden";
this.P_Hidden.ReadOnly = true;
this.P_Hidden.Text = "隐藏";
this.P_Hidden.Width = 85;
this.label4.Text = "过磅日期:";
//
// QualityOrderForm
//
@ -1180,14 +1105,6 @@
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;
private System.Windows.Forms.DataGridViewTextBoxColumn P_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn P_Show;
private System.Windows.Forms.DataGridViewTextBoxColumn P_B3ID;
@ -1199,6 +1116,9 @@
private System.Windows.Forms.DataGridViewTextBoxColumn P_WeighTime;
private System.Windows.Forms.DataGridViewButtonColumn P_OKBtn;
private System.Windows.Forms.DataGridViewButtonColumn P_Hidden;
private System.Windows.Forms.VScrollBar vScrollBar1;
private System.Windows.Forms.VScrollBar vScrollBar2;
private System.Windows.Forms.VScrollBar vScrollBar3;


+ 13
- 42
QualityAndOrder/QualityOrderForm.cs View File

@ -1,6 +1,7 @@
using BO.BO;
using BO.Utils;
using BO.Utils.BillRpc;
using BWP.WinFormControl;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -102,6 +103,7 @@ namespace QualityAndOrder
if ((bool)row.Cells["W_AlreadyHouse"].Value)
row.DefaultCellStyle.BackColor = Color.YellowGreen;
}
InitScrollBar();
weightBillGrid.Refresh();
}
@ -339,7 +341,7 @@ namespace QualityAndOrder
GetDataFromUI();
HouseAndSanctionRpc.UpdateInsertHouseAndSanction(Dmo);
Dmo = null;
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value, 9, tab1PageNumber);
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value);
BindWeightBillGrid();
BindNumberLabel();
ResetTab1Controls();
@ -347,7 +349,7 @@ namespace QualityAndOrder
private void syncBtn_Click(object sender, EventArgs e)
{
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value, 9, 1);
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value);
BindWeightBillGrid();
//BindNumberLabel();
//tab1SyncThread = new Thread(StartQuery) { IsBackground = true };
@ -530,50 +532,19 @@ namespace QualityAndOrder
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)
private void InitScrollBar()
{
if (tab1PageNumber != 1)
vScrollBar1.Maximum = (weightBillGrid.RowCount - weightBillGrid.DisplayedRowCount(false) + 30) * weightBillGrid.RowTemplate.Height;
vScrollBar1.Minimum = 0;
vScrollBar1.SmallChange = weightBillGrid.RowTemplate.Height;
vScrollBar1.LargeChange = weightBillGrid.RowTemplate.Height * 30;
this.vScrollBar1.Scroll += (sender, e) =>
{
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();
}
weightBillGrid.FirstDisplayedScrollingRowIndex = e.NewValue / weightBillGrid.RowTemplate.Height;
Application.DoEvents();
};
}
}
class SanctionSplit3Part
{
public long Sanction_ID1 { get; set; }


+ 32
- 94
QualityAndOrder/QualityOrderFormForTab2.cs View File

@ -28,7 +28,6 @@ namespace QualityAndOrder
preOrderGrid.DataSource = null;
AddKeyPadForTab2();
showAvailable.Checked = true;
}
private void AddKeyPadForTab2()
@ -74,10 +73,8 @@ namespace QualityAndOrder
}
private void tab2SyncBtn_Click(object sender, EventArgs e)
{
needOrderList = OrderDetailRpc.GetNeedOrderWeightBill(tab2DateSelect.Date.Value, GetSelectType());
{
BindPreOrderGrid();
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, 1);
BindOrderGrid();
if (tb2SyncThread == null)
{
@ -137,6 +134,7 @@ namespace QualityAndOrder
void BindPreOrderGrid()
{
needOrderList = OrderDetailRpc.GetNeedOrderWeightBill(tab2DateSelect.Date.Value, GetSelectType());
preOrderGrid.DataSource = needOrderList.OrderBy(x => x.WeighTime).ToList();
foreach (DataGridViewRow row in preOrderGrid.Rows)
{
@ -145,17 +143,20 @@ namespace QualityAndOrder
row.DefaultCellStyle.BackColor = Color.YellowGreen;
((DataGridViewButtonCell)row.Cells["P_Hidden"]).Value = show ? "隐藏" : "显示";
}
InitScrollBar3();
preOrderGrid.Refresh();
}
void BindOrderGrid()
{
orderList = OrderDetailRpc.GetOrderDetail();
orderGrid.DataSource = orderList.OrderByDescending(x => x.Order).ToList();
foreach (DataGridViewRow row in orderGrid.Rows)
{
if ((bool)row.Cells["O_IsHurryButcher"].Value)
row.DefaultCellStyle.BackColor = Color.YellowGreen;
}
InitScrollBar2();
orderGrid.Refresh();
}
@ -170,9 +171,9 @@ namespace QualityAndOrder
{
var currentOrder = 0;
if (orderGrid.CurrentRow != null)
currentOrder = (int)orderGrid.CurrentRow.Cells["O_Order"].Value;
currentOrder = OrderDetailRpc.GetCurrentOrder((long)orderGrid.CurrentRow.Cells["O_ID"].Value);
else
currentOrder = OrderDetailRpc.GetMaxOrder(tab2DateSelect.Date.Value);
currentOrder = OrderDetailRpc.GetMaxOrder();
currentOrder++;
var order = new OrderDetail();
order.Order = currentOrder;
@ -180,26 +181,15 @@ namespace QualityAndOrder
order.PlanNumber = entity.LastNumber;
order.WeightBill_ID = entity.WeightBill_ID;
order.B3WeighBill_ID = entity.B3ID;
order.Date = tab2DateSelect.Date.Value;
var needUpdate = ReOrder(order, true);
OrderDetailRpc.Insert(needUpdate, order);
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);
OrderDetailRpc.Insert(order);
BindOrderGrid();
needOrderList.Remove(entity);
BindPreOrderGrid();
}
else
{
entity.Show = !entity.Show;
OrderDetailRpc.ChangeShowType(entity.WeightBill_ID, entity.Show);
var row = preOrderGrid.CurrentRow;
if (entity.Show)
row.DefaultCellStyle.BackColor = preOrderGrid.RowsDefaultCellStyle.BackColor;
else
row.DefaultCellStyle.BackColor = Color.YellowGreen;
((DataGridViewButtonCell)row.Cells["P_Hidden"]).Value = entity.Show ? "隐藏" : "显示";
preOrderGrid.Refresh();
}
BindPreOrderGrid();
}
private void orderGrid_CellClick(object sender, DataGridViewCellEventArgs e)
@ -213,58 +203,24 @@ namespace QualityAndOrder
{
if (entity.PlanNumber < 0)
throw new Exception("排宰头数不能小于0");
var backInfo = OrderDetailRpc.GetBackWeightBillInfo(entity.WeightBill_ID, entity.ID);
var lastNumber = OrderDetailRpc.GetLastNumber(entity.WeightBill_ID, entity.ID);
if (entity.PlanNumber > backInfo.LastNumber)
if (entity.PlanNumber > lastNumber)
throw new Exception("排宰总头数多余过磅头数");
if (entity.PlanNumber == backInfo.LastNumber)
if (entity.PlanNumber == lastNumber)
return;
var item = needOrderList.FirstOrDefault(x => x.WeightBill_ID == backInfo.WeightBill_ID);
if (item == null)
{
item = new NeedOrderEntity();
needOrderList.Add(item);
item.WeightBill_ID = backInfo.WeightBill_ID;
item.Supplier_Name = backInfo.Supplier_Name;
item.HouseNames = backInfo.HouseNames;
item.Number = backInfo.Number;
item.AlreadyNumber = backInfo.AlreadyNumber;
item.WeighTime = backInfo.WeighTime;
item.B3ID = entity.B3WeighBill_ID;
}
if (entity.PlanNumber == 0)
{
orderList.Remove(entity);
var list = ReOrder(entity, false);
OrderDetailRpc.Delete(list, entity.ID);
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);
BindOrderGrid();
}
OrderDetailRpc.Delete(entity.ID);
else
OrderDetailRpc.UpdateNumber(entity.ID, entity.PlanNumber);
item.AlreadyNumber = backInfo.AlreadyNumber + entity.PlanNumber;
BindOrderGrid();
BindPreOrderGrid();
}
else if ((e.ColumnIndex == orderGrid.ColumnCount - 1))//急宰
{
entity.IsHurryButcher = !entity.IsHurryButcher;
OrderDetailRpc.UpdateHurryFlag(entity.ID, entity.IsHurryButcher);
BindOrderGrid();
}
}
List<CTuple<long, int>> ReOrder(OrderDetail dealDetail, bool isAdd)
{
var result = new List<CTuple<long, int>>();
foreach (var item in orderList.OrderByDescending(x => x.Order))
{
if (item.Order < dealDetail.Order)
break;
item.Order += isAdd ? 1 : -1;
result.Add(new CTuple<long, int>(item.ID, item.Order));
}
return result;
BindOrderGrid();
}
bool? GetSelectType()
@ -279,51 +235,33 @@ namespace QualityAndOrder
private void showRadio_CheckedChanged(object sender, EventArgs e)
{
needOrderList = OrderDetailRpc.GetNeedOrderWeightBill(tab2DateSelect.Date.Value, GetSelectType());
BindPreOrderGrid();
}
static int tab2PageNumber = 1;
private void _2FirstPageBtn_Click(object sender, EventArgs e)
private void InitScrollBar2()
{
if (tab2PageNumber != 1)
vScrollBar2.Maximum = (orderGrid.RowCount - orderGrid.DisplayedRowCount(false) + 30) * orderGrid.RowTemplate.Height;
vScrollBar2.Minimum = 0;
vScrollBar2.SmallChange = orderGrid.RowTemplate.Height;
vScrollBar2.LargeChange = orderGrid.RowTemplate.Height * 30;
this.vScrollBar2.Scroll += (sender, e) =>
{
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();
}
orderGrid.FirstDisplayedScrollingRowIndex = e.NewValue / orderGrid.RowTemplate.Height;
Application.DoEvents();
};
}
private void _2LastPageBtn_Click(object sender, EventArgs e)
private void InitScrollBar3()
{
var max = OrderDetailRpc.GetMaxPageNumber(tab2DateSelect.Date.Value, 8);
if (tab2PageNumber != max)
vScrollBar3.Maximum = (preOrderGrid.RowCount - preOrderGrid.DisplayedRowCount(false) + 30) * preOrderGrid.RowTemplate.Height;
vScrollBar3.Minimum = 0;
vScrollBar3.SmallChange = preOrderGrid.RowTemplate.Height;
vScrollBar3.LargeChange = preOrderGrid.RowTemplate.Height * 30;
this.vScrollBar3.Scroll += (sender, e) =>
{
tab2PageNumber = max;
orderList = OrderDetailRpc.GetOrderDetail(tab2DateSelect.Date.Value, 8, tab2PageNumber);
BindOrderGrid();
}
preOrderGrid.FirstDisplayedScrollingRowIndex = e.NewValue / preOrderGrid.RowTemplate.Height;
Application.DoEvents();
};
}
}
}

+ 2
- 2
WeighAndGrading/GradeContext.cs View File

@ -12,10 +12,10 @@ namespace WeighAndGrading
public static class GradeContext
{
//#if debug
//private static string loginConfigPath = @"C:\BwpB3Project\src\B3ButcherManageClient\ButcherManageClient\bin\Debug\GradeConfig.xml";
private static string loginConfigPath = @"C:\BwpB3Project\src\B3ButcherManageClient\ButcherManageClient\bin\Debug\GradeConfig.xml";
//#endif
//#if !debug
private static string loginConfigPath = Application.StartupPath + "\\GradeConfig.xml";
//private static string loginConfigPath = Application.StartupPath + "\\GradeConfig.xml";
//#endif
private static GradeConfig _config;
public static GradeConfig Config


Loading…
Cancel
Save