Browse Source

生产客户端 数据两分钟之内允许删除,超出两分钟上传到服务器。同时增加日志功能。称重计数增加删除功能。

master
yibo 6 years ago
parent
commit
a66bb0ef08
15 changed files with 1304 additions and 753 deletions
  1. +35
    -7
      ButcherFactory.BO/Bill/SegmentProduction.cs
  2. +67
    -9
      ButcherFactory.BO/LocalBL/SegmentProductionBL.cs
  3. +7
    -0
      ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs
  4. +9
    -0
      ButcherFactory.Form/ButcherFactory.Form.csproj
  5. +169
    -0
      ButcherFactory.Form/SegmentProductionAuto_/LogForm.Designer.cs
  6. +52
    -0
      ButcherFactory.Form/SegmentProductionAuto_/LogForm.cs
  7. +120
    -0
      ButcherFactory.Form/SegmentProductionAuto_/LogForm.resx
  8. +528
    -510
      ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs
  9. +43
    -16
      ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs
  10. +128
    -128
      ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.resx
  11. +17
    -0
      ButcherFactory.Form/WeightCount_/DiscontWeightSetDialog.cs
  12. +106
    -81
      ButcherFactory.Form/WeightCount_/WeightCountForm.Designer.cs
  13. +13
    -0
      ButcherFactory.Form/WeightCount_/WeightCountForm.cs
  14. +8
    -0
      ButcherFactory.Form/WeightCount_/WeightCountForm.resx
  15. +2
    -2
      ButcherFactory.Login/Login.xaml.cs

+ 35
- 7
ButcherFactory.BO/Bill/SegmentProduction.cs View File

@ -1,9 +1,10 @@
using Forks.EnterpriseServices.DataDictionary;
using Forks.EnterpriseServices.DomainObjects2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Forks.EnterpriseServices.DataDictionary;
using Forks.EnterpriseServices.DomainObjects2;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ButcherFactory.BO
@ -62,7 +63,34 @@ namespace ButcherFactory.BO
public bool InStored { get; set; }
[DbColumn(DefaultValue = 0)]
public bool StandardPic { get; set; }
public bool StandardPic { get; set; }
public string MsgID { get; set; }
}
[MapToTable("Butcher_SegmentLog")]
[KeyField("ID", KeyGenType.identity)]
public class SegmentLog
{
private SegmentLog()
{ }
public SegmentLog(string barCode,string action)
{
Time = DateTime.Now;
BarCode = barCode;
Action = action;
}
public long ID { get; set; }
public string Message { get; set; }
public string BarCode { get; set; }
public string Action { get; set; }
public DateTime Time { get; set; }
}
public class ProductTask


+ 67
- 9
ButcherFactory.BO/LocalBL/SegmentProductionBL.cs View File

@ -75,10 +75,19 @@ namespace ButcherFactory.BO.LocalBL
entity.ProductBatch_ID = productBatchID;
entity.RowIndex = GenerateRowIndex(productBatchID, session);
entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", batchDate, AppContext.ConnectInfo.ClientCode, entity.RowIndex);
session.Insert(entity);
session.Insert(entity);
FillMsgID(session, entity);
session.Commit();
return entity;
}
}
static void FillMsgID(IDmoSession session, SegmentProduction item)
{
var update = new DQUpdateDom(typeof(SegmentProduction));
update.Where.Conditions.Add(DQCondition.EQ("ID", item.ID));
update.Columns.Add(new DQUpdateColumn("MsgID", string.Format("{0}_{1}", AppContext.ConnectInfo.ClientCode, item.ID)));
session.ExecuteNonQuery(update);
}
public static SegmentProduction InsertAndSetGroupID(SegmentProduction entity, DateTime batchDate)
@ -258,9 +267,11 @@ namespace ButcherFactory.BO.LocalBL
query.Columns.Add(DQSelectColumn.Field("Goods_ID"));
query.Columns.Add(DQSelectColumn.Field("Weight"));
query.Columns.Add(DQSelectColumn.Field("CreateTime"));
query.Columns.Add(DQSelectColumn.Field("Delete"));
query.Columns.Add(DQSelectColumn.Field("StandardPic"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", true), DQCondition.EQ("Sync", false)));
query.Columns.Add(DQSelectColumn.Field("Delete"));
query.Columns.Add(DQSelectColumn.Field("StandardPic"));
query.Columns.Add(DQSelectColumn.Field("MsgID"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", true), DQCondition.EQ("Sync", false)));
query.Where.Conditions.Add(DQCondition.LessThan("CreateTime", DateTime.Now.AddMinutes(-2)));
query.Range = SelectRange.Top(10);
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID"));
@ -279,8 +290,9 @@ namespace ButcherFactory.BO.LocalBL
obj.Goods_ID = (long)reader[6];
obj.Weight = (decimal)reader[7];
obj.ProductTime = (DateTime)reader[8];
obj.Delete = (bool)reader[9];
obj.StandardPic = (bool)reader[10];
obj.Delete = (bool)reader[9];
obj.StandardPic = (bool)reader[10];
obj.MsgID = (string)reader[11];
upload.Add(obj);
}
}
@ -309,6 +321,20 @@ namespace ButcherFactory.BO.LocalBL
update.Columns.Add(new DQUpdateColumn("Delete", true));
update.Columns.Add(new DQUpdateColumn("RowVersion", DQExpression.Add(DQExpression.Field("RowVersion"), DQExpression.Value(1))));
update.EExecute();
}
public static void Delete(SegmentProduction entity)
{
var update = new DQUpdateDom(typeof(SegmentProduction));
update.Where.Conditions.Add(DQCondition.EQ("ID", entity.ID));
update.Columns.Add(new DQUpdateColumn("Sync", true));
update.Columns.Add(new DQUpdateColumn("Delete", true));
update.Columns.Add(new DQUpdateColumn("RowVersion", DQExpression.Add(DQExpression.Field("RowVersion"), DQExpression.Value(1))));
update.EExecute();
var log = new SegmentLog(entity.BarCode, "删除");
log.Message = string.Format("存货名称:{0} 重量:{1:#0.###}", entity.Goods_Name, entity.Weight);
InsertLog(log);
}
static bool? CheckCanDelete(string barCode)
@ -328,8 +354,39 @@ namespace ButcherFactory.BO.LocalBL
{
var delete = new DQDeleteDom(typeof(SegmentProduction));
delete.Where.Conditions.Add(DQCondition.LessThan("CreateTime", new DateTime(2018, 10, 15)));
delete.EExecute();
}
delete.EExecute();
var delete2 = new DQDeleteDom(typeof(SegmentLog));
delete2.Where.Conditions.Add(DQCondition.LessThan("Time", DateTime.Today.AddDays(-30)));
delete2.EExecute();
}
public static int GetUnSyncCount()
{
var query = new DQueryDom(new JoinAlias("_main", typeof(SegmentProduction)));
query.Columns.Add(DQSelectColumn.Count());
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", true), DQCondition.EQ("Sync", false)));
return Convert.ToInt32(query.EExecuteScalar());
}
public static void InsertLog(SegmentLog log)
{
using (var session = DmoSession.New())
{
session.Insert(log);
session.Commit();
}
}
public static IEnumerable<SegmentLog> GetLog(string type)
{
var query = new DmoQuery(typeof(SegmentLog));
query.Where.Conditions.Add(DQCondition.GreaterThan("Time", DateTime.Today.AddDays(-2)));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true));
if (!string.IsNullOrEmpty(type))
query.Where.Conditions.Add(DQCondition.EQ("Action", type));
return query.EExecuteList().Cast<SegmentLog>();
}
}
class SegmentProductionMin
@ -347,7 +404,8 @@ namespace ButcherFactory.BO.LocalBL
public decimal? Weight { get; set; }
public DateTime? InStoreTime { get; set; }
public bool Delete { get; set; }
public bool StandardPic { get; set; }
public bool StandardPic { get; set; }
public string MsgID { get; set; }
}
class TaskTemp


+ 7
- 0
ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs View File

@ -159,5 +159,12 @@ namespace ButcherFactory.BO.LocalBL
update.Columns.Add(new DQUpdateColumn("Sync", true));
session.ExecuteNonQuery(update);
}
public static void Delete(long id)
{
var delete = new DQUpdateDom(typeof(WeightCountEntity));
delete.Where.Conditions.Add(DQCondition.EQ("ID", id));
delete.EExecute();
}
}
}

+ 9
- 0
ButcherFactory.Form/ButcherFactory.Form.csproj View File

@ -212,6 +212,12 @@
<Compile Include="SegmentPickUp_\SegmentPickUpForm.Designer.cs">
<DependentUpon>SegmentPickUpForm.cs</DependentUpon>
</Compile>
<Compile Include="SegmentProductionAuto_\LogForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SegmentProductionAuto_\LogForm.Designer.cs">
<DependentUpon>LogForm.cs</DependentUpon>
</Compile>
<Compile Include="SegmentProductionAuto_\SegmentProductionAutoForm.cs">
<SubType>Form</SubType>
</Compile>
@ -362,6 +368,9 @@
<EmbeddedResource Include="SegmentPickUp_\SegmentPickUpForm.resx">
<DependentUpon>SegmentPickUpForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SegmentProductionAuto_\LogForm.resx">
<DependentUpon>LogForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SegmentProductionAuto_\SegmentProductionAutoForm.resx">
<DependentUpon>SegmentProductionAutoForm.cs</DependentUpon>
</EmbeddedResource>


+ 169
- 0
ButcherFactory.Form/SegmentProductionAuto_/LogForm.Designer.cs View File

@ -0,0 +1,169 @@
namespace ButcherFactory.SegmentProductionAuto_
{
partial class LogForm
{
/// <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()
{
this.listView1 = new System.Windows.Forms.ListView();
this.BarCode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Action = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Message = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Time = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colorButton1 = new ButcherFactory.Controls.ColorButton();
this.colorButton2 = new ButcherFactory.Controls.ColorButton();
this.colorButton3 = new ButcherFactory.Controls.ColorButton();
this.colorButton4 = new ButcherFactory.Controls.ColorButton();
this.SuspendLayout();
//
// listView1
//
this.listView1.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.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.BarCode,
this.Action,
this.Message,
this.Time});
this.listView1.Font = new System.Drawing.Font("宋体", 12F);
this.listView1.FullRowSelect = true;
this.listView1.Location = new System.Drawing.Point(12, 70);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(835, 589);
this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// BarCode
//
this.BarCode.Text = "条码";
this.BarCode.Width = 250;
//
// Action
//
this.Action.Text = "操作";
this.Action.Width = 100;
//
// Message
//
this.Message.Text = "详细";
this.Message.Width = 300;
//
// Time
//
this.Time.Text = "时间";
this.Time.Width = 150;
//
// colorButton1
//
this.colorButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
this.colorButton1.Font = new System.Drawing.Font("宋体", 12F);
this.colorButton1.ForeColor = System.Drawing.Color.White;
this.colorButton1.Location = new System.Drawing.Point(38, 20);
this.colorButton1.Name = "colorButton1";
this.colorButton1.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107)))));
this.colorButton1.Size = new System.Drawing.Size(90, 37);
this.colorButton1.TabIndex = 1;
this.colorButton1.Tag = "打印";
this.colorButton1.Text = "打 印";
this.colorButton1.UseVisualStyleBackColor = false;
this.colorButton1.Click += new System.EventHandler(this.colorButton1_Click);
//
// colorButton2
//
this.colorButton2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
this.colorButton2.Font = new System.Drawing.Font("宋体", 12F);
this.colorButton2.ForeColor = System.Drawing.Color.White;
this.colorButton2.Location = new System.Drawing.Point(151, 20);
this.colorButton2.Name = "colorButton2";
this.colorButton2.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107)))));
this.colorButton2.Size = new System.Drawing.Size(90, 37);
this.colorButton2.TabIndex = 2;
this.colorButton2.Tag = "删除";
this.colorButton2.Text = "删 除";
this.colorButton2.UseVisualStyleBackColor = false;
this.colorButton2.Click += new System.EventHandler(this.colorButton1_Click);
//
// colorButton3
//
this.colorButton3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
this.colorButton3.Font = new System.Drawing.Font("宋体", 12F);
this.colorButton3.ForeColor = System.Drawing.Color.White;
this.colorButton3.Location = new System.Drawing.Point(268, 20);
this.colorButton3.Name = "colorButton3";
this.colorButton3.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107)))));
this.colorButton3.Size = new System.Drawing.Size(90, 37);
this.colorButton3.TabIndex = 3;
this.colorButton3.Tag = "补打";
this.colorButton3.Text = "补 打";
this.colorButton3.UseVisualStyleBackColor = false;
this.colorButton3.Click += new System.EventHandler(this.colorButton1_Click);
//
// colorButton4
//
this.colorButton4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
this.colorButton4.Font = new System.Drawing.Font("宋体", 12F);
this.colorButton4.ForeColor = System.Drawing.Color.White;
this.colorButton4.Location = new System.Drawing.Point(394, 20);
this.colorButton4.Name = "colorButton4";
this.colorButton4.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107)))));
this.colorButton4.Size = new System.Drawing.Size(90, 37);
this.colorButton4.TabIndex = 4;
this.colorButton4.Tag = "";
this.colorButton4.Text = "全 部";
this.colorButton4.UseVisualStyleBackColor = false;
this.colorButton4.Click += new System.EventHandler(this.colorButton1_Click);
//
// LogForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(859, 671);
this.Controls.Add(this.colorButton4);
this.Controls.Add(this.colorButton3);
this.Controls.Add(this.colorButton2);
this.Controls.Add(this.colorButton1);
this.Controls.Add(this.listView1);
this.Name = "LogForm";
this.Text = "操作日志";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader BarCode;
private System.Windows.Forms.ColumnHeader Action;
private System.Windows.Forms.ColumnHeader Message;
private System.Windows.Forms.ColumnHeader Time;
private Controls.ColorButton colorButton1;
private Controls.ColorButton colorButton2;
private Controls.ColorButton colorButton3;
private Controls.ColorButton colorButton4;
}
}

+ 52
- 0
ButcherFactory.Form/SegmentProductionAuto_/LogForm.cs View File

@ -0,0 +1,52 @@
using ButcherFactory.BO.LocalBL;
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 ButcherFactory.SegmentProductionAuto_
{
public partial class LogForm : Form
{
public LogForm()
{
InitializeComponent();
this.Load += LogForm_Load;
}
void LogForm_Load(object sender, EventArgs e)
{
BindListView(null);
}
void BindListView(string type)
{
listView1.Items.Clear();
var list = SegmentProductionBL.GetLog(type);
foreach (var u in list)
{
ListViewItem lv = new ListViewItem();
lv.Text = u.BarCode;
lv.SubItems.Add(u.Action);
lv.SubItems.Add(u.Message);
lv.SubItems.Add(u.Time.ToString("yyyy/MM/dd HH:mm"));
listView1.Items.Add(lv);
}
listView1.Refresh();
}
private void colorButton1_Click(object sender, EventArgs e)
{
var tag = (sender as Button).Tag;
if (tag == null)
BindListView(null);
else
BindListView(tag.ToString());
}
}
}

+ 120
- 0
ButcherFactory.Form/SegmentProductionAuto_/LogForm.resx View File

@ -0,0 +1,120 @@
<?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>
</root>

+ 528
- 510
ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs
File diff suppressed because it is too large
View File


+ 43
- 16
ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs View File

@ -41,20 +41,11 @@ namespace ButcherFactory.SegmentProductionAuto_
long? batchID;
DateTime? batchDate;
NotAuto.SegmentProductionFormConfig config;
public SegmentProductionAutoForm()
{
InitializeComponent();
netStateWatch1.GetConnectState = () => LoginUtil.TestConnection(500);
this.FormClosing += delegate
{
if (initTask != null && initTask.IsAlive)
initTask.Abort();
if (uploadData != null && uploadData.IsAlive)
uploadData.Abort();
if (checkInStoreState != null && checkInStoreState.IsAlive)
checkInStoreState.Abort();
};
netStateWatch1.GetConnectState = () => LoginUtil.TestConnection(500);
this.FormClosing += SegmentProductionAutoForm_FormClosing;
workUnitSelect.SelectedIndexChanged += delegate
{
if (workUnitSelect.SelectedValue == null)
@ -77,6 +68,25 @@ namespace ButcherFactory.SegmentProductionAuto_
batchDate = entity.Date;
}
};
}
void SegmentProductionAutoForm_FormClosing(object sender, FormClosingEventArgs e)
{
var unSyncCount = SegmentProductionBL.GetUnSyncCount();
if (unSyncCount > 0)
{
if (MessageBox.Show(string.Format("{0}条数据等待上传,确认关闭?", unSyncCount), "关闭确认", MessageBoxButtons.OKCancel) != DialogResult.OK)
{
e.Cancel = true;
}
}
if (initTask != null && initTask.IsAlive)
initTask.Abort();
if (uploadData != null && uploadData.IsAlive)
uploadData.Abort();
if (checkInStoreState != null && checkInStoreState.IsAlive)
checkInStoreState.Abort();
}
protected override void OnLoad(EventArgs e)
@ -208,8 +218,11 @@ namespace ButcherFactory.SegmentProductionAuto_
{
var template = config.Template;
if (detail.GoodsType.HasValue)
template = detail.GoodsType == 0 ? "SegmentProductionPrint.html" : "SegmentProductionPrint1.html";
NotAuto.SegmentProductionPrint.Print(entity, batchDate, template);
template = detail.GoodsType == 0 ? "SegmentProductionPrint.html" : "SegmentProductionPrint1.html";
NotAuto.SegmentProductionPrint.Print(entity, batchDate, template);
var log = new SegmentLog(entity.BarCode, "打印");
log.Message = string.Format("存货名称:{0} 重量:{1:#0.###}", entity.Goods_Name, entity.Weight);
SegmentProductionBL.InsertLog(log);
}
var thd = new Thread(new ParameterizedThreadStart(RefreshTask));
thd.Start(entity);
@ -309,7 +322,10 @@ namespace ButcherFactory.SegmentProductionAuto_
item = row[0].DataBoundItem as SegmentProduction;
else
item = historyList.First();
NotAuto.SegmentProductionPrint.Print(item, batchDate, config.Template);
NotAuto.SegmentProductionPrint.Print(item, batchDate, config.Template);
var log = new SegmentLog(item.BarCode, "补打");
log.Message = string.Format("存货名称:{0} 重量:{1:#0.###}", item.Goods_Name, item.Weight);
SegmentProductionBL.InsertLog(log);
}
}
@ -325,8 +341,14 @@ namespace ButcherFactory.SegmentProductionAuto_
return;
if (MessageBox.Show("确定删除选中记录?", "删除确认", MessageBoxButtons.OKCancel) != DialogResult.OK)
return;
var tag = historyDataGrid.SelectedRows[0].DataBoundItem as SegmentProduction;
SegmentProductionBL.SetAsDelete(tag.ID, tag.BarCode);
var tag = historyDataGrid.SelectedRows[0].DataBoundItem as SegmentProduction;
if (tag.CreateTime.AddMinutes(2) < DateTime.Now)
{
MessageBox.Show("已超出可删除时间范围");
return;
}
SegmentProductionBL.Delete(tag);
//SegmentProductionBL.SetAsDelete(tag.ID, tag.BarCode);
historyList.Remove(tag);
historyDataGrid.DataSource = historyList;
historyDataGrid.ClearSelection();
@ -334,6 +356,11 @@ namespace ButcherFactory.SegmentProductionAuto_
var thd = new Thread(new ParameterizedThreadStart(RefreshTask));
thd.Start(tag);
}
private void logBtn_Click(object sender, EventArgs e)
{
new LogForm().ShowDialog();
}
}
}

+ 128
- 128
ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.resx View File

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

+ 17
- 0
ButcherFactory.Form/WeightCount_/DiscontWeightSetDialog.cs View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WinFormControl;
namespace ButcherFactory.WeightCount_
{
@ -129,6 +130,22 @@ namespace ButcherFactory.WeightCount_
//判断当前鼠标在哪个“按钮”范围内
if (rectDel.Contains(curPosition))//-
SubStract(entity);
else if (rectMod.Contains(curPosition))
{
var keyBoard = new NumberPad();
if (keyBoard.ShowDialog() == true)
{
var v = 0;
if (int.TryParse(keyBoard.Result, out v) && v > 0)
{
entity.Number = v;
mGrid.Refresh();
BindTotalLbl();
}
else
throw new Exception("输入数量有误!");
}
}
else if (rectLook.Contains(curPosition))//+
Add(entity);
}


+ 106
- 81
ButcherFactory.Form/WeightCount_/WeightCountForm.Designer.cs View File

@ -28,19 +28,19 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle42 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle41 = 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 dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WeightCountForm));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle43 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle44 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle48 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle45 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle46 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle47 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = 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 dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
this.historyDataGrid = new WinFormControl.UDataGridView();
this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -55,6 +55,7 @@
this.storeSelect = new System.Windows.Forms.ComboBox();
this.uLabel5 = new WinFormControl.ULabel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.barPrintCheck = new System.Windows.Forms.CheckBox();
this.numSetBtn = new WinFormControl.UButton();
this.productBatchSelect = new System.Windows.Forms.ComboBox();
this.uLabel2 = new WinFormControl.ULabel();
@ -69,6 +70,8 @@
this.uLabel7 = new WinFormControl.ULabel();
this.uLabel6 = new WinFormControl.ULabel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.deleteBtn = new WinFormControl.UButton();
this.rePrint = new WinFormControl.UButton();
this.needSubmitGrid = new WinFormControl.UDataGridView();
this.U_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -80,8 +83,6 @@
this.numFlowPanel = new System.Windows.Forms.FlowLayoutPanel();
this.submitBtn = new WinFormControl.UButton();
this.uLabel3 = new WinFormControl.ULabel();
this.barPrintCheck = new System.Windows.Forms.CheckBox();
this.rePrint = new WinFormControl.UButton();
((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).BeginInit();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@ -98,15 +99,15 @@
this.historyDataGrid.AllowUserToDeleteRows = false;
this.historyDataGrid.AllowUserToResizeColumns = false;
this.historyDataGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle37.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle37;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.historyDataGrid.BackgroundColor = System.Drawing.Color.White;
this.historyDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle38.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle38.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle38;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.historyDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.H_ID,
@ -122,9 +123,9 @@
this.historyDataGrid.Name = "historyDataGrid";
this.historyDataGrid.ReadOnly = true;
this.historyDataGrid.RowHeadersVisible = false;
dataGridViewCellStyle42.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle42.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle42;
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.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle6;
this.historyDataGrid.RowTemplate.Height = 23;
this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.historyDataGrid.Size = new System.Drawing.Size(683, 158);
@ -163,8 +164,8 @@
// H_GrossWeight
//
this.H_GrossWeight.DataPropertyName = "GrossWeight";
dataGridViewCellStyle39.Format = "#0.######";
this.H_GrossWeight.DefaultCellStyle = dataGridViewCellStyle39;
dataGridViewCellStyle3.Format = "#0.######";
this.H_GrossWeight.DefaultCellStyle = dataGridViewCellStyle3;
this.H_GrossWeight.HeaderText = "毛重";
this.H_GrossWeight.Name = "H_GrossWeight";
this.H_GrossWeight.ReadOnly = true;
@ -172,8 +173,8 @@
// H_Discont
//
this.H_Discont.DataPropertyName = "Discont";
dataGridViewCellStyle40.Format = "#0.######";
this.H_Discont.DefaultCellStyle = dataGridViewCellStyle40;
dataGridViewCellStyle4.Format = "#0.######";
this.H_Discont.DefaultCellStyle = dataGridViewCellStyle4;
this.H_Discont.HeaderText = "扣重";
this.H_Discont.Name = "H_Discont";
this.H_Discont.ReadOnly = true;
@ -181,8 +182,8 @@
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle41.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle41;
dataGridViewCellStyle5.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle5;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
@ -285,6 +286,17 @@
this.splitContainer1.SplitterDistance = 86;
this.splitContainer1.TabIndex = 3;
//
// barPrintCheck
//
this.barPrintCheck.AutoSize = true;
this.barPrintCheck.Font = new System.Drawing.Font("宋体", 15F);
this.barPrintCheck.Location = new System.Drawing.Point(498, 53);
this.barPrintCheck.Name = "barPrintCheck";
this.barPrintCheck.Size = new System.Drawing.Size(108, 24);
this.barPrintCheck.TabIndex = 24;
this.barPrintCheck.Text = "启用打码";
this.barPrintCheck.UseVisualStyleBackColor = true;
//
// numSetBtn
//
this.numSetBtn.AsClicked = false;
@ -477,6 +489,7 @@
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.deleteBtn);
this.groupBox1.Controls.Add(this.rePrint);
this.groupBox1.Controls.Add(this.needSubmitGrid);
this.groupBox1.Controls.Add(this.numFlowPanel);
@ -489,23 +502,67 @@
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
//
// deleteBtn
//
this.deleteBtn.AsClicked = false;
this.deleteBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("deleteBtn.BackgroundImage")));
this.deleteBtn.EnableGroup = false;
this.deleteBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.deleteBtn.FlatAppearance.BorderSize = 0;
this.deleteBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.deleteBtn.Font = new System.Drawing.Font("宋体", 15F);
this.deleteBtn.ForeColor = System.Drawing.Color.Black;
this.deleteBtn.Location = new System.Drawing.Point(211, 19);
this.deleteBtn.Name = "deleteBtn";
this.deleteBtn.PlaySound = false;
this.deleteBtn.SelfControlEnable = false;
this.deleteBtn.Size = new System.Drawing.Size(94, 34);
this.deleteBtn.SoundType = WinFormControl.SoundType.Click;
this.deleteBtn.TabIndex = 18;
this.deleteBtn.Text = "删 除";
this.deleteBtn.UseVisualStyleBackColor = true;
this.deleteBtn.WithStataHode = false;
this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click);
//
// rePrint
//
this.rePrint.AsClicked = false;
this.rePrint.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("rePrint.BackgroundImage")));
this.rePrint.EnableGroup = false;
this.rePrint.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.rePrint.FlatAppearance.BorderSize = 0;
this.rePrint.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.rePrint.Font = new System.Drawing.Font("宋体", 15F);
this.rePrint.ForeColor = System.Drawing.Color.Black;
this.rePrint.Location = new System.Drawing.Point(109, 19);
this.rePrint.Name = "rePrint";
this.rePrint.PlaySound = false;
this.rePrint.SelfControlEnable = false;
this.rePrint.Size = new System.Drawing.Size(94, 34);
this.rePrint.SoundType = WinFormControl.SoundType.Click;
this.rePrint.TabIndex = 17;
this.rePrint.Text = "补 打";
this.rePrint.UseVisualStyleBackColor = true;
this.rePrint.WithStataHode = false;
this.rePrint.Click += new System.EventHandler(this.rePrint_Click);
//
// needSubmitGrid
//
this.needSubmitGrid.AllowUserToAddRows = false;
this.needSubmitGrid.AllowUserToDeleteRows = false;
this.needSubmitGrid.AllowUserToResizeColumns = false;
this.needSubmitGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle43.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle43;
dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7;
this.needSubmitGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White;
this.needSubmitGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle44.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle44.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle44.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle44.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle44;
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle8.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8;
this.needSubmitGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.U_ID,
@ -520,9 +577,9 @@
this.needSubmitGrid.Name = "needSubmitGrid";
this.needSubmitGrid.ReadOnly = true;
this.needSubmitGrid.RowHeadersVisible = false;
dataGridViewCellStyle48.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle48.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle48;
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.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle12;
this.needSubmitGrid.RowTemplate.Height = 30;
this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.needSubmitGrid.Size = new System.Drawing.Size(683, 240);
@ -561,8 +618,8 @@
// U_GrossWeight
//
this.U_GrossWeight.DataPropertyName = "GrossWeight";
dataGridViewCellStyle45.Format = "#0.######";
this.U_GrossWeight.DefaultCellStyle = dataGridViewCellStyle45;
dataGridViewCellStyle9.Format = "#0.######";
this.U_GrossWeight.DefaultCellStyle = dataGridViewCellStyle9;
this.U_GrossWeight.HeaderText = "毛重";
this.U_GrossWeight.Name = "U_GrossWeight";
this.U_GrossWeight.ReadOnly = true;
@ -570,8 +627,8 @@
// U_Discont
//
this.U_Discont.DataPropertyName = "Discont";
dataGridViewCellStyle46.Format = "#0.######";
this.U_Discont.DefaultCellStyle = dataGridViewCellStyle46;
dataGridViewCellStyle10.Format = "#0.######";
this.U_Discont.DefaultCellStyle = dataGridViewCellStyle10;
this.U_Discont.HeaderText = "扣重";
this.U_Discont.Name = "U_Discont";
this.U_Discont.ReadOnly = true;
@ -579,8 +636,8 @@
// U_Weight
//
this.U_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle47.Format = "#0.######";
this.U_Weight.DefaultCellStyle = dataGridViewCellStyle47;
dataGridViewCellStyle11.Format = "#0.######";
this.U_Weight.DefaultCellStyle = dataGridViewCellStyle11;
this.U_Weight.HeaderText = "净重";
this.U_Weight.Name = "U_Weight";
this.U_Weight.ReadOnly = true;
@ -589,9 +646,9 @@
//
this.numFlowPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.numFlowPanel.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
this.numFlowPanel.Location = new System.Drawing.Point(211, 13);
this.numFlowPanel.Location = new System.Drawing.Point(311, 13);
this.numFlowPanel.Name = "numFlowPanel";
this.numFlowPanel.Size = new System.Drawing.Size(477, 41);
this.numFlowPanel.Size = new System.Drawing.Size(377, 41);
this.numFlowPanel.TabIndex = 15;
//
// submitBtn
@ -627,39 +684,6 @@
this.uLabel3.TabIndex = 0;
this.uLabel3.Text = "称重明细";
//
// barPrintCheck
//
this.barPrintCheck.AutoSize = true;
this.barPrintCheck.Font = new System.Drawing.Font("宋体", 15F);
this.barPrintCheck.Location = new System.Drawing.Point(498, 53);
this.barPrintCheck.Name = "barPrintCheck";
this.barPrintCheck.Size = new System.Drawing.Size(108, 24);
this.barPrintCheck.TabIndex = 24;
this.barPrintCheck.Text = "启用打码";
this.barPrintCheck.UseVisualStyleBackColor = true;
//
// rePrint
//
this.rePrint.AsClicked = false;
this.rePrint.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("rePrint.BackgroundImage")));
this.rePrint.EnableGroup = false;
this.rePrint.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.rePrint.FlatAppearance.BorderSize = 0;
this.rePrint.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.rePrint.Font = new System.Drawing.Font("宋体", 15F);
this.rePrint.ForeColor = System.Drawing.Color.Black;
this.rePrint.Location = new System.Drawing.Point(111, 19);
this.rePrint.Name = "rePrint";
this.rePrint.PlaySound = false;
this.rePrint.SelfControlEnable = false;
this.rePrint.Size = new System.Drawing.Size(94, 34);
this.rePrint.SoundType = WinFormControl.SoundType.Click;
this.rePrint.TabIndex = 17;
this.rePrint.Text = "补 打";
this.rePrint.UseVisualStyleBackColor = true;
this.rePrint.WithStataHode = false;
this.rePrint.Click += new System.EventHandler(this.rePrint_Click);
//
// WeightCountForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -730,5 +754,6 @@
private System.Windows.Forms.DataGridViewTextBoxColumn U_Weight;
private System.Windows.Forms.CheckBox barPrintCheck;
private WinFormControl.UButton rePrint;
private WinFormControl.UButton deleteBtn;
}
}

+ 13
- 0
ButcherFactory.Form/WeightCount_/WeightCountForm.cs View File

@ -305,5 +305,18 @@ namespace ButcherFactory.WeightCount_
return;
WeightCountPrint.Print(needSubmitGrid.CurrentRow.DataBoundItem as WeightCountEntity);
}
private void deleteBtn_Click(object sender, EventArgs e)
{
if (needSubmitGrid.CurrentRow == null)
return;
if (MessageBox.Show("确定要删除选中记录?", "删除确认", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
var entity = needSubmitGrid.CurrentRow.DataBoundItem as WeightCountEntity;
WeightCountEntityBL.Delete(entity.ID);
needSubmitedList.Remove(entity);
needSubmitGrid.Refresh();
}
}
}
}

+ 8
- 0
ButcherFactory.Form/WeightCount_/WeightCountForm.resx View File

@ -160,6 +160,14 @@
wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK
goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg
KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII=
</value>
</data>
<data name="deleteBtn.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK
goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg
KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII=
</value>
</data>
<data name="rePrint.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">


+ 2
- 2
ButcherFactory.Login/Login.xaml.cs View File

@ -62,8 +62,8 @@ namespace ButcherFactory.Login
var form = FormUtil.CreateFrom();
if (form == null)
throw new Exception("权限不符");
form.FormClosing += delegate
throw new Exception("权限不符");
form.FormClosed += delegate
{
this.Show();
};


Loading…
Cancel
Save