Browse Source

加分割称重 挂起功能。

master
yibo 7 years ago
parent
commit
e419b4d6ad
9 changed files with 501 additions and 86 deletions
  1. +1
    -1
      BO/Utils/AfterLoginUtil.cs
  2. +131
    -0
      SegmentationWeight/QieDanDialog.Designer.cs
  3. +46
    -0
      SegmentationWeight/QieDanDialog.cs
  4. +126
    -0
      SegmentationWeight/QieDanDialog.resx
  5. +1
    -0
      SegmentationWeight/Rpc/Dto/SegmentationWeightRecord.cs
  6. +34
    -10
      SegmentationWeight/Rpc/SegmentationWeightRecordRpc.cs
  7. +9
    -0
      SegmentationWeight/SegmentationWeight.csproj
  8. +82
    -52
      SegmentationWeight/SegmentationWeightForm.Designer.cs
  9. +71
    -23
      SegmentationWeight/SegmentationWeightForm.cs

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

@ -83,7 +83,7 @@ namespace BO.Utils
var filePath = Path.Combine(Application.StartupPath, string.Format("{0}.dll", item.Item2));
#endif
if (!File.Exists(filePath))
throw new Exception("相关模块不存在");
continue;
var formType = typeof(IAfterLogin);
foreach (var type in Assembly.LoadFile(filePath).GetTypes())
{


+ 131
- 0
SegmentationWeight/QieDanDialog.Designer.cs View File

@ -0,0 +1,131 @@
namespace SegmentationWeight
{
partial class QieDanDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.detailGridView1 = new BWP.WinFormControl.UDataGridView();
this.closeBtn = new System.Windows.Forms.Button();
this.Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DeleteBtn = new System.Windows.Forms.DataGridViewButtonColumn();
((System.ComponentModel.ISupportInitialize)(this.detailGridView1)).BeginInit();
this.SuspendLayout();
//
// detailGridView1
//
this.detailGridView1.AllowUserToAddRows = false;
this.detailGridView1.AllowUserToDeleteRows = false;
this.detailGridView1.AllowUserToResizeColumns = false;
this.detailGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.detailGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.detailGridView1.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.detailGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.detailGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.detailGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Goods_Name,
this.DeleteBtn});
this.detailGridView1.Location = new System.Drawing.Point(12, 12);
this.detailGridView1.MultiSelect = false;
this.detailGridView1.Name = "detailGridView1";
this.detailGridView1.ReadOnly = true;
this.detailGridView1.RowHeadersVisible = false;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.detailGridView1.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.detailGridView1.RowTemplate.Height = 60;
this.detailGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.detailGridView1.Size = new System.Drawing.Size(854, 444);
this.detailGridView1.TabIndex = 6;
this.detailGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.detailGridView1_CellContentClick);
//
// closeBtn
//
this.closeBtn.Font = new System.Drawing.Font("宋体", 15F);
this.closeBtn.Location = new System.Drawing.Point(382, 479);
this.closeBtn.Name = "closeBtn";
this.closeBtn.Size = new System.Drawing.Size(108, 41);
this.closeBtn.TabIndex = 5;
this.closeBtn.Text = "关闭";
this.closeBtn.UseVisualStyleBackColor = true;
this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click);
//
// Goods_Name
//
this.Goods_Name.DataPropertyName = "Goods_Name";
this.Goods_Name.HeaderText = "存货";
this.Goods_Name.Name = "Goods_Name";
this.Goods_Name.ReadOnly = true;
this.Goods_Name.Width = 400;
//
// DeleteBtn
//
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.DeleteBtn.DefaultCellStyle = dataGridViewCellStyle3;
this.DeleteBtn.HeaderText = "切回";
this.DeleteBtn.Name = "DeleteBtn";
this.DeleteBtn.ReadOnly = true;
this.DeleteBtn.Text = "切回";
this.DeleteBtn.UseColumnTextForButtonValue = true;
this.DeleteBtn.Width = 220;
//
// QieDanDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(878, 532);
this.ControlBox = false;
this.Controls.Add(this.detailGridView1);
this.Controls.Add(this.closeBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "QieDanDialog";
this.Text = "所有挂起";
((System.ComponentModel.ISupportInitialize)(this.detailGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private BWP.WinFormControl.UDataGridView detailGridView1;
private System.Windows.Forms.Button closeBtn;
private System.Windows.Forms.DataGridViewTextBoxColumn Goods_Name;
private System.Windows.Forms.DataGridViewButtonColumn DeleteBtn;
}
}

+ 46
- 0
SegmentationWeight/QieDanDialog.cs View File

@ -0,0 +1,46 @@
using SegmentationWeight.Rpc;
using SegmentationWeight.Rpc.Dto;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SegmentationWeight
{
public partial class QieDanDialog : Form
{
public QieDanDialog()
{
InitializeComponent();
detailGridView1.AutoGenerateColumns = false;
var details = SegmentationWeightRecordRpc.GetInstance().GetTodayGroupFlagList();
detailGridView1.DataSource = null;
detailGridView1.DataSource = details;
detailGridView1.Refresh();
}
public string GroupFlag { get; set; }
private void closeBtn_Click(object sender, EventArgs e)
{
this.Close();
}
private void detailGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex == -1)
return;
if (e.ColumnIndex != detailGridView1.ColumnCount - 1)
return;
var entity = detailGridView1.CurrentRow.DataBoundItem as SegmentationWeightRecord;
GroupFlag = entity.GroupFlag;
DialogResult = DialogResult.OK;
this.Close();
}
}
}

+ 126
- 0
SegmentationWeight/QieDanDialog.resx View File

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

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

@ -27,6 +27,7 @@ namespace SegmentationWeight.Rpc.Dto
public string CardBarCode{ get; set; }//放产品的车的条码
public string BiaoShi { get; set; }
public string ProductBatch { get; set; }
public string GroupFlag { get; set; }
public override string GetDtoJson()
{
var config = new MapperConfiguration(cfg => {


+ 34
- 10
SegmentationWeight/Rpc/SegmentationWeightRecordRpc.cs View File

@ -68,25 +68,27 @@ namespace SegmentationWeight.Rpc
}
public BindingList<SegmentationWeightRecord> GetTodayList()
public BindingList<SegmentationWeightRecord> GetTodayList(string flag)
{
return GetListByDate(DateTime.Today);
return GetListByDate(DateTime.Today, flag);
}
public BindingList<SegmentationWeightRecord> GetListByDate(DateTime date)
public BindingList<SegmentationWeightRecord> GetListByDate(DateTime date, string flag)
{
var bindList=new BindingList<SegmentationWeightRecord>();
var list=new List<SegmentationWeightRecord>();
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));
query.Where.Conditions.Add(DQCondition.EQ("IsDeleted", false));
if (!string.IsNullOrEmpty(flag))
query.Where.Conditions.Add(DQCondition.EQ("GroupFlag", flag));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", false));
using (var session = LocalDmoSession.New())
{
list= session.ExecuteList(query).Cast<SegmentationWeightRecord>().ToList();
list = session.ExecuteList(query).Cast<SegmentationWeightRecord>().ToList();
}
foreach (SegmentationWeightRecord record in list)
{
@ -95,16 +97,38 @@ namespace SegmentationWeight.Rpc
return bindList;
}
public static int GetTodayTotalCount(DateTime date)
{
var query = new DQueryDom(new JoinAlias(typeof(SegmentationWeightRecord)));
query.Columns.Add(DQSelectColumn.Count());
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.GreaterThanOrEqual("CreateTime", date.Date));
query.Where.Conditions.Add(DQCondition.LessThan("CreateTime", date.Date.AddDays(1))); ;
using (var session = LocalDmoSession.New())
{
return Convert.ToInt32(session.ExecuteScalar(query));
}
}
public BindingList<SegmentationWeightRecord> GetTodayGroupFlagList()
{
var bindList = new BindingList<SegmentationWeightRecord>();
var query = new DQueryDom(new JoinAlias(typeof(SegmentationWeightRecord)));
query.Where.Conditions.Add(DQCondition.And(DQCondition.Between("CreateTime", DateTime.Today, DateTime.Today + new TimeSpan(23, 59, 29)), DQCondition.EQ("IsDeleted", false), DQCondition.IsNotNull(DQExpression.Field("GroupFlag"))));
query.Columns.Add(DQSelectColumn.Field("Goods_Name"));
query.Columns.Add(DQSelectColumn.Field("GroupFlag"));
query.GroupBy.Expressions.Add(DQExpression.Field("Goods_Name"));
query.GroupBy.Expressions.Add(DQExpression.Field("GroupFlag"));
using (var session = LocalDmoSession.New())
{
using (var reader = session.ExecuteReader(query))
{
while (reader.Read())
bindList.Add(new SegmentationWeightRecord { Goods_Name = (string)reader[0], GroupFlag = (string)reader[1] });
}
}
return bindList;
}
}
}

+ 9
- 0
SegmentationWeight/SegmentationWeight.csproj View File

@ -63,6 +63,12 @@
<ItemGroup>
<Compile Include="ProductTask.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="QieDanDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="QieDanDialog.Designer.cs">
<DependentUpon>QieDanDialog.cs</DependentUpon>
</Compile>
<Compile Include="Rpc\Dto\SegmentationWeightRecord.cs" />
<Compile Include="Rpc\Dto\SegmentationWeightRecordDto.cs" />
<Compile Include="Rpc\SegmentationWeightRecordRpc.cs" />
@ -93,6 +99,9 @@
<Content Include="分割品车间称重.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="QieDanDialog.resx">
<DependentUpon>QieDanDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SegmentationWeightForm.resx">
<DependentUpon>SegmentationWeightForm.cs</DependentUpon>
</EmbeddedResource>


+ 82
- 52
SegmentationWeight/SegmentationWeightForm.Designer.cs View File

@ -28,12 +28,14 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel();
this.qieDanBtn = new System.Windows.Forms.Button();
this.guaQiBtn = new System.Windows.Forms.Button();
this.btnEnablePrint = new System.Windows.Forms.Button();
this.btnEnableWeight = new System.Windows.Forms.Button();
this.btnEnd = new System.Windows.Forms.Button();
@ -109,13 +111,15 @@
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(1117, 587);
this.splitContainer1.Size = new System.Drawing.Size(1202, 587);
this.splitContainer1.SplitterDistance = 128;
this.splitContainer1.SplitterWidth = 1;
this.splitContainer1.TabIndex = 0;
//
// panel1
//
this.panel1.Controls.Add(this.qieDanBtn);
this.panel1.Controls.Add(this.guaQiBtn);
this.panel1.Controls.Add(this.btnEnablePrint);
this.panel1.Controls.Add(this.btnEnableWeight);
this.panel1.Controls.Add(this.btnEnd);
@ -128,9 +132,33 @@
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1115, 126);
this.panel1.Size = new System.Drawing.Size(1200, 126);
this.panel1.TabIndex = 2;
//
// qieDanBtn
//
this.qieDanBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.qieDanBtn.Font = new System.Drawing.Font("宋体", 14F);
this.qieDanBtn.Location = new System.Drawing.Point(923, 28);
this.qieDanBtn.Name = "qieDanBtn";
this.qieDanBtn.Size = new System.Drawing.Size(75, 60);
this.qieDanBtn.TabIndex = 43;
this.qieDanBtn.Text = "切单";
this.qieDanBtn.UseVisualStyleBackColor = true;
this.qieDanBtn.Click += new System.EventHandler(this.qieDanBtn_Click);
//
// guaQiBtn
//
this.guaQiBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.guaQiBtn.Font = new System.Drawing.Font("宋体", 14F);
this.guaQiBtn.Location = new System.Drawing.Point(822, 28);
this.guaQiBtn.Name = "guaQiBtn";
this.guaQiBtn.Size = new System.Drawing.Size(75, 60);
this.guaQiBtn.TabIndex = 42;
this.guaQiBtn.Text = "挂起";
this.guaQiBtn.UseVisualStyleBackColor = true;
this.guaQiBtn.Click += new System.EventHandler(this.guaQiBtn_Click);
//
// btnEnablePrint
//
this.btnEnablePrint.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@ -158,7 +186,7 @@
this.btnEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnEnd.Enabled = false;
this.btnEnd.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnEnd.Location = new System.Drawing.Point(689, 28);
this.btnEnd.Location = new System.Drawing.Point(719, 28);
this.btnEnd.Name = "btnEnd";
this.btnEnd.Size = new System.Drawing.Size(75, 60);
this.btnEnd.TabIndex = 40;
@ -170,7 +198,7 @@
//
this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnStart.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStart.Location = new System.Drawing.Point(585, 28);
this.btnStart.Location = new System.Drawing.Point(615, 28);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(75, 60);
this.btnStart.TabIndex = 40;
@ -207,7 +235,7 @@
this.panel3.Controls.Add(this.label5);
this.panel3.Controls.Add(this.cbxWorkShop);
this.panel3.Controls.Add(this.label4);
this.panel3.Location = new System.Drawing.Point(797, 5);
this.panel3.Location = new System.Drawing.Point(1004, 5);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(191, 114);
this.panel3.TabIndex = 34;
@ -321,8 +349,8 @@
this.splitContainer2.Panel2.Controls.Add(this.btnRePrint);
this.splitContainer2.Panel2.Controls.Add(this.uDataGridView1);
this.splitContainer2.Panel2.Controls.Add(this.tableLayoutPanel1);
this.splitContainer2.Size = new System.Drawing.Size(1117, 458);
this.splitContainer2.SplitterDistance = 729;
this.splitContainer2.Size = new System.Drawing.Size(1202, 458);
this.splitContainer2.SplitterDistance = 784;
this.splitContainer2.SplitterWidth = 1;
this.splitContainer2.TabIndex = 0;
//
@ -330,7 +358,7 @@
//
this.btnGoodsSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnGoodsSet.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGoodsSet.Location = new System.Drawing.Point(628, 16);
this.btnGoodsSet.Location = new System.Drawing.Point(683, 16);
this.btnGoodsSet.Name = "btnGoodsSet";
this.btnGoodsSet.Size = new System.Drawing.Size(95, 50);
this.btnGoodsSet.TabIndex = 34;
@ -346,7 +374,7 @@
this.flpGoods.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flpGoods.Location = new System.Drawing.Point(4, 87);
this.flpGoods.Name = "flpGoods";
this.flpGoods.Size = new System.Drawing.Size(719, 369);
this.flpGoods.Size = new System.Drawing.Size(774, 369);
this.flpGoods.TabIndex = 1;
//
// flpClass
@ -356,7 +384,7 @@
this.flpClass.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flpClass.Location = new System.Drawing.Point(4, 4);
this.flpClass.Name = "flpClass";
this.flpClass.Size = new System.Drawing.Size(604, 76);
this.flpClass.Size = new System.Drawing.Size(659, 76);
this.flpClass.TabIndex = 0;
//
// btnSumbit
@ -401,20 +429,20 @@
this.uDataGridView1.AllowUserToDeleteRows = false;
this.uDataGridView1.AllowUserToResizeColumns = false;
this.uDataGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle17;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
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.Right)));
this.uDataGridView1.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle18.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.uDataGridView1.ColumnHeadersHeight = 40;
this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
@ -427,12 +455,12 @@
this.uDataGridView1.Name = "uDataGridView1";
this.uDataGridView1.ReadOnly = true;
this.uDataGridView1.RowHeadersVisible = false;
dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle20;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.uDataGridView1.RowTemplate.Height = 40;
this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.uDataGridView1.Size = new System.Drawing.Size(395, 295);
this.uDataGridView1.Size = new System.Drawing.Size(437, 295);
this.uDataGridView1.TabIndex = 1;
//
// 序号
@ -465,8 +493,8 @@
// 重量
//
this..DataPropertyName = "Weight";
dataGridViewCellStyle19.Format = "#0.##";
this..DefaultCellStyle = dataGridViewCellStyle19;
dataGridViewCellStyle3.Format = "#0.##";
this..DefaultCellStyle = dataGridViewCellStyle3;
this..HeaderText = "重量";
this..Name = "重量";
this..ReadOnly = true;
@ -482,7 +510,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.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, 91F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 99F));
this.tableLayoutPanel1.Controls.Add(this.lblGoodsName, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label8, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label3, 1, 1);
@ -503,7 +531,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.Size = new System.Drawing.Size(398, 98);
this.tableLayoutPanel1.Size = new System.Drawing.Size(440, 98);
this.tableLayoutPanel1.TabIndex = 0;
//
// lblGoodsName
@ -514,7 +542,7 @@
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.Name = "lblGoodsName";
this.lblGoodsName.Size = new System.Drawing.Size(95, 31);
this.lblGoodsName.Size = new System.Drawing.Size(115, 31);
this.lblGoodsName.TabIndex = 0;
this.lblGoodsName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
@ -526,7 +554,7 @@
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.Name = "label8";
this.label8.Size = new System.Drawing.Size(95, 31);
this.label8.Size = new System.Drawing.Size(115, 31);
this.label8.TabIndex = 0;
this.label8.Text = "产品";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -537,9 +565,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(106, 33);
this.label3.Location = new System.Drawing.Point(126, 33);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(67, 31);
this.label3.Size = new System.Drawing.Size(81, 31);
this.label3.TabIndex = 0;
this.label3.Text = "重量";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -550,9 +578,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(106, 65);
this.label2.Location = new System.Drawing.Point(126, 65);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(67, 32);
this.label2.Size = new System.Drawing.Size(81, 32);
this.label2.TabIndex = 0;
this.label2.Text = "数量";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -563,9 +591,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(308, 1);
this.label7.Location = new System.Drawing.Point(342, 1);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(86, 31);
this.label7.Size = new System.Drawing.Size(94, 31);
this.label7.TabIndex = 0;
this.label7.Text = "剩余";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -576,7 +604,7 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(249, 1);
this.label9.Location = new System.Drawing.Point(283, 1);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(52, 31);
this.label9.TabIndex = 0;
@ -589,7 +617,7 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(180, 33);
this.lblPlanWeight.Location = new System.Drawing.Point(214, 33);
this.lblPlanWeight.Name = "lblPlanWeight";
this.lblPlanWeight.Size = new System.Drawing.Size(62, 31);
this.lblPlanWeight.TabIndex = 0;
@ -601,7 +629,7 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(249, 65);
this.lblNumber.Location = new System.Drawing.Point(283, 65);
this.lblNumber.Name = "lblNumber";
this.lblNumber.Size = new System.Drawing.Size(52, 32);
this.lblNumber.TabIndex = 0;
@ -613,7 +641,7 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(249, 33);
this.lblWeight.Location = new System.Drawing.Point(283, 33);
this.lblWeight.Name = "lblWeight";
this.lblWeight.Size = new System.Drawing.Size(52, 31);
this.lblWeight.TabIndex = 0;
@ -625,7 +653,7 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(180, 65);
this.lblPlanNumber.Location = new System.Drawing.Point(214, 65);
this.lblPlanNumber.Name = "lblPlanNumber";
this.lblPlanNumber.Size = new System.Drawing.Size(62, 32);
this.lblPlanNumber.TabIndex = 0;
@ -637,7 +665,7 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(180, 1);
this.label1.Location = new System.Drawing.Point(214, 1);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(62, 31);
this.label1.TabIndex = 0;
@ -650,9 +678,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(308, 33);
this.lblLeftWeight.Location = new System.Drawing.Point(342, 33);
this.lblLeftWeight.Name = "lblLeftWeight";
this.lblLeftWeight.Size = new System.Drawing.Size(86, 31);
this.lblLeftWeight.Size = new System.Drawing.Size(94, 31);
this.lblLeftWeight.TabIndex = 0;
this.lblLeftWeight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
@ -662,9 +690,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| 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.Location = new System.Drawing.Point(308, 65);
this.lblLeftNumber.Location = new System.Drawing.Point(342, 65);
this.lblLeftNumber.Name = "lblLeftNumber";
this.lblLeftNumber.Size = new System.Drawing.Size(86, 32);
this.lblLeftNumber.Size = new System.Drawing.Size(94, 32);
this.lblLeftNumber.TabIndex = 0;
this.lblLeftNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
@ -676,7 +704,7 @@
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.Name = "lblGoodsSpec";
this.lblGoodsSpec.Size = new System.Drawing.Size(95, 32);
this.lblGoodsSpec.Size = new System.Drawing.Size(115, 32);
this.lblGoodsSpec.TabIndex = 0;
this.lblGoodsSpec.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
@ -684,7 +712,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1117, 587);
this.ClientSize = new System.Drawing.Size(1202, 587);
this.Controls.Add(this.splitContainer1);
this.MinimizeBox = false;
this.Name = "SegmentationWeightForm";
@ -760,5 +788,7 @@
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.Button qieDanBtn;
private System.Windows.Forms.Button guaQiBtn;
}
}

+ 71
- 23
SegmentationWeight/SegmentationWeightForm.cs View File

@ -379,7 +379,7 @@ namespace SegmentationWeight
{
if (string.IsNullOrEmpty(str))
str = "0";
this.Invoke(new Action(delegate ()
this.Invoke(new Action(delegate()
{
lblChengZhong.Text = string.Format(format, decimal.Parse(str));
if (str != "0")
@ -395,7 +395,7 @@ namespace SegmentationWeight
decimal num = 0;
if (decimal.TryParse(str, out num))
{
this.Invoke(new Action(delegate ()
this.Invoke(new Action(delegate()
{
lblChengZhong.Text = string.Format(format, num);
}));
@ -404,7 +404,7 @@ namespace SegmentationWeight
}
if (WeighAvgControl.TryGetValue(out num))
{
this.Invoke(new Action(delegate ()
this.Invoke(new Action(delegate()
{
//lblChengZhong.Text = string.Format(format, num);
if (str != "0")
@ -511,9 +511,10 @@ namespace SegmentationWeight
{
mAllWeightRecords = GetAllWeightRecords();
}
private BindingList<SegmentationWeightRecord> GetAllWeightRecords()
{
var list = SegmentationWeightRecordRpc.GetInstance().GetTodayList();
var list = SegmentationWeightRecordRpc.GetInstance().GetTodayList(null);
var resList = new BindingList<SegmentationWeightRecord>();
foreach (SegmentationWeightRecord record in list)
@ -610,7 +611,7 @@ namespace SegmentationWeight
lblGoodsName.Text = set.Goods_Name;
lblGoodsSpec.Text = set.Goods_Spec;
_selectGoodsID = set.Goods_ID;
//添加记录
var record = GetRecordBySet(set);
//当有标准重量的时候 必须符合范围 并且按标准重量打印
@ -620,11 +621,11 @@ namespace SegmentationWeight
var islow = set.StandardWeightLow.HasValue && record.Weight < set.StandardWeightLow.Value;
if (isup)
{
UMessageBox.Show("不能高于重量限制:"+set.StandardWeightUp.Value.ToString("F2"), "超上限提示", 3);
UMessageBox.Show("不能高于重量限制:" + set.StandardWeightUp.Value.ToString("F2"), "超上限提示", 3);
}
if (islow)
{
UMessageBox.Show("不能低于重量限制:" + set.StandardWeightLow.Value.ToString("F2"), "低下限提示",3);
UMessageBox.Show("不能低于重量限制:" + set.StandardWeightLow.Value.ToString("F2"), "低下限提示", 3);
}
if (isup || islow)
{
@ -662,12 +663,12 @@ namespace SegmentationWeight
void PrintGoodsEntity(SegmentationWeightRecord record)
{
var entity = CreatePrintEntity(record);
//#if DEBUG
//#if DEBUG
SegmentationWeightPrint.Print(entity);
//#endif
//#if !DEBUG
// SegmentationWeightPrint.Print5050(entity);
//#endif
//#endif
//#if !DEBUG
// SegmentationWeightPrint.Print5050(entity);
//#endif
}
@ -752,7 +753,7 @@ namespace SegmentationWeight
private SegmentationWeightRecord GetRecordBySet(SegmentationWeightGoodSet set)
{
if (cbxWorkUnit.SelectedValue==null)
if (cbxWorkUnit.SelectedValue == null)
{
throw new Exception("请选择工作单元");
}
@ -803,6 +804,11 @@ namespace SegmentationWeight
private bool _alreadyStart = false;
private void btnStart_Click(object sender, EventArgs e)
{
Start();
}
void Start()
{
_alreadyStart = true;
btnStart.Enabled = false;
@ -813,6 +819,11 @@ namespace SegmentationWeight
}
private void btnEnd_Click(object sender, EventArgs e)
{
ReStart(true);
}
void ReStart(bool end)
{
_alreadyStart = false;
_selectGoodsID = 0;
@ -824,13 +835,26 @@ namespace SegmentationWeight
if (mWeightRecords.Count > 0)
{
var endBarcode = GetEndBarCode();
foreach (SegmentationWeightRecord record in mWeightRecords)
if (end)
{
record.CardBarCode = endBarcode;
LocalDmoSession.Update(record, "CardBarCode");
var endBarcode = GetEndBarCode();
foreach (SegmentationWeightRecord record in mWeightRecords)
{
record.CardBarCode = endBarcode;
record.GroupFlag = null;
LocalDmoSession.Update(record, "CardBarCode", "GroupFlag");
}
PrintEnd(endBarcode);
}
else
{
var guid = Guid.NewGuid().ToString();
foreach (SegmentationWeightRecord record in mWeightRecords)
{
record.GroupFlag = guid;
LocalDmoSession.Update(record, "GroupFlag");
}
}
PrintEnd(endBarcode);
//清空记录
mWeightRecords.Clear();
}
@ -839,7 +863,6 @@ namespace SegmentationWeight
btnEnd.Enabled = false;
btnEnd.BackColor = SystemColors.Control;
btnStart.BackColor = Color.ForestGreen;
}
private void PrintEnd(string barcode)
@ -933,7 +956,7 @@ namespace SegmentationWeight
if (record != null)
{
LocalDmoSession.SaveDelete<SegmentationWeightRecord>(record.ID);
uDataGridView1.Rows.Remove(row);
uDataGridView1.Refresh();
uDataGridView1.CurrentCell = null;
@ -956,10 +979,10 @@ namespace SegmentationWeight
{
if (SegmentationWeightRecordRpc.GetInstance().IsSyncSucessed())
{
var id=RpcFacade.Call<long>("/MainSystem/B3ClientService/Rpcs/BillRpc/SegmentationWeightRecordRpc/CreateTodayB3OutputBill" );
if(id>0)
var id = RpcFacade.Call<long>("/MainSystem/B3ClientService/Rpcs/BillRpc/SegmentationWeightRecordRpc/CreateTodayB3OutputBill");
if (id > 0)
{
MessageBox.Show("同步完成,创建产出单:"+id);
MessageBox.Show("同步完成,创建产出单:" + id);
}
else if (id == -1)
{
@ -990,5 +1013,30 @@ namespace SegmentationWeight
btnSumbit.Enabled = true;
}
}
private void guaQiBtn_Click(object sender, EventArgs e)
{
ReStart(false);
}
private void qieDanBtn_Click(object sender, EventArgs e)
{
var dialog = new QieDanDialog();
if (dialog.ShowDialog() == DialogResult.OK)
{
Start();
var list = SegmentationWeightRecordRpc.GetInstance().GetTodayList(dialog.GroupFlag);
mWeightRecords = list;
if (list.Any())
{
var set = list.Last();
lblGoodsName.Text = set.Goods_Name;
lblGoodsSpec.Text = set.Goods_Spec;
_selectGoodsID = set.Goods_ID;
mIsNeedRefreshPlan = true;
RefreshUi();
}
}
}
}
}

Loading…
Cancel
Save