Browse Source

完善

master
luanhui 8 years ago
parent
commit
7fe64232fc
7 changed files with 192 additions and 142 deletions
  1. +26
    -11
      BO/Utils/AfterLoginUtil.cs
  2. +1
    -0
      BWP.WinFormControl/UMessageBox.Designer.cs
  3. +24
    -6
      BWP.WinFormControl/UMessageBox.cs
  4. +12
    -4
      ButcherManageClient/Login.cs
  5. +1
    -1
      SegmentationInStore/SegmentationInStoreForm.cs
  6. +115
    -114
      SegmentationWeight/SegmentationWeightForm.Designer.cs
  7. +13
    -6
      SegmentationWeight/SegmentationWeightForm.cs

+ 26
- 11
BO/Utils/AfterLoginUtil.cs View File

@ -19,17 +19,32 @@ namespace BO.Utils
public static class AfterLoginUtil public static class AfterLoginUtil
{ {
#if DEBUG #if DEBUG
static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>(){new Tuple<string,string>("排宰员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherOrder\bin\Debug\ButcherOrder"),
new Tuple<string,string>("过磅员",@"C:\B3\src\B3ButcherManageClient\ButcherWeight\bin\Debug\ButcherWeight"),
new Tuple<string,string>("验质员",@"C:\B3\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder"),
new Tuple<string,string>("定级员",@"C:\B3\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),
new Tuple<string,string>("窒晕员",@"C:\B3\src\B3ButcherManageClient\OrderConfirm\bin\Debug\OrderConfirm"),
new Tuple<string,string>("胴体白条出入库",@"C:\B3\src\B3ButcherManageClient\TrunksIousOutInStore\bin\Debug\TrunksIousOutInStore"),
new Tuple<string,string>("掉猪处理员",@"C:\B3\src\B3ButcherManageClient\DropPigReOrder\bin\Debug\DropPigReOrder"),
new Tuple<string,string>("配货员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\Distribution\bin\Debug\Distribution"),
new Tuple<string,string>("分割称重",@"C:\B3\src\B3ButcherManageClient\SegmentationWeight\bin\Debug\SegmentationWeight"),
new Tuple<string,string>("分割入库",@"C:\B3\src\B3ButcherManageClient\SegmentationInStore\bin\Debug\SegmentationInStore"),
new Tuple<string,string>("定级校验",@"C:\B3\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),
// static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>(){new Tuple<string,string>("排宰员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherOrder\bin\Debug\ButcherOrder"),
// new Tuple<string,string>("过磅员",@"C:\B3\src\B3ButcherManageClient\ButcherWeight\bin\Debug\ButcherWeight"),
// new Tuple<string,string>("验质员",@"C:\B3\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder"),
// new Tuple<string,string>("定级员",@"C:\B3\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),
// new Tuple<string,string>("窒晕员",@"C:\B3\src\B3ButcherManageClient\OrderConfirm\bin\Debug\OrderConfirm"),
// new Tuple<string,string>("胴体白条出入库",@"C:\B3\src\B3ButcherManageClient\TrunksIousOutInStore\bin\Debug\TrunksIousOutInStore"),
// new Tuple<string,string>("掉猪处理员",@"C:\B3\src\B3ButcherManageClient\DropPigReOrder\bin\Debug\DropPigReOrder"),
// new Tuple<string,string>("配货员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\Distribution\bin\Debug\Distribution"),
// new Tuple<string,string>("分割称重",@"C:\B3\src\B3ButcherManageClient\SegmentationWeight\bin\Debug\SegmentationWeight"),
// new Tuple<string,string>("分割入库",@"C:\B3\src\B3ButcherManageClient\SegmentationInStore\bin\Debug\SegmentationInStore"),
// new Tuple<string,string>("定级校验",@"C:\B3\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),
// };
//luanhui 公司电脑
static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>(){
new Tuple<string,string>("排宰员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\ButcherOrder\bin\Debug\ButcherOrder"),
new Tuple<string,string>("过磅员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\ButcherWeight\bin\Debug\ButcherWeight"),
new Tuple<string,string>("验质员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder"),
new Tuple<string,string>("定级员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),
new Tuple<string,string>("窒晕员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\OrderConfirm\bin\Debug\OrderConfirm"),
new Tuple<string,string>("胴体白条出入库",@"D:\BWP\BWPB3\src\B3ButcherManageClient\TrunksIousOutInStore\bin\Debug\TrunksIousOutInStore"),
new Tuple<string,string>("掉猪处理员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\DropPigReOrder\bin\Debug\DropPigReOrder"),
new Tuple<string,string>("配货员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\Distribution\bin\Debug\Distribution"),
new Tuple<string,string>("分割称重",@"D:\BWP\BWPB3\src\B3ButcherManageClient\SegmentationWeight\bin\Debug\SegmentationWeight"),
new Tuple<string,string>("分割入库",@"D:\BWP\BWPB3\src\B3ButcherManageClient\SegmentationInStore\bin\Debug\SegmentationInStore"),
new Tuple<string,string>("定级校验",@"D:\BWP\BWPB3\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),
}; };
#else #else
static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>() static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>()


+ 1
- 0
BWP.WinFormControl/UMessageBox.Designer.cs View File

@ -66,6 +66,7 @@
this.Name = "UMessageBox"; this.Name = "UMessageBox";
this.ShowIcon = false; this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Load += new System.EventHandler(this.UMessageBox_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();


+ 24
- 6
BWP.WinFormControl/UMessageBox.cs View File

@ -12,32 +12,50 @@ namespace BWP.WinFormControl
{ {
public partial class UMessageBox : Form public partial class UMessageBox : Form
{ {
public static void Show(string msg)
private int mCloseMin = 0;
public static void Show(string msg, int closeMin = 0)
{ {
new UMessageBox(msg).ShowDialog();
new UMessageBox(msg, closeMin).ShowDialog();
} }
public static void Show(string msg, string title)
public static void Show(string msg, string title, int closeMin = 0)
{ {
new UMessageBox(msg, title).ShowDialog();
new UMessageBox(msg, title, closeMin).ShowDialog();
} }
private UMessageBox(string msg)
private UMessageBox(string msg,int closeMin=0)
{ {
InitializeComponent(); InitializeComponent();
this.msgLabel.Text = msg; this.msgLabel.Text = msg;
mCloseMin = closeMin;
} }
private UMessageBox(string msg, string title)
private UMessageBox(string msg, string title, int closeMin = 0)
{ {
InitializeComponent(); InitializeComponent();
this.msgLabel.Text = msg; this.msgLabel.Text = msg;
this.Text = title; this.Text = title;
mCloseMin = closeMin;
} }
private void OKBtn_Click(object sender, EventArgs e) private void OKBtn_Click(object sender, EventArgs e)
{ {
this.Close(); this.Close();
} }
private void UMessageBox_Load(object sender, EventArgs e)
{
if (mCloseMin > 0)
{
var timer = new Timer();
timer.Enabled = true;
timer.Interval = mCloseMin * 1000;
timer.Tick += delegate
{
this.Close();
};
timer.Start();
}
}
} }
} }

+ 12
- 4
ButcherManageClient/Login.cs View File

@ -69,10 +69,18 @@ namespace ButcherManageClient
throw new Exception("离线状态请保持与上次用户名一致"); throw new Exception("离线状态请保持与上次用户名一致");
ButcherAppContext.Context.UserConfig.Connection = false; ButcherAppContext.Context.UserConfig.Connection = false;
} }
var form = AfterLoginUtil.CreateForm(ButcherAppContext.Context.UserConfig.Role);
// var form = AfterLoginUtil.CreateForm("分割入库");
// var form = AfterLoginUtil.CreateForm("分割称重");
// var form = AfterLoginUtil.CreateForm("定级员");
#if DEBUG
var form = AfterLoginUtil.CreateForm("分割称重");
#endif
#if !DEBUG
var form = AfterLoginUtil.CreateForm(ButcherAppContext.Context.UserConfig.Role);
#endif
// var form = AfterLoginUtil.CreateForm("分割入库");
// var form = AfterLoginUtil.CreateForm("分割称重");
// var form = AfterLoginUtil.CreateForm("定级员");
if (form == null) if (form == null)
throw new Exception("权限不符"); throw new Exception("权限不符");
form.FormClosing += delegate { SubFormClosing(); }; form.FormClosing += delegate { SubFormClosing(); };


+ 1
- 1
SegmentationInStore/SegmentationInStoreForm.cs View File

@ -404,7 +404,7 @@ namespace SegmentationInStore
{ {
//如果是扫码汇总码 //如果是扫码汇总码
if (barCodesBarCode.ToLower().Contains("end"))
if (barCodesBarCode.ToLower().Contains("fgd"))
{ {
if (!LoginRpcUtil.TestConnection(1000)) if (!LoginRpcUtil.TestConnection(1000))
{ {


+ 115
- 114
SegmentationWeight/SegmentationWeightForm.Designer.cs View File

@ -28,10 +28,10 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.btnEnablePrint = new System.Windows.Forms.Button(); this.btnEnablePrint = new System.Windows.Forms.Button();
@ -56,7 +56,14 @@
this.btnGoodsSet = new System.Windows.Forms.Button(); this.btnGoodsSet = new System.Windows.Forms.Button();
this.flpGoods = new System.Windows.Forms.FlowLayoutPanel(); this.flpGoods = new System.Windows.Forms.FlowLayoutPanel();
this.flpClass = new System.Windows.Forms.FlowLayoutPanel(); this.flpClass = new System.Windows.Forms.FlowLayoutPanel();
this.btnSumbit = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.btnRePrint = new System.Windows.Forms.Button();
this.uDataGridView1 = new BWP.WinFormControl.UDataGridView(); this.uDataGridView1 = new BWP.WinFormControl.UDataGridView();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.lblGoodsName = new System.Windows.Forms.Label(); this.lblGoodsName = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
@ -72,13 +79,6 @@
this.lblLeftWeight = new System.Windows.Forms.Label(); this.lblLeftWeight = new System.Windows.Forms.Label();
this.lblLeftNumber = new System.Windows.Forms.Label(); this.lblLeftNumber = new System.Windows.Forms.Label();
this.lblGoodsSpec = new System.Windows.Forms.Label(); this.lblGoodsSpec = new System.Windows.Forms.Label();
this.btnRePrint = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.btnSumbit = new System.Windows.Forms.Button();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
@ -383,27 +383,64 @@
this.flpClass.Size = new System.Drawing.Size(604, 76); this.flpClass.Size = new System.Drawing.Size(604, 76);
this.flpClass.TabIndex = 0; this.flpClass.TabIndex = 0;
// //
// btnSumbit
//
this.btnSumbit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSumbit.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSumbit.Location = new System.Drawing.Point(275, 409);
this.btnSumbit.Name = "btnSumbit";
this.btnSumbit.Size = new System.Drawing.Size(75, 45);
this.btnSumbit.TabIndex = 2;
this.btnSumbit.Text = "提交";
this.btnSumbit.UseVisualStyleBackColor = true;
this.btnSumbit.Click += new System.EventHandler(this.btnSumbit_Click);
//
// btnDelete
//
this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnDelete.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelete.Location = new System.Drawing.Point(142, 409);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(75, 45);
this.btnDelete.TabIndex = 2;
this.btnDelete.Text = "删除";
this.btnDelete.UseVisualStyleBackColor = true;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnRePrint
//
this.btnRePrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRePrint.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRePrint.Location = new System.Drawing.Point(10, 409);
this.btnRePrint.Name = "btnRePrint";
this.btnRePrint.Size = new System.Drawing.Size(75, 45);
this.btnRePrint.TabIndex = 2;
this.btnRePrint.Text = "补打";
this.btnRePrint.UseVisualStyleBackColor = true;
this.btnRePrint.Click += new System.EventHandler(this.btnRePrint_Click);
//
// uDataGridView1 // uDataGridView1
// //
this.uDataGridView1.AllowUserToAddRows = false; this.uDataGridView1.AllowUserToAddRows = false;
this.uDataGridView1.AllowUserToDeleteRows = false; this.uDataGridView1.AllowUserToDeleteRows = false;
this.uDataGridView1.AllowUserToResizeColumns = false; this.uDataGridView1.AllowUserToResizeColumns = false;
this.uDataGridView1.AllowUserToResizeRows = false; this.uDataGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; this.uDataGridView1.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.uDataGridView1.ColumnHeadersHeight = 40; this.uDataGridView1.ColumnHeadersHeight = 40;
this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this., this.,
this., this.,
@ -414,14 +451,51 @@
this.uDataGridView1.Name = "uDataGridView1"; this.uDataGridView1.Name = "uDataGridView1";
this.uDataGridView1.ReadOnly = true; this.uDataGridView1.ReadOnly = true;
this.uDataGridView1.RowHeadersVisible = false; this.uDataGridView1.RowHeadersVisible = false;
dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle12;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.uDataGridView1.RowTemplate.Height = 40; this.uDataGridView1.RowTemplate.Height = 40;
this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.uDataGridView1.Size = new System.Drawing.Size(386, 295);
this.uDataGridView1.Size = new System.Drawing.Size(389, 295);
this.uDataGridView1.TabIndex = 1; this.uDataGridView1.TabIndex = 1;
// //
// 序号
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "Index";
this..HeaderText = "序号";
this..Name = "序号";
this..ReadOnly = true;
this..Width = 60;
//
// 条码
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "BarCode";
this..HeaderText = "条码";
this..Name = "条码";
this..ReadOnly = true;
this..Width = 60;
//
// 产品
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "Goods_Name";
this..HeaderText = "产品";
this..MinimumWidth = 100;
this..Name = "产品";
this..ReadOnly = true;
//
// 重量
//
this..DataPropertyName = "Weight";
dataGridViewCellStyle3.Format = "#0.##";
this..DefaultCellStyle = dataGridViewCellStyle3;
this..HeaderText = "重量";
this..Name = "重量";
this..ReadOnly = true;
this..Width = 80;
//
// tableLayoutPanel1 // tableLayoutPanel1
// //
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -432,7 +506,7 @@
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 41.77215F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 41.77215F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 68F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 68F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 58F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 58F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 85F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 87F));
this.tableLayoutPanel1.Controls.Add(this.lblGoodsName, 0, 1); this.tableLayoutPanel1.Controls.Add(this.lblGoodsName, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label8, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label8, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label3, 1, 1); this.tableLayoutPanel1.Controls.Add(this.label3, 1, 1);
@ -453,7 +527,7 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(389, 98);
this.tableLayoutPanel1.Size = new System.Drawing.Size(392, 98);
this.tableLayoutPanel1.TabIndex = 0; this.tableLayoutPanel1.TabIndex = 0;
// //
// lblGoodsName // lblGoodsName
@ -489,7 +563,7 @@
this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(105, 33); this.label3.Location = new System.Drawing.Point(105, 33);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 31);
this.label3.Size = new System.Drawing.Size(66, 31);
this.label3.TabIndex = 0; this.label3.TabIndex = 0;
this.label3.Text = "重量"; this.label3.Text = "重量";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -502,7 +576,7 @@
this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(105, 65); this.label2.Location = new System.Drawing.Point(105, 65);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 32);
this.label2.Size = new System.Drawing.Size(66, 32);
this.label2.TabIndex = 0; this.label2.TabIndex = 0;
this.label2.Text = "数量"; this.label2.Text = "数量";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -513,9 +587,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.label7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.Location = new System.Drawing.Point(305, 1);
this.label7.Location = new System.Drawing.Point(306, 1);
this.label7.Name = "label7"; this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(80, 31);
this.label7.Size = new System.Drawing.Size(82, 31);
this.label7.TabIndex = 0; this.label7.TabIndex = 0;
this.label7.Text = "剩余"; this.label7.Text = "剩余";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -526,7 +600,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.label9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label9.Location = new System.Drawing.Point(246, 1);
this.label9.Location = new System.Drawing.Point(247, 1);
this.label9.Name = "label9"; this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(52, 31); this.label9.Size = new System.Drawing.Size(52, 31);
this.label9.TabIndex = 0; this.label9.TabIndex = 0;
@ -539,7 +613,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblPlanWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblPlanWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblPlanWeight.Location = new System.Drawing.Point(177, 33);
this.lblPlanWeight.Location = new System.Drawing.Point(178, 33);
this.lblPlanWeight.Name = "lblPlanWeight"; this.lblPlanWeight.Name = "lblPlanWeight";
this.lblPlanWeight.Size = new System.Drawing.Size(62, 31); this.lblPlanWeight.Size = new System.Drawing.Size(62, 31);
this.lblPlanWeight.TabIndex = 0; this.lblPlanWeight.TabIndex = 0;
@ -551,7 +625,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblNumber.Location = new System.Drawing.Point(246, 65);
this.lblNumber.Location = new System.Drawing.Point(247, 65);
this.lblNumber.Name = "lblNumber"; this.lblNumber.Name = "lblNumber";
this.lblNumber.Size = new System.Drawing.Size(52, 32); this.lblNumber.Size = new System.Drawing.Size(52, 32);
this.lblNumber.TabIndex = 0; this.lblNumber.TabIndex = 0;
@ -563,7 +637,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWeight.Location = new System.Drawing.Point(246, 33);
this.lblWeight.Location = new System.Drawing.Point(247, 33);
this.lblWeight.Name = "lblWeight"; this.lblWeight.Name = "lblWeight";
this.lblWeight.Size = new System.Drawing.Size(52, 31); this.lblWeight.Size = new System.Drawing.Size(52, 31);
this.lblWeight.TabIndex = 0; this.lblWeight.TabIndex = 0;
@ -575,7 +649,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblPlanNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblPlanNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblPlanNumber.Location = new System.Drawing.Point(177, 65);
this.lblPlanNumber.Location = new System.Drawing.Point(178, 65);
this.lblPlanNumber.Name = "lblPlanNumber"; this.lblPlanNumber.Name = "lblPlanNumber";
this.lblPlanNumber.Size = new System.Drawing.Size(62, 32); this.lblPlanNumber.Size = new System.Drawing.Size(62, 32);
this.lblPlanNumber.TabIndex = 0; this.lblPlanNumber.TabIndex = 0;
@ -587,7 +661,7 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(177, 1);
this.label1.Location = new System.Drawing.Point(178, 1);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(62, 31); this.label1.Size = new System.Drawing.Size(62, 31);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
@ -600,9 +674,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblLeftWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblLeftWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblLeftWeight.Location = new System.Drawing.Point(305, 33);
this.lblLeftWeight.Location = new System.Drawing.Point(306, 33);
this.lblLeftWeight.Name = "lblLeftWeight"; this.lblLeftWeight.Name = "lblLeftWeight";
this.lblLeftWeight.Size = new System.Drawing.Size(80, 31);
this.lblLeftWeight.Size = new System.Drawing.Size(82, 31);
this.lblLeftWeight.TabIndex = 0; this.lblLeftWeight.TabIndex = 0;
this.lblLeftWeight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblLeftWeight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
@ -612,9 +686,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.lblLeftNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblLeftNumber.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblLeftNumber.Location = new System.Drawing.Point(305, 65);
this.lblLeftNumber.Location = new System.Drawing.Point(306, 65);
this.lblLeftNumber.Name = "lblLeftNumber"; this.lblLeftNumber.Name = "lblLeftNumber";
this.lblLeftNumber.Size = new System.Drawing.Size(80, 32);
this.lblLeftNumber.Size = new System.Drawing.Size(82, 32);
this.lblLeftNumber.TabIndex = 0; this.lblLeftNumber.TabIndex = 0;
this.lblLeftNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblLeftNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
@ -630,79 +704,6 @@
this.lblGoodsSpec.TabIndex = 0; this.lblGoodsSpec.TabIndex = 0;
this.lblGoodsSpec.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblGoodsSpec.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// btnRePrint
//
this.btnRePrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRePrint.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRePrint.Location = new System.Drawing.Point(10, 409);
this.btnRePrint.Name = "btnRePrint";
this.btnRePrint.Size = new System.Drawing.Size(75, 45);
this.btnRePrint.TabIndex = 2;
this.btnRePrint.Text = "补打";
this.btnRePrint.UseVisualStyleBackColor = true;
this.btnRePrint.Click += new System.EventHandler(this.btnRePrint_Click);
//
// btnDelete
//
this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnDelete.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelete.Location = new System.Drawing.Point(142, 409);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(75, 45);
this.btnDelete.TabIndex = 2;
this.btnDelete.Text = "删除";
this.btnDelete.UseVisualStyleBackColor = true;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnSumbit
//
this.btnSumbit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSumbit.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSumbit.Location = new System.Drawing.Point(275, 409);
this.btnSumbit.Name = "btnSumbit";
this.btnSumbit.Size = new System.Drawing.Size(75, 45);
this.btnSumbit.TabIndex = 2;
this.btnSumbit.Text = "提交";
this.btnSumbit.UseVisualStyleBackColor = true;
this.btnSumbit.Click += new System.EventHandler(this.btnSumbit_Click);
//
// 序号
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "Index";
this..HeaderText = "序号";
this..Name = "序号";
this..ReadOnly = true;
this..Width = 60;
//
// 条码
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "BarCode";
this..HeaderText = "条码";
this..Name = "条码";
this..ReadOnly = true;
this..Width = 60;
//
// 产品
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "Goods_Name";
this..HeaderText = "产品";
this..MinimumWidth = 100;
this..Name = "产品";
this..ReadOnly = true;
//
// 重量
//
this..DataPropertyName = "Weight";
dataGridViewCellStyle11.Format = "#0.##";
this..DefaultCellStyle = dataGridViewCellStyle11;
this..HeaderText = "重量";
this..Name = "重量";
this..ReadOnly = true;
this..Width = 80;
//
// SegmentationWeightForm // SegmentationWeightForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);


+ 13
- 6
SegmentationWeight/SegmentationWeightForm.cs View File

@ -15,6 +15,7 @@ using System.Windows.Forms;
using BO; using BO;
using BO.Utils; using BO.Utils;
using BO.Utils.BillRpc; using BO.Utils.BillRpc;
using BWP.WinFormControl;
using BWP.WinFormControl.WeightDataFormat; using BWP.WinFormControl.WeightDataFormat;
using Forks.JsonRpc.Client; using Forks.JsonRpc.Client;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -595,7 +596,7 @@ namespace SegmentationWeight
btn.BackColor = Color.Green; btn.BackColor = Color.Green;
Application.DoEvents(); Application.DoEvents();
var set = btn.Tag as SegmentationWeightGoodSet; var set = btn.Tag as SegmentationWeightGoodSet;
//MessageBox.Show("标准重量:" + set.StandardWeight + " 上限:" + set.StandardWeightUp + " 下限:" + set.StandardWeightLow);
// if (mWeightRecords.Count > 0) // if (mWeightRecords.Count > 0)
// { // {
// var oldText = mWeightRecords.First().Goods_Name; // var oldText = mWeightRecords.First().Goods_Name;
@ -615,13 +616,19 @@ namespace SegmentationWeight
//当有标准重量的时候 必须符合范围 并且按标准重量打印 //当有标准重量的时候 必须符合范围 并且按标准重量打印
if (set.StandardWeight.HasValue) if (set.StandardWeight.HasValue)
{ {
if (set.StandardWeightUp.HasValue && record.Weight > set.StandardWeightUp.Value)
var isup = set.StandardWeightUp.HasValue && record.Weight > set.StandardWeightUp.Value;
var islow = set.StandardWeightLow.HasValue && record.Weight < set.StandardWeightLow.Value;
if (isup)
{
UMessageBox.Show("不能高于重量限制:"+set.StandardWeightUp.Value.ToString("F2"), "超上限提示", 3);
}
if (islow)
{ {
// MessageBox.Show("当前重量:"+record.Weight+" 不允许大于标准重量上限:"+ set.StandardWeightUp.Value);
UMessageBox.Show("不能低于重量限制:" + set.StandardWeightLow.Value.ToString("F2"), "低下限提示",3);
} }
if (set.StandardWeightLow.HasValue && record.Weight < set.StandardWeightLow.Value)
if (isup || islow)
{ {
// MessageBox.Show("当前重量:" + record.Weight + " 不允许小于标准重量下限:" + set.StandardWeightLow.Value);
mIsNeedRefreshPlan = false;
} }
else else
{ {
@ -633,7 +640,7 @@ namespace SegmentationWeight
{ {
mIsNeedRefreshPlan = true;//todo 这里可以完善 mIsNeedRefreshPlan = true;//todo 这里可以完善
} }
//MessageBox.Show("mIsNeedRefreshPlan" + mIsNeedRefreshPlan);
if (mIsNeedRefreshPlan) if (mIsNeedRefreshPlan)
{ {
var id = LocalDmoSession.Insert(record); var id = LocalDmoSession.Insert(record);


Loading…
Cancel
Save