| @ -0,0 +1,60 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Drawing; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Windows.Controls; | |||||
| using System.Windows.Forms; | |||||
| namespace ButcherFactory.Controls | |||||
| { | |||||
| public class CircleButton : System.Windows.Forms.Button | |||||
| { | |||||
| public CircleButton() | |||||
| { | |||||
| this.SetStyle(ControlStyles.AllPaintingInWmPaint | | |||||
| ControlStyles.DoubleBuffer | | |||||
| ControlStyles.UserPaint, true); | |||||
| this.ForeColor = Color.White; | |||||
| this.BackColor = Color.DeepSkyBlue; | |||||
| } | |||||
| protected override void OnPaint(PaintEventArgs e) | |||||
| { | |||||
| base.OnPaint(e); | |||||
| System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath(); | |||||
| path.AddEllipse(2, 2, this.Width - 6, this.Height - 6); | |||||
| Graphics g = e.Graphics; | |||||
| g.DrawEllipse(new Pen(Color.Black, 2), 2, 2, Width - 6, Height - 6); | |||||
| Region = new Region(path); | |||||
| } | |||||
| private int _minCount = 0; | |||||
| public int MinCount | |||||
| { | |||||
| get { return _minCount; } | |||||
| set { | |||||
| if (value > _maxCount) | |||||
| { | |||||
| value = 1; | |||||
| } | |||||
| _minCount = value; | |||||
| this.Text = string.Format("{0}-{1}", _maxCount, _minCount); | |||||
| } | |||||
| } | |||||
| private int _maxCount = 1; | |||||
| public int MaxCount | |||||
| { | |||||
| get { return _maxCount; } | |||||
| set { | |||||
| _maxCount = value; | |||||
| this.Text = string.Format("{0}-{1}", _minCount, _minCount); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,75 @@ | |||||
| namespace ButcherFactory.Controls | |||||
| { | |||||
| partial class ButtonTag | |||||
| { | |||||
| /// <summary> | |||||
| /// 必需的设计器变量。 | |||||
| /// </summary> | |||||
| private System.ComponentModel.IContainer components = null; | |||||
| /// <summary> | |||||
| /// 清理所有正在使用的资源。 | |||||
| /// </summary> | |||||
| /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> | |||||
| protected override void Dispose(bool disposing) | |||||
| { | |||||
| if (disposing && (components != null)) | |||||
| { | |||||
| components.Dispose(); | |||||
| } | |||||
| base.Dispose(disposing); | |||||
| } | |||||
| #region 组件设计器生成的代码 | |||||
| /// <summary> | |||||
| /// 设计器支持所需的方法 - 不要 | |||||
| /// 使用代码编辑器修改此方法的内容。 | |||||
| /// </summary> | |||||
| private void InitializeComponent() | |||||
| { | |||||
| this.Label = new ButcherFactory.Controls.CircleButton(); | |||||
| this.Button = new ButcherFactory.Controls.ColorButton(); | |||||
| this.SuspendLayout(); | |||||
| // | |||||
| // Tag | |||||
| // | |||||
| this.Label.BackColor = System.Drawing.Color.DeepSkyBlue; | |||||
| this.Label.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||||
| this.Label.ForeColor = System.Drawing.Color.White; | |||||
| this.Label.Location = new System.Drawing.Point(111, 0); | |||||
| this.Label.Name = "Tag"; | |||||
| this.Label.Size = new System.Drawing.Size(36, 33); | |||||
| this.Label.TabIndex = 1; | |||||
| this.Label.UseVisualStyleBackColor = false; | |||||
| // | |||||
| // Button | |||||
| // | |||||
| this.Button.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); | |||||
| this.Button.ForeColor = System.Drawing.Color.White; | |||||
| this.Button.Location = new System.Drawing.Point(0, 0); | |||||
| this.Button.Name = "Button"; | |||||
| this.Button.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); | |||||
| this.Button.Size = new System.Drawing.Size(140, 90); | |||||
| this.Button.TabIndex = 2; | |||||
| this.Button.UseVisualStyleBackColor = false; | |||||
| // | |||||
| // ButtonTag | |||||
| // | |||||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||||
| this.Controls.Add(this.Label); | |||||
| this.Controls.Add(this.Button); | |||||
| this.Name = "ButtonTag"; | |||||
| this.Size = new System.Drawing.Size(147, 90); | |||||
| this.ResumeLayout(false); | |||||
| this.PerformLayout(); | |||||
| } | |||||
| #endregion | |||||
| public ColorButton Button; | |||||
| public CircleButton Label; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,20 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.ComponentModel; | |||||
| using System.Drawing; | |||||
| using System.Data; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Windows.Forms; | |||||
| namespace ButcherFactory.Controls | |||||
| { | |||||
| public partial class ButtonTag : UserControl | |||||
| { | |||||
| public ButtonTag() | |||||
| { | |||||
| InitializeComponent(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,120 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <root> | |||||
| <!-- | |||||
| Microsoft ResX Schema | |||||
| Version 2.0 | |||||
| The primary goals of this format is to allow a simple XML format | |||||
| that is mostly human readable. The generation and parsing of the | |||||
| various data types are done through the TypeConverter classes | |||||
| associated with the data types. | |||||
| Example: | |||||
| ... ado.net/XML headers & schema ... | |||||
| <resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
| <resheader name="version">2.0</resheader> | |||||
| <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
| <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
| <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
| <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
| <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
| <value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
| </data> | |||||
| <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
| <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
| <comment>This is a comment</comment> | |||||
| </data> | |||||
| There are any number of "resheader" rows that contain simple | |||||
| name/value pairs. | |||||
| Each data row contains a name, and value. The row also contains a | |||||
| type or mimetype. Type corresponds to a .NET class that support | |||||
| text/value conversion through the TypeConverter architecture. | |||||
| Classes that don't support this are serialized and stored with the | |||||
| mimetype set. | |||||
| The mimetype is used for serialized objects, and tells the | |||||
| ResXResourceReader how to depersist the object. This is currently not | |||||
| extensible. For a given mimetype the value must be set accordingly: | |||||
| Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
| that the ResXResourceWriter will generate, however the reader can | |||||
| read any of the formats listed below. | |||||
| mimetype: application/x-microsoft.net.object.binary.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.soap.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
| value : The object must be serialized into a byte array | |||||
| : using a System.ComponentModel.TypeConverter | |||||
| : and then encoded with base64 encoding. | |||||
| --> | |||||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
| <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
| <xsd:element name="root" msdata:IsDataSet="true"> | |||||
| <xsd:complexType> | |||||
| <xsd:choice maxOccurs="unbounded"> | |||||
| <xsd:element name="metadata"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
| <xsd:attribute name="type" type="xsd:string" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="assembly"> | |||||
| <xsd:complexType> | |||||
| <xsd:attribute name="alias" type="xsd:string" /> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="data"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="resheader"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:choice> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:schema> | |||||
| <resheader name="resmimetype"> | |||||
| <value>text/microsoft-resx</value> | |||||
| </resheader> | |||||
| <resheader name="version"> | |||||
| <value>2.0</value> | |||||
| </resheader> | |||||
| <resheader name="reader"> | |||||
| <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <resheader name="writer"> | |||||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| </root> | |||||
| @ -0,0 +1,148 @@ | |||||
| namespace ButcherFactory.SegmentProductionAuto_ | |||||
| { | |||||
| partial class WeightView | |||||
| { | |||||
| /// <summary> | |||||
| /// Required designer variable. | |||||
| /// </summary> | |||||
| private System.ComponentModel.IContainer components = null; | |||||
| /// <summary> | |||||
| /// Clean up any resources being used. | |||||
| /// </summary> | |||||
| /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||||
| protected override void Dispose(bool disposing) | |||||
| { | |||||
| if (disposing && (components != null)) | |||||
| { | |||||
| components.Dispose(); | |||||
| } | |||||
| base.Dispose(disposing); | |||||
| } | |||||
| #region Windows Form Designer generated code | |||||
| /// <summary> | |||||
| /// Required method for Designer support - do not modify | |||||
| /// the contents of this method with the code editor. | |||||
| /// </summary> | |||||
| private void InitializeComponent() | |||||
| { | |||||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); | |||||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); | |||||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); | |||||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); | |||||
| this.taskGrid = new WinFormControl.UDataGridView(); | |||||
| this.label1 = new System.Windows.Forms.Label(); | |||||
| this.I_No = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||||
| this.I_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||||
| this.deleteBtn = new ButcherFactory.Controls.ColorButton(); | |||||
| ((System.ComponentModel.ISupportInitialize)(this.taskGrid)).BeginInit(); | |||||
| this.SuspendLayout(); | |||||
| // | |||||
| // taskGrid | |||||
| // | |||||
| this.taskGrid.AllowUserToAddRows = false; | |||||
| this.taskGrid.AllowUserToDeleteRows = false; | |||||
| this.taskGrid.AllowUserToResizeColumns = false; | |||||
| this.taskGrid.AllowUserToResizeRows = false; | |||||
| dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); | |||||
| this.taskGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; | |||||
| this.taskGrid.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.taskGrid.BackgroundColor = System.Drawing.Color.White; | |||||
| this.taskGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; | |||||
| dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; | |||||
| dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); | |||||
| dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; | |||||
| dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; | |||||
| this.taskGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; | |||||
| this.taskGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; | |||||
| this.taskGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { | |||||
| this.I_No, | |||||
| this.I_Weight}); | |||||
| this.taskGrid.Location = new System.Drawing.Point(12, 63); | |||||
| this.taskGrid.MultiSelect = false; | |||||
| this.taskGrid.Name = "taskGrid"; | |||||
| this.taskGrid.ReadOnly = true; | |||||
| this.taskGrid.RowHeadersVisible = false; | |||||
| dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||||
| dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); | |||||
| this.taskGrid.RowsDefaultCellStyle = dataGridViewCellStyle4; | |||||
| this.taskGrid.RowTemplate.Height = 23; | |||||
| this.taskGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; | |||||
| this.taskGrid.Size = new System.Drawing.Size(263, 184); | |||||
| this.taskGrid.TabIndex = 13; | |||||
| this.taskGrid.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.taskGrid_CellContentClick); | |||||
| // | |||||
| // label1 | |||||
| // | |||||
| this.label1.AutoSize = true; | |||||
| this.label1.Font = new System.Drawing.Font("宋体", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||||
| this.label1.ForeColor = System.Drawing.Color.Red; | |||||
| this.label1.Location = new System.Drawing.Point(12, 9); | |||||
| this.label1.Name = "label1"; | |||||
| this.label1.Size = new System.Drawing.Size(17, 18); | |||||
| this.label1.TabIndex = 14; | |||||
| this.label1.Text = " "; | |||||
| // | |||||
| // I_No | |||||
| // | |||||
| this.I_No.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||||
| this.I_No.DataPropertyName = "No"; | |||||
| this.I_No.FillWeight = 150F; | |||||
| this.I_No.HeaderText = "序号"; | |||||
| this.I_No.Name = "I_No"; | |||||
| this.I_No.ReadOnly = true; | |||||
| // | |||||
| // I_Weight | |||||
| // | |||||
| this.I_Weight.DataPropertyName = "Weight"; | |||||
| dataGridViewCellStyle3.Format = "#0.######"; | |||||
| this.I_Weight.DefaultCellStyle = dataGridViewCellStyle3; | |||||
| this.I_Weight.HeaderText = "重量"; | |||||
| this.I_Weight.Name = "I_Weight"; | |||||
| this.I_Weight.ReadOnly = true; | |||||
| this.I_Weight.Width = 120; | |||||
| // | |||||
| // deleteBtn | |||||
| // | |||||
| this.deleteBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); | |||||
| this.deleteBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25))))); | |||||
| this.deleteBtn.Font = new System.Drawing.Font("宋体", 15F); | |||||
| this.deleteBtn.ForeColor = System.Drawing.Color.White; | |||||
| this.deleteBtn.Location = new System.Drawing.Point(164, 16); | |||||
| this.deleteBtn.Name = "deleteBtn"; | |||||
| this.deleteBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); | |||||
| this.deleteBtn.Size = new System.Drawing.Size(111, 41); | |||||
| this.deleteBtn.TabIndex = 24; | |||||
| this.deleteBtn.Text = "删除"; | |||||
| this.deleteBtn.UseVisualStyleBackColor = false; | |||||
| this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); | |||||
| // | |||||
| // WeightView | |||||
| // | |||||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||||
| this.ClientSize = new System.Drawing.Size(287, 259); | |||||
| this.Controls.Add(this.deleteBtn); | |||||
| this.Controls.Add(this.label1); | |||||
| this.Controls.Add(this.taskGrid); | |||||
| this.Name = "WeightView"; | |||||
| this.Text = "称重明细"; | |||||
| ((System.ComponentModel.ISupportInitialize)(this.taskGrid)).EndInit(); | |||||
| this.ResumeLayout(false); | |||||
| this.PerformLayout(); | |||||
| } | |||||
| #endregion | |||||
| private WinFormControl.UDataGridView taskGrid; | |||||
| private System.Windows.Forms.DataGridViewTextBoxColumn I_No; | |||||
| private System.Windows.Forms.DataGridViewTextBoxColumn I_Weight; | |||||
| private System.Windows.Forms.Label label1; | |||||
| private Controls.ColorButton deleteBtn; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,123 @@ | |||||
| using ButcherFactory.BO; | |||||
| 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.SegmentProductionAuto_ | |||||
| { | |||||
| public partial class WeightView : Form | |||||
| { | |||||
| BindingList<WeightDetail> list; | |||||
| ClientGoodsSet_Detail goods; | |||||
| private SegmentProductionAutoForm form; | |||||
| private ButtonTag bTag; | |||||
| public WeightView() | |||||
| { | |||||
| InitializeComponent(); | |||||
| taskGrid.RowPrePaint += uDataGridView1_RowPrePaint; | |||||
| taskGrid.CellPainting += uDataGridView1_CellPainting; | |||||
| } | |||||
| public WeightView(SegmentProductionAutoForm form, ButtonTag bTag) | |||||
| : this() | |||||
| { | |||||
| this.bTag = bTag; | |||||
| this.form = form; | |||||
| goods = ((ClientGoodsSet_Detail)bTag.Button.Tag); | |||||
| label1.Text = goods.Goods_Name; | |||||
| list = new BindingList<WeightDetail>(); | |||||
| var l = new List<decimal>(0); | |||||
| if (form.wDic.ContainsKey(goods.Goods_ID)) | |||||
| { | |||||
| l = form.wDic[goods.Goods_ID]; | |||||
| } | |||||
| int i = 1; | |||||
| foreach (var item in l) | |||||
| { | |||||
| list.Add(new WeightDetail { No = i, Weight = item }); | |||||
| i++; | |||||
| } | |||||
| } | |||||
| private void uDataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) | |||||
| { | |||||
| //if (e.RowIndex == taskGrid.Rows.Count - 1) | |||||
| //{ | |||||
| // var row = taskGrid.Rows[e.RowIndex]; | |||||
| // row.DefaultCellStyle.SelectionForeColor = Color.Black; | |||||
| // row.DefaultCellStyle.BackColor = Color.Khaki; | |||||
| // row.DefaultCellStyle.SelectionBackColor = Color.Khaki; | |||||
| //} | |||||
| } | |||||
| private void uDataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) | |||||
| { | |||||
| var last = taskGrid.Rows.Count - 1; | |||||
| if (e.RowIndex == last) | |||||
| { | |||||
| if (e.ColumnIndex == 0) | |||||
| { | |||||
| } | |||||
| } | |||||
| } | |||||
| protected override void OnLoad(EventArgs e) | |||||
| { | |||||
| base.OnLoad(e); | |||||
| taskGrid.DataSource = list; | |||||
| taskGrid.Refresh(); | |||||
| } | |||||
| private void CloseBtn_Click(object sender, EventArgs e) | |||||
| { | |||||
| this.Close(); | |||||
| } | |||||
| private void taskGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) | |||||
| { | |||||
| } | |||||
| private void deleteBtn_Click(object sender, EventArgs e) | |||||
| { | |||||
| var row = taskGrid.SelectedRows; | |||||
| if (row.Count == 0) | |||||
| return; | |||||
| if (MessageBox.Show("确定删除选中记录?", "删除确认", MessageBoxButtons.OKCancel) != DialogResult.OK) | |||||
| return; | |||||
| var tag = taskGrid.SelectedRows[0].DataBoundItem as WeightDetail; | |||||
| if (form.wDic.ContainsKey(goods.Goods_ID)) | |||||
| { | |||||
| var l = form.wDic[goods.Goods_ID]; | |||||
| l.RemoveAt(tag.No - 1); | |||||
| bTag.Label.MinCount = l.Count; | |||||
| } | |||||
| list.Remove(tag); | |||||
| int i = 1; | |||||
| foreach (var item in list) | |||||
| { | |||||
| item.No = i; | |||||
| i++; | |||||
| } | |||||
| taskGrid.DataSource = list; | |||||
| taskGrid.ClearSelection(); | |||||
| taskGrid.Refresh(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,123 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <root> | |||||
| <!-- | |||||
| Microsoft ResX Schema | |||||
| Version 2.0 | |||||
| The primary goals of this format is to allow a simple XML format | |||||
| that is mostly human readable. The generation and parsing of the | |||||
| various data types are done through the TypeConverter classes | |||||
| associated with the data types. | |||||
| Example: | |||||
| ... ado.net/XML headers & schema ... | |||||
| <resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
| <resheader name="version">2.0</resheader> | |||||
| <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
| <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
| <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
| <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
| <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
| <value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
| </data> | |||||
| <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
| <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
| <comment>This is a comment</comment> | |||||
| </data> | |||||
| There are any number of "resheader" rows that contain simple | |||||
| name/value pairs. | |||||
| Each data row contains a name, and value. The row also contains a | |||||
| type or mimetype. Type corresponds to a .NET class that support | |||||
| text/value conversion through the TypeConverter architecture. | |||||
| Classes that don't support this are serialized and stored with the | |||||
| mimetype set. | |||||
| The mimetype is used for serialized objects, and tells the | |||||
| ResXResourceReader how to depersist the object. This is currently not | |||||
| extensible. For a given mimetype the value must be set accordingly: | |||||
| Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
| that the ResXResourceWriter will generate, however the reader can | |||||
| read any of the formats listed below. | |||||
| mimetype: application/x-microsoft.net.object.binary.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.soap.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
| value : The object must be serialized into a byte array | |||||
| : using a System.ComponentModel.TypeConverter | |||||
| : and then encoded with base64 encoding. | |||||
| --> | |||||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
| <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
| <xsd:element name="root" msdata:IsDataSet="true"> | |||||
| <xsd:complexType> | |||||
| <xsd:choice maxOccurs="unbounded"> | |||||
| <xsd:element name="metadata"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
| <xsd:attribute name="type" type="xsd:string" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="assembly"> | |||||
| <xsd:complexType> | |||||
| <xsd:attribute name="alias" type="xsd:string" /> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="data"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="resheader"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:choice> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:schema> | |||||
| <resheader name="resmimetype"> | |||||
| <value>text/microsoft-resx</value> | |||||
| </resheader> | |||||
| <resheader name="version"> | |||||
| <value>2.0</value> | |||||
| </resheader> | |||||
| <resheader name="reader"> | |||||
| <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <resheader name="writer"> | |||||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <metadata name="I_Weight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
| <value>True</value> | |||||
| </metadata> | |||||
| </root> | |||||