| @ -0,0 +1,65 @@ | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace ButcherFactory.BO | |||
| { | |||
| [MapToTable("Butcher_SegmentSaleOut_Detail")] | |||
| [KeyField("ID", KeyGenType.identity)] | |||
| public class SegmentSaleOut_Detail | |||
| { | |||
| public SegmentSaleOut_Detail() | |||
| { | |||
| Time = DateTime.Now; | |||
| } | |||
| public long ID { get; set; } | |||
| public long? BillID { get; set; } | |||
| public long? DetailID { get; set; } | |||
| public string BarCode { get; set; } | |||
| [NonDmoProperty] | |||
| public string ShortCode | |||
| { | |||
| get | |||
| { | |||
| if (string.IsNullOrEmpty(BarCode)) | |||
| return null; | |||
| if (BarCode.Contains("260912011")) | |||
| return BarCode.Replace("260912011", ""); | |||
| return BarCode; | |||
| } | |||
| } | |||
| public long? Goods_ID { get; set; } | |||
| public string Goods_Name { get; set; } | |||
| public string Goods_Code { get; set; } | |||
| public long? ProductBatch_ID { get; set; } | |||
| public decimal Number { get; set; } | |||
| public decimal? DiscontWeight { get; set; } | |||
| public decimal? SecondNumber { get; set; } | |||
| [NonDmoProperty] | |||
| public int Idx { get; set; } | |||
| public DateTime Time { get; set; } | |||
| public long? WeightRecord_ID { get; set; } | |||
| public long? ScanRecord_ID { get; set; } | |||
| public string Operator { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,175 @@ | |||
| using ButcherFactory.BO.Utils; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.JsonRpc.Client; | |||
| using Newtonsoft.Json; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.ComponentModel; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace ButcherFactory.BO.LocalBL | |||
| { | |||
| public static class SegmentSaleOutBL | |||
| { | |||
| const string RpcPath = @"/MainSystem/B3Sale/Rpcs/"; | |||
| const string MESPath = @"/MainSystem/B3ClientService/Rpcs/"; | |||
| public static BindingList<SaleOutStore> GetSaleOutStoreList(DateTime sendDate, long? deliverGoodsLineID, long? customerID, int billState, long? storeID, bool already = false) | |||
| { | |||
| return CarcassSaleOutBL.GetSaleOutStoreList(sendDate, deliverGoodsLineID, customerID, billState, storeID, already); | |||
| } | |||
| public static BindingList<SaleOutStore_Detail> GetSaleOutStoreDetailList(long id) | |||
| { | |||
| return CarcassSaleOutBL.GetSaleOutStoreDetailList(id); | |||
| } | |||
| public static BindingList<SegmentSaleOut_Detail> GetWeightRecord(long detailID) | |||
| { | |||
| var query = new DmoQuery(typeof(SegmentSaleOut_Detail)); | |||
| query.Where.Conditions.Add(DQCondition.EQ("DetailID", detailID)); | |||
| query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); | |||
| var list = query.EExecuteList().Cast<SegmentSaleOut_Detail>().ToList(); | |||
| var idx = list.Count; | |||
| foreach (var item in list) | |||
| { | |||
| item.Idx = idx; | |||
| idx--; | |||
| } | |||
| return new BindingList<SegmentSaleOut_Detail>(list); | |||
| } | |||
| public static SegmentSaleOut_Detail Insert(decimal weight) | |||
| { | |||
| using (var session = DmoSession.New()) | |||
| { | |||
| var detail = new SegmentSaleOut_Detail() { Number = weight, SecondNumber = 1 }; | |||
| session.Insert(detail); | |||
| session.Commit(); | |||
| return detail; | |||
| } | |||
| } | |||
| public static List<ProductBatch> GetBatchFromEMS() | |||
| { | |||
| return CarcassSaleOutBL.GetBatchFromEMS(); | |||
| } | |||
| static void SubmitDetails(IEnumerable<SegmentSaleOut_Detail> details, SaleOutStore_Detail detail, int flag) | |||
| { | |||
| var arr = details.Select(x => new WeightRecord { Flag = flag, ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Number, SecondNumber = x.SecondNumber, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode }); | |||
| var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); | |||
| var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json); | |||
| using (var session = DmoSession.New()) | |||
| { | |||
| foreach (var item in details) | |||
| { | |||
| var first = back.First(x => x.LongExt1 == item.ID); | |||
| Update(session, item.ID, | |||
| new Tuple<string, object>("WeightRecord_ID", first.LongExt2), | |||
| new Tuple<string, object>("ScanRecord_ID", first.LongExt3) | |||
| ); | |||
| } | |||
| session.Commit(); | |||
| } | |||
| } | |||
| static void Update(IDmoSession session, long id, params Tuple<string, object>[] pops) | |||
| { | |||
| var update = new DQUpdateDom(typeof(SegmentSaleOut_Detail)); | |||
| foreach (var item in pops) | |||
| update.Columns.Add(new DQUpdateColumn(item.Item1, item.Item2)); | |||
| update.Where.Conditions.Add(DQCondition.EQ("ID", id)); | |||
| session.ExecuteNonQuery(update); | |||
| } | |||
| public static void SetGoodsFinish(long id) | |||
| { | |||
| CarcassSaleOutBL.SetGoodsFinish(id); | |||
| } | |||
| public static void SetGoodsUnFinish(long id) | |||
| { | |||
| CarcassSaleOutBL.SetGoodsUnFinish(id); | |||
| } | |||
| static void Delete(long id) | |||
| { | |||
| var delete = new DQDeleteDom(typeof(SegmentSaleOut_Detail)); | |||
| delete.Where.Conditions.Add(DQCondition.EQ("ID", id)); | |||
| delete.EExecute(); | |||
| } | |||
| public static void AddAndUpdate(SegmentSaleOut_Detail detail) | |||
| { | |||
| using (var session = DmoSession.New()) | |||
| { | |||
| session.Insert(detail); | |||
| var arr = new List<WeightRecord> { new WeightRecord { Flag = 2, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Number, SecondNumber = detail.SecondNumber } }; | |||
| var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID); | |||
| var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json); | |||
| var first = back.First(); | |||
| Update(session, detail.ID, new Tuple<string, object>("WeightRecord_ID", first.LongExt2), | |||
| new Tuple<string, object>("ScanRecord_ID", first.LongExt3) | |||
| ); | |||
| session.Commit(); | |||
| } | |||
| } | |||
| public static void DeleteAndUpdate(SegmentSaleOut_Detail tag) | |||
| { | |||
| var json = JsonConvert.SerializeObject(new List<ExtensionObj>() { new ExtensionObj { LongExt1 = tag.DetailID, LongExt2 = tag.WeightRecord_ID, LongExt3 = tag.ScanRecord_ID } }); | |||
| RpcFacade.Call<int>(RpcPath + "SaleOutStoreRpc/DeleteAndUpdate", json); | |||
| Delete(tag.ID); | |||
| } | |||
| public static void InsertByCode(SaleOutStore_Detail orderDetail, SegmentSaleOut_Detail detail) | |||
| { | |||
| var json = ButcherFactoryUtil.SimpleMESCall<string>(MESPath + "SegmentSaleOutStoreRpc/GetSegmentInfo", detail.BarCode); | |||
| var scanInfo = JsonConvert.DeserializeObject<ExtensionObj>(json); | |||
| if (scanInfo.StringExt1 != orderDetail.Goods_Code) | |||
| throw new Exception("扫码明细与发货明细 存货不一致!"); | |||
| detail.BillID = orderDetail.SaleOutStore_ID; | |||
| detail.DetailID = orderDetail.ID; | |||
| detail.Goods_ID = orderDetail.Goods_ID; | |||
| detail.Goods_Code = orderDetail.Goods_Code; | |||
| detail.Goods_Name = orderDetail.Goods_Name; | |||
| detail.Number = scanInfo.DecimalExt1.Value; | |||
| if (orderDetail.Number.HasValue && orderDetail.SecondNumber.HasValue && orderDetail.Number != 0) | |||
| detail.SecondNumber = decimal.Round(orderDetail.SecondNumber.Value * detail.Number / orderDetail.Number.Value, 2); | |||
| detail.Operator = "扫码发货"; | |||
| using (var session = DmoSession.New()) | |||
| { | |||
| session.Insert(detail); | |||
| session.Commit(); | |||
| } | |||
| SubmitDetails(new SegmentSaleOut_Detail[] { detail }, orderDetail, 1); | |||
| } | |||
| public static void InsertReadWeight(SaleOutStore_Detail orderDetail, SegmentSaleOut_Detail detail) | |||
| { | |||
| detail.BillID = orderDetail.SaleOutStore_ID; | |||
| detail.DetailID = orderDetail.ID; | |||
| detail.Goods_ID = orderDetail.Goods_ID; | |||
| detail.Goods_Code = orderDetail.Goods_Code; | |||
| detail.Goods_Name = orderDetail.Goods_Name; | |||
| if (orderDetail.Number.HasValue && orderDetail.SecondNumber.HasValue && orderDetail.Number != 0) | |||
| detail.SecondNumber = decimal.Round(orderDetail.SecondNumber.Value * detail.Number / orderDetail.Number.Value, 2); | |||
| detail.Operator = "读入重量"; | |||
| using (var session = DmoSession.New()) | |||
| { | |||
| session.Insert(detail); | |||
| session.Commit(); | |||
| } | |||
| SubmitDetails(new SegmentSaleOut_Detail[] { detail }, orderDetail, 2); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,168 @@ | |||
| namespace ButcherFactory.SegmentSaleOut_ | |||
| { | |||
| partial class AddWeightRecord | |||
| { | |||
| /// <summary> | |||
| /// Required designer variable. | |||
| /// </summary> | |||
| private System.ComponentModel.IContainer components = null; | |||
| /// <summary> | |||
| /// Clean up any resources being used. | |||
| /// </summary> | |||
| /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
| protected override void Dispose(bool disposing) | |||
| { | |||
| if (disposing && (components != null)) | |||
| { | |||
| components.Dispose(); | |||
| } | |||
| base.Dispose(disposing); | |||
| } | |||
| #region Windows Form Designer generated code | |||
| /// <summary> | |||
| /// Required method for Designer support - do not modify | |||
| /// the contents of this method with the code editor. | |||
| /// </summary> | |||
| private void InitializeComponent() | |||
| { | |||
| this.cancelBtn = new ButcherFactory.Controls.ColorButton(); | |||
| this.okBtn = new ButcherFactory.Controls.ColorButton(); | |||
| this.numberInput = new WinFormControl.UTextBoxWithPad(); | |||
| this.weightInput = new WinFormControl.UTextBoxWithPad(); | |||
| this.goodsLabel = new WinFormControl.ULabel(); | |||
| this.uLabel3 = new WinFormControl.ULabel(); | |||
| this.uLabel2 = new WinFormControl.ULabel(); | |||
| this.uLabel1 = new WinFormControl.ULabel(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // cancelBtn | |||
| // | |||
| this.cancelBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); | |||
| this.cancelBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||
| this.cancelBtn.ForeColor = System.Drawing.Color.White; | |||
| this.cancelBtn.Location = new System.Drawing.Point(375, 259); | |||
| this.cancelBtn.Name = "cancelBtn"; | |||
| this.cancelBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); | |||
| this.cancelBtn.Size = new System.Drawing.Size(92, 40); | |||
| this.cancelBtn.TabIndex = 17; | |||
| this.cancelBtn.Text = "取消"; | |||
| this.cancelBtn.UseVisualStyleBackColor = false; | |||
| this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); | |||
| // | |||
| // okBtn | |||
| // | |||
| this.okBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(194)))), ((int)(((byte)(76))))); | |||
| this.okBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||
| this.okBtn.ForeColor = System.Drawing.Color.White; | |||
| this.okBtn.Location = new System.Drawing.Point(231, 259); | |||
| this.okBtn.Name = "okBtn"; | |||
| this.okBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); | |||
| this.okBtn.Size = new System.Drawing.Size(92, 40); | |||
| this.okBtn.TabIndex = 16; | |||
| this.okBtn.Text = "确定"; | |||
| this.okBtn.UseVisualStyleBackColor = false; | |||
| this.okBtn.Click += new System.EventHandler(this.okBtn_Click); | |||
| // | |||
| // numberInput | |||
| // | |||
| this.numberInput.Font = new System.Drawing.Font("宋体", 20F); | |||
| this.numberInput.Location = new System.Drawing.Point(228, 99); | |||
| this.numberInput.Name = "numberInput"; | |||
| this.numberInput.Size = new System.Drawing.Size(242, 38); | |||
| this.numberInput.TabIndex = 11; | |||
| this.numberInput.Type = WinFormControl.UTextBoxWithPad.TextBoxType.Number; | |||
| this.numberInput.Click += new System.EventHandler(this.weightInput_Click); | |||
| // | |||
| // weightInput | |||
| // | |||
| this.weightInput.Font = new System.Drawing.Font("宋体", 20F); | |||
| this.weightInput.Location = new System.Drawing.Point(228, 175); | |||
| this.weightInput.Name = "weightInput"; | |||
| this.weightInput.Size = new System.Drawing.Size(242, 38); | |||
| this.weightInput.TabIndex = 13; | |||
| this.weightInput.Type = WinFormControl.UTextBoxWithPad.TextBoxType.Number; | |||
| this.weightInput.Click += new System.EventHandler(this.weightInput_Click); | |||
| // | |||
| // goodsLabel | |||
| // | |||
| this.goodsLabel.AutoSize = true; | |||
| this.goodsLabel.BackColor = System.Drawing.Color.Transparent; | |||
| this.goodsLabel.Font = new System.Drawing.Font("宋体", 15F); | |||
| this.goodsLabel.ForeColor = System.Drawing.Color.Red; | |||
| this.goodsLabel.Location = new System.Drawing.Point(227, 43); | |||
| this.goodsLabel.Name = "goodsLabel"; | |||
| this.goodsLabel.Size = new System.Drawing.Size(49, 20); | |||
| this.goodsLabel.TabIndex = 14; | |||
| this.goodsLabel.Text = "存货"; | |||
| // | |||
| // uLabel3 | |||
| // | |||
| this.uLabel3.AutoSize = true; | |||
| this.uLabel3.BackColor = System.Drawing.Color.Transparent; | |||
| this.uLabel3.Font = new System.Drawing.Font("宋体", 12F); | |||
| this.uLabel3.Location = new System.Drawing.Point(107, 184); | |||
| this.uLabel3.Name = "uLabel3"; | |||
| this.uLabel3.Size = new System.Drawing.Size(80, 16); | |||
| this.uLabel3.TabIndex = 12; | |||
| this.uLabel3.Text = "重 量:"; | |||
| // | |||
| // uLabel2 | |||
| // | |||
| this.uLabel2.AutoSize = true; | |||
| this.uLabel2.BackColor = System.Drawing.Color.Transparent; | |||
| this.uLabel2.Font = new System.Drawing.Font("宋体", 12F); | |||
| this.uLabel2.Location = new System.Drawing.Point(110, 111); | |||
| this.uLabel2.Name = "uLabel2"; | |||
| this.uLabel2.Size = new System.Drawing.Size(80, 16); | |||
| this.uLabel2.TabIndex = 10; | |||
| this.uLabel2.Text = "数 量:"; | |||
| // | |||
| // uLabel1 | |||
| // | |||
| this.uLabel1.AutoSize = true; | |||
| this.uLabel1.BackColor = System.Drawing.Color.Transparent; | |||
| this.uLabel1.Font = new System.Drawing.Font("宋体", 12F); | |||
| this.uLabel1.Location = new System.Drawing.Point(110, 43); | |||
| this.uLabel1.Name = "uLabel1"; | |||
| this.uLabel1.Size = new System.Drawing.Size(88, 16); | |||
| this.uLabel1.TabIndex = 9; | |||
| this.uLabel1.Text = "存货名称:"; | |||
| // | |||
| // AddWeightRecord | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.BackColor = System.Drawing.Color.White; | |||
| this.ClientSize = new System.Drawing.Size(582, 357); | |||
| this.ControlBox = false; | |||
| this.Controls.Add(this.cancelBtn); | |||
| this.Controls.Add(this.okBtn); | |||
| this.Controls.Add(this.numberInput); | |||
| this.Controls.Add(this.weightInput); | |||
| this.Controls.Add(this.goodsLabel); | |||
| this.Controls.Add(this.uLabel3); | |||
| this.Controls.Add(this.uLabel2); | |||
| this.Controls.Add(this.uLabel1); | |||
| this.Name = "AddWeightRecord"; | |||
| this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; | |||
| this.Text = "新增"; | |||
| this.ResumeLayout(false); | |||
| this.PerformLayout(); | |||
| } | |||
| #endregion | |||
| private Controls.ColorButton cancelBtn; | |||
| private Controls.ColorButton okBtn; | |||
| private WinFormControl.UTextBoxWithPad numberInput; | |||
| private WinFormControl.UTextBoxWithPad weightInput; | |||
| private WinFormControl.ULabel goodsLabel; | |||
| private WinFormControl.ULabel uLabel3; | |||
| private WinFormControl.ULabel uLabel2; | |||
| private WinFormControl.ULabel uLabel1; | |||
| } | |||
| } | |||
| @ -0,0 +1,66 @@ | |||
| using ButcherFactory.BO; | |||
| using ButcherFactory.BO.LocalBL; | |||
| using ButcherFactory.BO.Utils; | |||
| 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; | |||
| using WinFormControl; | |||
| namespace ButcherFactory.SegmentSaleOut_ | |||
| { | |||
| public partial class AddWeightRecord : Form | |||
| { | |||
| SaleOutStore_Detail mDetail; | |||
| long? mBatchID = null; | |||
| public AddWeightRecord(SaleOutStore_Detail detail, long? batchID) | |||
| { | |||
| InitializeComponent(); | |||
| mDetail = detail; | |||
| mBatchID = batchID; | |||
| goodsLabel.Text = mDetail.Goods_Name; | |||
| } | |||
| private void okBtn_Click(object sender, EventArgs e) | |||
| { | |||
| decimal weight = 0; | |||
| if (!decimal.TryParse(weightInput.Text, out weight)) | |||
| throw new Exception("请输入重量"); | |||
| decimal number = 0; | |||
| if (!decimal.TryParse(numberInput.Text, out number)) | |||
| throw new Exception("请输入数量"); | |||
| if (number < 0) | |||
| throw new Exception("数量不能为负"); | |||
| var record = new SegmentSaleOut_Detail(); | |||
| record.BillID = mDetail.SaleOutStore_ID; | |||
| record.DetailID = mDetail.ID; | |||
| record.ProductBatch_ID = mBatchID; | |||
| record.Goods_Code = mDetail.Goods_Code; | |||
| record.Goods_ID = mDetail.Goods_ID; | |||
| record.Goods_Name = mDetail.Goods_Name; | |||
| record.Number = weight; | |||
| record.SecondNumber = number; | |||
| record.Operator = AppContext.Worker.Name; | |||
| SegmentSaleOutBL.AddAndUpdate(record); | |||
| DialogResult = DialogResult.OK; | |||
| } | |||
| private void cancelBtn_Click(object sender, EventArgs e) | |||
| { | |||
| this.Close(); | |||
| } | |||
| private void weightInput_Click(object sender, EventArgs e) | |||
| { | |||
| var keyBoard = new NumberPad(); | |||
| if (keyBoard.ShowDialog() == true) | |||
| (sender as TextBox).Text = keyBoard.Result; | |||
| } | |||
| } | |||
| } | |||
| @ -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,180 @@ | |||
| namespace ButcherFactory.SegmentSaleOut_ | |||
| { | |||
| partial class DiscontSetDialog | |||
| { | |||
| /// <summary> | |||
| /// Required designer variable. | |||
| /// </summary> | |||
| private System.ComponentModel.IContainer components = null; | |||
| /// <summary> | |||
| /// Clean up any resources being used. | |||
| /// </summary> | |||
| /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
| protected override void Dispose(bool disposing) | |||
| { | |||
| if (disposing && (components != null)) | |||
| { | |||
| components.Dispose(); | |||
| } | |||
| base.Dispose(disposing); | |||
| } | |||
| #region Windows Form Designer generated code | |||
| /// <summary> | |||
| /// Required method for Designer support - do not modify | |||
| /// the contents of this method with the code editor. | |||
| /// </summary> | |||
| private void InitializeComponent() | |||
| { | |||
| this.label1 = new System.Windows.Forms.Label(); | |||
| this.label2 = new System.Windows.Forms.Label(); | |||
| this.label3 = new System.Windows.Forms.Label(); | |||
| this.label4 = new System.Windows.Forms.Label(); | |||
| this.lbl1 = new System.Windows.Forms.Label(); | |||
| this.lbl2 = new System.Windows.Forms.Label(); | |||
| this.lbl3 = new System.Windows.Forms.Label(); | |||
| this.lbl4 = new System.Windows.Forms.Label(); | |||
| this.okBtn = new ButcherFactory.Controls.ColorButton(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // label1 | |||
| // | |||
| this.label1.AutoSize = true; | |||
| this.label1.Font = new System.Drawing.Font("宋体", 12F); | |||
| this.label1.Location = new System.Drawing.Point(72, 32); | |||
| this.label1.Name = "label1"; | |||
| this.label1.Size = new System.Drawing.Size(56, 16); | |||
| this.label1.TabIndex = 0; | |||
| this.label1.Text = "扣重一"; | |||
| // | |||
| // label2 | |||
| // | |||
| this.label2.AutoSize = true; | |||
| this.label2.Font = new System.Drawing.Font("宋体", 12F); | |||
| this.label2.Location = new System.Drawing.Point(72, 87); | |||
| this.label2.Name = "label2"; | |||
| this.label2.Size = new System.Drawing.Size(56, 16); | |||
| this.label2.TabIndex = 1; | |||
| this.label2.Text = "扣重一"; | |||
| // | |||
| // label3 | |||
| // | |||
| this.label3.AutoSize = true; | |||
| this.label3.Font = new System.Drawing.Font("宋体", 12F); | |||
| this.label3.Location = new System.Drawing.Point(72, 144); | |||
| this.label3.Name = "label3"; | |||
| this.label3.Size = new System.Drawing.Size(56, 16); | |||
| this.label3.TabIndex = 2; | |||
| this.label3.Text = "扣重一"; | |||
| // | |||
| // label4 | |||
| // | |||
| this.label4.AutoSize = true; | |||
| this.label4.Font = new System.Drawing.Font("宋体", 12F); | |||
| this.label4.Location = new System.Drawing.Point(72, 201); | |||
| this.label4.Name = "label4"; | |||
| this.label4.Size = new System.Drawing.Size(56, 16); | |||
| this.label4.TabIndex = 3; | |||
| this.label4.Text = "扣重一"; | |||
| // | |||
| // lbl1 | |||
| // | |||
| this.lbl1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; | |||
| this.lbl1.Font = new System.Drawing.Font("黑体", 12F); | |||
| this.lbl1.ForeColor = System.Drawing.Color.Red; | |||
| this.lbl1.Location = new System.Drawing.Point(161, 29); | |||
| this.lbl1.Name = "lbl1"; | |||
| this.lbl1.Size = new System.Drawing.Size(100, 30); | |||
| this.lbl1.TabIndex = 4; | |||
| this.lbl1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | |||
| this.lbl1.Click += new System.EventHandler(this.lbl1_Click); | |||
| // | |||
| // lbl2 | |||
| // | |||
| this.lbl2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; | |||
| this.lbl2.Font = new System.Drawing.Font("黑体", 12F); | |||
| this.lbl2.ForeColor = System.Drawing.Color.Red; | |||
| this.lbl2.Location = new System.Drawing.Point(161, 84); | |||
| this.lbl2.Name = "lbl2"; | |||
| this.lbl2.Size = new System.Drawing.Size(100, 30); | |||
| this.lbl2.TabIndex = 5; | |||
| this.lbl2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | |||
| this.lbl2.Click += new System.EventHandler(this.lbl1_Click); | |||
| // | |||
| // lbl3 | |||
| // | |||
| this.lbl3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; | |||
| this.lbl3.Font = new System.Drawing.Font("黑体", 12F); | |||
| this.lbl3.ForeColor = System.Drawing.Color.Red; | |||
| this.lbl3.Location = new System.Drawing.Point(161, 141); | |||
| this.lbl3.Name = "lbl3"; | |||
| this.lbl3.Size = new System.Drawing.Size(100, 30); | |||
| this.lbl3.TabIndex = 6; | |||
| this.lbl3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | |||
| this.lbl3.Click += new System.EventHandler(this.lbl1_Click); | |||
| // | |||
| // lbl4 | |||
| // | |||
| this.lbl4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; | |||
| this.lbl4.Font = new System.Drawing.Font("黑体", 12F); | |||
| this.lbl4.ForeColor = System.Drawing.Color.Red; | |||
| this.lbl4.Location = new System.Drawing.Point(161, 198); | |||
| this.lbl4.Name = "lbl4"; | |||
| this.lbl4.Size = new System.Drawing.Size(100, 30); | |||
| this.lbl4.TabIndex = 7; | |||
| this.lbl4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | |||
| this.lbl4.Click += new System.EventHandler(this.lbl1_Click); | |||
| // | |||
| // okBtn | |||
| // | |||
| this.okBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); | |||
| this.okBtn.Font = new System.Drawing.Font("宋体", 12F); | |||
| this.okBtn.ForeColor = System.Drawing.Color.White; | |||
| this.okBtn.Location = new System.Drawing.Point(119, 271); | |||
| this.okBtn.Name = "okBtn"; | |||
| this.okBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); | |||
| this.okBtn.Size = new System.Drawing.Size(98, 43); | |||
| this.okBtn.TabIndex = 8; | |||
| this.okBtn.Text = "确定"; | |||
| this.okBtn.UseVisualStyleBackColor = false; | |||
| this.okBtn.Click += new System.EventHandler(this.okBtn_Click); | |||
| // | |||
| // DiscontSetDialog | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.BackColor = System.Drawing.Color.White; | |||
| this.ClientSize = new System.Drawing.Size(343, 343); | |||
| this.ControlBox = false; | |||
| this.Controls.Add(this.okBtn); | |||
| this.Controls.Add(this.lbl4); | |||
| this.Controls.Add(this.lbl3); | |||
| this.Controls.Add(this.lbl2); | |||
| this.Controls.Add(this.lbl1); | |||
| this.Controls.Add(this.label4); | |||
| this.Controls.Add(this.label3); | |||
| this.Controls.Add(this.label2); | |||
| this.Controls.Add(this.label1); | |||
| this.Name = "DiscontSetDialog"; | |||
| this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; | |||
| this.Text = "扣重设置"; | |||
| this.ResumeLayout(false); | |||
| this.PerformLayout(); | |||
| } | |||
| #endregion | |||
| private System.Windows.Forms.Label label1; | |||
| private System.Windows.Forms.Label label2; | |||
| private System.Windows.Forms.Label label3; | |||
| private System.Windows.Forms.Label label4; | |||
| private System.Windows.Forms.Label lbl1; | |||
| private System.Windows.Forms.Label lbl2; | |||
| private System.Windows.Forms.Label lbl3; | |||
| private System.Windows.Forms.Label lbl4; | |||
| private Controls.ColorButton okBtn; | |||
| } | |||
| } | |||
| @ -0,0 +1,69 @@ | |||
| using ButcherFactory.BO.Utils; | |||
| 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; | |||
| using WinFormControl; | |||
| namespace ButcherFactory.SegmentSaleOut_ | |||
| { | |||
| public partial class DiscontSetDialog : Form | |||
| { | |||
| public string disCont = string.Empty; | |||
| SegmentSaleOutFormConfig config; | |||
| List<Label> lbls; | |||
| public DiscontSetDialog() | |||
| { | |||
| InitializeComponent(); | |||
| config = XmlUtil.DeserializeFromFile<SegmentSaleOutFormConfig>(); | |||
| disCont = config.DiscontWeight; | |||
| lbls = new List<Label> { lbl1, lbl2, lbl3, lbl4 }; | |||
| } | |||
| protected override void OnLoad(EventArgs e) | |||
| { | |||
| base.OnLoad(e); | |||
| var arr = config.DiscontWeight.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(x => decimal.Parse(x)).OrderByDescending(x => x); | |||
| var idx = 0; | |||
| foreach (var item in arr) | |||
| { | |||
| lbls[idx].Text = item.ToString("#0.##"); | |||
| idx++; | |||
| if (idx == 4) | |||
| break; | |||
| } | |||
| } | |||
| private void lbl1_Click(object sender, EventArgs e) | |||
| { | |||
| var keyBoard = new NumberPad(); | |||
| if (keyBoard.ShowDialog() == true) | |||
| (sender as Label).Text = keyBoard.Result; | |||
| } | |||
| private void okBtn_Click(object sender, EventArgs e) | |||
| { | |||
| List<decimal> arr = new List<decimal>(); | |||
| foreach (var item in lbls) | |||
| { | |||
| if (!string.IsNullOrEmpty(item.Text)) | |||
| arr.Add(decimal.Parse(item.Text)); | |||
| } | |||
| disCont = string.Join(",", arr.Distinct().OrderBy(x => x)); | |||
| if (config.DiscontWeight != disCont) | |||
| { | |||
| config.DiscontWeight = disCont; | |||
| XmlUtil.SerializerObjToFile(config); | |||
| DialogResult = DialogResult.OK; | |||
| } | |||
| else | |||
| DialogResult = DialogResult.Cancel; | |||
| } | |||
| } | |||
| } | |||
| @ -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,440 @@ | |||
| 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.Tasks; | |||
| using System.Windows.Forms; | |||
| using WinFormControl; | |||
| namespace ButcherFactory.SegmentSaleOut_ | |||
| { | |||
| public partial class SegmentSaleOutForm : FormTemplate, IWithRoleForm | |||
| { | |||
| #region IWithRoleForm | |||
| public List<short> RoleName | |||
| { | |||
| get { return new List<short> { (short)设备类别.销售发货 }; } | |||
| } | |||
| public Form Generate() | |||
| { | |||
| return this; | |||
| } | |||
| #endregion | |||
| BindingList<SaleOutStore> saleOutStoreList; | |||
| BindingList<SaleOutStore_Detail> details; | |||
| BindingList<SegmentSaleOut_Detail> weightRecord; | |||
| string strDiscontWeight = ""; | |||
| internal DateTime sendTime = DateTime.Today; | |||
| internal long? deliverGoodsLineID; | |||
| internal long? customerID; | |||
| internal int billState; | |||
| internal long? storeID; | |||
| long? batchID; | |||
| bool already = false; | |||
| decimal? discont = null; | |||
| public SegmentSaleOutForm() | |||
| { | |||
| InitializeComponent(); | |||
| uScanPanel1.AfterScan += uScanPanel1_AfterScan; | |||
| productBatchSelect.SelectedIndexChanged += delegate | |||
| { | |||
| if (productBatchSelect.SelectedValue == null) | |||
| batchID = null; | |||
| else | |||
| batchID = (long)productBatchSelect.SelectedValue; | |||
| }; | |||
| } | |||
| protected override void OnLoad(EventArgs e) | |||
| { | |||
| base.OnLoad(e); | |||
| billState = 0; | |||
| billStateBox.Text = "未审核"; | |||
| sendDateBox.Text = sendTime.ToString("yyyy-MM-dd"); | |||
| var config = XmlUtil.DeserializeFromFile<SegmentSaleOutFormConfig>(); | |||
| if (config.Store_ID.HasValue) | |||
| { | |||
| storeBox.Text = config.Store_Name; | |||
| storeID = config.Store_ID; | |||
| } | |||
| if (!string.IsNullOrEmpty(config.DiscontWeight)) | |||
| strDiscontWeight = config.DiscontWeight; | |||
| BindProductBatch(); | |||
| BindDiscontBtn(); | |||
| } | |||
| private void BindProductBatch() | |||
| { | |||
| var batchs = SegmentSaleOutBL.GetBatchFromEMS(); | |||
| productBatchSelect.DisplayMember = "Name"; | |||
| productBatchSelect.ValueMember = "ID"; | |||
| productBatchSelect.DataSource = batchs; | |||
| var idx = batchs.FindIndex(x => x.Date == DateTime.Today); | |||
| if (idx > 0) | |||
| productBatchSelect.SelectedIndex = idx; | |||
| productBatchSelect.Refresh(); | |||
| } | |||
| void uScanPanel1_AfterScan() | |||
| { | |||
| var barCode = uScanPanel1.TextBox.Text.Trim(); | |||
| if (string.IsNullOrEmpty(barCode)) | |||
| throw new Exception("条码错误"); | |||
| if (already) | |||
| throw new Exception("正在查看已配货记录,不允许配货"); | |||
| if (detailGridView.CurrentRow == null) | |||
| throw new Exception("没有订货明细"); | |||
| if (weightRecord.Any(x => x.BarCode == barCode)) | |||
| return; | |||
| InsertDetailByScan(barCode); | |||
| WinFormControl.SoundPalyUtil.PlaySound(WinFormControl.SoundType.Click); | |||
| } | |||
| void InsertDetailByScan(string barCode) | |||
| { | |||
| var orderDetail = detailGridView.CurrentRow.DataBoundItem as SaleOutStore_Detail; | |||
| var detail = new SegmentSaleOut_Detail(); | |||
| detail.BarCode = barCode; | |||
| if (weightRecord.Any()) | |||
| detail.Idx = weightRecord.Max(x => x.Idx) + 1; | |||
| else | |||
| detail.Idx = 1; | |||
| SegmentSaleOutBL.InsertByCode(orderDetail, detail); | |||
| weightRecord.Insert(0, detail); | |||
| weightRecordGridView.FirstDisplayedScrollingRowIndex = 0; | |||
| weightRecordGridView.Refresh(); | |||
| BindDetailByLocal(orderDetail.ID); | |||
| } | |||
| private void queryControl_MouseDown(object sender, MouseEventArgs e) | |||
| { | |||
| var simpleLbl = sender as Label; | |||
| switch (simpleLbl.Name) | |||
| { | |||
| case "sendDateBox": | |||
| var cs = new CalendarSelecter(); | |||
| if (cs.ShowDialog() == true) | |||
| { | |||
| sendTime = cs.Result; | |||
| sendDateBox.Text = sendTime.ToString("yyyy-MM-dd"); | |||
| } | |||
| break; | |||
| case "deliverGoodsLineBox": | |||
| var dgl = new SelectDeliverGoodsLineDialog(); | |||
| if (dgl.ShowDialog() == DialogResult.OK) | |||
| { | |||
| simpleLbl.Text = dgl.Result.Item1; | |||
| deliverGoodsLineID = dgl.Result.Item2; | |||
| } | |||
| break; | |||
| case "customerBox": | |||
| var cb = new SelectCustomerDialog(); | |||
| if (cb.ShowDialog() == DialogResult.OK) | |||
| { | |||
| simpleLbl.Text = cb.Result.Item1; | |||
| customerID = cb.Result.Item2; | |||
| } | |||
| break; | |||
| case "billStateBox": | |||
| var bs = new SelectBillStateDialog(); | |||
| if (bs.ShowDialog() == DialogResult.OK) | |||
| { | |||
| simpleLbl.Text = bs.Result.Item1; | |||
| billState = bs.Result.Item2; | |||
| } | |||
| break; | |||
| case "storeBox": | |||
| var sb = new SelectStoreDialog(); | |||
| if (sb.ShowDialog() == DialogResult.OK) | |||
| { | |||
| simpleLbl.Text = sb.Result.Item1; | |||
| storeID = sb.Result.Item2; | |||
| XmlUtil.SerializerObjToFile(new SegmentSaleOutFormConfig { DiscontWeight = strDiscontWeight, Store_ID = storeID, Store_Name = simpleLbl.Text }); | |||
| } | |||
| break; | |||
| } | |||
| } | |||
| private void refreshBtn_Click(object sender, EventArgs e) | |||
| { | |||
| already = false; | |||
| Refersh(); | |||
| } | |||
| private void clearBtn_Click(object sender, EventArgs e) | |||
| { | |||
| billState = 0; | |||
| billStateBox.Text = "未审核"; | |||
| sendTime = DateTime.Today; | |||
| sendDateBox.Text = sendTime.ToString("yyyy-MM-dd"); | |||
| deliverGoodsLineBox.Text = string.Empty; | |||
| deliverGoodsLineID = null; | |||
| customerBox.Text = string.Empty; | |||
| customerID = null; | |||
| storeBox.Text = string.Empty; | |||
| storeID = null; | |||
| } | |||
| private void alreadyViewBtn_Click(object sender, EventArgs e) | |||
| { | |||
| already = true; | |||
| Refersh(); | |||
| } | |||
| void Refersh() | |||
| { | |||
| goodsFinishBtn.Enabled = !already; | |||
| unFinishBtn.Enabled = already; | |||
| deleteBtn.Enabled = !already; | |||
| readBtn.Enabled = !already; | |||
| saleOutStoreList = SegmentSaleOutBL.GetSaleOutStoreList(sendTime, deliverGoodsLineID, customerID, billState, storeID, already); | |||
| orderGridView.DataSource = saleOutStoreList; | |||
| orderGridView.Refresh(); | |||
| BindLabels(saleOutStoreList.FirstOrDefault() ?? new SaleOutStore()); | |||
| BindDetailGrid(); | |||
| } | |||
| private void weightRecordBtn_Click(object sender, EventArgs e) | |||
| { | |||
| if (detailGridView.CurrentRow == null) | |||
| throw new Exception("请选择配货明细"); | |||
| var detail = detailGridView.CurrentRow.DataBoundItem as SaleOutStore_Detail; | |||
| var dg = new SegmentSaleOut_.WeightRecordDialog(details.First(x => x.ID == detail.ID), already, batchID); | |||
| dg.ShowDialog(); | |||
| if (dg.Changed) | |||
| { | |||
| weightRecord = SegmentSaleOutBL.GetWeightRecord(detail.ID); | |||
| weightRecordGridView.DataSource = weightRecord; | |||
| weightRecordGridView.Refresh(); | |||
| BindDetailByLocal(detail.ID); | |||
| } | |||
| } | |||
| private void goodsFinishBtn_Click(object sender, EventArgs e) | |||
| { | |||
| if (orderGridView.CurrentRow == null) | |||
| throw new Exception("请选择要配货完成的发货单"); | |||
| var id = (long)orderGridView.CurrentRow.Cells[0].Value; | |||
| var ds = SegmentSaleOutBL.GetSaleOutStoreDetailList(id); | |||
| if (ds.Any(x => x.SNumber == null || x.SNumber == 0)) | |||
| { | |||
| if (MessageBox.Show("有未配货的明细,确认配货完成?", "配货完成确认", MessageBoxButtons.OKCancel) != DialogResult.OK) | |||
| return; | |||
| } | |||
| SegmentSaleOutBL.SetGoodsFinish(id); | |||
| AfterChangeFinishGoods(id); | |||
| MessageBox.Show("配货完成!"); | |||
| } | |||
| private void unFinishBtn_Click(object sender, EventArgs e) | |||
| { | |||
| if (orderGridView.CurrentRow == null) | |||
| throw new Exception("请选择要撤销完毕的发货单"); | |||
| var id = (long)orderGridView.CurrentRow.Cells[0].Value; | |||
| SegmentSaleOutBL.SetGoodsUnFinish(id); | |||
| AfterChangeFinishGoods(id); | |||
| MessageBox.Show("撤销成功!"); | |||
| } | |||
| private void AfterChangeFinishGoods(long id) | |||
| { | |||
| saleOutStoreList.Remove(saleOutStoreList.First(x => x.ID == id)); | |||
| orderGridView.Refresh(); | |||
| details = new BindingList<SaleOutStore_Detail>(); | |||
| detailGridView.DataSource = details; | |||
| detailGridView.Refresh(); | |||
| weightRecord = new BindingList<SegmentSaleOut_Detail>(); | |||
| weightRecordGridView.DataSource = weightRecord; | |||
| weightRecordGridView.Refresh(); | |||
| BindLabels(new SaleOutStore()); | |||
| } | |||
| private void deleteBtn_Click(object sender, EventArgs e) | |||
| { | |||
| if (weightRecordGridView.CurrentRow == null) | |||
| return; | |||
| var id = (long)weightRecordGridView.CurrentRow.Cells[0].Value; | |||
| var tag = weightRecord.First(x => x.ID == id); | |||
| SegmentSaleOutBL.DeleteAndUpdate(tag); | |||
| weightRecord.Remove(tag); | |||
| foreach (var item in weightRecord.Where(x => x.Idx > tag.Idx)) | |||
| item.Idx -= 1; | |||
| weightRecordGridView.Refresh(); | |||
| BindDetailByLocal(tag.DetailID.Value); | |||
| } | |||
| private void readBtn_Click(object sender, EventArgs e) | |||
| { | |||
| if (weightControl1.Weight == 0) | |||
| return; | |||
| if (already) | |||
| throw new Exception("正在查看已配货记录,不允许配货"); | |||
| if (detailGridView.CurrentRow == null) | |||
| throw new Exception("没有订货明细"); | |||
| var weight = weightControl1.Weight - (discont ?? 0); | |||
| if (weight <= 0) | |||
| throw new Exception(string.Format("扣重后重量为{0:#0.##}", weight)); | |||
| InsertDetailByReadWeight(weight); | |||
| } | |||
| private void InsertDetailByReadWeight(decimal weight) | |||
| { | |||
| var orderDetail = detailGridView.CurrentRow.DataBoundItem as SaleOutStore_Detail; | |||
| var detail = new SegmentSaleOut_Detail(); | |||
| detail.Number = weight; | |||
| detail.DiscontWeight = discont; | |||
| if (weightRecord.Any()) | |||
| detail.Idx = weightRecord.Max(x => x.Idx) + 1; | |||
| else | |||
| detail.Idx = 1; | |||
| SegmentSaleOutBL.InsertReadWeight(orderDetail, detail); | |||
| weightRecord.Insert(0, detail); | |||
| weightRecordGridView.FirstDisplayedScrollingRowIndex = 0; | |||
| weightRecordGridView.Refresh(); | |||
| BindDetailByLocal(orderDetail.ID); | |||
| } | |||
| private void orderGridView_CellClick(object sender, DataGridViewCellEventArgs e) | |||
| { | |||
| if (orderGridView.CurrentRow == null) | |||
| return; | |||
| BindLabels(orderGridView.CurrentRow.DataBoundItem as SaleOutStore); | |||
| BindDetailGrid(); | |||
| } | |||
| private void detailGridView_CellClick(object sender, DataGridViewCellEventArgs e) | |||
| { | |||
| BindWeightRecord(); | |||
| } | |||
| void BindDetailGrid() | |||
| { | |||
| var row = orderGridView.CurrentRow; | |||
| if (row == null) | |||
| details = new BindingList<SaleOutStore_Detail>(); | |||
| else | |||
| { | |||
| var id = long.Parse(billIDLabel.Text); | |||
| details = SegmentSaleOutBL.GetSaleOutStoreDetailList(id); | |||
| foreach (var item in details) | |||
| { | |||
| item.SaleOutStore_ID = id; | |||
| item.Customer_Name = customerLabel.Text; | |||
| } | |||
| } | |||
| detailGridView.DataSource = details; | |||
| detailGridView.Refresh(); | |||
| BindWeightRecord(); | |||
| } | |||
| void BindWeightRecord() | |||
| { | |||
| var row = detailGridView.CurrentRow; | |||
| if (row == null) | |||
| weightRecord = new BindingList<SegmentSaleOut_Detail>(); | |||
| else | |||
| weightRecord = SegmentSaleOutBL.GetWeightRecord((long)row.Cells["D_ID"].Value); | |||
| weightRecordGridView.DataSource = weightRecord; | |||
| weightRecordGridView.Refresh(); | |||
| } | |||
| void BindDetailByLocal(long detailID) | |||
| { | |||
| var first = details.First(x => x.ID == detailID); | |||
| first.SNumber = weightRecord.Sum(x => x.Number); | |||
| first.SSecondNumber = weightRecord.Sum(x => x.SecondNumber ?? 0); | |||
| foreach (DataGridViewRow row in detailGridView.Rows) | |||
| { | |||
| if ((long)row.Cells[0].Value == detailID) | |||
| { | |||
| row.Selected = true; | |||
| break; | |||
| } | |||
| } | |||
| detailGridView.Refresh(); | |||
| } | |||
| void BindLabels(SaleOutStore entity) | |||
| { | |||
| billIDLabel.Text = entity.ID == 0 ? "" : entity.ID.ToString(); | |||
| customerLabel.Text = entity.Customer_Name; | |||
| addressLabel.Text = entity.Address; | |||
| carNumberLabel.Text = entity.CarNumber; | |||
| } | |||
| private void detailGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) | |||
| { | |||
| DataGridViewRow dgrSingle = detailGridView.Rows[e.RowIndex]; | |||
| var v = (decimal?)dgrSingle.Cells["D_SNumber"].Value; | |||
| if (v.HasValue && v > 0) | |||
| { | |||
| dgrSingle.DefaultCellStyle.BackColor = Color.YellowGreen; | |||
| } | |||
| } | |||
| Color btnColor = Color.FromArgb(10, 106, 201); | |||
| Color selectedColor = Color.FromArgb(255, 0, 25); | |||
| void BindDiscontBtn() | |||
| { | |||
| var arr = strDiscontWeight.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(x => decimal.Parse(x)).OrderBy(x => x); | |||
| flowLayoutPanel1.Controls.Clear(); | |||
| foreach (var v in arr) | |||
| { | |||
| var btn = new ColorButton { Width = 84, Height = 35, BackColor = btnColor, SelectedColor = selectedColor, EnableGroup = true, Margin = new Padding(10, 5, 10, 5), Text = v.ToString("#0.##"), Font = new Font("黑体", 12) }; | |||
| btn.Click += delegate { discont = v; disContLbl.Text = discont.Value.ToString("#0.##"); }; | |||
| flowLayoutPanel1.Controls.Add(btn); | |||
| } | |||
| } | |||
| private void discontSetBtn_Click(object sender, EventArgs e) | |||
| { | |||
| var dialog = new DiscontSetDialog(); | |||
| if (dialog.ShowDialog() == DialogResult.OK) | |||
| { | |||
| strDiscontWeight = dialog.disCont; | |||
| BindDiscontBtn(); | |||
| } | |||
| } | |||
| private void disContLbl_Click(object sender, EventArgs e) | |||
| { | |||
| var keyBoard = new NumberPad(); | |||
| if (keyBoard.ShowDialog() == true) | |||
| { | |||
| discont = decimal.Parse(keyBoard.Result); | |||
| disContLbl.Text = discont.Value.ToString("#0.##"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,189 @@ | |||
| <?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="F_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Idx.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_BarCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_GoodsCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Goods_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_SecondNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_DiscontWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Time.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_SaleOutStore_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_Customer_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_Goods_Code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_Goods_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_SecondNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_SSecondNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_SNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_DiffNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="M_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="M_Customer_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="M_SendTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="M_DeliverGoodsLine_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| </root> | |||
| @ -0,0 +1,17 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace ButcherFactory.SegmentSaleOut_ | |||
| { | |||
| public class SegmentSaleOutFormConfig | |||
| { | |||
| public long? Store_ID { get; set; } | |||
| public string Store_Name { get; set; } | |||
| public string DiscontWeight { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,274 @@ | |||
| namespace ButcherFactory.SegmentSaleOut_ | |||
| { | |||
| partial class WeightRecordDialog | |||
| { | |||
| /// <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 dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| this.panel1 = new System.Windows.Forms.Panel(); | |||
| this.closeBtn = new ButcherFactory.Controls.ColorButton(); | |||
| this.deleteBtn = new ButcherFactory.Controls.ColorButton(); | |||
| this.addBtn = new ButcherFactory.Controls.ColorButton(); | |||
| this.uDataGridView1 = new WinFormControl.UDataGridView(); | |||
| this.R_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_Idx = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_Goods_Code = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_DiscontWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_Operator = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.panel1.SuspendLayout(); | |||
| ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).BeginInit(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // panel1 | |||
| // | |||
| this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | |||
| | System.Windows.Forms.AnchorStyles.Right))); | |||
| this.panel1.Controls.Add(this.closeBtn); | |||
| this.panel1.Controls.Add(this.deleteBtn); | |||
| this.panel1.Controls.Add(this.addBtn); | |||
| this.panel1.Location = new System.Drawing.Point(185, 461); | |||
| this.panel1.Name = "panel1"; | |||
| this.panel1.Size = new System.Drawing.Size(744, 52); | |||
| this.panel1.TabIndex = 4; | |||
| // | |||
| // closeBtn | |||
| // | |||
| this.closeBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); | |||
| this.closeBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||
| this.closeBtn.ForeColor = System.Drawing.Color.White; | |||
| this.closeBtn.Location = new System.Drawing.Point(537, 5); | |||
| 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(117, 43); | |||
| this.closeBtn.TabIndex = 3; | |||
| this.closeBtn.Text = "关闭"; | |||
| this.closeBtn.UseVisualStyleBackColor = false; | |||
| this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click); | |||
| // | |||
| // deleteBtn | |||
| // | |||
| this.deleteBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25))))); | |||
| this.deleteBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||
| this.deleteBtn.ForeColor = System.Drawing.Color.White; | |||
| this.deleteBtn.Location = new System.Drawing.Point(328, 5); | |||
| this.deleteBtn.Name = "deleteBtn"; | |||
| this.deleteBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); | |||
| this.deleteBtn.Size = new System.Drawing.Size(117, 43); | |||
| this.deleteBtn.TabIndex = 5; | |||
| this.deleteBtn.Text = "删除且更新"; | |||
| this.deleteBtn.UseVisualStyleBackColor = false; | |||
| this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); | |||
| // | |||
| // addBtn | |||
| // | |||
| this.addBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(198)))), ((int)(((byte)(58))))); | |||
| this.addBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||
| this.addBtn.ForeColor = System.Drawing.Color.White; | |||
| this.addBtn.Location = new System.Drawing.Point(128, 5); | |||
| this.addBtn.Name = "addBtn"; | |||
| this.addBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); | |||
| this.addBtn.Size = new System.Drawing.Size(117, 43); | |||
| this.addBtn.TabIndex = 3; | |||
| this.addBtn.Text = "新增"; | |||
| this.addBtn.UseVisualStyleBackColor = false; | |||
| this.addBtn.Click += new System.EventHandler(this.addBtn_Click); | |||
| // | |||
| // uDataGridView1 | |||
| // | |||
| this.uDataGridView1.AllowUserToAddRows = false; | |||
| this.uDataGridView1.AllowUserToDeleteRows = false; | |||
| this.uDataGridView1.AllowUserToResizeColumns = false; | |||
| this.uDataGridView1.AllowUserToResizeRows = false; | |||
| dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); | |||
| this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; | |||
| this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | |||
| | System.Windows.Forms.AnchorStyles.Left) | |||
| | System.Windows.Forms.AnchorStyles.Right))); | |||
| this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; | |||
| this.uDataGridView1.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.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; | |||
| this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; | |||
| this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { | |||
| this.R_ID, | |||
| this.R_Idx, | |||
| this.R_BarCode, | |||
| this.R_Goods_Code, | |||
| this.R_Goods_Name, | |||
| this.R_SecondNumber, | |||
| this.R_Number, | |||
| this.R_DiscontWeight, | |||
| this.R_Operator, | |||
| this.R_Time}); | |||
| this.uDataGridView1.Location = new System.Drawing.Point(12, 15); | |||
| this.uDataGridView1.MultiSelect = false; | |||
| this.uDataGridView1.Name = "uDataGridView1"; | |||
| this.uDataGridView1.ReadOnly = true; | |||
| this.uDataGridView1.RowHeadersVisible = false; | |||
| dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||
| dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); | |||
| this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle6; | |||
| this.uDataGridView1.RowTemplate.Height = 40; | |||
| this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; | |||
| this.uDataGridView1.Size = new System.Drawing.Size(1045, 434); | |||
| this.uDataGridView1.TabIndex = 3; | |||
| // | |||
| // R_ID | |||
| // | |||
| this.R_ID.DataPropertyName = "ID"; | |||
| this.R_ID.HeaderText = "ID"; | |||
| this.R_ID.Name = "R_ID"; | |||
| this.R_ID.ReadOnly = true; | |||
| this.R_ID.Visible = false; | |||
| // | |||
| // R_Idx | |||
| // | |||
| this.R_Idx.DataPropertyName = "Idx"; | |||
| this.R_Idx.HeaderText = "序号"; | |||
| this.R_Idx.Name = "R_Idx"; | |||
| this.R_Idx.ReadOnly = true; | |||
| this.R_Idx.Width = 75; | |||
| // | |||
| // R_BarCode | |||
| // | |||
| this.R_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.R_BarCode.DataPropertyName = "ShortCode"; | |||
| this.R_BarCode.HeaderText = "存货条码"; | |||
| this.R_BarCode.MinimumWidth = 100; | |||
| this.R_BarCode.Name = "R_BarCode"; | |||
| this.R_BarCode.ReadOnly = true; | |||
| // | |||
| // R_Goods_Code | |||
| // | |||
| this.R_Goods_Code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.R_Goods_Code.DataPropertyName = "Goods_Code"; | |||
| this.R_Goods_Code.HeaderText = "产品编码"; | |||
| this.R_Goods_Code.Name = "R_Goods_Code"; | |||
| this.R_Goods_Code.ReadOnly = true; | |||
| // | |||
| // R_Goods_Name | |||
| // | |||
| this.R_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.R_Goods_Name.DataPropertyName = "Goods_Name"; | |||
| this.R_Goods_Name.HeaderText = "产品名称"; | |||
| this.R_Goods_Name.MinimumWidth = 100; | |||
| this.R_Goods_Name.Name = "R_Goods_Name"; | |||
| this.R_Goods_Name.ReadOnly = true; | |||
| // | |||
| // R_SecondNumber | |||
| // | |||
| this.R_SecondNumber.DataPropertyName = "SecondNumber"; | |||
| dataGridViewCellStyle3.Format = "#0.######"; | |||
| this.R_SecondNumber.DefaultCellStyle = dataGridViewCellStyle3; | |||
| this.R_SecondNumber.HeaderText = "辅数量"; | |||
| this.R_SecondNumber.Name = "R_SecondNumber"; | |||
| this.R_SecondNumber.ReadOnly = true; | |||
| // | |||
| // R_Number | |||
| // | |||
| this.R_Number.DataPropertyName = "Number"; | |||
| dataGridViewCellStyle4.Format = "#0.######"; | |||
| this.R_Number.DefaultCellStyle = dataGridViewCellStyle4; | |||
| this.R_Number.HeaderText = "报价数量"; | |||
| this.R_Number.Name = "R_Number"; | |||
| this.R_Number.ReadOnly = true; | |||
| // | |||
| // R_DiscontWeight | |||
| // | |||
| this.R_DiscontWeight.DataPropertyName = "DiscontWeight"; | |||
| dataGridViewCellStyle5.Format = "#0.######"; | |||
| this.R_DiscontWeight.DefaultCellStyle = dataGridViewCellStyle5; | |||
| this.R_DiscontWeight.HeaderText = "扣重"; | |||
| this.R_DiscontWeight.Name = "R_DiscontWeight"; | |||
| this.R_DiscontWeight.ReadOnly = true; | |||
| // | |||
| // R_Operator | |||
| // | |||
| this.R_Operator.DataPropertyName = "Operator"; | |||
| this.R_Operator.HeaderText = "操作员"; | |||
| this.R_Operator.Name = "R_Operator"; | |||
| this.R_Operator.ReadOnly = true; | |||
| this.R_Operator.Width = 150; | |||
| // | |||
| // R_Time | |||
| // | |||
| this.R_Time.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.R_Time.DataPropertyName = "Time"; | |||
| this.R_Time.HeaderText = "时间"; | |||
| this.R_Time.MinimumWidth = 120; | |||
| this.R_Time.Name = "R_Time"; | |||
| this.R_Time.ReadOnly = true; | |||
| // | |||
| // WeightRecordDialog | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.BackColor = System.Drawing.Color.White; | |||
| this.ClientSize = new System.Drawing.Size(1069, 528); | |||
| this.Controls.Add(this.panel1); | |||
| this.Controls.Add(this.uDataGridView1); | |||
| this.Name = "WeightRecordDialog"; | |||
| this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; | |||
| this.Text = "称重记录"; | |||
| this.panel1.ResumeLayout(false); | |||
| ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).EndInit(); | |||
| this.ResumeLayout(false); | |||
| } | |||
| #endregion | |||
| private System.Windows.Forms.Panel panel1; | |||
| private Controls.ColorButton closeBtn; | |||
| private Controls.ColorButton deleteBtn; | |||
| private Controls.ColorButton addBtn; | |||
| private WinFormControl.UDataGridView uDataGridView1; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_ID; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_Idx; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_BarCode; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_Goods_Code; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_Goods_Name; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_SecondNumber; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_Number; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_DiscontWeight; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_Operator; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_Time; | |||
| } | |||
| } | |||
| @ -0,0 +1,122 @@ | |||
| using ButcherFactory.BO; | |||
| using ButcherFactory.BO.LocalBL; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.ComponentModel; | |||
| using System.Data; | |||
| using System.Drawing; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using System.Windows.Forms; | |||
| namespace ButcherFactory.SegmentSaleOut_ | |||
| { | |||
| public partial class WeightRecordDialog : Form | |||
| { | |||
| BindingList<SegmentSaleOut_Detail> list; | |||
| SaleOutStore_Detail mDetail; | |||
| long? mBatchID = null; | |||
| public bool Changed = false; | |||
| public WeightRecordDialog(SaleOutStore_Detail detail, bool readOnly, long? batchID) | |||
| { | |||
| InitializeComponent(); | |||
| mDetail = detail; | |||
| mBatchID = batchID; | |||
| if (readOnly) | |||
| { | |||
| addBtn.Enabled = false; | |||
| deleteBtn.Enabled = false; | |||
| } | |||
| uDataGridView1.BorderStyle = BorderStyle.FixedSingle; | |||
| BindGrid(); | |||
| uDataGridView1.RowPrePaint += uDataGridView1_RowPrePaint; | |||
| uDataGridView1.CellPainting += uDataGridView1_CellPainting; | |||
| } | |||
| void uDataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) | |||
| { | |||
| var last = uDataGridView1.Rows.Count - 1; | |||
| if (e.RowIndex == last) | |||
| { | |||
| if (e.ColumnIndex == 2) | |||
| { | |||
| e.PaintBackground(e.ClipBounds, false); | |||
| e.Handled = true; | |||
| } | |||
| else if (e.ColumnIndex == 3) | |||
| { | |||
| using (Brush foreColor = new SolidBrush(e.CellStyle.ForeColor)) | |||
| { | |||
| e.PaintBackground(e.ClipBounds, false); | |||
| StringFormat drawFormat = new StringFormat(); | |||
| drawFormat.LineAlignment = StringAlignment.Center; | |||
| drawFormat.Alignment = System.Drawing.StringAlignment.Center; | |||
| e.Graphics.DrawString("合计", e.CellStyle.Font, foreColor, e.CellBounds, drawFormat); | |||
| e.Handled = true; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| void uDataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) | |||
| { | |||
| if (e.RowIndex == uDataGridView1.Rows.Count - 1) | |||
| { | |||
| var row = uDataGridView1.Rows[e.RowIndex]; | |||
| row.DefaultCellStyle.SelectionForeColor = Color.Black; | |||
| row.DefaultCellStyle.BackColor = Color.Khaki; | |||
| row.DefaultCellStyle.SelectionBackColor = Color.Khaki; | |||
| } | |||
| } | |||
| void BindGrid() | |||
| { | |||
| list = SegmentSaleOutBL.GetWeightRecord(mDetail.ID); | |||
| var total = new SegmentSaleOut_Detail(); | |||
| total.Number = list.Sum(x => x.Number); | |||
| total.SecondNumber = list.Sum(x => x.SecondNumber); | |||
| list.Add(total); | |||
| uDataGridView1.DataSource = list; | |||
| ReBuildTotalRow(); | |||
| uDataGridView1.Refresh(); | |||
| } | |||
| private void ReBuildTotalRow() | |||
| { | |||
| var row = uDataGridView1.Rows[list.Count - 1]; | |||
| row.Cells["R_Time"].Value = null; | |||
| } | |||
| private void addBtn_Click(object sender, EventArgs e) | |||
| { | |||
| if (new AddWeightRecord(mDetail, mBatchID).ShowDialog() == DialogResult.OK) | |||
| { | |||
| BindGrid(); | |||
| Changed = true; | |||
| } | |||
| } | |||
| private void deleteBtn_Click(object sender, EventArgs e) | |||
| { | |||
| if (uDataGridView1.CurrentRow == null) | |||
| return; | |||
| var id = (long)uDataGridView1.CurrentRow.Cells[0].Value; | |||
| if (id == 0) | |||
| return; | |||
| var tag = list.First(x => x.ID == id); | |||
| SegmentSaleOutBL.DeleteAndUpdate(tag); | |||
| BindGrid(); | |||
| Changed = true; | |||
| } | |||
| private void closeBtn_Click(object sender, EventArgs e) | |||
| { | |||
| Close(); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,150 @@ | |||
| <?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="R_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_Idx.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_BarCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_Goods_Code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_Goods_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_SecondNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_DiscontWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_Operator.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_Time.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| </root> | |||