diff --git a/ButcherFactory.BO/Bill/StockUpEntity.cs b/ButcherFactory.BO/Bill/StockUpEntity.cs index f2046d2..1c7ab0c 100644 --- a/ButcherFactory.BO/Bill/StockUpEntity.cs +++ b/ButcherFactory.BO/Bill/StockUpEntity.cs @@ -24,6 +24,7 @@ namespace ButcherFactory.BO public bool StandardPic { get; set; } public bool StockUpBySecondNum { get; set; } public bool FinishAssign { get; set; } + public long? DeliverLineGroup_ID { get; set; } public bool Finishd { get @@ -92,5 +93,12 @@ namespace ButcherFactory.BO //public bool StandardPic { get; set; } public decimal? UnitNum { get; set; } public decimal? SecondNumber { get; set; } + } + + public class DeliverLineGroup + { + public long ID { get; set; } + public string Name { get; set; } + public int Order { get; set; } } } diff --git a/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs b/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs index 3da1c22..28d77a9 100644 --- a/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs @@ -106,6 +106,12 @@ namespace ButcherFactory.BO.LocalBL #endif return new List(); } + } + + public static List GetDeliverLineGroupList() + { + var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/GetDeliverLineGroup"); + return JsonConvert.DeserializeObject>(json); } } } diff --git a/ButcherFactory.Form/ButcherFactory.Form.csproj b/ButcherFactory.Form/ButcherFactory.Form.csproj index e3269e5..29f12f5 100644 --- a/ButcherFactory.Form/ButcherFactory.Form.csproj +++ b/ButcherFactory.Form/ButcherFactory.Form.csproj @@ -269,6 +269,12 @@ WeightRecordDialog.cs + + Form + + + DeliverLineGroupSelectDialog.cs + @@ -402,6 +408,9 @@ WeightRecordDialog.cs + + DeliverLineGroupSelectDialog.cs + SegmentStockUpForm.cs diff --git a/ButcherFactory.Form/SegmentStockUp_/DeliverLineGroupSelectDialog.Designer.cs b/ButcherFactory.Form/SegmentStockUp_/DeliverLineGroupSelectDialog.Designer.cs new file mode 100644 index 0000000..3e7ecdb --- /dev/null +++ b/ButcherFactory.Form/SegmentStockUp_/DeliverLineGroupSelectDialog.Designer.cs @@ -0,0 +1,78 @@ +namespace ButcherFactory.SegmentStockUp_ +{ + partial class DeliverLineGroupSelectDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.closeBtn = new ButcherFactory.Controls.ColorButton(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.SuspendLayout(); + // + // closeBtn + // + this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.closeBtn.BackColor = System.Drawing.Color.Red; + this.closeBtn.Font = new System.Drawing.Font("宋体", 12F); + this.closeBtn.ForeColor = System.Drawing.Color.White; + this.closeBtn.Location = new System.Drawing.Point(716, 24); + this.closeBtn.Name = "closeBtn"; + this.closeBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.closeBtn.Size = new System.Drawing.Size(88, 39); + this.closeBtn.TabIndex = 6; + this.closeBtn.Text = "关闭"; + this.closeBtn.UseVisualStyleBackColor = false; + this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click); + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.flowLayoutPanel1.Location = new System.Drawing.Point(18, 84); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(789, 452); + this.flowLayoutPanel1.TabIndex = 5; + // + // DeliverLineGroupSelectDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(824, 560); + this.Controls.Add(this.closeBtn); + this.Controls.Add(this.flowLayoutPanel1); + this.Name = "DeliverLineGroupSelectDialog"; + this.Text = "选择线路分组"; + this.ResumeLayout(false); + + } + + #endregion + + private Controls.ColorButton closeBtn; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + } +} \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentStockUp_/DeliverLineGroupSelectDialog.cs b/ButcherFactory.Form/SegmentStockUp_/DeliverLineGroupSelectDialog.cs new file mode 100644 index 0000000..b145037 --- /dev/null +++ b/ButcherFactory.Form/SegmentStockUp_/DeliverLineGroupSelectDialog.cs @@ -0,0 +1,75 @@ +using ButcherFactory.BO; +using ButcherFactory.BO.LocalBL; +using ButcherFactory.BO.Utils; +using ButcherFactory.Controls; +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.SegmentStockUp_ +{ + public partial class DeliverLineGroupSelectDialog : Form + { + Color color = Color.FromArgb(105, 105, 105); + Color selectColor = Color.FromArgb(250, 120, 24); + SegmentStockUpConfig config; + public DeliverLineGroupSelectDialog() + { + InitializeComponent(); + this.FormClosing += DeliverLineGroupSelectDialog_FormClosing; + } + + void DeliverLineGroupSelectDialog_FormClosing(object sender, FormClosingEventArgs e) + { + XmlUtil.SerializerObjToFile(config); + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + config = XmlUtil.DeserializeFromFile(); + BindList(); + } + + void BindList() + { + flowLayoutPanel1.Controls.Clear(); + var list = SegmentStockUpBL.GetDeliverLineGroupList(); + foreach (var item in list) + { + var btn = new ColorButton() { Width = 150, Height = 60, Text = item.Name, Tag = item, Font = new Font("宋体", 14), Margin = new Padding(30) }; + btn.BackColor = config.LineGroup.Any(x => x.ID == item.ID) ? selectColor : color; + btn.Click += ItemClick; + flowLayoutPanel1.Controls.Add(btn); + } + } + + private void ItemClick(object sender, EventArgs e) + { + var btn = sender as ColorButton; + var item = (DeliverLineGroup)btn.Tag; + var first = config.LineGroup.FirstOrDefault(x => x.ID == item.ID); + if (first == null) + { + config.LineGroup.Add(item); + btn.BackColor = selectColor; + } + else + { + config.LineGroup.Remove(first); + btn.BackColor = color; + } + } + + private void closeBtn_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/ButcherFactory.Form/SegmentStockUp_/DeliverLineGroupSelectDialog.resx b/ButcherFactory.Form/SegmentStockUp_/DeliverLineGroupSelectDialog.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ButcherFactory.Form/SegmentStockUp_/DeliverLineGroupSelectDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpConfig.cs b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpConfig.cs index 5bae73c..188faa4 100644 --- a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpConfig.cs +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpConfig.cs @@ -1,4 +1,5 @@ -using System; +using ButcherFactory.BO; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -9,5 +10,8 @@ namespace ButcherFactory.SegmentStockUp_ public class SegmentStockUpConfig { public decimal? AllowDownWeight { get; set; } + + private List mLineGroup = new List(); + public List LineGroup { get { return mLineGroup; } } } } diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs index 0447efb..e7b76c5 100644 --- a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs @@ -28,13 +28,6 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = 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 dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); @@ -47,23 +40,29 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); - this.uScanPanel1 = new WinFormControl.UScanPanel(); - this.panel4 = new System.Windows.Forms.Panel(); - this.goodsLbl = new System.Windows.Forms.Label(); - this.driveLineLbl = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.dhNumberLbl = new System.Windows.Forms.Label(); - this.panel5 = new System.Windows.Forms.Panel(); - this.mainGridView = new WinFormControl.UDataGridView(); - this.D_Finishd = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_Customer_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_Goods_Spec = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_UnitNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_SSecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_SUnitNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.label12 = new System.Windows.Forms.Label(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.downWeightBox = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.panel7 = new System.Windows.Forms.Panel(); + this.colorButton1 = new ButcherFactory.Controls.ColorButton(); + this.printCk = new System.Windows.Forms.CheckBox(); + this.refresh = new ButcherFactory.Controls.ColorButton(); + this.bhUnitNumLbl = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.bhNumberLbl = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.dhUnitNumLbl = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); this.panel6 = new System.Windows.Forms.Panel(); this.finishGrid = new WinFormControl.UDataGridView(); this.F_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -80,259 +79,251 @@ this.B_SaleOutStoreID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_UnitNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dhUnitNumLbl = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.bhUnitNumLbl = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.bhNumberLbl = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.panel7 = new System.Windows.Forms.Panel(); - this.colorButton1 = new ButcherFactory.Controls.ColorButton(); - this.printCk = new System.Windows.Forms.CheckBox(); - this.refresh = new ButcherFactory.Controls.ColorButton(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.downWeightBox = new System.Windows.Forms.Label(); + this.panel5 = new System.Windows.Forms.Panel(); + this.mainGridView = new WinFormControl.UDataGridView(); + this.D_Finishd = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Customer_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Goods_Spec = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_UnitNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_SSecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_SUnitNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.label12 = new System.Windows.Forms.Label(); + this.dhNumberLbl = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.driveLineLbl = new System.Windows.Forms.Label(); + this.goodsLbl = new System.Windows.Forms.Label(); + this.panel4 = new System.Windows.Forms.Panel(); + this.uScanPanel1 = new WinFormControl.UScanPanel(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.lineGroupSetBtn = new ButcherFactory.Controls.ColorButton(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.roundPanel1.SuspendLayout(); - this.panel5.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).BeginInit(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.panel7.SuspendLayout(); this.panel6.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.finishGrid)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.detailGridView)).BeginInit(); - this.panel7.SuspendLayout(); + this.panel5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).BeginInit(); + this.tabPage2.SuspendLayout(); this.SuspendLayout(); // // roundPanel1 // - this.roundPanel1.Controls.Add(this.downWeightBox); - this.roundPanel1.Controls.Add(this.label5); - this.roundPanel1.Controls.Add(this.label2); - this.roundPanel1.Controls.Add(this.label1); - this.roundPanel1.Controls.Add(this.panel7); - this.roundPanel1.Controls.Add(this.bhUnitNumLbl); - this.roundPanel1.Controls.Add(this.label9); - this.roundPanel1.Controls.Add(this.bhNumberLbl); - this.roundPanel1.Controls.Add(this.label11); - this.roundPanel1.Controls.Add(this.dhUnitNumLbl); - this.roundPanel1.Controls.Add(this.label7); - this.roundPanel1.Controls.Add(this.panel6); - this.roundPanel1.Controls.Add(this.panel5); - this.roundPanel1.Controls.Add(this.dhNumberLbl); - this.roundPanel1.Controls.Add(this.label4); - this.roundPanel1.Controls.Add(this.driveLineLbl); - this.roundPanel1.Controls.Add(this.goodsLbl); - this.roundPanel1.Controls.Add(this.panel4); - this.roundPanel1.Controls.Add(this.uScanPanel1); - // - // uScanPanel1 - // - this.uScanPanel1.BackColor = System.Drawing.Color.Transparent; - this.uScanPanel1.Location = new System.Drawing.Point(18, 9); - this.uScanPanel1.Name = "uScanPanel1"; - this.uScanPanel1.Size = new System.Drawing.Size(303, 32); - this.uScanPanel1.TabIndex = 0; - // - // panel4 + this.roundPanel1.Controls.Add(this.tabControl1); + this.roundPanel1.Size = new System.Drawing.Size(1187, 530); + // + // label3 + // + this.label3.Location = new System.Drawing.Point(495, 599); + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.ItemSize = new System.Drawing.Size(48, 40); + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Margin = new System.Windows.Forms.Padding(0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.Padding = new System.Drawing.Point(60, 3); + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(1187, 530); + this.tabControl1.TabIndex = 0; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.downWeightBox); + this.tabPage1.Controls.Add(this.label5); + this.tabPage1.Controls.Add(this.label2); + this.tabPage1.Controls.Add(this.label1); + this.tabPage1.Controls.Add(this.panel7); + this.tabPage1.Controls.Add(this.bhUnitNumLbl); + this.tabPage1.Controls.Add(this.label9); + this.tabPage1.Controls.Add(this.bhNumberLbl); + this.tabPage1.Controls.Add(this.label11); + this.tabPage1.Controls.Add(this.dhUnitNumLbl); + this.tabPage1.Controls.Add(this.label7); + this.tabPage1.Controls.Add(this.panel6); + this.tabPage1.Controls.Add(this.panel5); + this.tabPage1.Controls.Add(this.dhNumberLbl); + this.tabPage1.Controls.Add(this.label4); + this.tabPage1.Controls.Add(this.driveLineLbl); + this.tabPage1.Controls.Add(this.goodsLbl); + this.tabPage1.Controls.Add(this.panel4); + this.tabPage1.Controls.Add(this.uScanPanel1); + this.tabPage1.Location = new System.Drawing.Point(4, 44); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(1179, 482); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "备货"; + this.tabPage1.UseVisualStyleBackColor = true; // - this.panel4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.panel4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(243)))), ((int)(((byte)(243))))); - this.panel4.Location = new System.Drawing.Point(7, 53); - this.panel4.Name = "panel4"; - this.panel4.Size = new System.Drawing.Size(1174, 1); - this.panel4.TabIndex = 3; - // - // goodsLbl - // - this.goodsLbl.AutoSize = true; - this.goodsLbl.Font = new System.Drawing.Font("宋体", 14F); - this.goodsLbl.ForeColor = System.Drawing.Color.Red; - this.goodsLbl.Location = new System.Drawing.Point(236, 63); - this.goodsLbl.Name = "goodsLbl"; - this.goodsLbl.Size = new System.Drawing.Size(85, 19); - this.goodsLbl.TabIndex = 4; - this.goodsLbl.Text = "存货名称"; - // - // driveLineLbl + // downWeightBox // - this.driveLineLbl.AutoSize = true; - this.driveLineLbl.Font = new System.Drawing.Font("宋体", 14F); - this.driveLineLbl.ForeColor = System.Drawing.Color.Red; - this.driveLineLbl.Location = new System.Drawing.Point(16, 63); - this.driveLineLbl.Name = "driveLineLbl"; - this.driveLineLbl.Size = new System.Drawing.Size(85, 19); - this.driveLineLbl.TabIndex = 4; - this.driveLineLbl.Text = "送货线路"; + this.downWeightBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.downWeightBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.downWeightBox.Font = new System.Drawing.Font("宋体", 14F); + this.downWeightBox.ForeColor = System.Drawing.Color.Red; + this.downWeightBox.Location = new System.Drawing.Point(1070, 82); + this.downWeightBox.Name = "downWeightBox"; + this.downWeightBox.Size = new System.Drawing.Size(102, 30); + this.downWeightBox.TabIndex = 43; + this.downWeightBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.downWeightBox.Click += new System.EventHandler(this.downWeightBox_Click); // - // label4 + // label5 // - this.label4.AutoSize = true; - this.label4.Font = new System.Drawing.Font("宋体", 14F); - this.label4.Location = new System.Drawing.Point(16, 100); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(85, 19); - this.label4.TabIndex = 5; - this.label4.Text = "订货数量"; + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("宋体", 14F); + this.label5.ForeColor = System.Drawing.Color.Blue; + this.label5.Location = new System.Drawing.Point(973, 88); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(104, 19); + this.label5.TabIndex = 42; + this.label5.Text = "下浮重量:"; // - // dhNumberLbl + // label2 // - this.dhNumberLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.dhNumberLbl.Font = new System.Drawing.Font("宋体", 14F); - this.dhNumberLbl.ForeColor = System.Drawing.Color.Red; - this.dhNumberLbl.Location = new System.Drawing.Point(104, 94); - this.dhNumberLbl.Name = "dhNumberLbl"; - this.dhNumberLbl.Size = new System.Drawing.Size(120, 30); - this.dhNumberLbl.TabIndex = 5; - this.dhNumberLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.label2.Font = new System.Drawing.Font("宋体", 14F); + this.label2.ForeColor = System.Drawing.Color.Red; + this.label2.Location = new System.Drawing.Point(470, 5); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(332, 32); + this.label2.TabIndex = 41; + this.label2.Text = "请选择"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label2.Click += new System.EventHandler(this.label2_Click); // - // panel5 + // label1 // - this.panel5.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.panel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); - this.panel5.Controls.Add(this.mainGridView); - this.panel5.Controls.Add(this.label12); - this.panel5.Location = new System.Drawing.Point(7, 142); - this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(567, 362); - this.panel5.TabIndex = 12; + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("宋体", 14F); + this.label1.Location = new System.Drawing.Point(373, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(104, 19); + this.label1.TabIndex = 40; + this.label1.Text = "选择客户:"; // - // mainGridView + // panel7 // - this.mainGridView.AllowUserToAddRows = false; - this.mainGridView.AllowUserToDeleteRows = false; - this.mainGridView.AllowUserToResizeColumns = false; - this.mainGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(217)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); - this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13; - this.mainGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.mainGridView.BackgroundColor = System.Drawing.Color.White; - this.mainGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.mainGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - this.mainGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); - dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 10F); - dataGridViewCellStyle14.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14; - this.mainGridView.ColumnHeadersHeight = 30; - this.mainGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.mainGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.D_Finishd, - this.D_Customer_Name, - this.D_Goods_Name, - this.D_Goods_Spec, - this.D_SecondNumber, - this.D_UnitNum, - this.D_SSecondNumber, - this.D_SUnitNum}); - this.mainGridView.EnableHeadersVisualStyles = false; - this.mainGridView.Location = new System.Drawing.Point(11, 31); - this.mainGridView.MultiSelect = false; - this.mainGridView.Name = "mainGridView"; - this.mainGridView.ReadOnly = true; - this.mainGridView.RowHeadersVisible = false; - dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(243)))), ((int)(((byte)(250))))); - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F); - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); - this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle19; - this.mainGridView.RowTemplate.Height = 40; - this.mainGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.mainGridView.Size = new System.Drawing.Size(545, 320); - this.mainGridView.TabIndex = 7; - this.mainGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mainGridView_CellClick); - this.mainGridView.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.mainGridView_RowPrePaint); + this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.panel7.Controls.Add(this.colorButton1); + this.panel7.Controls.Add(this.printCk); + this.panel7.Controls.Add(this.refresh); + this.panel7.Location = new System.Drawing.Point(829, -1); + this.panel7.Name = "panel7"; + this.panel7.Size = new System.Drawing.Size(346, 44); + this.panel7.TabIndex = 39; // - // D_Finishd + // colorButton1 // - this.D_Finishd.DataPropertyName = "Finishd"; - this.D_Finishd.HeaderText = "Finishd"; - this.D_Finishd.Name = "D_Finishd"; - this.D_Finishd.ReadOnly = true; - this.D_Finishd.Visible = false; + this.colorButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.colorButton1.ForeColor = System.Drawing.Color.White; + this.colorButton1.Location = new System.Drawing.Point(136, 5); + this.colorButton1.Name = "colorButton1"; + this.colorButton1.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.colorButton1.Size = new System.Drawing.Size(75, 35); + this.colorButton1.TabIndex = 2; + this.colorButton1.Text = "打印测试"; + this.colorButton1.UseVisualStyleBackColor = false; + this.colorButton1.Click += new System.EventHandler(this.colorButton1_Click); // - // D_Customer_Name + // printCk // - this.D_Customer_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.D_Customer_Name.DataPropertyName = "Customer_Name"; - this.D_Customer_Name.HeaderText = "客户"; - this.D_Customer_Name.MinimumWidth = 100; - this.D_Customer_Name.Name = "D_Customer_Name"; - this.D_Customer_Name.ReadOnly = true; + this.printCk.AutoSize = true; + this.printCk.Checked = true; + this.printCk.CheckState = System.Windows.Forms.CheckState.Checked; + this.printCk.Font = new System.Drawing.Font("黑体", 12F); + this.printCk.Location = new System.Drawing.Point(14, 13); + this.printCk.Name = "printCk"; + this.printCk.Size = new System.Drawing.Size(91, 20); + this.printCk.TabIndex = 1; + this.printCk.Text = "打印条码"; + this.printCk.UseVisualStyleBackColor = true; // - // D_Goods_Name + // refresh // - this.D_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.D_Goods_Name.DataPropertyName = "Goods_Name"; - this.D_Goods_Name.HeaderText = "产品名称"; - this.D_Goods_Name.MinimumWidth = 100; - this.D_Goods_Name.Name = "D_Goods_Name"; - this.D_Goods_Name.ReadOnly = true; + this.refresh.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.refresh.ForeColor = System.Drawing.Color.White; + this.refresh.Location = new System.Drawing.Point(268, 4); + this.refresh.Name = "refresh"; + this.refresh.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.refresh.Size = new System.Drawing.Size(75, 35); + this.refresh.TabIndex = 0; + this.refresh.Text = "刷新"; + this.refresh.UseVisualStyleBackColor = false; + this.refresh.Click += new System.EventHandler(this.refresh_Click); // - // D_Goods_Spec + // bhUnitNumLbl // - this.D_Goods_Spec.DataPropertyName = "Goods_Spec"; - this.D_Goods_Spec.HeaderText = "规格"; - this.D_Goods_Spec.MinimumWidth = 70; - this.D_Goods_Spec.Name = "D_Goods_Spec"; - this.D_Goods_Spec.ReadOnly = true; - this.D_Goods_Spec.Width = 70; + this.bhUnitNumLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.bhUnitNumLbl.Font = new System.Drawing.Font("宋体", 14F); + this.bhUnitNumLbl.ForeColor = System.Drawing.Color.Red; + this.bhUnitNumLbl.Location = new System.Drawing.Point(768, 82); + this.bhUnitNumLbl.Name = "bhUnitNumLbl"; + this.bhUnitNumLbl.Size = new System.Drawing.Size(120, 30); + this.bhUnitNumLbl.TabIndex = 37; + this.bhUnitNumLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // D_SecondNumber + // label9 // - this.D_SecondNumber.DataPropertyName = "SecondNumber"; - dataGridViewCellStyle15.Format = "#0.######"; - this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle15; - this.D_SecondNumber.HeaderText = "订货数量"; - this.D_SecondNumber.Name = "D_SecondNumber"; - this.D_SecondNumber.ReadOnly = true; - this.D_SecondNumber.Width = 90; + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("宋体", 14F); + this.label9.Location = new System.Drawing.Point(675, 88); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(85, 19); + this.label9.TabIndex = 38; + this.label9.Text = "备货重量"; // - // D_UnitNum + // bhNumberLbl // - this.D_UnitNum.DataPropertyName = "UnitNum"; - dataGridViewCellStyle16.Format = "#0.######"; - this.D_UnitNum.DefaultCellStyle = dataGridViewCellStyle16; - this.D_UnitNum.HeaderText = "订货重量"; - this.D_UnitNum.Name = "D_UnitNum"; - this.D_UnitNum.ReadOnly = true; - this.D_UnitNum.Width = 90; + this.bhNumberLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.bhNumberLbl.Font = new System.Drawing.Font("宋体", 14F); + this.bhNumberLbl.ForeColor = System.Drawing.Color.Red; + this.bhNumberLbl.Location = new System.Drawing.Point(542, 82); + this.bhNumberLbl.Name = "bhNumberLbl"; + this.bhNumberLbl.Size = new System.Drawing.Size(120, 30); + this.bhNumberLbl.TabIndex = 35; + this.bhNumberLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // D_SSecondNumber + // label11 // - this.D_SSecondNumber.DataPropertyName = "SSecondNumber"; - dataGridViewCellStyle17.Format = "#0.######"; - this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle17; - this.D_SSecondNumber.HeaderText = "备货数量"; - this.D_SSecondNumber.Name = "D_SSecondNumber"; - this.D_SSecondNumber.ReadOnly = true; - this.D_SSecondNumber.Width = 90; + this.label11.AutoSize = true; + this.label11.Font = new System.Drawing.Font("宋体", 14F); + this.label11.Location = new System.Drawing.Point(455, 88); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(85, 19); + this.label11.TabIndex = 36; + this.label11.Text = "备货数量"; // - // D_SUnitNum + // dhUnitNumLbl // - this.D_SUnitNum.DataPropertyName = "SUnitNum"; - dataGridViewCellStyle18.Format = "#0.######"; - this.D_SUnitNum.DefaultCellStyle = dataGridViewCellStyle18; - this.D_SUnitNum.HeaderText = "备货重量"; - this.D_SUnitNum.Name = "D_SUnitNum"; - this.D_SUnitNum.ReadOnly = true; - this.D_SUnitNum.Width = 90; + this.dhUnitNumLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.dhUnitNumLbl.Font = new System.Drawing.Font("宋体", 14F); + this.dhUnitNumLbl.ForeColor = System.Drawing.Color.Red; + this.dhUnitNumLbl.Location = new System.Drawing.Point(321, 82); + this.dhUnitNumLbl.Name = "dhUnitNumLbl"; + this.dhUnitNumLbl.Size = new System.Drawing.Size(120, 30); + this.dhUnitNumLbl.TabIndex = 33; + this.dhUnitNumLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label12 + // label7 // - this.label12.AutoSize = true; - this.label12.Font = new System.Drawing.Font("宋体", 10F); - this.label12.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(99)))), ((int)(((byte)(219))))); - this.label12.Location = new System.Drawing.Point(14, 10); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(77, 14); - this.label12.TabIndex = 6; - this.label12.Text = "销售订货:"; + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("宋体", 14F); + this.label7.Location = new System.Drawing.Point(231, 88); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(85, 19); + this.label7.TabIndex = 34; + this.label7.Text = "订货重量"; // // panel6 // @@ -342,10 +333,10 @@ this.panel6.Controls.Add(this.finishGrid); this.panel6.Controls.Add(this.label13); this.panel6.Controls.Add(this.detailGridView); - this.panel6.Location = new System.Drawing.Point(580, 142); + this.panel6.Location = new System.Drawing.Point(575, 128); this.panel6.Name = "panel6"; - this.panel6.Size = new System.Drawing.Size(600, 362); - this.panel6.TabIndex = 13; + this.panel6.Size = new System.Drawing.Size(600, 355); + this.panel6.TabIndex = 32; // // finishGrid // @@ -378,7 +369,7 @@ this.F_SUnitNum, this.F_SSecondNumber}); this.finishGrid.EnableHeadersVisualStyles = false; - this.finishGrid.Location = new System.Drawing.Point(10, 314); + this.finishGrid.Location = new System.Drawing.Point(10, 313); this.finishGrid.MultiSelect = false; this.finishGrid.Name = "finishGrid"; this.finishGrid.ReadOnly = true; @@ -389,7 +380,7 @@ this.finishGrid.RowsDefaultCellStyle = dataGridViewCellStyle7; this.finishGrid.RowTemplate.Height = 40; this.finishGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.finishGrid.Size = new System.Drawing.Size(580, 37); + this.finishGrid.Size = new System.Drawing.Size(580, 40); this.finishGrid.TabIndex = 8; // // F_RowIndex @@ -555,218 +546,316 @@ this.B_UnitNumber.ReadOnly = true; this.B_UnitNumber.Width = 80; // - // dhUnitNumLbl + // panel5 // - this.dhUnitNumLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.dhUnitNumLbl.Font = new System.Drawing.Font("宋体", 14F); - this.dhUnitNumLbl.ForeColor = System.Drawing.Color.Red; - this.dhUnitNumLbl.Location = new System.Drawing.Point(326, 94); - this.dhUnitNumLbl.Name = "dhUnitNumLbl"; - this.dhUnitNumLbl.Size = new System.Drawing.Size(120, 30); - this.dhUnitNumLbl.TabIndex = 14; - this.dhUnitNumLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.panel5.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); + this.panel5.Controls.Add(this.mainGridView); + this.panel5.Controls.Add(this.label12); + this.panel5.Location = new System.Drawing.Point(2, 128); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(567, 355); + this.panel5.TabIndex = 31; + // + // mainGridView + // + this.mainGridView.AllowUserToAddRows = false; + this.mainGridView.AllowUserToDeleteRows = false; + this.mainGridView.AllowUserToResizeColumns = false; + this.mainGridView.AllowUserToResizeRows = false; + dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(217)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); + this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13; + this.mainGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.mainGridView.BackgroundColor = System.Drawing.Color.White; + this.mainGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.mainGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + this.mainGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; + dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle14.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14; + this.mainGridView.ColumnHeadersHeight = 30; + this.mainGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.mainGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.D_Finishd, + this.D_Customer_Name, + this.D_Goods_Name, + this.D_Goods_Spec, + this.D_SecondNumber, + this.D_UnitNum, + this.D_SSecondNumber, + this.D_SUnitNum}); + this.mainGridView.EnableHeadersVisualStyles = false; + this.mainGridView.Location = new System.Drawing.Point(11, 31); + this.mainGridView.MultiSelect = false; + this.mainGridView.Name = "mainGridView"; + this.mainGridView.ReadOnly = true; + this.mainGridView.RowHeadersVisible = false; + dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(243)))), ((int)(((byte)(250))))); + dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle19.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle19; + this.mainGridView.RowTemplate.Height = 40; + this.mainGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.mainGridView.Size = new System.Drawing.Size(545, 320); + this.mainGridView.TabIndex = 7; + this.mainGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mainGridView_CellClick); + this.mainGridView.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.mainGridView_RowPrePaint); + // + // D_Finishd + // + this.D_Finishd.DataPropertyName = "Finishd"; + this.D_Finishd.HeaderText = "Finishd"; + this.D_Finishd.Name = "D_Finishd"; + this.D_Finishd.ReadOnly = true; + this.D_Finishd.Visible = false; // - // label7 + // D_Customer_Name // - this.label7.AutoSize = true; - this.label7.Font = new System.Drawing.Font("宋体", 14F); - this.label7.Location = new System.Drawing.Point(236, 100); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(85, 19); - this.label7.TabIndex = 15; - this.label7.Text = "订货重量"; + this.D_Customer_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.D_Customer_Name.DataPropertyName = "Customer_Name"; + this.D_Customer_Name.HeaderText = "客户"; + this.D_Customer_Name.MinimumWidth = 100; + this.D_Customer_Name.Name = "D_Customer_Name"; + this.D_Customer_Name.ReadOnly = true; // - // bhUnitNumLbl + // D_Goods_Name // - this.bhUnitNumLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.bhUnitNumLbl.Font = new System.Drawing.Font("宋体", 14F); - this.bhUnitNumLbl.ForeColor = System.Drawing.Color.Red; - this.bhUnitNumLbl.Location = new System.Drawing.Point(773, 94); - this.bhUnitNumLbl.Name = "bhUnitNumLbl"; - this.bhUnitNumLbl.Size = new System.Drawing.Size(120, 30); - this.bhUnitNumLbl.TabIndex = 18; - this.bhUnitNumLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.D_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.D_Goods_Name.DataPropertyName = "Goods_Name"; + this.D_Goods_Name.HeaderText = "产品名称"; + this.D_Goods_Name.MinimumWidth = 100; + this.D_Goods_Name.Name = "D_Goods_Name"; + this.D_Goods_Name.ReadOnly = true; // - // label9 + // D_Goods_Spec // - this.label9.AutoSize = true; - this.label9.Font = new System.Drawing.Font("宋体", 14F); - this.label9.Location = new System.Drawing.Point(680, 100); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(85, 19); - this.label9.TabIndex = 19; - this.label9.Text = "备货重量"; + this.D_Goods_Spec.DataPropertyName = "Goods_Spec"; + this.D_Goods_Spec.HeaderText = "规格"; + this.D_Goods_Spec.MinimumWidth = 70; + this.D_Goods_Spec.Name = "D_Goods_Spec"; + this.D_Goods_Spec.ReadOnly = true; + this.D_Goods_Spec.Width = 70; // - // bhNumberLbl + // D_SecondNumber // - this.bhNumberLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.bhNumberLbl.Font = new System.Drawing.Font("宋体", 14F); - this.bhNumberLbl.ForeColor = System.Drawing.Color.Red; - this.bhNumberLbl.Location = new System.Drawing.Point(547, 94); - this.bhNumberLbl.Name = "bhNumberLbl"; - this.bhNumberLbl.Size = new System.Drawing.Size(120, 30); - this.bhNumberLbl.TabIndex = 16; - this.bhNumberLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.D_SecondNumber.DataPropertyName = "SecondNumber"; + dataGridViewCellStyle15.Format = "#0.######"; + this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle15; + this.D_SecondNumber.HeaderText = "订货数量"; + this.D_SecondNumber.Name = "D_SecondNumber"; + this.D_SecondNumber.ReadOnly = true; + this.D_SecondNumber.Width = 90; // - // label11 + // D_UnitNum // - this.label11.AutoSize = true; - this.label11.Font = new System.Drawing.Font("宋体", 14F); - this.label11.Location = new System.Drawing.Point(460, 100); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(85, 19); - this.label11.TabIndex = 17; - this.label11.Text = "备货数量"; + this.D_UnitNum.DataPropertyName = "UnitNum"; + dataGridViewCellStyle16.Format = "#0.######"; + this.D_UnitNum.DefaultCellStyle = dataGridViewCellStyle16; + this.D_UnitNum.HeaderText = "订货重量"; + this.D_UnitNum.Name = "D_UnitNum"; + this.D_UnitNum.ReadOnly = true; + this.D_UnitNum.Width = 90; // - // panel7 + // D_SSecondNumber // - this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.panel7.Controls.Add(this.colorButton1); - this.panel7.Controls.Add(this.printCk); - this.panel7.Controls.Add(this.refresh); - this.panel7.Location = new System.Drawing.Point(824, 5); - this.panel7.Name = "panel7"; - this.panel7.Size = new System.Drawing.Size(346, 44); - this.panel7.TabIndex = 20; + this.D_SSecondNumber.DataPropertyName = "SSecondNumber"; + dataGridViewCellStyle17.Format = "#0.######"; + this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle17; + this.D_SSecondNumber.HeaderText = "备货数量"; + this.D_SSecondNumber.Name = "D_SSecondNumber"; + this.D_SSecondNumber.ReadOnly = true; + this.D_SSecondNumber.Width = 90; // - // colorButton1 + // D_SUnitNum // - this.colorButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); - this.colorButton1.ForeColor = System.Drawing.Color.White; - this.colorButton1.Location = new System.Drawing.Point(136, 5); - this.colorButton1.Name = "colorButton1"; - this.colorButton1.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); - this.colorButton1.Size = new System.Drawing.Size(75, 35); - this.colorButton1.TabIndex = 2; - this.colorButton1.Text = "打印测试"; - this.colorButton1.UseVisualStyleBackColor = false; - this.colorButton1.Click += new System.EventHandler(this.colorButton1_Click); + this.D_SUnitNum.DataPropertyName = "SUnitNum"; + dataGridViewCellStyle18.Format = "#0.######"; + this.D_SUnitNum.DefaultCellStyle = dataGridViewCellStyle18; + this.D_SUnitNum.HeaderText = "备货重量"; + this.D_SUnitNum.Name = "D_SUnitNum"; + this.D_SUnitNum.ReadOnly = true; + this.D_SUnitNum.Width = 90; // - // printCk + // label12 // - this.printCk.AutoSize = true; - this.printCk.Checked = true; - this.printCk.CheckState = System.Windows.Forms.CheckState.Checked; - this.printCk.Font = new System.Drawing.Font("黑体", 12F); - this.printCk.Location = new System.Drawing.Point(14, 13); - this.printCk.Name = "printCk"; - this.printCk.Size = new System.Drawing.Size(91, 20); - this.printCk.TabIndex = 1; - this.printCk.Text = "打印条码"; - this.printCk.UseVisualStyleBackColor = true; + this.label12.AutoSize = true; + this.label12.Font = new System.Drawing.Font("宋体", 10F); + this.label12.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(99)))), ((int)(((byte)(219))))); + this.label12.Location = new System.Drawing.Point(14, 10); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(77, 14); + this.label12.TabIndex = 6; + this.label12.Text = "销售订货:"; // - // refresh + // dhNumberLbl // - this.refresh.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); - this.refresh.ForeColor = System.Drawing.Color.White; - this.refresh.Location = new System.Drawing.Point(268, 4); - this.refresh.Name = "refresh"; - this.refresh.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); - this.refresh.Size = new System.Drawing.Size(75, 35); - this.refresh.TabIndex = 0; - this.refresh.Text = "刷新"; - this.refresh.UseVisualStyleBackColor = false; - this.refresh.Click += new System.EventHandler(this.refresh_Click); + this.dhNumberLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.dhNumberLbl.Font = new System.Drawing.Font("宋体", 14F); + this.dhNumberLbl.ForeColor = System.Drawing.Color.Red; + this.dhNumberLbl.Location = new System.Drawing.Point(99, 82); + this.dhNumberLbl.Name = "dhNumberLbl"; + this.dhNumberLbl.Size = new System.Drawing.Size(120, 30); + this.dhNumberLbl.TabIndex = 30; + this.dhNumberLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label1 + // label4 // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("宋体", 14F); - this.label1.Location = new System.Drawing.Point(378, 18); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(104, 19); - this.label1.TabIndex = 21; - this.label1.Text = "选择客户:"; + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("宋体", 14F); + this.label4.Location = new System.Drawing.Point(11, 88); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(85, 19); + this.label4.TabIndex = 29; + this.label4.Text = "订货数量"; // - // label2 + // driveLineLbl // - this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.label2.Font = new System.Drawing.Font("宋体", 14F); - this.label2.ForeColor = System.Drawing.Color.Red; - this.label2.Location = new System.Drawing.Point(475, 11); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(332, 32); - this.label2.TabIndex = 22; - this.label2.Text = "请选择"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.label2.Click += new System.EventHandler(this.label2_Click); + this.driveLineLbl.AutoSize = true; + this.driveLineLbl.Font = new System.Drawing.Font("宋体", 14F); + this.driveLineLbl.ForeColor = System.Drawing.Color.Red; + this.driveLineLbl.Location = new System.Drawing.Point(11, 51); + this.driveLineLbl.Name = "driveLineLbl"; + this.driveLineLbl.Size = new System.Drawing.Size(85, 19); + this.driveLineLbl.TabIndex = 28; + this.driveLineLbl.Text = "送货线路"; // - // label5 + // goodsLbl // - this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label5.AutoSize = true; - this.label5.Font = new System.Drawing.Font("宋体", 14F); - this.label5.ForeColor = System.Drawing.Color.Blue; - this.label5.Location = new System.Drawing.Point(978, 100); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(104, 19); - this.label5.TabIndex = 23; - this.label5.Text = "下浮重量:"; + this.goodsLbl.AutoSize = true; + this.goodsLbl.Font = new System.Drawing.Font("宋体", 14F); + this.goodsLbl.ForeColor = System.Drawing.Color.Red; + this.goodsLbl.Location = new System.Drawing.Point(231, 51); + this.goodsLbl.Name = "goodsLbl"; + this.goodsLbl.Size = new System.Drawing.Size(85, 19); + this.goodsLbl.TabIndex = 27; + this.goodsLbl.Text = "存货名称"; // - // downWeightBox + // panel4 // - this.downWeightBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.downWeightBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.downWeightBox.Font = new System.Drawing.Font("宋体", 14F); - this.downWeightBox.ForeColor = System.Drawing.Color.Red; - this.downWeightBox.Location = new System.Drawing.Point(1075, 94); - this.downWeightBox.Name = "downWeightBox"; - this.downWeightBox.Size = new System.Drawing.Size(102, 30); - this.downWeightBox.TabIndex = 24; - this.downWeightBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.downWeightBox.Click += new System.EventHandler(this.downWeightBox_Click); + this.panel4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(243)))), ((int)(((byte)(243))))); + this.panel4.Location = new System.Drawing.Point(2, 41); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(1174, 1); + this.panel4.TabIndex = 26; + // + // uScanPanel1 + // + this.uScanPanel1.BackColor = System.Drawing.Color.Transparent; + this.uScanPanel1.Location = new System.Drawing.Point(13, 3); + this.uScanPanel1.Name = "uScanPanel1"; + this.uScanPanel1.Size = new System.Drawing.Size(303, 32); + this.uScanPanel1.TabIndex = 25; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.lineGroupSetBtn); + this.tabPage2.Controls.Add(this.flowLayoutPanel1); + this.tabPage2.Location = new System.Drawing.Point(4, 44); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(1179, 482); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "线路分组"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // lineGroupSetBtn + // + this.lineGroupSetBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.lineGroupSetBtn.Font = new System.Drawing.Font("宋体", 12F); + this.lineGroupSetBtn.ForeColor = System.Drawing.Color.White; + this.lineGroupSetBtn.Location = new System.Drawing.Point(22, 21); + this.lineGroupSetBtn.Name = "lineGroupSetBtn"; + this.lineGroupSetBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.lineGroupSetBtn.Size = new System.Drawing.Size(137, 47); + this.lineGroupSetBtn.TabIndex = 1; + this.lineGroupSetBtn.Text = "选择线路分组"; + this.lineGroupSetBtn.UseVisualStyleBackColor = false; + this.lineGroupSetBtn.Click += new System.EventHandler(this.lineGroupSetBtn_Click); + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.flowLayoutPanel1.Location = new System.Drawing.Point(22, 78); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(1133, 385); + this.flowLayoutPanel1.TabIndex = 0; // // SegmentStockUpForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1212, 600); + this.ClientSize = new System.Drawing.Size(1212, 620); this.ImeMode = System.Windows.Forms.ImeMode.Disable; this.KeyPreview = true; this.Name = "SegmentStockUpForm"; this.Text = "销售备货"; this.roundPanel1.ResumeLayout(false); - this.roundPanel1.PerformLayout(); - this.panel5.ResumeLayout(false); - this.panel5.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).EndInit(); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage1.PerformLayout(); + this.panel7.ResumeLayout(false); + this.panel7.PerformLayout(); this.panel6.ResumeLayout(false); this.panel6.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.finishGrid)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.detailGridView)).EndInit(); - this.panel7.ResumeLayout(false); - this.panel7.PerformLayout(); + this.panel5.ResumeLayout(false); + this.panel5.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).EndInit(); + this.tabPage2.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); } - #endregion - - private WinFormControl.UScanPanel uScanPanel1; - private System.Windows.Forms.Label dhNumberLbl; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label driveLineLbl; - private System.Windows.Forms.Label goodsLbl; - private System.Windows.Forms.Panel panel4; - private System.Windows.Forms.Panel panel5; - private System.Windows.Forms.Panel panel6; - private System.Windows.Forms.Label label12; - private WinFormControl.UDataGridView mainGridView; - private System.Windows.Forms.Label label13; - private WinFormControl.UDataGridView detailGridView; - private System.Windows.Forms.Label bhUnitNumLbl; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label bhNumberLbl; - private System.Windows.Forms.Label label11; - private System.Windows.Forms.Label dhUnitNumLbl; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Panel panel7; - private Controls.ColorButton refresh; + #endregion + + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.Label downWeightBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Panel panel7; + private Controls.ColorButton colorButton1; private System.Windows.Forms.CheckBox printCk; + private Controls.ColorButton refresh; + private System.Windows.Forms.Label bhUnitNumLbl; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label bhNumberLbl; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label dhUnitNumLbl; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Panel panel6; private WinFormControl.UDataGridView finishGrid; - private Controls.ColorButton colorButton1; + private System.Windows.Forms.DataGridViewTextBoxColumn F_RowIndex; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn F_UnitNum; + private System.Windows.Forms.DataGridViewTextBoxColumn F_SecondNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn F_SUnitNum; + private System.Windows.Forms.DataGridViewTextBoxColumn F_SSecondNumber; + private System.Windows.Forms.Label label13; + private WinFormControl.UDataGridView detailGridView; + private System.Windows.Forms.DataGridViewTextBoxColumn B_Customer_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn B_ShortCode; + private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn B_SaleOutStoreID; + private System.Windows.Forms.DataGridViewTextBoxColumn B_SecondNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn B_UnitNumber; + private System.Windows.Forms.Panel panel5; + private WinFormControl.UDataGridView mainGridView; private System.Windows.Forms.DataGridViewTextBoxColumn D_Finishd; private System.Windows.Forms.DataGridViewTextBoxColumn D_Customer_Name; private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_Name; @@ -775,21 +864,16 @@ private System.Windows.Forms.DataGridViewTextBoxColumn D_UnitNum; private System.Windows.Forms.DataGridViewTextBoxColumn D_SSecondNumber; private System.Windows.Forms.DataGridViewTextBoxColumn D_SUnitNum; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.DataGridViewTextBoxColumn B_Customer_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn B_ShortCode; - private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn B_SaleOutStoreID; - private System.Windows.Forms.DataGridViewTextBoxColumn B_SecondNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn B_UnitNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn F_RowIndex; - private System.Windows.Forms.DataGridViewTextBoxColumn F_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn F_UnitNum; - private System.Windows.Forms.DataGridViewTextBoxColumn F_SecondNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn F_SUnitNum; - private System.Windows.Forms.DataGridViewTextBoxColumn F_SSecondNumber; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label downWeightBox; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label dhNumberLbl; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label driveLineLbl; + private System.Windows.Forms.Label goodsLbl; + private System.Windows.Forms.Panel panel4; + private WinFormControl.UScanPanel uScanPanel1; + private System.Windows.Forms.TabPage tabPage2; + private Controls.ColorButton lineGroupSetBtn; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + } } \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs index 50a6487..7f488e8 100644 --- a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs @@ -1,428 +1,430 @@ -using ButcherFactory.BO; -using ButcherFactory.BO.LocalBL; -using ButcherFactory.BO.Utils; -using ButcherFactory.Controls; -using ButcherFactory.Dialogs; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; +using ButcherFactory.BO; +using ButcherFactory.BO.LocalBL; +using ButcherFactory.BO.Utils; +using ButcherFactory.Controls; +using ButcherFactory.Dialogs; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; using System.Windows.Forms; -using WinFormControl; - -namespace ButcherFactory.SegmentStockUp_ -{ - public partial class SegmentStockUpForm : FormTemplate, IWithRoleForm - { - #region IWithRoleForm - public List RoleName - { - get { return new List { (short)设备类别.销售备货 }; } - } - - public Form Generate() - { - return this; - } +using WinFormControl; + +namespace ButcherFactory.SegmentStockUp_ +{ + public partial class SegmentStockUpForm : FormTemplate, IWithRoleForm + { + #region IWithRoleForm + public List RoleName + { + get { return new List { (short)设备类别.销售备货 }; } + } + + public Form Generate() + { + return this; + } #endregion - Tuple selectedCustomer; - + Tuple selectedCustomer; + DateTime sendTime = DateTime.Today; - SegmentStockUpConfig config; - - BindingList mainList; - BindingList detailList; - BindingList finishList; - - List allMain; - List allDetail; - List alreadyList; - - Thread syncStockdNumber; - Thread refreshFromServer; - Thread loadBindTask;//onetime - - public SegmentStockUpForm() + SegmentStockUpConfig config; + + BindingList mainList; + BindingList detailList; + BindingList finishList; + + List allMain; + List allDetail; + List alreadyList; + + Thread syncStockdNumber; + Thread refreshFromServer; + Thread loadBindTask;//onetime + List mLineGroupIds = new List(); + + public SegmentStockUpForm() + { + config = XmlUtil.DeserializeFromFile(); + InitializeComponent(); + finishList = new BindingList(); + allMain = new List(); + allDetail = new List(); + alreadyList = new List(); + // dataPicker.Text = sendTime.ToString("yyyy-MM-dd"); + uScanPanel1.AfterScan += uScanPanel1_AfterScan; + this.FormClosing += delegate + { + AbortTask(); + }; + } + + void AbortTask() + { + if (loadBindTask != null && loadBindTask.IsAlive) + loadBindTask.Abort(); + if (syncStockdNumber != null && syncStockdNumber.IsAlive) + syncStockdNumber.Abort(); + if (refreshFromServer != null && refreshFromServer.IsAlive) + refreshFromServer.Abort(); + } + + protected override void OnLoad(EventArgs e) + { + BindDeliverLineGroup(false); + downWeightBox.Text = string.Format("{0:#0.######}", config.AllowDownWeight); + StartTask(); + base.OnLoad(e); + } + + void StartTask() + { + allDetail = SegmentStockUpBL.GetLocalList(sendTime); + loadBindTask = new Thread(LoadBind); + loadBindTask.Start(); + syncStockdNumber = new Thread(SyncStockdNumber); + syncStockdNumber.Start(); + refreshFromServer = new Thread(RefreshFromServer); + refreshFromServer.Start(); + } + + private void LoadBind() { - config = XmlUtil.DeserializeFromFile(); - InitializeComponent(); - finishList = new BindingList(); - allMain = new List(); - allDetail = new List(); - alreadyList = new List(); - // dataPicker.Text = sendTime.ToString("yyyy-MM-dd"); - uScanPanel1.AfterScan += uScanPanel1_AfterScan; - this.FormClosing += delegate - { - AbortTask(); - }; - } - - void AbortTask() - { - if (loadBindTask != null && loadBindTask.IsAlive) - loadBindTask.Abort(); - if (syncStockdNumber != null && syncStockdNumber.IsAlive) - syncStockdNumber.Abort(); - if (refreshFromServer != null && refreshFromServer.IsAlive) - refreshFromServer.Abort(); - } - - protected override void OnLoad(EventArgs e) + var mainList = SegmentStockUpBL.GetSaleOutStoreList(sendTime); + var appendAlready = SegmentStockUpBL.SyncAlreadyNumber(mainList.Select(x => x.DetailID), null); + ReBind(mainList, appendAlready); + } + + object _lock = new object(); + //loadBind,Refresh, taskMain,taskAlready,Scan + void ReBind(List mainList, List appendAlready) + { + lock (_lock) + { + AppendData(mainList, appendAlready); + var needRefresh = PrepareFinishList(); + + if (needRefresh) + BindFinishGrid(); + } + } + + void AppendData(List mainList, List appendAlready) + { + if (mainList.Any()) + allMain = mainList; + foreach (var item in appendAlready) + { + var first = alreadyList.FirstOrDefault(x => x.DetailID == item.DetailID); + if (first == null) + { + first = item; + alreadyList.Add(item); + } + else if (first.MaxID < item.MaxID) + { + first.MaxID = item.MaxID; + first.UnitNum = (first.UnitNum ?? 0) + (item.UnitNum ?? 0); + first.SecondNumber = (first.SecondNumber ?? 0) + (item.SecondNumber ?? 0); + } + else + continue; + + //局部更新 + if (!mainList.Any()) + UpdateMainInfo(first); + } + + //全量更新 + if (mainList.Any()) + { + foreach (var item in alreadyList) + UpdateMainInfo(item); + } + } + + void UpdateMainInfo(AlreadyStockUp item) { - downWeightBox.Text = string.Format("{0:#0.######}", config.AllowDownWeight); - StartTask(); - base.OnLoad(e); - } - - void StartTask() - { - allDetail = SegmentStockUpBL.GetLocalList(sendTime); - loadBindTask = new Thread(LoadBind); - loadBindTask.Start(); - syncStockdNumber = new Thread(SyncStockdNumber); - syncStockdNumber.Start(); - refreshFromServer = new Thread(RefreshFromServer); - refreshFromServer.Start(); - } - - private void LoadBind() - { - var mainList = SegmentStockUpBL.GetSaleOutStoreList(sendTime); - var appendAlready = SegmentStockUpBL.SyncAlreadyNumber(mainList.Select(x => x.DetailID), null); - ReBind(mainList, appendAlready); - } - - object _lock = new object(); - //loadBind,Refresh, taskMain,taskAlready,Scan - void ReBind(List mainList, List appendAlready) - { - lock (_lock) - { - AppendData(mainList, appendAlready); - var needRefresh = PrepareFinishList(); - - if (needRefresh) - BindFinishGrid(); - } - } - - void AppendData(List mainList, List appendAlready) - { - if (mainList.Any()) - allMain = mainList; - foreach (var item in appendAlready) - { - var first = alreadyList.FirstOrDefault(x => x.DetailID == item.DetailID); - if (first == null) - { - first = item; - alreadyList.Add(item); - } - else if (first.MaxID < item.MaxID) - { - first.MaxID = item.MaxID; - first.UnitNum = (first.UnitNum ?? 0) + (item.UnitNum ?? 0); - first.SecondNumber = (first.SecondNumber ?? 0) + (item.SecondNumber ?? 0); - } - else - continue; - - //局部更新 - if (!mainList.Any()) - UpdateMainInfo(first); - } - - //全量更新 - if (mainList.Any()) - { - foreach (var item in alreadyList) - UpdateMainInfo(item); - } - } - - void UpdateMainInfo(AlreadyStockUp item) - { - var mainFirst = allMain.FirstOrDefault(x => x.DetailID == item.DetailID); - if (mainFirst != null) + var mainFirst = allMain.FirstOrDefault(x => x.DetailID == item.DetailID); + if (mainFirst != null) { - mainFirst.StandardPic = false;// item.StandardPic; - mainFirst.SUnitNum = item.UnitNum; + mainFirst.StandardPic = false;// item.StandardPic; + mainFirst.SUnitNum = item.UnitNum; mainFirst.SSecondNumber = item.SecondNumber; - mainFirst.DownFloat = config.AllowDownWeight; - } - } - - //返回是否需要更新Grid; - bool PrepareFinishList() - { - var old = finishList.ToList(); - var append = new List(); - finishList = new BindingList(); - var idx = 0; - foreach (var item in allMain.GroupBy(x => x.Customer_Name).Where(x => x.All(y => y.Finishd))) - { - var detail = new DeliverGoodsLineTemp(); - detail.RowIndex = ++idx; - detail.Name = item.Key; - detail.UnitNum = item.Sum(x => x.UnitNum ?? 0); - detail.SecondNumber = item.Sum(x => x.SecondNumber ?? 0); - detail.SUnitNum = item.Sum(x => x.SUnitNum ?? 0); - detail.SSecondNumber = item.Sum(x => x.SSecondNumber ?? 0); - if (!old.Any(x => x.Name == item.Key)) - { - idx--; - append.Add(detail); - } - else - finishList.Insert(0, detail); - } - - foreach (var item in append) - { - item.RowIndex = ++idx; - finishList.Insert(0, item); - } - - if (old.Count != finishList.Count) - return true; - return old.Except(finishList).Count() != 0; - } - - void BindFinishGrid() - { - this.Invoke(new Action(() => - { - finishGrid.DataSource = finishList; - if (finishList.Any()) - finishGrid.Rows[0].Selected = true; - finishGrid.Refresh(); - })); - } - - private void SyncStockdNumber() - { - while (true) - { - Thread.Sleep(2000); - IEnumerable tags = new List(); - long? maxID = null; - if (alreadyList.Any()) - maxID = alreadyList.Max(x => x.MaxID); - else - tags = allMain.Select(x => x.DetailID); - - if (maxID.HasValue || tags.Any()) - { - var temp = SegmentStockUpBL.SyncAlreadyNumber(tags, maxID); - if (temp.Any()) - { - ReBind(new List(), temp); - } - } - } - } - - private void RefreshFromServer() - { - while (true) - { - Thread.Sleep(2 * 60 * 1000); - var temp = SegmentStockUpBL.GetSaleOutStoreList(sendTime); - if (temp.Any()) - { - ReBind(temp, new List()); - } - } - } - - void uScanPanel1_AfterScan() - { - var code = uScanPanel1.TextBox.Text; - if (string.IsNullOrEmpty(code)) - return; - if (allDetail.Any(x => x.BarCode == code)) - { - InfoBox.Show("错误", "条码已使用过", Color.Green, 1, this); - return; - } - var info = SegmentStockUpBL.StockUpScan(code); - if (info == null) - { - InfoBox.Show("错误", "条码未入库", Color.Blue, 1, this); - return; - } - - InsertDetail(info); - } - - void InsertDetail(Tuple scan) + mainFirst.DownFloat = config.AllowDownWeight; + } + } + + //返回是否需要更新Grid; + bool PrepareFinishList() + { + var old = finishList.ToList(); + var append = new List(); + finishList = new BindingList(); + var idx = 0; + foreach (var item in allMain.GroupBy(x => x.Customer_Name).Where(x => x.All(y => y.Finishd))) + { + var detail = new DeliverGoodsLineTemp(); + detail.RowIndex = ++idx; + detail.Name = item.Key; + detail.UnitNum = item.Sum(x => x.UnitNum ?? 0); + detail.SecondNumber = item.Sum(x => x.SecondNumber ?? 0); + detail.SUnitNum = item.Sum(x => x.SUnitNum ?? 0); + detail.SSecondNumber = item.Sum(x => x.SSecondNumber ?? 0); + if (!old.Any(x => x.Name == item.Key)) + { + idx--; + append.Add(detail); + } + else + finishList.Insert(0, detail); + } + + foreach (var item in append) + { + item.RowIndex = ++idx; + finishList.Insert(0, item); + } + + if (old.Count != finishList.Count) + return true; + return old.Except(finishList).Count() != 0; + } + + void BindFinishGrid() + { + this.Invoke(new Action(() => + { + finishGrid.DataSource = finishList; + if (finishList.Any()) + finishGrid.Rows[0].Selected = true; + finishGrid.Refresh(); + })); + } + + private void SyncStockdNumber() { - SaleOutStoreInfo saleOutStore; + while (true) + { + Thread.Sleep(2000); + IEnumerable tags = new List(); + long? maxID = null; + if (alreadyList.Any()) + maxID = alreadyList.Max(x => x.MaxID); + else + tags = allMain.Select(x => x.DetailID); + + if (maxID.HasValue || tags.Any()) + { + var temp = SegmentStockUpBL.SyncAlreadyNumber(tags, maxID); + if (temp.Any()) + { + ReBind(new List(), temp); + } + } + } + } + + private void RefreshFromServer() + { + while (true) + { + Thread.Sleep(2 * 60 * 1000); + var temp = SegmentStockUpBL.GetSaleOutStoreList(sendTime); + if (temp.Any()) + { + ReBind(temp, new List()); + } + } + } + + void uScanPanel1_AfterScan() + { + var code = uScanPanel1.TextBox.Text; + if (string.IsNullOrEmpty(code)) + return; + if (allDetail.Any(x => x.BarCode == code)) + { + InfoBox.Show("错误", "条码已使用过", Color.Green, 1, this); + return; + } + var info = SegmentStockUpBL.StockUpScan(code); + if (info == null) + { + InfoBox.Show("错误", "条码未入库", Color.Blue, 1, this); + return; + } + + InsertDetail(info); + } + + void InsertDetail(Tuple scan) + { + SaleOutStoreInfo saleOutStore; if (selectedCustomer != null) - saleOutStore = allMain.FirstOrDefault(x => x.Customer_Name == selectedCustomer.Item1 && !x.Finishd && x.Goods_Code == scan.Item1); + saleOutStore = allMain.FirstOrDefault(x => x.Customer_Name == selectedCustomer.Item1 && !x.Finishd && x.Goods_Code == scan.Item1); else - saleOutStore = allMain.FirstOrDefault(x => !x.Finishd && x.Goods_Code == scan.Item1); - if (saleOutStore == null) - { - InfoBox.Show("提示", "没有订单", Color.Red, 1, this); - return; - } - var detail = new SegmentStockUp(); - detail.BarCode = uScanPanel1.TextBox.Text; - detail.Date = sendTime; - detail.DetailID = saleOutStore.DetailID; - detail.DeliverGoodsLine_Name = saleOutStore.DeliverGoodsLine_Name; - detail.Goods_Name = saleOutStore.Goods_Name; + saleOutStore = allMain.FirstOrDefault(x => mLineGroupIds.Contains(x.DeliverLineGroup_ID ?? 0) && !x.Finishd && x.Goods_Code == scan.Item1); + if (saleOutStore == null) + { + InfoBox.Show("提示", "没有订单", Color.Red, 1, this); + return; + } + var detail = new SegmentStockUp(); + detail.BarCode = uScanPanel1.TextBox.Text; + detail.Date = sendTime; + detail.DetailID = saleOutStore.DetailID; + detail.DeliverGoodsLine_Name = saleOutStore.DeliverGoodsLine_Name; + detail.Goods_Name = saleOutStore.Goods_Name; //detail.BillID = saleOutStore.BillID; - detail.Customer_Name = saleOutStore.Customer_Name; - detail.UnitNumber = scan.Item2; - detail.StandardPic = scan.Item3; - //if (detail.UnitNumber.HasValue && saleOutStore.Rate.HasValue) - // detail.SecondNumber = detail.UnitNumber * saleOutStore.Rate; - //else - detail.SecondNumber = 1; - var number = 0m; - if (saleOutStore.StockUpBySecondNum) - number = saleOutStore.SecondNumber ?? 0; - else - number = (saleOutStore.UnitNum ?? 0) - (config.AllowDownWeight ?? 0); + detail.Customer_Name = saleOutStore.Customer_Name; + detail.UnitNumber = scan.Item2; + detail.StandardPic = scan.Item3; + //if (detail.UnitNumber.HasValue && saleOutStore.Rate.HasValue) + // detail.SecondNumber = detail.UnitNumber * saleOutStore.Rate; + //else + detail.SecondNumber = 1; + var number = 0m; + if (saleOutStore.StockUpBySecondNum) + number = saleOutStore.SecondNumber ?? 0; + else + number = (saleOutStore.UnitNum ?? 0) - (config.AllowDownWeight ?? 0); //if (!detail.StandardPic) - // number = saleOutStore.SecondNumber; - + // number = saleOutStore.SecondNumber; + var already = alreadyList.FirstOrDefault(x => x.DetailID == detail.DetailID); if (already == null) already = new AlreadyStockUp() { DetailID = detail.DetailID };//StandardPic = detail.StandardPic - var back = SegmentStockUpBL.Insert(detail, already, number,saleOutStore.StockUpBySecondNum); - if (back == null) - { - InfoBox.Show("提示", "网络错误!", Color.Red, 1, this); - return; - } - if (back.State == -1) - { - InfoBox.Show("提示", "条码已使用过", Color.Green, 1, this); - return; - } - //back.StandardPic = detail.StandardPic; - back.DetailID = detail.DetailID; - if (back.State == 0) - { - ReBind(new List(), new List { back }); - InsertDetail(scan); - return; - } - if (back.State != 1) - { - InfoBox.Show("提示", "未知状态" + back.State, Color.Green, 1, this); - return; - } - ReBind(new List(), new List { back }); - allDetail.Add(detail); - - if (printCk.Checked) + var back = SegmentStockUpBL.Insert(detail, already, number, saleOutStore.StockUpBySecondNum); + if (back == null) + { + InfoBox.Show("提示", "网络错误!", Color.Red, 1, this); + return; + } + if (back.State == -1) + { + InfoBox.Show("提示", "条码已使用过", Color.Green, 1, this); + return; + } + //back.StandardPic = detail.StandardPic; + back.DetailID = detail.DetailID; + if (back.State == 0) + { + ReBind(new List(), new List { back }); + InsertDetail(scan); + return; + } + if (back.State != 1) { - var last = 0m; - // allMain.Where(x => x.Goods_Name == saleOutStore.Goods_Name && x.DeliverGoodsLine_Name == saleOutStore.DeliverGoodsLine_Name) - // .Sum(x => ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0)) < 0 ? 0 : ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0))); - //if (last < 0) + InfoBox.Show("提示", "未知状态" + back.State, Color.Green, 1, this); + return; + } + ReBind(new List(), new List { back }); + allDetail.Add(detail); + + if (printCk.Checked) + { + var last = 0m; + // allMain.Where(x => x.Goods_Name == saleOutStore.Goods_Name && x.DeliverGoodsLine_Name == saleOutStore.DeliverGoodsLine_Name) + // .Sum(x => ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0)) < 0 ? 0 : ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0))); + //if (last < 0) // last = 0; - SegmentStockUpPrint.Print(detail, last, saleOutStore); + SegmentStockUpPrint.Print(detail, last, saleOutStore); } var hasUnFinish = allMain.Where(x => x.Customer_Name == saleOutStore.Customer_Name).Any(x => !x.Finishd); if (!hasUnFinish) - InfoBox.Show("提示", string.Format("{0} 备货完成", saleOutStore.Customer_Name), Color.Green, 1, this); - BindMainGrid(saleOutStore); - } - - void BindMainGrid(SaleOutStoreInfo saleOutStore) - { - var main = new List(); - foreach (var g in allMain.Where(x => x.Goods_Name == saleOutStore.Goods_Name).GroupBy(x => x.Customer_Name)) - { - var item = new SaleOutStoreInfo(); - var f = g.First(); - main.Add(item); - item.Customer_Name = g.Key; - item.Goods_Name = f.Goods_Name; - item.Goods_Spec = f.Goods_Spec; - item.SecondNumber = g.Sum(x => x.SecondNumber ?? 0); - item.UnitNum = g.Sum(x => x.UnitNum ?? 0); - item.SSecondNumber = g.Sum(x => x.SSecondNumber ?? 0); + InfoBox.Show("提示", string.Format("{0} 备货完成", saleOutStore.Customer_Name), Color.Green, 1, this); + BindMainGrid(saleOutStore); + } + + void BindMainGrid(SaleOutStoreInfo saleOutStore) + { + var main = new List(); + foreach (var g in allMain.Where(x => x.Goods_Name == saleOutStore.Goods_Name).GroupBy(x => x.Customer_Name)) + { + var item = new SaleOutStoreInfo(); + var f = g.First(); + main.Add(item); + item.Customer_Name = g.Key; + item.Goods_Name = f.Goods_Name; + item.Goods_Spec = f.Goods_Spec; + item.SecondNumber = g.Sum(x => x.SecondNumber ?? 0); + item.UnitNum = g.Sum(x => x.UnitNum ?? 0); + item.SSecondNumber = g.Sum(x => x.SSecondNumber ?? 0); item.SUnitNum = g.Sum(x => x.SUnitNum ?? 0); item.DownFloat = config.AllowDownWeight; item.StockUpBySecondNum = f.StockUpBySecondNum; - item.FinishAssign = f.FinishAssign; - } - mainList = new BindingList(main.OrderBy(x => x.Finishd).ToList()); - - mainGridView.DataSource = mainList; - mainGridView.Refresh(); - BindDetail(main.Where(x => x.Customer_Name == saleOutStore.Customer_Name).First()); - } - - void BindDetail(SaleOutStoreInfo first) - { - //if (first != null) - //{ - driveLineLbl.Text = first.DeliverGoodsLine_Name; - goodsLbl.Text = first.Goods_Name; - - dhNumberLbl.Text = string.Format("{0:#0.##}", first.SecondNumber); - dhUnitNumLbl.Text = string.Format("{0:#0.##}", first.UnitNum); - bhNumberLbl.Text = string.Format("{0:#0.##}", first.SSecondNumber); + item.FinishAssign = f.FinishAssign; + } + mainList = new BindingList(main.OrderBy(x => x.Finishd).ToList()); + + mainGridView.DataSource = mainList; + mainGridView.Refresh(); + BindDetail(main.Where(x => x.Customer_Name == saleOutStore.Customer_Name).First()); + } + + void BindDetail(SaleOutStoreInfo first) + { + //if (first != null) + //{ + driveLineLbl.Text = first.DeliverGoodsLine_Name; + goodsLbl.Text = first.Goods_Name; + + dhNumberLbl.Text = string.Format("{0:#0.##}", first.SecondNumber); + dhUnitNumLbl.Text = string.Format("{0:#0.##}", first.UnitNum); + bhNumberLbl.Text = string.Format("{0:#0.##}", first.SSecondNumber); bhUnitNumLbl.Text = string.Format("{0:#0.##}", first.SUnitNum); - var detail = allDetail.Where(x => x.Customer_Name == first.Customer_Name && x.Goods_Name == first.Goods_Name).OrderByDescending(x => x.ID); - detailList = new BindingList(detail.ToList()); - //} - //else - //{ - // driveLineLbl.Text = string.Empty; - // goodsLbl.Text = string.Empty; - // dhNumberLbl.Text = string.Empty; - // dhUnitNumLbl.Text = string.Empty; - // bhNumberLbl.Text = string.Empty; - // bhUnitNumLbl.Text = string.Empty; - - // detailList = new BindingList(); - //} - detailGridView.DataSource = detailList; - detailGridView.Refresh(); - } - - private void refresh_Click(object sender, EventArgs e) - { - AbortTask(); - StartTask(); - } - - private void mainGridView_CellClick(object sender, DataGridViewCellEventArgs e) - { - if (e.RowIndex < 0) - return; - var item = mainGridView.CurrentRow.DataBoundItem as SaleOutStoreInfo; - BindDetail(item); - } - - private void mainGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) - { - DataGridViewRow dgrSingle = mainGridView.Rows[e.RowIndex]; - var v = (bool)dgrSingle.Cells["D_Finishd"].Value; - if (v) - { - dgrSingle.DefaultCellStyle.BackColor = Color.YellowGreen; - } + var detail = allDetail.Where(x => x.Customer_Name == first.Customer_Name && x.Goods_Name == first.Goods_Name).OrderByDescending(x => x.ID); + detailList = new BindingList(detail.ToList()); + //} + //else + //{ + // driveLineLbl.Text = string.Empty; + // goodsLbl.Text = string.Empty; + // dhNumberLbl.Text = string.Empty; + // dhUnitNumLbl.Text = string.Empty; + // bhNumberLbl.Text = string.Empty; + // bhUnitNumLbl.Text = string.Empty; + + // detailList = new BindingList(); + //} + detailGridView.DataSource = detailList; + detailGridView.Refresh(); + } + + private void refresh_Click(object sender, EventArgs e) + { + AbortTask(); + StartTask(); + } + + private void mainGridView_CellClick(object sender, DataGridViewCellEventArgs e) + { + if (e.RowIndex < 0) + return; + var item = mainGridView.CurrentRow.DataBoundItem as SaleOutStoreInfo; + BindDetail(item); + } + + private void mainGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) + { + DataGridViewRow dgrSingle = mainGridView.Rows[e.RowIndex]; + var v = (bool)dgrSingle.Cells["D_Finishd"].Value; + if (v) + { + dgrSingle.DefaultCellStyle.BackColor = Color.YellowGreen; + } } private void colorButton1_Click(object sender, EventArgs e) { - var detail = new SegmentStockUp() { DeliverGoodsLine_Name = "青岛龙钰聚祥万福批发部", Date = DateTime.Today, BarCode="260912011201905120100005" }; + var detail = new SegmentStockUp() { DeliverGoodsLine_Name = "青岛龙钰聚祥万福批发部", Date = DateTime.Today, BarCode = "260912011201905120100005" }; var last = 5.234m; var saleOutStore = new SaleOutStoreInfo() { Customer_Name = "青岛市大客户", SendQueue = 51 }; SegmentStockUpPrint.Print(detail, last, saleOutStore); @@ -446,7 +448,7 @@ namespace ButcherFactory.SegmentStockUp_ var pad = new NumberPad(); if (pad.ShowDialog() == true) { - decimal? weight=null; + decimal? weight = null; if (!string.IsNullOrEmpty(pad.Result)) { decimal v; @@ -459,38 +461,78 @@ namespace ButcherFactory.SegmentStockUp_ config.AllowDownWeight = weight; XmlUtil.SerializerObjToFile(config); } - } - } - - class DeliverGoodsLineTemp - { - public string Name { get; set; } - - public int RowIndex { get; set; } - - public decimal? SecondNumber { get; set; } - public decimal? UnitNum { get; set; } - public decimal? SSecondNumber { get; set; } - public decimal? SUnitNum { get; set; } - - public override bool Equals(object obj) - { - var tag = obj as DeliverGoodsLineTemp; - return tag.Name == this.Name - && tag.UnitNum == this.UnitNum - && tag.SecondNumber == this.SecondNumber - && tag.SUnitNum == this.SUnitNum - && tag.SSecondNumber == this.SSecondNumber; - } - - public override int GetHashCode() - { - var hc1 = Name.GetHashCode(); - var hc2 = UnitNum.GetHashCode(); - var hc3 = SecondNumber.GetHashCode(); - var hc4 = SUnitNum.GetHashCode(); - var hc5 = SSecondNumber.GetHashCode(); - return hc1 ^ hc2 ^ hc3 ^ hc4 ^ hc5; - } - } -} + } + + private void lineGroupSetBtn_Click(object sender, EventArgs e) + { + new DeliverLineGroupSelectDialog().ShowDialog(); + BindDeliverLineGroup(true); + } + + Color color = Color.FromArgb(105, 105, 105); + Color selectColor = Color.FromArgb(250, 120, 24); + void BindDeliverLineGroup(bool loadNew) + { + flowLayoutPanel1.Controls.Clear(); + mLineGroupIds.Clear(); + if (loadNew) + config = XmlUtil.DeserializeFromFile(); + foreach (var item in config.LineGroup) + { + var btn = new ColorButton() { Width = 150, Height = 60, Text = item.Name, Tag = item, Font = new Font("宋体", 14), Margin = new Padding(30) }; + btn.BackColor = color; + btn.Click += DeliverLineBtn_Click; + flowLayoutPanel1.Controls.Add(btn); + } + } + + private void DeliverLineBtn_Click(object sender, EventArgs e) + { + var btn = sender as ColorButton; + var item = (DeliverLineGroup)btn.Tag; + var first = mLineGroupIds.FirstOrDefault(x => x == item.ID); + if (first == 0) + { + mLineGroupIds.Add(item.ID); + btn.BackColor = selectColor; + } + else + { + mLineGroupIds.Remove(item.ID); + btn.BackColor = color; + } + } + } + + class DeliverGoodsLineTemp + { + public string Name { get; set; } + + public int RowIndex { get; set; } + + public decimal? SecondNumber { get; set; } + public decimal? UnitNum { get; set; } + public decimal? SSecondNumber { get; set; } + public decimal? SUnitNum { get; set; } + + public override bool Equals(object obj) + { + var tag = obj as DeliverGoodsLineTemp; + return tag.Name == this.Name + && tag.UnitNum == this.UnitNum + && tag.SecondNumber == this.SecondNumber + && tag.SUnitNum == this.SUnitNum + && tag.SSecondNumber == this.SSecondNumber; + } + + public override int GetHashCode() + { + var hc1 = Name.GetHashCode(); + var hc2 = UnitNum.GetHashCode(); + var hc3 = SecondNumber.GetHashCode(); + var hc4 = SUnitNum.GetHashCode(); + var hc5 = SSecondNumber.GetHashCode(); + return hc1 ^ hc2 ^ hc3 ^ hc4 ^ hc5; + } + } +}