Browse Source

称重计数客户端加扣重项。

master
yibo 6 years ago
parent
commit
892873d785
10 changed files with 902 additions and 136 deletions
  1. +4
    -0
      ButcherFactory.BO/Bill/WeightCountEntity.cs
  2. +5
    -1
      ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs
  3. +10
    -0
      ButcherFactory.Form/ButcherFactory.Form.csproj
  4. +33
    -0
      ButcherFactory.Form/WeightCount_/DiscontSetting.cs
  5. +288
    -0
      ButcherFactory.Form/WeightCount_/DiscontWeightSetDialog.Designer.cs
  6. +150
    -0
      ButcherFactory.Form/WeightCount_/DiscontWeightSetDialog.cs
  7. +149
    -0
      ButcherFactory.Form/WeightCount_/DiscontWeightSetDialog.resx
  8. +226
    -133
      ButcherFactory.Form/WeightCount_/WeightCountForm.Designer.cs
  9. +17
    -2
      ButcherFactory.Form/WeightCount_/WeightCountForm.cs
  10. +20
    -0
      ButcherFactory.Form/WeightCount_/WeightCountForm.resx

+ 4
- 0
ButcherFactory.BO/Bill/WeightCountEntity.cs View File

@ -18,6 +18,10 @@ namespace ButcherFactory.BO.Bill
public long? ProductBatch_ID { get; set; } public long? ProductBatch_ID { get; set; }
public decimal? GrossWeight { get; set; }
public decimal? Discont { get; set; }
public decimal? Weight { get; set; } public decimal? Weight { get; set; }
[DbColumn(DefaultValue = 1)] [DbColumn(DefaultValue = 1)]


+ 5
- 1
ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs View File

@ -25,6 +25,8 @@ namespace ButcherFactory.BO.LocalBL
query.Columns.Add(DQSelectColumn.Field("RowIndex")); query.Columns.Add(DQSelectColumn.Field("RowIndex"));
query.Columns.Add(DQSelectColumn.Field("Goods_Name")); query.Columns.Add(DQSelectColumn.Field("Goods_Name"));
query.Columns.Add(DQSelectColumn.Field("Number")); query.Columns.Add(DQSelectColumn.Field("Number"));
query.Columns.Add(DQSelectColumn.Field("GrossWeight"));
query.Columns.Add(DQSelectColumn.Field("Discont"));
query.Columns.Add(DQSelectColumn.Field("Weight")); query.Columns.Add(DQSelectColumn.Field("Weight"));
//query.Columns.Add(DQSelectColumn.Field("CreateTime")); //query.Columns.Add(DQSelectColumn.Field("CreateTime"));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true));
@ -46,7 +48,9 @@ namespace ButcherFactory.BO.LocalBL
entity.RowIndex = (int)reader[1]; entity.RowIndex = (int)reader[1];
entity.Goods_Name = (string)reader[2]; entity.Goods_Name = (string)reader[2];
entity.Number = (int)reader[3]; entity.Number = (int)reader[3];
entity.Weight = (decimal?)reader[4];
entity.GrossWeight = (decimal?)reader[4];
entity.Discont = (decimal?)reader[5];
entity.Weight = (decimal?)reader[6];
//entity.CreateTime = (DateTime)reader[5]; //entity.CreateTime = (DateTime)reader[5];
list.Add(entity); list.Add(entity);
} }


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

@ -272,6 +272,13 @@
</Compile> </Compile>
<Compile Include="SegmentStockUp_\SegmentStockUpPrint.cs" /> <Compile Include="SegmentStockUp_\SegmentStockUpPrint.cs" />
<Compile Include="Utils\ControlsUtil.cs" /> <Compile Include="Utils\ControlsUtil.cs" />
<Compile Include="WeightCount_\DiscontSetting.cs" />
<Compile Include="WeightCount_\DiscontWeightSetDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="WeightCount_\DiscontWeightSetDialog.Designer.cs">
<DependentUpon>DiscontWeightSetDialog.cs</DependentUpon>
</Compile>
<Compile Include="WeightCount_\WeightCountConfig.cs" /> <Compile Include="WeightCount_\WeightCountConfig.cs" />
<Compile Include="WeightCount_\WeightCountForm.cs"> <Compile Include="WeightCount_\WeightCountForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
@ -381,6 +388,9 @@
<EmbeddedResource Include="SegmentStockUp_\SegmentStockUpForm.resx"> <EmbeddedResource Include="SegmentStockUp_\SegmentStockUpForm.resx">
<DependentUpon>SegmentStockUpForm.cs</DependentUpon> <DependentUpon>SegmentStockUpForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="WeightCount_\DiscontWeightSetDialog.resx">
<DependentUpon>DiscontWeightSetDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WeightCount_\WeightCountForm.resx"> <EmbeddedResource Include="WeightCount_\WeightCountForm.resx">
<DependentUpon>WeightCountForm.cs</DependentUpon> <DependentUpon>WeightCountForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>


+ 33
- 0
ButcherFactory.Form/WeightCount_/DiscontSetting.cs View File

@ -0,0 +1,33 @@
using ButcherFactory.BO.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace ButcherFactory.WeightCount_
{
public class DiscontSetting
{
public string Name { get; set; }
public decimal Standard { get; set; }
public int Number { get; set; }
[XmlIgnore]
public decimal Weight { get { return Standard * Number; } }
public static BindingList<DiscontSetting> Load()
{
return XmlUtil.DeserializeFromFile<BindingList<DiscontSetting>>("Config\\DiscontSetting.xml");
}
public static void Save(BindingList<DiscontSetting> list)
{
XmlUtil.SerializerObjToFile(list, "Config\\DiscontSetting.xml");
}
}
}

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

@ -0,0 +1,288 @@
namespace ButcherFactory.WeightCount_
{
partial class DiscontWeightSetDialog
{
/// <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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DiscontWeightSetDialog));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle();
this.uLabel2 = new WinFormControl.ULabel();
this.nameBox = new System.Windows.Forms.TextBox();
this.discontBox = new System.Windows.Forms.TextBox();
this.uLabel1 = new WinFormControl.ULabel();
this.addBtn = new WinFormControl.UButton();
this.mGrid = new WinFormControl.UDataGridView();
this.uLabel3 = new WinFormControl.ULabel();
this.totalLbl = new WinFormControl.ULabel();
this.okBtn = new WinFormControl.UButton();
this.U_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Standard = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_NumberEdit = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.mGrid)).BeginInit();
this.SuspendLayout();
//
// uLabel2
//
this.uLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.uLabel2.AutoSize = true;
this.uLabel2.BackColor = System.Drawing.Color.Transparent;
this.uLabel2.Font = new System.Drawing.Font("宋体", 15F);
this.uLabel2.Location = new System.Drawing.Point(35, 29);
this.uLabel2.Name = "uLabel2";
this.uLabel2.Size = new System.Drawing.Size(89, 20);
this.uLabel2.TabIndex = 17;
this.uLabel2.Text = "扣重项:";
//
// nameBox
//
this.nameBox.Font = new System.Drawing.Font("宋体", 15F);
this.nameBox.Location = new System.Drawing.Point(119, 26);
this.nameBox.Name = "nameBox";
this.nameBox.Size = new System.Drawing.Size(144, 30);
this.nameBox.TabIndex = 18;
//
// discontBox
//
this.discontBox.Font = new System.Drawing.Font("宋体", 15F);
this.discontBox.Location = new System.Drawing.Point(378, 26);
this.discontBox.Name = "discontBox";
this.discontBox.Size = new System.Drawing.Size(144, 30);
this.discontBox.TabIndex = 20;
//
// uLabel1
//
this.uLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.uLabel1.AutoSize = true;
this.uLabel1.BackColor = System.Drawing.Color.Transparent;
this.uLabel1.Font = new System.Drawing.Font("宋体", 15F);
this.uLabel1.Location = new System.Drawing.Point(294, 29);
this.uLabel1.Name = "uLabel1";
this.uLabel1.Size = new System.Drawing.Size(89, 20);
this.uLabel1.TabIndex = 19;
this.uLabel1.Text = "标准重:";
//
// addBtn
//
this.addBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.addBtn.AsClicked = false;
this.addBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("addBtn.BackgroundImage")));
this.addBtn.EnableGroup = false;
this.addBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.addBtn.FlatAppearance.BorderSize = 0;
this.addBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.addBtn.Font = new System.Drawing.Font("宋体", 15F);
this.addBtn.ForeColor = System.Drawing.Color.Black;
this.addBtn.Location = new System.Drawing.Point(550, 22);
this.addBtn.Name = "addBtn";
this.addBtn.PlaySound = false;
this.addBtn.SelfControlEnable = false;
this.addBtn.Size = new System.Drawing.Size(111, 34);
this.addBtn.SoundType = WinFormControl.SoundType.Click;
this.addBtn.TabIndex = 26;
this.addBtn.Text = "添加";
this.addBtn.UseVisualStyleBackColor = true;
this.addBtn.WithStataHode = false;
this.addBtn.Click += new System.EventHandler(this.addBtn_Click);
//
// mGrid
//
this.mGrid.AllowUserToAddRows = false;
this.mGrid.AllowUserToDeleteRows = false;
this.mGrid.AllowUserToResizeColumns = false;
this.mGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle26.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.mGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle26;
this.mGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.mGrid.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle27.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle27.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle27.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.mGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle27;
this.mGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.mGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.U_Number,
this.U_Name,
this.U_Standard,
this.U_NumberEdit,
this.U_Weight});
this.mGrid.Location = new System.Drawing.Point(36, 87);
this.mGrid.MultiSelect = false;
this.mGrid.Name = "mGrid";
this.mGrid.ReadOnly = true;
this.mGrid.RowHeadersVisible = false;
dataGridViewCellStyle30.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle30.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.mGrid.RowsDefaultCellStyle = dataGridViewCellStyle30;
this.mGrid.RowTemplate.Height = 60;
this.mGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.mGrid.Size = new System.Drawing.Size(631, 358);
this.mGrid.TabIndex = 27;
this.mGrid.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.mGrid_CellMouseClick);
this.mGrid.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.mGrid_CellPainting);
//
// uLabel3
//
this.uLabel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.uLabel3.AutoSize = true;
this.uLabel3.BackColor = System.Drawing.Color.Transparent;
this.uLabel3.Font = new System.Drawing.Font("宋体", 15F);
this.uLabel3.Location = new System.Drawing.Point(127, 482);
this.uLabel3.Name = "uLabel3";
this.uLabel3.Size = new System.Drawing.Size(89, 20);
this.uLabel3.TabIndex = 28;
this.uLabel3.Text = "总扣重:";
//
// totalLbl
//
this.totalLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.totalLbl.AutoSize = true;
this.totalLbl.BackColor = System.Drawing.Color.Transparent;
this.totalLbl.Font = new System.Drawing.Font("宋体", 15F);
this.totalLbl.ForeColor = System.Drawing.Color.Red;
this.totalLbl.Location = new System.Drawing.Point(222, 482);
this.totalLbl.Name = "totalLbl";
this.totalLbl.Size = new System.Drawing.Size(19, 20);
this.totalLbl.TabIndex = 29;
this.totalLbl.Text = "0";
//
// okBtn
//
this.okBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.okBtn.AsClicked = false;
this.okBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("okBtn.BackgroundImage")));
this.okBtn.EnableGroup = false;
this.okBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.okBtn.FlatAppearance.BorderSize = 0;
this.okBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.okBtn.Font = new System.Drawing.Font("宋体", 15F);
this.okBtn.ForeColor = System.Drawing.Color.Black;
this.okBtn.Location = new System.Drawing.Point(378, 475);
this.okBtn.Name = "okBtn";
this.okBtn.PlaySound = false;
this.okBtn.SelfControlEnable = false;
this.okBtn.Size = new System.Drawing.Size(111, 34);
this.okBtn.SoundType = WinFormControl.SoundType.Click;
this.okBtn.TabIndex = 30;
this.okBtn.Text = "确定";
this.okBtn.UseVisualStyleBackColor = true;
this.okBtn.WithStataHode = false;
this.okBtn.Click += new System.EventHandler(this.okBtn_Click);
//
// U_Number
//
this.U_Number.HeaderText = "Number";
this.U_Number.Name = "U_Number";
this.U_Number.ReadOnly = true;
this.U_Number.Visible = false;
//
// U_Name
//
this.U_Name.DataPropertyName = "Name";
this.U_Name.HeaderText = "扣重项";
this.U_Name.Name = "U_Name";
this.U_Name.ReadOnly = true;
this.U_Name.Width = 180;
//
// U_Standard
//
this.U_Standard.DataPropertyName = "Standard";
dataGridViewCellStyle28.Format = "#0.##";
this.U_Standard.DefaultCellStyle = dataGridViewCellStyle28;
this.U_Standard.HeaderText = "标准重";
this.U_Standard.Name = "U_Standard";
this.U_Standard.ReadOnly = true;
this.U_Standard.Width = 120;
//
// U_NumberEdit
//
this.U_NumberEdit.HeaderText = "数量";
this.U_NumberEdit.Name = "U_NumberEdit";
this.U_NumberEdit.ReadOnly = true;
this.U_NumberEdit.Width = 200;
//
// U_Weight
//
this.U_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle29.Format = "#0.######";
this.U_Weight.DefaultCellStyle = dataGridViewCellStyle29;
this.U_Weight.HeaderText = "扣重";
this.U_Weight.Name = "U_Weight";
this.U_Weight.ReadOnly = true;
this.U_Weight.Width = 120;
//
// DiscontWeightSetDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(695, 537);
this.Controls.Add(this.okBtn);
this.Controls.Add(this.totalLbl);
this.Controls.Add(this.uLabel3);
this.Controls.Add(this.mGrid);
this.Controls.Add(this.addBtn);
this.Controls.Add(this.discontBox);
this.Controls.Add(this.uLabel1);
this.Controls.Add(this.nameBox);
this.Controls.Add(this.uLabel2);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "DiscontWeightSetDialog";
this.Text = "扣重设置";
((System.ComponentModel.ISupportInitialize)(this.mGrid)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private WinFormControl.ULabel uLabel2;
private System.Windows.Forms.TextBox nameBox;
private System.Windows.Forms.TextBox discontBox;
private WinFormControl.ULabel uLabel1;
private WinFormControl.UButton addBtn;
private WinFormControl.UDataGridView mGrid;
private WinFormControl.ULabel uLabel3;
private WinFormControl.ULabel totalLbl;
private WinFormControl.UButton okBtn;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Standard;
private System.Windows.Forms.DataGridViewTextBoxColumn U_NumberEdit;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Weight;
}
}

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

@ -0,0 +1,150 @@
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.WeightCount_
{
public partial class DiscontWeightSetDialog : Form
{
BindingList<DiscontSetting> list;
public DiscontWeightSetDialog()
{
InitializeComponent();
this.Load += DiscontWeightSetDialog_Load;
}
void DiscontWeightSetDialog_Load(object sender, EventArgs e)
{
list = DiscontSetting.Load();
mGrid.DataSource = list;
mGrid.Refresh();
BindTotalLbl();
}
private void addBtn_Click(object sender, EventArgs e)
{
var name = nameBox.Text.Trim();
if (string.IsNullOrEmpty(name))
throw new Exception("请输入扣重项");
if (list.Any(x => x.Name == name))
throw new Exception("名称已存在");
decimal discont;
if (!decimal.TryParse(discontBox.Text.Trim(), out discont))
throw new Exception("标准重输入不正确");
if (discont == 0)
throw new Exception("标准值不能为0");
list.Insert(0, new DiscontSetting { Name = name, Standard = discont, Number = 0 });
mGrid.Refresh();
}
private void okBtn_Click(object sender, EventArgs e)
{
DiscontSetting.Save(list);
DialogResult = DialogResult.OK;
}
SolidBrush btnBrush = new SolidBrush(Color.LightBlue);
private void mGrid_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
{
if (this.mGrid.Columns[e.ColumnIndex].HeaderText == "数量")
{
StringFormat sf = StringFormat.GenericDefault.Clone() as StringFormat;//设置重绘入单元格的字体样式
sf.FormatFlags = StringFormatFlags.DisplayFormatControl;
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
sf.Trimming = StringTrimming.EllipsisCharacter;
e.PaintBackground(e.CellBounds, false);//重绘边框
var entity = this.mGrid.Rows[e.RowIndex].DataBoundItem as DiscontSetting;
//设置要写入字体的大小
System.Drawing.Font myFont = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
SizeF sizeDel = e.Graphics.MeasureString("-", myFont);
SizeF sizeMod = e.Graphics.MeasureString(entity.Number.ToString(), myFont);
SizeF sizeLook = e.Graphics.MeasureString("+", myFont);
float fDel = sizeDel.Width / (sizeDel.Width + sizeMod.Width + sizeLook.Width); //
float fMod = sizeMod.Width / (sizeDel.Width + sizeMod.Width + sizeLook.Width);
float fLook = sizeLook.Width / (sizeDel.Width + sizeMod.Width + sizeLook.Width);
//设置每个“按钮的边界”
RectangleF rectDel = new RectangleF(e.CellBounds.Left, e.CellBounds.Top, e.CellBounds.Width * fDel, e.CellBounds.Height);
RectangleF rectMod = new RectangleF(rectDel.Right, e.CellBounds.Top, e.CellBounds.Width * fMod, e.CellBounds.Height);
RectangleF rectLook = new RectangleF(rectMod.Right, e.CellBounds.Top, e.CellBounds.Width * fLook, e.CellBounds.Height);
e.Graphics.FillRectangles(btnBrush, new RectangleF[] { rectDel });
e.Graphics.DrawString("-", myFont, Brushes.Black, rectDel, sf); //绘制“按钮”
e.Graphics.DrawString(entity.Number.ToString(), myFont, Brushes.Black, rectMod, sf);
e.Graphics.FillRectangles(btnBrush, new RectangleF[] { rectLook });
e.Graphics.DrawString("+", myFont, Brushes.Black, rectLook, sf);
e.Handled = true;
}
}
}
private void mGrid_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
{
Point curPosition = e.Location;//当前鼠标在当前单元格中的坐标
if (this.mGrid.Columns[e.ColumnIndex].HeaderText == "数量")
{
Graphics g = this.mGrid.CreateGraphics();
System.Drawing.Font myFont = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
var entity = this.mGrid.Rows[e.RowIndex].DataBoundItem as DiscontSetting;
SizeF sizeDel = g.MeasureString("-", myFont);
SizeF sizeMod = g.MeasureString(entity.Number.ToString(), myFont);
SizeF sizeLook = g.MeasureString("+", myFont);
float fDel = sizeDel.Width / (sizeDel.Width + sizeMod.Width + sizeLook.Width);
float fMod = sizeMod.Width / (sizeDel.Width + sizeMod.Width + sizeLook.Width);
float fLook = sizeLook.Width / (sizeDel.Width + sizeMod.Width + sizeLook.Width);
Rectangle rectTotal = new Rectangle(0, 0, this.mGrid.Columns[e.ColumnIndex].Width, this.mGrid.Rows[e.RowIndex].Height);
RectangleF rectDel = new RectangleF(rectTotal.Left, rectTotal.Top, rectTotal.Width * fDel, rectTotal.Height);
RectangleF rectMod = new RectangleF(rectDel.Right, rectTotal.Top, rectTotal.Width * fMod, rectTotal.Height);
RectangleF rectLook = new RectangleF(rectMod.Right, rectTotal.Top, rectTotal.Width * fLook, rectTotal.Height);
//判断当前鼠标在哪个“按钮”范围内
if (rectDel.Contains(curPosition))//-
SubStract(entity);
else if (rectLook.Contains(curPosition))//+
Add(entity);
}
}
}
private void SubStract(DiscontSetting entity)
{
if (entity.Number == 0)
return;
entity.Number -= 1;
mGrid.Refresh();
BindTotalLbl();
}
private void Add(DiscontSetting entity)
{
entity.Number += 1;
mGrid.Refresh();
BindTotalLbl();
}
void BindTotalLbl()
{
totalLbl.Text = string.Format("{0:#0.##}", list.Sum(x => x.Weight));
}
}
}

+ 149
- 0
ButcherFactory.Form/WeightCount_/DiscontWeightSetDialog.resx View File

@ -0,0 +1,149 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="addBtn.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK
goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg
KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII=
</value>
</data>
<metadata name="U_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="U_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="U_NumberEdit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="U_Weight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="okBtn.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK
goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg
KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII=
</value>
</data>
</root>

+ 226
- 133
ButcherFactory.Form/WeightCount_/WeightCountForm.Designer.cs View File

@ -28,28 +28,29 @@
/// </summary> /// </summary>
private void InitializeComponent() 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 dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = 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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WeightCountForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WeightCountForm));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
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();
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();
this.historyDataGrid = new WinFormControl.UDataGridView(); this.historyDataGrid = new WinFormControl.UDataGridView();
this.H_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.uLabel4 = new WinFormControl.ULabel(); this.uLabel4 = new WinFormControl.ULabel();
this.storeSelect = new System.Windows.Forms.ComboBox(); this.storeSelect = new System.Windows.Forms.ComboBox();
this.uLabel5 = new WinFormControl.ULabel(); this.uLabel5 = new WinFormControl.ULabel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.discontBtn = new WinFormControl.UButton();
this.typeBtn = new WinFormControl.UButton(); this.typeBtn = new WinFormControl.UButton();
this.uLabel7 = new WinFormControl.ULabel();
this.uLabel6 = new WinFormControl.ULabel(); this.uLabel6 = new WinFormControl.ULabel();
this.numSetBtn = new WinFormControl.UButton(); this.numSetBtn = new WinFormControl.UButton();
this.productBatchSelect = new System.Windows.Forms.ComboBox(); this.productBatchSelect = new System.Windows.Forms.ComboBox();
@ -62,14 +63,23 @@
this.uLabel1 = new WinFormControl.ULabel(); this.uLabel1 = new WinFormControl.ULabel();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.needSubmitGrid = new WinFormControl.UDataGridView(); this.needSubmitGrid = new WinFormControl.UDataGridView();
this.numFlowPanel = new System.Windows.Forms.FlowLayoutPanel();
this.submitBtn = new WinFormControl.UButton();
this.uLabel3 = new WinFormControl.ULabel();
this.U_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_GrossWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Discont = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.numFlowPanel = new System.Windows.Forms.FlowLayoutPanel();
this.submitBtn = new WinFormControl.UButton();
this.uLabel3 = new WinFormControl.ULabel();
this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_GrossWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Discont = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).BeginInit();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@ -80,59 +90,29 @@
((System.ComponentModel.ISupportInitialize)(this.needSubmitGrid)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.needSubmitGrid)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle17.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle17;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
//
// H_Goods_Name
//
this.H_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.H_Goods_Name.DataPropertyName = "Goods_Name";
this.H_Goods_Name.HeaderText = "产品名称";
this.H_Goods_Name.Name = "H_Goods_Name";
this.H_Goods_Name.ReadOnly = true;
//
// H_RowIndex
//
this.H_RowIndex.DataPropertyName = "RowIndex";
this.H_RowIndex.HeaderText = "序号";
this.H_RowIndex.Name = "H_RowIndex";
this.H_RowIndex.ReadOnly = true;
//
// H_ID
//
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "ID";
this.H_ID.Name = "H_ID";
this.H_ID.ReadOnly = true;
this.H_ID.Visible = false;
//
// historyDataGrid // historyDataGrid
// //
this.historyDataGrid.AllowUserToAddRows = false; this.historyDataGrid.AllowUserToAddRows = false;
this.historyDataGrid.AllowUserToDeleteRows = false; this.historyDataGrid.AllowUserToDeleteRows = false;
this.historyDataGrid.AllowUserToResizeColumns = false; this.historyDataGrid.AllowUserToResizeColumns = false;
this.historyDataGrid.AllowUserToResizeRows = false; this.historyDataGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18;
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.BackgroundColor = System.Drawing.Color.White;
this.historyDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; this.historyDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle19.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle19;
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.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.H_ID, this.H_ID,
this.H_RowIndex, this.H_RowIndex,
this.H_Goods_Name, this.H_Goods_Name,
this.H_Number, this.H_Number,
this.H_GrossWeight,
this.H_Discont,
this.H_Weight}); this.H_Weight});
this.historyDataGrid.Dock = System.Windows.Forms.DockStyle.Fill; this.historyDataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.historyDataGrid.Location = new System.Drawing.Point(5, 19); this.historyDataGrid.Location = new System.Drawing.Point(5, 19);
@ -140,30 +120,23 @@
this.historyDataGrid.Name = "historyDataGrid"; this.historyDataGrid.Name = "historyDataGrid";
this.historyDataGrid.ReadOnly = true; this.historyDataGrid.ReadOnly = true;
this.historyDataGrid.RowHeadersVisible = false; this.historyDataGrid.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.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle20;
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.RowTemplate.Height = 23;
this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.historyDataGrid.Size = new System.Drawing.Size(590, 158);
this.historyDataGrid.Size = new System.Drawing.Size(683, 158);
this.historyDataGrid.TabIndex = 2; this.historyDataGrid.TabIndex = 2;
// //
// H_Number
//
this.H_Number.DataPropertyName = "Number";
this.H_Number.HeaderText = "数量";
this.H_Number.Name = "H_Number";
this.H_Number.ReadOnly = true;
//
// flowLayoutPanel1 // flowLayoutPanel1
// //
this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.flowLayoutPanel1.AutoScroll = true; this.flowLayoutPanel1.AutoScroll = true;
this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowLayoutPanel1.Location = new System.Drawing.Point(627, -1);
this.flowLayoutPanel1.Location = new System.Drawing.Point(710, -1);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(680, 521);
this.flowLayoutPanel1.Size = new System.Drawing.Size(597, 521);
this.flowLayoutPanel1.TabIndex = 4; this.flowLayoutPanel1.TabIndex = 4;
// //
// groupBox2 // groupBox2
@ -176,7 +149,7 @@
this.groupBox2.Location = new System.Drawing.Point(11, 324); this.groupBox2.Location = new System.Drawing.Point(11, 324);
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(5); this.groupBox2.Padding = new System.Windows.Forms.Padding(5);
this.groupBox2.Size = new System.Drawing.Size(600, 182);
this.groupBox2.Size = new System.Drawing.Size(693, 182);
this.groupBox2.TabIndex = 3; this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
// //
@ -189,7 +162,7 @@
this.uLabel4.Name = "uLabel4"; this.uLabel4.Name = "uLabel4";
this.uLabel4.Size = new System.Drawing.Size(80, 18); this.uLabel4.Size = new System.Drawing.Size(80, 18);
this.uLabel4.TabIndex = 1; this.uLabel4.TabIndex = 1;
this.uLabel4.Text = "历史领料";
this.uLabel4.Text = "历史明细";
// //
// storeSelect // storeSelect
// //
@ -227,7 +200,9 @@
// splitContainer1.Panel1 // splitContainer1.Panel1
// //
this.splitContainer1.Panel1.BackColor = System.Drawing.Color.Transparent; this.splitContainer1.Panel1.BackColor = System.Drawing.Color.Transparent;
this.splitContainer1.Panel1.Controls.Add(this.discontBtn);
this.splitContainer1.Panel1.Controls.Add(this.typeBtn); this.splitContainer1.Panel1.Controls.Add(this.typeBtn);
this.splitContainer1.Panel1.Controls.Add(this.uLabel7);
this.splitContainer1.Panel1.Controls.Add(this.uLabel6); this.splitContainer1.Panel1.Controls.Add(this.uLabel6);
this.splitContainer1.Panel1.Controls.Add(this.storeSelect); this.splitContainer1.Panel1.Controls.Add(this.storeSelect);
this.splitContainer1.Panel1.Controls.Add(this.uLabel5); this.splitContainer1.Panel1.Controls.Add(this.uLabel5);
@ -250,6 +225,29 @@
this.splitContainer1.SplitterDistance = 86; this.splitContainer1.SplitterDistance = 86;
this.splitContainer1.TabIndex = 3; this.splitContainer1.TabIndex = 3;
// //
// discontBtn
//
this.discontBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.discontBtn.AsClicked = false;
this.discontBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("discontBtn.BackgroundImage")));
this.discontBtn.EnableGroup = false;
this.discontBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.discontBtn.FlatAppearance.BorderSize = 0;
this.discontBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.discontBtn.Font = new System.Drawing.Font("宋体", 15F);
this.discontBtn.ForeColor = System.Drawing.Color.Black;
this.discontBtn.Location = new System.Drawing.Point(540, 46);
this.discontBtn.Name = "discontBtn";
this.discontBtn.PlaySound = false;
this.discontBtn.SelfControlEnable = false;
this.discontBtn.Size = new System.Drawing.Size(111, 34);
this.discontBtn.SoundType = WinFormControl.SoundType.Click;
this.discontBtn.TabIndex = 25;
this.discontBtn.Text = "0";
this.discontBtn.UseVisualStyleBackColor = true;
this.discontBtn.WithStataHode = false;
this.discontBtn.Click += new System.EventHandler(this.discontBtn_Click);
//
// typeBtn // typeBtn
// //
this.typeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.typeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -261,7 +259,7 @@
this.typeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.typeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.typeBtn.Font = new System.Drawing.Font("宋体", 15F); this.typeBtn.Font = new System.Drawing.Font("宋体", 15F);
this.typeBtn.ForeColor = System.Drawing.Color.Black; this.typeBtn.ForeColor = System.Drawing.Color.Black;
this.typeBtn.Location = new System.Drawing.Point(696, 46);
this.typeBtn.Location = new System.Drawing.Point(758, 46);
this.typeBtn.Name = "typeBtn"; this.typeBtn.Name = "typeBtn";
this.typeBtn.PlaySound = false; this.typeBtn.PlaySound = false;
this.typeBtn.SelfControlEnable = false; this.typeBtn.SelfControlEnable = false;
@ -272,13 +270,25 @@
this.typeBtn.WithStataHode = false; this.typeBtn.WithStataHode = false;
this.typeBtn.Click += new System.EventHandler(this.typeBtn_Click); this.typeBtn.Click += new System.EventHandler(this.typeBtn_Click);
// //
// uLabel7
//
this.uLabel7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.uLabel7.AutoSize = true;
this.uLabel7.BackColor = System.Drawing.Color.Transparent;
this.uLabel7.Font = new System.Drawing.Font("宋体", 15F);
this.uLabel7.Location = new System.Drawing.Point(475, 53);
this.uLabel7.Name = "uLabel7";
this.uLabel7.Size = new System.Drawing.Size(69, 20);
this.uLabel7.TabIndex = 24;
this.uLabel7.Text = "扣重:";
//
// uLabel6 // uLabel6
// //
this.uLabel6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.uLabel6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.uLabel6.AutoSize = true; this.uLabel6.AutoSize = true;
this.uLabel6.BackColor = System.Drawing.Color.Transparent; this.uLabel6.BackColor = System.Drawing.Color.Transparent;
this.uLabel6.Font = new System.Drawing.Font("宋体", 15F); this.uLabel6.Font = new System.Drawing.Font("宋体", 15F);
this.uLabel6.Location = new System.Drawing.Point(595, 53);
this.uLabel6.Location = new System.Drawing.Point(657, 53);
this.uLabel6.Name = "uLabel6"; this.uLabel6.Name = "uLabel6";
this.uLabel6.Size = new System.Drawing.Size(109, 20); this.uLabel6.Size = new System.Drawing.Size(109, 20);
this.uLabel6.TabIndex = 24; this.uLabel6.TabIndex = 24;
@ -414,7 +424,7 @@
this.groupBox1.Location = new System.Drawing.Point(11, 13); this.groupBox1.Location = new System.Drawing.Point(11, 13);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(5); this.groupBox1.Padding = new System.Windows.Forms.Padding(5);
this.groupBox1.Size = new System.Drawing.Size(600, 305);
this.groupBox1.Size = new System.Drawing.Size(693, 305);
this.groupBox1.TabIndex = 2; this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
@ -424,37 +434,81 @@
this.needSubmitGrid.AllowUserToDeleteRows = false; this.needSubmitGrid.AllowUserToDeleteRows = false;
this.needSubmitGrid.AllowUserToResizeColumns = false; this.needSubmitGrid.AllowUserToResizeColumns = false;
this.needSubmitGrid.AllowUserToResizeRows = false; this.needSubmitGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle21.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle21;
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) this.needSubmitGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White; this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White;
this.needSubmitGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; this.needSubmitGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle22.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle22.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle22.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle22;
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.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.U_ID, this.U_ID,
this.U_RowIndex, this.U_RowIndex,
this.U_Goods_Name, this.U_Goods_Name,
this.U_Number, this.U_Number,
this.U_GrossWeight,
this.U_Discont,
this.U_Weight}); this.U_Weight});
this.needSubmitGrid.Location = new System.Drawing.Point(5, 57); this.needSubmitGrid.Location = new System.Drawing.Point(5, 57);
this.needSubmitGrid.MultiSelect = false; this.needSubmitGrid.MultiSelect = false;
this.needSubmitGrid.Name = "needSubmitGrid"; this.needSubmitGrid.Name = "needSubmitGrid";
this.needSubmitGrid.ReadOnly = true; this.needSubmitGrid.ReadOnly = true;
this.needSubmitGrid.RowHeadersVisible = false; this.needSubmitGrid.RowHeadersVisible = false;
dataGridViewCellStyle24.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle24.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle24;
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.RowTemplate.Height = 30;
this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.needSubmitGrid.Size = new System.Drawing.Size(590, 240);
this.needSubmitGrid.Size = new System.Drawing.Size(683, 240);
this.needSubmitGrid.TabIndex = 16; this.needSubmitGrid.TabIndex = 16;
// //
// numFlowPanel
//
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(143, 13);
this.numFlowPanel.Name = "numFlowPanel";
this.numFlowPanel.Size = new System.Drawing.Size(545, 41);
this.numFlowPanel.TabIndex = 15;
//
// submitBtn
//
this.submitBtn.AsClicked = false;
this.submitBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("submitBtn.BackgroundImage")));
this.submitBtn.EnableGroup = false;
this.submitBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.submitBtn.FlatAppearance.BorderSize = 0;
this.submitBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.submitBtn.Font = new System.Drawing.Font("宋体", 15F);
this.submitBtn.ForeColor = System.Drawing.Color.Black;
this.submitBtn.Location = new System.Drawing.Point(11, 20);
this.submitBtn.Name = "submitBtn";
this.submitBtn.PlaySound = false;
this.submitBtn.SelfControlEnable = false;
this.submitBtn.Size = new System.Drawing.Size(111, 34);
this.submitBtn.SoundType = WinFormControl.SoundType.Click;
this.submitBtn.TabIndex = 11;
this.submitBtn.Text = "提 交";
this.submitBtn.UseVisualStyleBackColor = true;
this.submitBtn.WithStataHode = false;
this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click);
//
// uLabel3
//
this.uLabel3.AutoSize = true;
this.uLabel3.BackColor = System.Drawing.Color.White;
this.uLabel3.Font = new System.Drawing.Font("宋体", 13F);
this.uLabel3.Location = new System.Drawing.Point(8, 0);
this.uLabel3.Name = "uLabel3";
this.uLabel3.Size = new System.Drawing.Size(80, 18);
this.uLabel3.TabIndex = 0;
this.uLabel3.Text = "称重明细";
//
// U_ID // U_ID
// //
this.U_ID.DataPropertyName = "ID"; this.U_ID.DataPropertyName = "ID";
@ -485,56 +539,89 @@
this.U_Number.Name = "U_Number"; this.U_Number.Name = "U_Number";
this.U_Number.ReadOnly = true; this.U_Number.ReadOnly = true;
// //
// U_GrossWeight
//
this.U_GrossWeight.DataPropertyName = "GrossWeight";
dataGridViewCellStyle9.Format = "#0.######";
this.U_GrossWeight.DefaultCellStyle = dataGridViewCellStyle9;
this.U_GrossWeight.HeaderText = "毛重";
this.U_GrossWeight.Name = "U_GrossWeight";
this.U_GrossWeight.ReadOnly = true;
//
// U_Discont
//
this.U_Discont.DataPropertyName = "Discont";
dataGridViewCellStyle10.Format = "#0.######";
this.U_Discont.DefaultCellStyle = dataGridViewCellStyle10;
this.U_Discont.HeaderText = "扣重";
this.U_Discont.Name = "U_Discont";
this.U_Discont.ReadOnly = true;
//
// U_Weight // U_Weight
// //
this.U_Weight.DataPropertyName = "Weight"; this.U_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle23.Format = "#0.######";
this.U_Weight.DefaultCellStyle = dataGridViewCellStyle23;
this.U_Weight.HeaderText = "重量";
dataGridViewCellStyle11.Format = "#0.######";
this.U_Weight.DefaultCellStyle = dataGridViewCellStyle11;
this.U_Weight.HeaderText = "重";
this.U_Weight.Name = "U_Weight"; this.U_Weight.Name = "U_Weight";
this.U_Weight.ReadOnly = true; this.U_Weight.ReadOnly = true;
// //
// numFlowPanel
// H_ID
// //
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(143, 13);
this.numFlowPanel.Name = "numFlowPanel";
this.numFlowPanel.Size = new System.Drawing.Size(452, 41);
this.numFlowPanel.TabIndex = 15;
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "ID";
this.H_ID.Name = "H_ID";
this.H_ID.ReadOnly = true;
this.H_ID.Visible = false;
// //
// submitBtn
// H_RowIndex
// //
this.submitBtn.AsClicked = false;
this.submitBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("submitBtn.BackgroundImage")));
this.submitBtn.EnableGroup = false;
this.submitBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.submitBtn.FlatAppearance.BorderSize = 0;
this.submitBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.submitBtn.Font = new System.Drawing.Font("宋体", 15F);
this.submitBtn.ForeColor = System.Drawing.Color.Black;
this.submitBtn.Location = new System.Drawing.Point(11, 20);
this.submitBtn.Name = "submitBtn";
this.submitBtn.PlaySound = false;
this.submitBtn.SelfControlEnable = false;
this.submitBtn.Size = new System.Drawing.Size(111, 34);
this.submitBtn.SoundType = WinFormControl.SoundType.Click;
this.submitBtn.TabIndex = 11;
this.submitBtn.Text = "提 交";
this.submitBtn.UseVisualStyleBackColor = true;
this.submitBtn.WithStataHode = false;
this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click);
this.H_RowIndex.DataPropertyName = "RowIndex";
this.H_RowIndex.HeaderText = "序号";
this.H_RowIndex.Name = "H_RowIndex";
this.H_RowIndex.ReadOnly = true;
// //
// uLabel3
// H_Goods_Name
// //
this.uLabel3.AutoSize = true;
this.uLabel3.BackColor = System.Drawing.Color.White;
this.uLabel3.Font = new System.Drawing.Font("宋体", 13F);
this.uLabel3.Location = new System.Drawing.Point(8, 0);
this.uLabel3.Name = "uLabel3";
this.uLabel3.Size = new System.Drawing.Size(80, 18);
this.uLabel3.TabIndex = 0;
this.uLabel3.Text = "领料明细";
this.H_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.H_Goods_Name.DataPropertyName = "Goods_Name";
this.H_Goods_Name.HeaderText = "产品名称";
this.H_Goods_Name.Name = "H_Goods_Name";
this.H_Goods_Name.ReadOnly = true;
//
// H_Number
//
this.H_Number.DataPropertyName = "Number";
this.H_Number.HeaderText = "数量";
this.H_Number.Name = "H_Number";
this.H_Number.ReadOnly = true;
//
// H_GrossWeight
//
this.H_GrossWeight.DataPropertyName = "GrossWeight";
dataGridViewCellStyle3.Format = "#0.######";
this.H_GrossWeight.DefaultCellStyle = dataGridViewCellStyle3;
this.H_GrossWeight.HeaderText = "毛重";
this.H_GrossWeight.Name = "H_GrossWeight";
this.H_GrossWeight.ReadOnly = true;
//
// H_Discont
//
this.H_Discont.DataPropertyName = "Discont";
dataGridViewCellStyle4.Format = "#0.######";
this.H_Discont.DefaultCellStyle = dataGridViewCellStyle4;
this.H_Discont.HeaderText = "扣重";
this.H_Discont.Name = "H_Discont";
this.H_Discont.ReadOnly = true;
//
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle5.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle5;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
// //
// WeightCountForm // WeightCountForm
// //
@ -564,12 +651,7 @@
#endregion #endregion
private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn H_RowIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn H_ID;
private WinFormControl.UDataGridView historyDataGrid; private WinFormControl.UDataGridView historyDataGrid;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Number;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox groupBox2;
private WinFormControl.ULabel uLabel4; private WinFormControl.ULabel uLabel4;
@ -587,15 +669,26 @@
private WinFormControl.ULabel uLabel1; private WinFormControl.ULabel uLabel1;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private WinFormControl.UDataGridView needSubmitGrid; private WinFormControl.UDataGridView needSubmitGrid;
private System.Windows.Forms.DataGridViewTextBoxColumn U_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn U_RowIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Weight;
private System.Windows.Forms.FlowLayoutPanel numFlowPanel; private System.Windows.Forms.FlowLayoutPanel numFlowPanel;
private WinFormControl.UButton submitBtn; private WinFormControl.UButton submitBtn;
private WinFormControl.ULabel uLabel3; private WinFormControl.ULabel uLabel3;
private WinFormControl.ULabel uLabel6; private WinFormControl.ULabel uLabel6;
private WinFormControl.UButton typeBtn; private WinFormControl.UButton typeBtn;
private WinFormControl.UButton discontBtn;
private WinFormControl.ULabel uLabel7;
private System.Windows.Forms.DataGridViewTextBoxColumn H_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_RowIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn H_GrossWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Discont;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn U_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn U_RowIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn U_GrossWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Discont;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Weight;
} }
} }

+ 17
- 2
ButcherFactory.Form/WeightCount_/WeightCountForm.cs View File

@ -38,6 +38,7 @@ namespace ButcherFactory.WeightCount_
BindingList<WeightCountEntity> needSubmitedList; BindingList<WeightCountEntity> needSubmitedList;
BindingList<WeightCountEntity> historyList; BindingList<WeightCountEntity> historyList;
WeightCountConfig config; WeightCountConfig config;
decimal discontWeight;
long? batchID; long? batchID;
@ -78,9 +79,9 @@ namespace ButcherFactory.WeightCount_
protected override void OnLoad(EventArgs e) protected override void OnLoad(EventArgs e)
{ {
base.OnLoad(e); base.OnLoad(e);
BindDiscontWeight();
var initTask = new Thread(LoadBind); var initTask = new Thread(LoadBind);
initTask.Start(); initTask.Start();
uploadData = new Thread(UpLoadLocalData); uploadData = new Thread(UpLoadLocalData);
uploadData.Start(); uploadData.Start();
} }
@ -128,7 +129,9 @@ namespace ButcherFactory.WeightCount_
var c = sender as UButton; var c = sender as UButton;
var entity = new WeightCountEntity(); var entity = new WeightCountEntity();
entity.RowIndex = GetRowIndex(); entity.RowIndex = GetRowIndex();
entity.Weight = uWeightControl1.Weight;
entity.GrossWeight= uWeightControl1.Weight;
entity.Discont = discontWeight;
entity.Weight = (entity.GrossWeight ?? 0) - discontWeight;
entity.Goods_ID = (long)c.Tag; entity.Goods_ID = (long)c.Tag;
entity.Goods_Name = c.Text; entity.Goods_Name = c.Text;
entity.ProductBatch_ID = batchID; entity.ProductBatch_ID = batchID;
@ -279,5 +282,17 @@ namespace ButcherFactory.WeightCount_
typeBtn.Text = config.ProduceOut ? "产出" : "入库"; typeBtn.Text = config.ProduceOut ? "产出" : "入库";
BindGrid(); BindGrid();
} }
private void discontBtn_Click(object sender, EventArgs e)
{
if (new DiscontWeightSetDialog().ShowDialog() == DialogResult.OK)
BindDiscontWeight();
}
void BindDiscontWeight()
{
discontWeight = DiscontSetting.Load().Sum(x => x.Weight);
discontBtn.Text = string.Format("{0:#0.##}", discontWeight);
}
} }
} }

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

@ -123,7 +123,21 @@
<metadata name="H_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="H_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="H_GrossWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_Discont.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="discontBtn.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="typeBtn.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="typeBtn.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@ -154,6 +168,12 @@
<metadata name="U_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="U_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="U_GrossWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="U_Discont.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="U_Weight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="U_Weight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>


Loading…
Cancel
Save