Browse Source

分割称重

master
wugang 8 years ago
parent
commit
b99f1924f6
7 changed files with 300 additions and 106 deletions
  1. +0
    -1
      BO/LocalDmoSession.cs
  2. +3
    -3
      ButcherManageClient/Login.cs
  3. +3
    -0
      SegmentationWeight/Rpc/Dto/SegmentationWeightRecord.cs
  4. +29
    -0
      SegmentationWeight/Rpc/SegmentationWeightRecordRpc.cs
  5. +140
    -92
      SegmentationWeight/SegmentationWeightForm.Designer.cs
  6. +122
    -10
      SegmentationWeight/SegmentationWeightForm.cs
  7. +3
    -0
      SegmentationWeight/SegmentationWeightForm.resx

+ 0
- 1
BO/LocalDmoSession.cs View File

@ -235,7 +235,6 @@ namespace BO
query.Where.Conditions.Add(DQCondition.Or(, )); query.Where.Conditions.Add(DQCondition.Or(, ));
query.Range = SelectRange.Top(top); query.Range = SelectRange.Top(top);
query.Where.Conditions.Add(DQCondition.EQ("IsDeleted", false));
List<T> list; List<T> list;
using (var session = LocalDmoSession.New()) using (var session = LocalDmoSession.New())


+ 3
- 3
ButcherManageClient/Login.cs View File

@ -33,7 +33,7 @@ namespace ButcherManageClient
{ {
InitializeComponent(); InitializeComponent();
userNameTxt.Text = ButcherAppContext.Context.UserConfig.UserName; userNameTxt.Text = ButcherAppContext.Context.UserConfig.UserName;
pwdTxt.Text = "123";
pwdTxt.Text = "";
} }
private void settingBtn_Click(object sender, EventArgs e) private void settingBtn_Click(object sender, EventArgs e)
@ -65,9 +65,9 @@ namespace ButcherManageClient
throw new Exception("离线状态请保持与上次用户名一致"); throw new Exception("离线状态请保持与上次用户名一致");
ButcherAppContext.Context.UserConfig.Connection = false; ButcherAppContext.Context.UserConfig.Connection = false;
} }
var form = AfterLoginUtil.CreateForm(ButcherAppContext.Context.UserConfig.Role);
// var form = AfterLoginUtil.CreateForm(ButcherAppContext.Context.UserConfig.Role);
// var form = AfterLoginUtil.CreateForm("分割入库"); // var form = AfterLoginUtil.CreateForm("分割入库");
// var form = AfterLoginUtil.CreateForm("分割称重");
var form = AfterLoginUtil.CreateForm("分割称重");
if (form == null) if (form == null)
throw new Exception("权限不符"); throw new Exception("权限不符");
form.FormClosing += delegate { SubFormClosing(); }; form.FormClosing += delegate { SubFormClosing(); };


+ 3
- 0
SegmentationWeight/Rpc/Dto/SegmentationWeightRecord.cs View File

@ -16,6 +16,9 @@ namespace SegmentationWeight.Rpc.Dto
[DFClass] [DFClass]
public class SegmentationWeightRecord: LocalSyncBase public class SegmentationWeightRecord: LocalSyncBase
{ {
[NonDmoProperty]
public int Index { get; set; }
public string BarCode { get; set; }//条码 public string BarCode { get; set; }//条码
public long Goods_ID { get; set; } public long Goods_ID { get; set; }
public string Goods_Name { get; set; } public string Goods_Name { get; set; }


+ 29
- 0
SegmentationWeight/Rpc/SegmentationWeightRecordRpc.cs View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -66,6 +67,34 @@ namespace SegmentationWeight.Rpc
get { return "/MainSystem/B3ClientService/Rpcs/BillRpc/SegmentationWeightRecordRpc/Delete"; } get { return "/MainSystem/B3ClientService/Rpcs/BillRpc/SegmentationWeightRecordRpc/Delete"; }
} }
public BindingList<SegmentationWeightRecord> GetTodayList()
{
return GetListByDate(DateTime.Today);
}
public BindingList<SegmentationWeightRecord> GetListByDate(DateTime date)
{
var bindList=new BindingList<SegmentationWeightRecord>();
var list=new List<SegmentationWeightRecord>();
var query = new DmoQuery(typeof(SegmentationWeightRecord));
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("CreateTime", date.Date));
query.Where.Conditions.Add(DQCondition.LessThan("CreateTime", date.Date.AddDays(1)));
query.Where.Conditions.Add(DQCondition.EQ("IsDeleted",false));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID",false));
using (var session = LocalDmoSession.New())
{
list= session.ExecuteList(query).Cast<SegmentationWeightRecord>().ToList();
}
foreach (SegmentationWeightRecord record in list)
{
bindList.Add(record);
}
return bindList;
}
public static int GetTodayTotalCount(DateTime date) public static int GetTodayTotalCount(DateTime date)
{ {
var query = new DQueryDom(new JoinAlias(typeof(SegmentationWeightRecord))); var query = new DQueryDom(new JoinAlias(typeof(SegmentationWeightRecord)));


+ 140
- 92
SegmentationWeight/SegmentationWeightForm.Designer.cs View File

@ -28,11 +28,13 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = 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 dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.btnEnablePrint = new System.Windows.Forms.Button();
this.btnEnableWeight = new System.Windows.Forms.Button(); this.btnEnableWeight = new System.Windows.Forms.Button();
this.btnEnd = new System.Windows.Forms.Button(); this.btnEnd = new System.Windows.Forms.Button();
this.btnStart = new System.Windows.Forms.Button(); this.btnStart = new System.Windows.Forms.Button();
@ -55,10 +57,6 @@
this.flpGoods = new System.Windows.Forms.FlowLayoutPanel(); this.flpGoods = new System.Windows.Forms.FlowLayoutPanel();
this.flpClass = new System.Windows.Forms.FlowLayoutPanel(); this.flpClass = new System.Windows.Forms.FlowLayoutPanel();
this.uDataGridView1 = new BWP.WinFormControl.UDataGridView(); this.uDataGridView1 = new BWP.WinFormControl.UDataGridView();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.lblGoodsName = new System.Windows.Forms.Label(); this.lblGoodsName = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
@ -74,7 +72,13 @@
this.lblLeftWeight = new System.Windows.Forms.Label(); this.lblLeftWeight = new System.Windows.Forms.Label();
this.lblLeftNumber = new System.Windows.Forms.Label(); this.lblLeftNumber = new System.Windows.Forms.Label();
this.lblGoodsSpec = new System.Windows.Forms.Label(); this.lblGoodsSpec = new System.Windows.Forms.Label();
this.btnEnablePrint = new System.Windows.Forms.Button();
this.btnRePrint = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.btnSumbit = new System.Windows.Forms.Button();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
@ -132,6 +136,17 @@
this.panel1.Size = new System.Drawing.Size(1115, 123); this.panel1.Size = new System.Drawing.Size(1115, 123);
this.panel1.TabIndex = 2; this.panel1.TabIndex = 2;
// //
// btnEnablePrint
//
this.btnEnablePrint.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnEnablePrint.Location = new System.Drawing.Point(468, 17);
this.btnEnablePrint.Name = "btnEnablePrint";
this.btnEnablePrint.Size = new System.Drawing.Size(111, 34);
this.btnEnablePrint.TabIndex = 41;
this.btnEnablePrint.Text = "启用打码";
this.btnEnablePrint.UseVisualStyleBackColor = true;
this.btnEnablePrint.Click += new System.EventHandler(this.btnEnablePrint_Click);
//
// btnEnableWeight // btnEnableWeight
// //
this.btnEnableWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnEnableWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@ -325,6 +340,9 @@
// //
// splitContainer2.Panel2 // splitContainer2.Panel2
// //
this.splitContainer2.Panel2.Controls.Add(this.btnSumbit);
this.splitContainer2.Panel2.Controls.Add(this.btnDelete);
this.splitContainer2.Panel2.Controls.Add(this.btnRePrint);
this.splitContainer2.Panel2.Controls.Add(this.uDataGridView1); this.splitContainer2.Panel2.Controls.Add(this.uDataGridView1);
this.splitContainer2.Panel2.Controls.Add(this.tableLayoutPanel1); this.splitContainer2.Panel2.Controls.Add(this.tableLayoutPanel1);
this.splitContainer2.Size = new System.Drawing.Size(1117, 461); this.splitContainer2.Size = new System.Drawing.Size(1117, 461);
@ -371,22 +389,21 @@
this.uDataGridView1.AllowUserToDeleteRows = false; this.uDataGridView1.AllowUserToDeleteRows = false;
this.uDataGridView1.AllowUserToResizeColumns = false; this.uDataGridView1.AllowUserToResizeColumns = false;
this.uDataGridView1.AllowUserToResizeRows = false; this.uDataGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; this.uDataGridView1.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
this.uDataGridView1.ColumnHeadersHeight = 40; this.uDataGridView1.ColumnHeadersHeight = 40;
this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this., this.,
this., this.,
@ -397,48 +414,14 @@
this.uDataGridView1.Name = "uDataGridView1"; this.uDataGridView1.Name = "uDataGridView1";
this.uDataGridView1.ReadOnly = true; this.uDataGridView1.ReadOnly = true;
this.uDataGridView1.RowHeadersVisible = false; this.uDataGridView1.RowHeadersVisible = false;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle6;
this.uDataGridView1.RowTemplate.Height = 23;
dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle12;
this.uDataGridView1.RowTemplate.Height = 40;
this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.uDataGridView1.Size = new System.Drawing.Size(391, 348);
this.uDataGridView1.Size = new System.Drawing.Size(386, 295);
this.uDataGridView1.TabIndex = 1; this.uDataGridView1.TabIndex = 1;
// //
// 序号
//
this..DataPropertyName = "ID";
this..HeaderText = "序号";
this..Name = "序号";
this..ReadOnly = true;
this..Width = 80;
//
// 条码
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "BarCode";
this..HeaderText = "条码";
this..Name = "条码";
this..ReadOnly = true;
this..Width = 60;
//
// 产品
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this..DataPropertyName = "Goods_Name";
this..HeaderText = "产品";
this..MinimumWidth = 100;
this..Name = "产品";
this..ReadOnly = true;
//
// 重量
//
this..DataPropertyName = "Weight";
this..HeaderText = "重量";
this..Name = "重量";
this..ReadOnly = true;
this..Width = 80;
//
// tableLayoutPanel1 // tableLayoutPanel1
// //
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -449,7 +432,7 @@
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 41.77215F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 41.77215F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 68F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 68F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 58F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 58F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 81F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 85F));
this.tableLayoutPanel1.Controls.Add(this.lblGoodsName, 0, 1); this.tableLayoutPanel1.Controls.Add(this.lblGoodsName, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label8, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label8, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label3, 1, 1); this.tableLayoutPanel1.Controls.Add(this.label3, 1, 1);
@ -470,7 +453,7 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(392, 98);
this.tableLayoutPanel1.Size = new System.Drawing.Size(389, 98);
this.tableLayoutPanel1.TabIndex = 0; this.tableLayoutPanel1.TabIndex = 0;
// //
// lblGoodsName // lblGoodsName
@ -481,7 +464,7 @@
this.lblGoodsName.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblGoodsName.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblGoodsName.Location = new System.Drawing.Point(4, 33); this.lblGoodsName.Location = new System.Drawing.Point(4, 33);
this.lblGoodsName.Name = "lblGoodsName"; this.lblGoodsName.Name = "lblGoodsName";
this.lblGoodsName.Size = new System.Drawing.Size(98, 31);
this.lblGoodsName.Size = new System.Drawing.Size(94, 31);
this.lblGoodsName.TabIndex = 0; this.lblGoodsName.TabIndex = 0;
this.lblGoodsName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblGoodsName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
@ -493,7 +476,7 @@
this.label8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(4, 1); this.label8.Location = new System.Drawing.Point(4, 1);
this.label8.Name = "label8"; this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(98, 31);
this.label8.Size = new System.Drawing.Size(94, 31);
this.label8.TabIndex = 0; this.label8.TabIndex = 0;
this.label8.Text = "产品"; this.label8.Text = "产品";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -504,9 +487,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(109, 33);
this.label3.Location = new System.Drawing.Point(105, 33);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(68, 31);
this.label3.Size = new System.Drawing.Size(65, 31);
this.label3.TabIndex = 0; this.label3.TabIndex = 0;
this.label3.Text = "重量"; this.label3.Text = "重量";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -517,9 +500,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(109, 65);
this.label2.Location = new System.Drawing.Point(105, 65);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(68, 32);
this.label2.Size = new System.Drawing.Size(65, 32);
this.label2.TabIndex = 0; this.label2.TabIndex = 0;
this.label2.Text = "数量"; this.label2.Text = "数量";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -530,9 +513,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.label7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.Location = new System.Drawing.Point(312, 1);
this.label7.Location = new System.Drawing.Point(305, 1);
this.label7.Name = "label7"; this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(76, 31);
this.label7.Size = new System.Drawing.Size(80, 31);
this.label7.TabIndex = 0; this.label7.TabIndex = 0;
this.label7.Text = "剩余"; this.label7.Text = "剩余";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -543,7 +526,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.label9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label9.Location = new System.Drawing.Point(253, 1);
this.label9.Location = new System.Drawing.Point(246, 1);
this.label9.Name = "label9"; this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(52, 31); this.label9.Size = new System.Drawing.Size(52, 31);
this.label9.TabIndex = 0; this.label9.TabIndex = 0;
@ -556,7 +539,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblPlanWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblPlanWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblPlanWeight.Location = new System.Drawing.Point(184, 33);
this.lblPlanWeight.Location = new System.Drawing.Point(177, 33);
this.lblPlanWeight.Name = "lblPlanWeight"; this.lblPlanWeight.Name = "lblPlanWeight";
this.lblPlanWeight.Size = new System.Drawing.Size(62, 31); this.lblPlanWeight.Size = new System.Drawing.Size(62, 31);
this.lblPlanWeight.TabIndex = 0; this.lblPlanWeight.TabIndex = 0;
@ -568,7 +551,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblNumber.Location = new System.Drawing.Point(253, 65);
this.lblNumber.Location = new System.Drawing.Point(246, 65);
this.lblNumber.Name = "lblNumber"; this.lblNumber.Name = "lblNumber";
this.lblNumber.Size = new System.Drawing.Size(52, 32); this.lblNumber.Size = new System.Drawing.Size(52, 32);
this.lblNumber.TabIndex = 0; this.lblNumber.TabIndex = 0;
@ -580,7 +563,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWeight.Location = new System.Drawing.Point(253, 33);
this.lblWeight.Location = new System.Drawing.Point(246, 33);
this.lblWeight.Name = "lblWeight"; this.lblWeight.Name = "lblWeight";
this.lblWeight.Size = new System.Drawing.Size(52, 31); this.lblWeight.Size = new System.Drawing.Size(52, 31);
this.lblWeight.TabIndex = 0; this.lblWeight.TabIndex = 0;
@ -592,7 +575,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblPlanNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblPlanNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblPlanNumber.Location = new System.Drawing.Point(184, 65);
this.lblPlanNumber.Location = new System.Drawing.Point(177, 65);
this.lblPlanNumber.Name = "lblPlanNumber"; this.lblPlanNumber.Name = "lblPlanNumber";
this.lblPlanNumber.Size = new System.Drawing.Size(62, 32); this.lblPlanNumber.Size = new System.Drawing.Size(62, 32);
this.lblPlanNumber.TabIndex = 0; this.lblPlanNumber.TabIndex = 0;
@ -604,7 +587,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(184, 1);
this.label1.Location = new System.Drawing.Point(177, 1);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(62, 31); this.label1.Size = new System.Drawing.Size(62, 31);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
@ -617,9 +600,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblLeftWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblLeftWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblLeftWeight.Location = new System.Drawing.Point(312, 33);
this.lblLeftWeight.Location = new System.Drawing.Point(305, 33);
this.lblLeftWeight.Name = "lblLeftWeight"; this.lblLeftWeight.Name = "lblLeftWeight";
this.lblLeftWeight.Size = new System.Drawing.Size(76, 31);
this.lblLeftWeight.Size = new System.Drawing.Size(80, 31);
this.lblLeftWeight.TabIndex = 0; this.lblLeftWeight.TabIndex = 0;
this.lblLeftWeight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblLeftWeight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
@ -629,9 +612,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblLeftNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblLeftNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblLeftNumber.Location = new System.Drawing.Point(312, 65);
this.lblLeftNumber.Location = new System.Drawing.Point(305, 65);
this.lblLeftNumber.Name = "lblLeftNumber"; this.lblLeftNumber.Name = "lblLeftNumber";
this.lblLeftNumber.Size = new System.Drawing.Size(76, 32);
this.lblLeftNumber.Size = new System.Drawing.Size(80, 32);
this.lblLeftNumber.TabIndex = 0; this.lblLeftNumber.TabIndex = 0;
this.lblLeftNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblLeftNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
@ -643,20 +626,82 @@
this.lblGoodsSpec.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblGoodsSpec.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblGoodsSpec.Location = new System.Drawing.Point(4, 65); this.lblGoodsSpec.Location = new System.Drawing.Point(4, 65);
this.lblGoodsSpec.Name = "lblGoodsSpec"; this.lblGoodsSpec.Name = "lblGoodsSpec";
this.lblGoodsSpec.Size = new System.Drawing.Size(98, 32);
this.lblGoodsSpec.Size = new System.Drawing.Size(94, 32);
this.lblGoodsSpec.TabIndex = 0; this.lblGoodsSpec.TabIndex = 0;
this.lblGoodsSpec.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblGoodsSpec.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// btnEnablePrint
// btnRePrint
//
this.btnRePrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRePrint.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRePrint.Location = new System.Drawing.Point(10, 409);
this.btnRePrint.Name = "btnRePrint";
this.btnRePrint.Size = new System.Drawing.Size(75, 45);
this.btnRePrint.TabIndex = 2;
this.btnRePrint.Text = "补打";
this.btnRePrint.UseVisualStyleBackColor = true;
this.btnRePrint.Click += new System.EventHandler(this.btnRePrint_Click);
//
// btnDelete
//
this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnDelete.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelete.Location = new System.Drawing.Point(142, 409);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(75, 45);
this.btnDelete.TabIndex = 2;
this.btnDelete.Text = "删除";
this.btnDelete.UseVisualStyleBackColor = true;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnSumbit
//
this.btnSumbit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSumbit.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSumbit.Location = new System.Drawing.Point(275, 409);
this.btnSumbit.Name = "btnSumbit";
this.btnSumbit.Size = new System.Drawing.Size(75, 45);
this.btnSumbit.TabIndex = 2;
this.btnSumbit.Text = "提交";
this.btnSumbit.UseVisualStyleBackColor = true;
this.btnSumbit.Click += new System.EventHandler(this.btnSumbit_Click);
// //
this.btnEnablePrint.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnEnablePrint.Location = new System.Drawing.Point(468, 17);
this.btnEnablePrint.Name = "btnEnablePrint";
this.btnEnablePrint.Size = new System.Drawing.Size(111, 34);
this.btnEnablePrint.TabIndex = 41;
this.btnEnablePrint.Text = "启用打码";
this.btnEnablePrint.UseVisualStyleBackColor = true;
this.btnEnablePrint.Click += new System.EventHandler(this.btnEnablePrint_Click);
// 序号
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "Index";
this..HeaderText = "序号";
this..Name = "序号";
this..ReadOnly = true;
this..Width = 60;
//
// 条码
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "BarCode";
this..HeaderText = "条码";
this..Name = "条码";
this..ReadOnly = true;
this..Width = 60;
//
// 产品
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "Goods_Name";
this..HeaderText = "产品";
this..MinimumWidth = 100;
this..Name = "产品";
this..ReadOnly = true;
//
// 重量
//
this..DataPropertyName = "Weight";
dataGridViewCellStyle11.Format = "#0.##";
this..DefaultCellStyle = dataGridViewCellStyle11;
this..HeaderText = "重量";
this..Name = "重量";
this..ReadOnly = true;
this..Width = 80;
// //
// SegmentationWeightForm // SegmentationWeightForm
// //
@ -718,10 +763,6 @@
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox cbxWorkShop; private System.Windows.Forms.ComboBox cbxWorkShop;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
@ -738,5 +779,12 @@
private System.Windows.Forms.Label lblGoodsSpec; private System.Windows.Forms.Label lblGoodsSpec;
private System.Windows.Forms.Button btnEnableWeight; private System.Windows.Forms.Button btnEnableWeight;
private System.Windows.Forms.Button btnEnablePrint; private System.Windows.Forms.Button btnEnablePrint;
private System.Windows.Forms.Button btnRePrint;
private System.Windows.Forms.Button btnSumbit;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
} }
} }

+ 122
- 10
SegmentationWeight/SegmentationWeightForm.cs View File

@ -39,7 +39,9 @@ namespace SegmentationWeight
#endregion #endregion
private List<SegmentationWeightGoodSet> mSetList; private List<SegmentationWeightGoodSet> mSetList;
BindingList<SegmentationWeightRecord> mWeightRecords;
BindingList<SegmentationWeightRecord> mWeightRecords = new BindingList<SegmentationWeightRecord>();
BindingList<SegmentationWeightRecord> mAllWeightRecords = new BindingList<SegmentationWeightRecord>();
private bool mIsNeedRefreshPlan = false; private bool mIsNeedRefreshPlan = false;
private readonly Thread _tdSyncAlreadyFromMiddleDb; private readonly Thread _tdSyncAlreadyFromMiddleDb;
@ -507,12 +509,32 @@ namespace SegmentationWeight
{ {
InitPlanGoodsNumber(); InitPlanGoodsNumber();
mWeightRecords = new BindingList<SegmentationWeightRecord>();//以后可能取数据库中没做完的,比如做着做着突然断点
InitWeightRecords();
RefreshUi(); RefreshUi();
InitControl(); InitControl();
btnEnd.BackColor = SystemColors.Control; btnEnd.BackColor = SystemColors.Control;
btnStart.BackColor = Color.Green; btnStart.BackColor = Color.Green;
} }
private void InitWeightRecords()
{
mAllWeightRecords = GetAllWeightRecords();
}
private BindingList<SegmentationWeightRecord> GetAllWeightRecords()
{
var list = SegmentationWeightRecordRpc.GetInstance().GetTodayList();
var resList = new BindingList<SegmentationWeightRecord>();
foreach (SegmentationWeightRecord record in list)
{
record.Index = resList.Count + 1;
resList.Insert(0, record);
}
return resList;
}
private void InitControl() private void InitControl()
{ {
mSetList = XmlUtil.DeserializeFromFile<List<SegmentationWeightGoodSet>>(SegmentationWeightGoodsSetForm.SegmentationWeightGoodsSetFileName).Where(x => x.IsSelected).ToList(); mSetList = XmlUtil.DeserializeFromFile<List<SegmentationWeightGoodSet>>(SegmentationWeightGoodsSetForm.SegmentationWeightGoodsSetFileName).Where(x => x.IsSelected).ToList();
@ -568,8 +590,8 @@ namespace SegmentationWeight
btn.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); btn.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
btn.Click += BtnGoods_Click; btn.Click += BtnGoods_Click;
btn.BackColor = SystemColors.Control; btn.BackColor = SystemColors.Control;
btn.Width = 120;
btn.Height = 60;
btn.Width = 140;
btn.Height = 80;
return btn; return btn;
} }
@ -604,17 +626,26 @@ namespace SegmentationWeight
var record = GetRecordBySet(set); var record = GetRecordBySet(set);
var id = LocalDmoSession.Insert(record); var id = LocalDmoSession.Insert(record);
record.ID = id; record.ID = id;
record.Index = mAllWeightRecords.Count + 1;
mAllWeightRecords.Insert(0, record);
mWeightRecords.Insert(0, record); mWeightRecords.Insert(0, record);
// mWeightRecords.Add(record);
RefreshUi(); RefreshUi();
if (_enablePrint) if (_enablePrint)
{ {
var entity = CreatePrintEntity(record);
SegmentationWeightPrint.Print(entity);
PrintGoodsEntity(record);
} }
btn.BackColor = SystemColors.Control; btn.BackColor = SystemColors.Control;
Application.DoEvents(); Application.DoEvents();
} }
void PrintGoodsEntity(SegmentationWeightRecord record)
{
var entity = CreatePrintEntity(record);
SegmentationWeightPrint.Print(entity);
}
PrintEntity CreatePrintEntity(SegmentationWeightRecord record) PrintEntity CreatePrintEntity(SegmentationWeightRecord record)
{ {
var entity = new PrintEntity(); var entity = new PrintEntity();
@ -627,7 +658,7 @@ namespace SegmentationWeight
entity.TelNumber = "0532-88488888"; entity.TelNumber = "0532-88488888";
entity.BarCode = record.BarCode; entity.BarCode = record.BarCode;
entity._2DQRCode = string.Format(ButcherAppContext.Context.UrlConfig.OutAddress + "?code={0}&&gid={1}", entity.BarCode, record.Goods_ID); entity._2DQRCode = string.Format(ButcherAppContext.Context.UrlConfig.OutAddress + "?code={0}&&gid={1}", entity.BarCode, record.Goods_ID);
entity.Weight = record.Weight.ToString();
entity.Weight = record.Weight.ToString("#0.##");
return entity; return entity;
} }
@ -642,11 +673,12 @@ namespace SegmentationWeight
lblPlanWeight.Text = mProductTasks.Where(x => x.Goods_Name == lblGoodsName.Text).Sum(x => x.Number).ToString("#0.##"); lblPlanWeight.Text = mProductTasks.Where(x => x.Goods_Name == lblGoodsName.Text).Sum(x => x.Number).ToString("#0.##");
lblPlanNumber.Text = mProductTasks.Where(x => x.Goods_Name == lblGoodsName.Text).Sum(x => x.SecondNumber).ToString("#0.##"); lblPlanNumber.Text = mProductTasks.Where(x => x.Goods_Name == lblGoodsName.Text).Sum(x => x.SecondNumber).ToString("#0.##");
} }
if (mWeightRecords.Count < 1)
if (mAllWeightRecords.Count < 1)
{ {
return; return;
} }
uDataGridView1.DataSource = mWeightRecords;
uDataGridView1.DataSource = mAllWeightRecords;
uDataGridView1.CurrentCell = null;
} }
private long _selectGoodsID = 0; private long _selectGoodsID = 0;
@ -812,6 +844,7 @@ namespace SegmentationWeight
{ {
btnEnableWeight.Text = "开始称重"; btnEnableWeight.Text = "开始称重";
btnEnableWeight.BackColor = SystemColors.Control; btnEnableWeight.BackColor = SystemColors.Control;
btnEnablePrint.UseVisualStyleBackColor = true;
} }
} }
@ -828,6 +861,85 @@ namespace SegmentationWeight
{ {
btnEnablePrint.Text = "开始打码"; btnEnablePrint.Text = "开始打码";
btnEnablePrint.BackColor = SystemColors.Control; btnEnablePrint.BackColor = SystemColors.Control;
btnEnablePrint.UseVisualStyleBackColor = true;
}
}
private void btnRePrint_Click(object sender, EventArgs e)
{
if (_enablePrint)
{
var row = uDataGridView1.CurrentRow;
if (row != null)
{
var record = row.DataBoundItem as SegmentationWeightRecord;
if (record != null)
{
PrintGoodsEntity(record);
uDataGridView1.CurrentCell = null;
}
}
}
}
private void btnDelete_Click(object sender, EventArgs e)
{
if (MessageBox.Show("删除无法恢复,确定删除?", "删除", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
{
var row = uDataGridView1.CurrentRow;
if (row != null)
{
var record = row.DataBoundItem as SegmentationWeightRecord;
if (record != null)
{
LocalDmoSession.SaveDelete<SegmentationWeightRecord>(record.ID);
uDataGridView1.Rows.Remove(row);
uDataGridView1.Refresh();
uDataGridView1.CurrentCell = null;
}
}
}
}
private void btnSumbit_Click(object sender, EventArgs e)
{
try
{
btnSumbit.Enabled = false;
Application.DoEvents();
if (LoginRpcUtil.TestConnection(1000))
{
if (SegmentationWeightRecordRpc.GetInstance().IsSyncSucessed())
{
var sucess=RpcFacade.Call<bool>("/MainSystem/B3ClientService/Rpcs/BillRpc/SegmentationWeightRecordRpc/CreateTodayB3OutputBill" );
if(sucess)
{
MessageBox.Show("同步完成");
}
else
{
MessageBox.Show("同步失败");
}
}
else
{
MessageBox.Show("请等待数据同步完成");
}
}
else
{
MessageBox.Show("没有网络,请通知管理员");
}
}
catch (Exception exception)
{
LogUtil.Error(exception);
MessageBox.Show(exception.ToString());
}
finally
{
btnSumbit.Enabled = true;
} }
} }
} }


+ 3
- 0
SegmentationWeight/SegmentationWeightForm.resx View File

@ -129,4 +129,7 @@
<metadata name="重量.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="重量.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="tableLayoutPanel1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>

Loading…
Cancel
Save