diff --git a/ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs b/ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs index ee2169a..3bab51d 100644 --- a/ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs +++ b/ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs @@ -85,6 +85,9 @@ namespace ButcherFactory.BO public long? ScanRecord_ID { get; set; } public string Operator { get; set; } + + [DbColumn(DefaultValue = false)] + public bool IsBack { get; set; } } public class SaleOutStore diff --git a/ButcherFactory.BO/Bill/SegmentInStore.cs b/ButcherFactory.BO/Bill/SegmentInStore.cs index 954f40f..27c5b0a 100644 --- a/ButcherFactory.BO/Bill/SegmentInStore.cs +++ b/ButcherFactory.BO/Bill/SegmentInStore.cs @@ -52,13 +52,16 @@ namespace ButcherFactory.BO //1 正在退库 //2 已退库 public int State { get; set; } + + [NonDmoProperty]//同步未入库信息时用于增量查询 + public long? SID { get; set; } } [MapToTable("Butcher_SegmentCodeError")] [KeyField("ID", KeyGenType.identity)] public class SegmentCodeError { - public long ID { get; set; } + public long ID { get; set; } public string BarCode { get; set; } diff --git a/ButcherFactory.BO/Bill/StockUpEntity.cs b/ButcherFactory.BO/Bill/StockUpEntity.cs index 3faaebc..c3cb81d 100644 --- a/ButcherFactory.BO/Bill/StockUpEntity.cs +++ b/ButcherFactory.BO/Bill/StockUpEntity.cs @@ -28,9 +28,9 @@ namespace ButcherFactory.BO { get { - if (StandardPic) + //if (StandardPic) return (UnitNum ?? 0) <= (SUnitNum ?? 0); - return (SecondNumber ?? 0) <= (SSecondNumber ?? 0); + //return (SecondNumber ?? 0) <= (SSecondNumber ?? 0); } } } @@ -69,13 +69,21 @@ namespace ButcherFactory.BO } } - [NonDmoProperty] public string Goods_Name { get; set; } - [NonDmoProperty] public string DeliverGoodsLine_Name { get; set; } [NonDmoProperty] public long BillID { get; set; } } + + public class AlreadyStockUp + { + public int State { get; set; } + public long DetailID { get; set; } + public long MaxID { get; set; } + //public bool StandardPic { get; set; } + public decimal? UnitNum { get; set; } + public decimal? SecondNumber { get; set; } + } } diff --git a/ButcherFactory.BO/Enums/DriveType.cs b/ButcherFactory.BO/Enums/DriveType.cs index d027e0a..e1ded43 100644 --- a/ButcherFactory.BO/Enums/DriveType.cs +++ b/ButcherFactory.BO/Enums/DriveType.cs @@ -18,6 +18,7 @@ namespace ButcherFactory.BO 白条发货 = 51, 销售备货 = 52, 销售发货 = 53, + 白条静态称发货 = 54, //101-200是留给屠宰车间使用 diff --git a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs index 5bf55c9..1a737ff 100644 --- a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs @@ -74,6 +74,7 @@ namespace ButcherFactory.BO.LocalBL var query = new DQueryDom(new JoinAlias(typeof(CarcassSaleOut_Detail))); query.Where.Conditions.Add(DQCondition.EQ("BarCode", barCode)); query.Columns.Add(DQSelectColumn.Create(DQExpression.Value(1), "c")); + query.Having.Conditions.Add(DQCondition.EQ(DQExpression.Sum(DQExpression.LogicCase(DQCondition.EQ("IsBack", true), DQExpression.Value(-1), DQExpression.Value(1))), DQExpression.Value(0))); return query.EExecuteScalar() != null; } @@ -116,18 +117,22 @@ namespace ButcherFactory.BO.LocalBL } else { - var json = ButcherFactoryUtil.SecondUrlCall(MESPath + "CarcassSaleOutStoreRpc/GetCarcassInstoreInfo", barCode); - var mesInfo = JsonConvert.DeserializeObject(json); - if (!string.IsNullOrEmpty(mesInfo.Goods_Code)) + try { - if (mesInfo.Goods_Code == "X002")//特殊处理,有个存货编码不存在。 - mesInfo.Goods_Code = "0001"; - var gInfo = GetGoodsInfo(mesInfo.Goods_Code); - first.Goods_Code = mesInfo.Goods_Code; - first.InStoreWeight = mesInfo.InStoreWeight; - first.Goods_ID = gInfo.Item1; - first.Goods_Name = gInfo.Item2; + var json = ButcherFactoryUtil.SecondUrlCall(MESPath + "CarcassSaleOutStoreRpc/GetCarcassInstoreInfo", barCode); + var mesInfo = JsonConvert.DeserializeObject(json); + if (!string.IsNullOrEmpty(mesInfo.Goods_Code)) + { + if (mesInfo.Goods_Code == "X002")//特殊处理,有个存货编码不存在。 + mesInfo.Goods_Code = "0001"; + var gInfo = GetGoodsInfo(mesInfo.Goods_Code); + first.Goods_Code = mesInfo.Goods_Code; + first.InStoreWeight = mesInfo.InStoreWeight; + first.Goods_ID = gInfo.Item1; + first.Goods_Name = gInfo.Item2; + } } + catch { }; first.BarCode = barCode; list.Add(new Tuple("BarCode", first.BarCode)); list.Add(new Tuple("InStoreWeight", first.InStoreWeight)); @@ -312,6 +317,99 @@ namespace ButcherFactory.BO.LocalBL } return new BindingList(list); } + + #region 静态称发货 + + //插入包括条码的记录 条码、批次、数量为1 、重量为0 Fill为否 + public static CarcassSaleOut_Detail ReadBarCode(string barCode, long? batchID, bool isBack) + { + using (var session = DmoSession.New()) + { + var detail = new CarcassSaleOut_Detail(); + if (barCode.StartsWith("G")) + { + var arr = barCode.TrimStart('G').Split(new char[] { '&' }, StringSplitOptions.RemoveEmptyEntries); + + var gid = long.Parse(arr[0]); + var gInfo = GetGoodsInfo(gid); + detail.Goods_ID = gid; + detail.Goods_Name = gInfo.Item1; + detail.Goods_Code = gInfo.Item2; + detail.ProductBatch_ID = batchID; + if (arr.Length == 2) + detail.Number = 0.5m; + else + detail.Number = 1; + } + else + { + var json = ButcherFactoryUtil.SecondUrlCall(MESPath + "CarcassSaleOutStoreRpc/GetCarcassInstoreInfo", barCode); + var mesInfo = JsonConvert.DeserializeObject(json); + if (!string.IsNullOrEmpty(mesInfo.Goods_Code)) + { + if (mesInfo.Goods_Code == "X002")//特殊处理,有个存货编码不存在。 + mesInfo.Goods_Code = "0001"; + var gInfo = GetGoodsInfo(mesInfo.Goods_Code); + detail.Goods_Code = mesInfo.Goods_Code; + detail.InStoreWeight = mesInfo.InStoreWeight; + detail.Goods_ID = gInfo.Item1; + detail.Goods_Name = gInfo.Item2; + detail.Number = 1; + } + detail.BarCode = barCode; + } + session.Insert(detail); + session.Commit(); + return detail; + } + } + + //为一组重量为空(或加个标识)的数据赋值重量 + public static void InsertWeight(List ids, decimal weight) + { + var last = ids.Last(); + ids.Remove(last); + using (var session = DmoSession.New()) + { + Update(session, last, new Tuple("Filled", true), new Tuple("Weight", weight)); + if (ids.Any()) + BatchUpdate(session, ids, new Tuple("Filled", true), new Tuple("Weight", 0)); + session.Commit(); + } + } + + static void BatchUpdate(IDmoSession session, IEnumerable ids, params Tuple[] pops) + { + var update = new DQUpdateDom(typeof(CarcassSaleOut_Detail)); + foreach (var item in pops) + update.Columns.Add(new DQUpdateColumn(item.Item1, item.Item2)); + update.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), ids.Select(x => DQExpression.Value(x)).ToArray())); + session.ExecuteNonQuery(update); + } + + //自动发货,包括重量,默认码。只有一条数据 + public static CarcassSaleOut_Detail AutoFill(string barCode, long? batchID, decimal weight) + { + using (var session = DmoSession.New()) + { + var detail = new CarcassSaleOut_Detail(); + + var gid = long.Parse(barCode.TrimStart('G')); + var gInfo = GetGoodsInfo(gid); + detail.Goods_ID = gid; + detail.Goods_Name = gInfo.Item1; + detail.Goods_Code = gInfo.Item2; + detail.ProductBatch_ID = batchID; + detail.Number = 1; + detail.Filled = true; + detail.Weight = weight; + session.Insert(detail); + session.Commit(); + return detail; + } + } + + #endregion } class SaleOutCarcassObj diff --git a/ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs b/ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs index 356563f..54f16e1 100644 --- a/ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs @@ -6,9 +6,9 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace ButcherFactory.BO.LocalBL { @@ -22,7 +22,6 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("ID")); query.Columns.Add(DQSelectColumn.Field("RowIndex")); query.Columns.Add(DQSelectColumn.Field("BarCode")); - query.Columns.Add(DQSelectColumn.Field("Goods_Code")); query.Columns.Add(DQSelectColumn.Field("Goods_Name")); query.Columns.Add(DQSelectColumn.Field("Goods_Spec")); query.Columns.Add(DQSelectColumn.Field("Weight")); @@ -36,7 +35,7 @@ namespace ButcherFactory.BO.LocalBL query.Where.Conditions.Add(DQCondition.EQ("State", state)); if (state == 0) query.Where.Conditions.Add(DQCondition.Between("InStoreTime", DateTime.Today, DateTime.Today + new TimeSpan(23, 59, 59))); - query.OrderBy.Expressions.Add(DQOrderByExpression.Create("RowIndex")); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create("RowIndex", true)); var list = new List(); using (var session = DmoSession.New()) { @@ -48,14 +47,13 @@ namespace ButcherFactory.BO.LocalBL entity.ID = (long)reader[0]; entity.RowIndex = (int?)reader[1]; entity.BarCode = (string)reader[2]; - entity.Goods_Code = (string)reader[3]; - entity.Goods_Name = (string)reader[4]; - entity.Goods_Spec = (string)reader[5]; - entity.Weight = (decimal?)reader[6]; + entity.Goods_Name = (string)reader[3]; + entity.Goods_Spec = (string)reader[4]; + entity.Weight = (decimal?)reader[5]; if (state == 0) - entity.InStoreTime = (DateTime)reader[7]; + entity.InStoreTime = (DateTime)reader[6]; else - entity.ProductTime = (DateTime?)reader[7]; + entity.ProductTime = (DateTime?)reader[6]; list.Add(entity); } } @@ -66,79 +64,55 @@ namespace ButcherFactory.BO.LocalBL public static BindingList GetExceptionList() { var query = new DmoQuery(typeof(SegmentCodeError)); - query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); + query.Range = SelectRange.Top(10); using (var session = DmoSession.New()) { return new BindingList(session.ExecuteList(query).Cast().ToList()); } } - public static BindingList GetUnInStoreList() + public static void InsertSegmentCodeError(SegmentCodeError entity) + { + using (var session = DmoSession.New()) + { + session.Insert(entity); + session.Commit(); + } + } + + public static List GetUnInStoreList(long? maxID = null) { try { - var json = RpcFacade.Call(RpcPath + "GetUnInStoreList"); + var json = RpcFacade.Call(RpcPath + "GetUnInStoreList", 50, maxID, "[_goods].[Name] not like '%冻%'"); var list = JsonConvert.DeserializeObject>(json); - //var inStored = GetInstoredList(list.Select(x => x.BarCode)); - // var result = list.Where(x => !inStored.Any(y => x.BarCode == y)).ToList(); var idx = 1; foreach (var item in list) { item.RowIndex = idx; idx++; } - return new BindingList(list); + return list; } catch { #if DEBUG throw; #endif - return null; + return new List(); } } - static List GetInstoredList(IEnumerable barCodes) + public static string InsertInStore(SegmentInStore entity) { - var query = new DQueryDom(new JoinAlias(typeof(SegmentInStore))); - query.Columns.Add(DQSelectColumn.Field("BarCode")); - query.Where.Conditions.Add(DQCondition.And(DQCondition.InList(DQExpression.Field("BarCode"), barCodes.Select(x => DQExpression.Value(x)).ToArray()), DQCondition.InEQ("State", -1))); using (var session = DmoSession.New()) { - return query.EExecuteList(session); - } - } - - public static SegmentInStore InsertInStore(string barCode, long? storeID, int rowIndex, out string msg) - { - using (var session = DmoSession.New()) - { - var entity = new SegmentInStore(); - entity.BarCode = barCode; - entity.Store_ID = storeID; + var localData = GetLocalData(session, entity.BarCode); entity.InStoreTime = DateTime.Now; - entity.RowIndex = rowIndex; - - var localData = GetLocalData(session, barCode); - if (localData == null) //if not exist LoadFromServer + if (localData == null) { - try - { - var json = RpcFacade.Call(RpcPath + "GetSegmentProductInfo", barCode); - var obj = JsonConvert.DeserializeObject(json); - entity.Goods_Code = obj.Goods_Code; - entity.Goods_Name = obj.Goods_Name; - entity.Goods_Spec = obj.Goods_Spec; - entity.ProductTime = obj.ProductTime; - entity.Weight = obj.Weight; - session.Insert(entity); - } - catch - { -#if DEBUG - throw; -#endif - } + session.Insert(entity); } else { @@ -149,32 +123,52 @@ namespace ButcherFactory.BO.LocalBL Update(session, entity.ID, new Tuple("Store_ID", entity.Store_ID), new Tuple("InStoreTime", entity.InStoreTime), - new Tuple("RowIndex", rowIndex), + new Tuple("RowIndex", entity.RowIndex), new Tuple("State", 0) ); + FillFromLocal(session, entity); } else { //if inStored Error 已入库 //if isBacking Error 正在退库 //if back Error 已退库 - var append = "已入库"; + var msg = "重复入库"; switch (localData.Item2) { case 1: - append = "正在退库"; + msg = "正在退库"; break; case 2: - append = "已退库"; + msg = "已退库"; break; } - msg = string.Format("入库失败!当前条码{0}", append); - return null; + return msg; } } session.Commit(); - msg = string.Empty; - return entity; + return null; + } + } + + static void FillFromLocal(IDmoSession session, SegmentInStore obj) + { + var query = new DQueryDom(new JoinAlias(typeof(SegmentInStore))); + query.Columns.Add(DQSelectColumn.Field("Goods_Name")); + query.Columns.Add(DQSelectColumn.Field("Goods_Spec")); + query.Columns.Add(DQSelectColumn.Field("Weight")); + query.Columns.Add(DQSelectColumn.Field("ProductTime")); + query.Range = SelectRange.Top(1); + query.Where.Conditions.Add(DQCondition.EQ("ID", obj.ID)); + using (var reader = session.ExecuteReader(query)) + { + if (reader.Read()) + { + obj.Goods_Name = (string)reader[0]; + obj.Goods_Spec = (string)reader[1]; + obj.Weight = (decimal?)reader[2]; + obj.ProductTime = (DateTime?)reader[3]; + } } } @@ -199,7 +193,7 @@ namespace ButcherFactory.BO.LocalBL switch (localData.Item2) { case -1: - return "已删除,无法退库"; + return "已删除,无法退库"; case 1: return "已在退库中,等待提交"; case 2: @@ -219,8 +213,8 @@ namespace ButcherFactory.BO.LocalBL using (var session = DmoSession.New()) { Update(session, id, new Tuple("State", -1), - new Tuple("InStoreTime", DQExpression.NULL), - new Tuple("Store_ID", DQExpression.NULL)); + new Tuple("InStoreTime", null), + new Tuple("Store_ID", null)); session.Commit(); } } @@ -260,15 +254,6 @@ namespace ButcherFactory.BO.LocalBL session.ExecuteNonQuery(update); } - public static void InsertScanException(SegmentCodeError error) - { - using (var session = DmoSession.New()) - { - session.Insert(error); - session.Commit(); - } - } - public static BindingList GetInStoreSummary() { var query = new DQueryDom(new JoinAlias("_main", typeof(SegmentInStore))); @@ -310,26 +295,17 @@ namespace ButcherFactory.BO.LocalBL public static void UploadSegmentInstoreInfo() { - try - { - using (var session = DmoSession.New()) - { - var needUpload = GetUnSyncData(session); - if (needUpload.Count == 0) - return; - - var json = JsonConvert.SerializeObject(needUpload); - RpcFacade.Call(RpcPath + "UploadSegmentInStoreInfo", json); - foreach (var item in needUpload) - SetLocalAsSyncd(item, session); - session.Commit(); - } - } - catch + using (var session = DmoSession.New()) { -#if DEBUG - throw; -#endif + var needUpload = GetUnSyncData(session); + if (needUpload.Count == 0) + return; + + var json = JsonConvert.SerializeObject(needUpload); + RpcFacade.Call(RpcPath + "UploadSegmentInStoreInfo", json); + foreach (var item in needUpload) + SetLocalAsSyncd(item, session); + session.Commit(); } } @@ -342,7 +318,7 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("InStoreTime")); query.Columns.Add(DQSelectColumn.Field("Store_ID")); query.Columns.Add(DQSelectColumn.Field("BackStoreTime")); - query.Where.Conditions.Add(DQCondition.And(DQCondition.InEQ("State", 1), DQCondition.EQ("Sync", false))); + query.Where.Conditions.Add(DQCondition.And(DQCondition.InEQ("State", 1), DQCondition.EQ("Sync", false), DQCondition.IsNotNull(DQExpression.Field("Weight")))); query.Range = SelectRange.Top(10); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); @@ -355,7 +331,7 @@ namespace ButcherFactory.BO.LocalBL obj.ID = (long)reader[0]; obj.RowVersion = (int)reader[1]; obj.BarCode = (string)reader[2]; - obj.InStoreTime = (DateTime)reader[3]; + obj.InStoreTime = (DateTime?)reader[3]; obj.Store_ID = (long?)reader[4]; obj.BackStoreTime = (DateTime?)reader[5]; upload.Add(obj); @@ -371,6 +347,56 @@ namespace ButcherFactory.BO.LocalBL update.Columns.Add(new DQUpdateColumn("Sync", true)); session.ExecuteNonQuery(update); } + + public static void ClearErrorMsg() + { + var sql = string.Format(@"truncate table [{0}]", DmoInfo.Get(typeof(SegmentCodeError)).MappedDBObject); + using (var session = DmoSession.New()) + { + session.ExecuteSqlNonQuery(sql); + session.Commit(); + } + } + + public static void RefreshFromServer(SegmentInStore entity) + { + try + { + var json = RpcFacade.Call(RpcPath + "GetBarInfoByCode", entity.BarCode); + if (string.IsNullOrEmpty(json)) + return; + var obj = JsonConvert.DeserializeObject(json); + entity.Goods_Name = obj.Goods_Name; + entity.Goods_Spec = obj.Goods_Spec; + entity.ProductTime = obj.ProductTime; + entity.Weight = obj.Weight; + SimpleUpdate(entity); + } + catch + { +#if DEBUG + throw; +#endif + } + } + + public static void SimpleUpdate(SegmentInStore entity) + { + var update = new DQUpdateDom(typeof(SegmentInStore)); + update.Where.Conditions.Add(DQCondition.EQ("ID", entity.ID)); + update.Columns.Add(new DQUpdateColumn("Goods_Name", entity.Goods_Name)); + update.Columns.Add(new DQUpdateColumn("Goods_Spec", entity.Goods_Spec)); + update.Columns.Add(new DQUpdateColumn("ProductTime", entity.ProductTime)); + update.Columns.Add(new DQUpdateColumn("Weight", entity.Weight)); + update.EExecute(); + } + + public static void DeleteEmpty(long id) + { + var delete = new DQDeleteDom(typeof(SegmentInStore)); + delete.Where.Conditions.Add(DQCondition.EQ("ID", id)); + delete.EExecute(); + } } class SegmentInStoreObj @@ -383,20 +409,10 @@ namespace ButcherFactory.BO.LocalBL public string BarCode { get; set; } - public DateTime InStoreTime { get; set; } + public DateTime? InStoreTime { get; set; } public long? Store_ID { get; set; } public DateTime? BackStoreTime { get; set; } } - - class SegmentProductObj - { - public string BarCode { get; set; } - public string Goods_Name { get; set; } - public string Goods_Code { get; set; } - public string Goods_Spec { get; set; } - public decimal? Weight { get; set; } - public DateTime? ProductTime { get; set; } - } } diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs index f207ea2..a0c8c5c 100644 --- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs @@ -16,7 +16,7 @@ namespace ButcherFactory.BO.LocalBL public static class SegmentProductionBL { const string RpcPath = @"/MainSystem/B3ClientService/Rpcs/SegmentProductionRpc/"; - const string ProductTaskRpc = @"/MainSystem/B3ButcherManage/Rpcs/ProductTaskRpc/GetProductTaskNumber"; + const string ProductTaskRpc = @"/MainSystem/B3Sale/Rpcs/SaleOutStoreRpc/GetSaleOutStoreNumber"; public static BindingList GetListByState(bool submited) { @@ -81,7 +81,7 @@ namespace ButcherFactory.BO.LocalBL } } - public static SegmentProduction InsertAndSetGroupID(SegmentProduction entity,DateTime batchDate, bool test) + public static SegmentProduction InsertAndSetGroupID(SegmentProduction entity, DateTime batchDate) { using (var session = DmoSession.New()) { @@ -89,12 +89,9 @@ namespace ButcherFactory.BO.LocalBL entity.RowIndex = GenerateRowIndex(entity.ProductBatch_ID, session); entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", batchDate, AppContext.ConnectInfo.ClientCode, entity.RowIndex); entity.Submited = true; - if (!test) - { - session.Insert(entity); - FillGroupIDAsID(session, entity.ID); - session.Commit(); - } + session.Insert(entity); + FillGroupIDAsID(session, entity.ID); + session.Commit(); return entity; } } @@ -155,13 +152,6 @@ namespace ButcherFactory.BO.LocalBL } } - public static void Delete(long id) - { - var delete = new DQDeleteDom(typeof(SegmentProduction)); - delete.Where.Conditions.Add(DQCondition.EQ("ID", id)); - delete.EExecute(); - } - public static List GetInStoreState(List codeArr) { try @@ -169,7 +159,7 @@ namespace ButcherFactory.BO.LocalBL var json = RpcFacade.Call(RpcPath + "CheckInStored", JsonConvert.SerializeObject(codeArr)); return JsonConvert.DeserializeObject>(json); } - catch(Exception ex) + catch (Exception ex) { #if DEBUG throw; @@ -333,6 +323,13 @@ namespace ButcherFactory.BO.LocalBL return null; } } + + public static void DeleteBefore() + { + var delete = new DQDeleteDom(typeof(SegmentProduction)); + delete.Where.Conditions.Add(DQCondition.LessThan("CreateTime", new DateTime(2018, 10, 15))); + delete.EExecute(); + } } class SegmentProductionMin diff --git a/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs b/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs index c16f10f..25c03d1 100644 --- a/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs @@ -29,92 +29,82 @@ namespace ButcherFactory.BO.LocalBL public static List GetSaleOutStoreList(DateTime date) { - var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/GetSaleOutStoreByDate", date); - var list = JsonConvert.DeserializeObject>(json); - foreach (var item in list) - item.Date = date; - return list; + try + { + var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/GetSaleOutStoreByDate", date); + var list = JsonConvert.DeserializeObject>(json); + foreach (var item in list) + item.Date = date; + return list; + } + catch + { +#if DEBUG + throw; +#endif + return new List(); + } } public static List GetLocalList(DateTime date) { - var query = new DmoQuery(typeof(SegmentStockUp)); - query.Where.Conditions.Add(DQCondition.EQ("Date", date)); - return query.EExecuteList().Cast().ToList(); + using (var session = DmoSession.New()) + { + DeleteOld(session); + + var query = new DmoQuery(typeof(SegmentStockUp)); + query.Where.Conditions.Add(DQCondition.EQ("Date", date)); + return session.ExecuteList(query).Cast().ToList(); + } } - public static void DeleteOld() + static void DeleteOld(IDmoSession session) { var delete = new DQDeleteDom(typeof(SegmentStockUp)); - delete.Where.Conditions.Add(DQCondition.And(DQCondition.LessThan("Date", DateTime.Today.AddDays(-2)), DQCondition.EQ("Sync", true))); - delete.EExecute(); + delete.Where.Conditions.Add(DQCondition.LessThan("Date", DateTime.Today.AddDays(-1))); + session.ExecuteNonQuery(delete); } - public static void SyncToServer() + //当明细备完后,要返回该明细已备数量。 + public static AlreadyStockUp Insert(SegmentStockUp detail, AlreadyStockUp already, decimal totalNumber) { try { - using (var session = DmoSession.New()) + var json = JsonConvert.SerializeObject(new { DetailID = detail.DetailID, StandardPic = detail.StandardPic, BarCode = detail.BarCode, SecondNumber = detail.SecondNumber, UnitNumber = detail.UnitNumber }); + var r = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/InsertStockUpDetail", json, JsonConvert.SerializeObject(already), totalNumber); + var outSide = JsonConvert.DeserializeObject(r); + if (outSide.State == 1) { - var list = GetUnSyncList(session); - if (list.Count == 0) - return; - var arr = JsonConvert.SerializeObject(list.Select(x => new { DetailID = x.DetailID, BarCode = x.BarCode, SecondNumber=x.SecondNumber,UnitNumber=x.UnitNumber })); - RpcFacade.Call(RpcPath + "SaleOutStoreRpc/InsertStockUpDetail", arr); - SetLocalSync(session, list.First().ID, list.Last().ID); - session.Commit(); + using (var session = DmoSession.New()) + { + session.Insert(detail); + session.Commit(); + } } + return outSide; } catch { - #if DEBUG - throw; -#endif + return null; } } - static List GetUnSyncList(IDmoSession session) + public static List SyncAlreadyNumber(IEnumerable detailIDs, long? maxID) { - var query = new DQueryDom(new JoinAlias(typeof(SegmentStockUp))); - query.Where.Conditions.Add(DQCondition.EQ("Sync", false)); - query.Columns.Add(DQSelectColumn.Field("ID")); - query.Columns.Add(DQSelectColumn.Field("DetailID")); - query.Columns.Add(DQSelectColumn.Field("BarCode")); - query.Columns.Add(DQSelectColumn.Field("SecondNumber")); - query.Columns.Add(DQSelectColumn.Field("UnitNumber")); - query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); - query.Range = SelectRange.Top(50); - var list = new List(); - using (var reader = session.ExecuteReader(query)) + if (detailIDs.Count() == 0 && maxID == null) + return new List(); + var json = JsonConvert.SerializeObject(detailIDs); + try { - while (reader.Read()) - { - var entity = new SegmentStockUp(); - entity.ID = (long)reader[0]; - entity.DetailID = (long)reader[1]; - entity.BarCode = (string)reader[2]; - entity.SecondNumber = (decimal?)reader[3]; - entity.UnitNumber = (decimal?)reader[4]; - list.Add(entity); - } + var result = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/GetStockNumber", json, maxID); + return JsonConvert.DeserializeObject>(result); } - return list; - } - - static void SetLocalSync(IDmoSession session, long min, long max) - { - var update = new DQUpdateDom(typeof(SegmentStockUp)); - update.Columns.Add(new DQUpdateColumn("Sync", true)); - update.Where.Conditions.Add(DQCondition.Between("ID", min, max)); - session.ExecuteNonQuery(update); - } - - public static void Insert(SegmentStockUp detail) - { - using (var session = DmoSession.New()) + catch { - session.Insert(detail); - session.Commit(); +#if DEBUG + throw; +#endif + return new List(); } } } diff --git a/ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs b/ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs index 62035f0..fe54d99 100644 --- a/ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs +++ b/ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs @@ -16,7 +16,7 @@ namespace ButcherFactory.BO.Rpcs { const string baseInfoRpcPath = @"/MainSystem/B3ClientService/Rpcs/SyncBaseInfoRpc/"; - public static void SyncBaseInfo(string methodName = null) + public static bool SyncBaseInfo(string methodName = null) where T : BaseInfo { var type = typeof(T); @@ -27,6 +27,8 @@ namespace ButcherFactory.BO.Rpcs var localVersion = GetLocalVersion(session); var json = RpcFacade.Call(baseInfoRpcPath + methodName, JsonConvert.SerializeObject(localVersion)); var result = JsonConvert.DeserializeObject, List, List>>(json);//insert,update,delete + if (result.Item1.Count == 0 && result.Item2.Count == 0 && result.Item3.Count == 0) + return false; foreach (var item in result.Item1) session.Insert(item); foreach (var item in result.Item2) @@ -35,6 +37,7 @@ namespace ButcherFactory.BO.Rpcs Delete(session, result.Item3); session.Commit(); } + return true; } static void Delete(IDmoSession session, List ids) @@ -54,7 +57,7 @@ namespace ButcherFactory.BO.Rpcs return query.EExecuteList(session); } - public static void SyncProductBatch(int batchType) + public static bool SyncProductBatch(int batchType) { using (var session = DmoSession.New()) { @@ -62,6 +65,8 @@ namespace ButcherFactory.BO.Rpcs var json = RpcFacade.Call(baseInfoRpcPath + "SyncProductBatchByType", batchType, JsonConvert.SerializeObject(local)); var result = JsonConvert.DeserializeObject, List, List>>(json);//insert,update,delete + if (result.Item1.Count == 0 && result.Item2.Count == 0 && result.Item3.Count == 0) + return false; foreach (var item in result.Item1) session.Insert(item); foreach (var item in result.Item2) @@ -71,9 +76,10 @@ namespace ButcherFactory.BO.Rpcs session.Commit(); } + return true; } - public static void SyncGoodsByTag(ApplyClient applyClient) + public static bool SyncGoodsByTag(ApplyClient applyClient) { using (var session = DmoSession.New()) { @@ -82,10 +88,15 @@ namespace ButcherFactory.BO.Rpcs var json = RpcFacade.Call(baseInfoRpcPath + "SyncClientGoodsSetByClient", (short)applyClient, JsonConvert.SerializeObject(local), JsonConvert.SerializeObject(g2)); var result = JsonConvert.DeserializeObject, List, List, List, List, List>>(json);//insert,update,delete + if (result.Item1.Count == 0 && result.Item2.Count == 0 && result.Item3.Count == 0 && result.Item4.Count == 0 && result.Item5.Count == 0 && result.Item6.Count == 0) + return false; foreach (var item in result.Item1) Insert(item, session); foreach (var item in result.Item2) + { + DeleteNotExistDetail(item, session); Update(item, session); + } foreach (var item in result.Item3) DeleteClientSet(item, session); @@ -98,6 +109,7 @@ namespace ButcherFactory.BO.Rpcs session.Commit(); } + return true; } static void DeleteClientSet(long id, IDmoSession session) @@ -124,5 +136,12 @@ namespace ButcherFactory.BO.Rpcs foreach (var detail in entity.Details) session.AddUpdateOrInsert(detail); } + + static void DeleteNotExistDetail(ClientGoodsSet entity, IDmoSession session) + { + var delete = new DQDeleteDom(typeof(ClientGoodsSet_Detail)); + delete.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("ClientGoodsSet_ID", entity.ID), DQCondition.NotInList(DQExpression.Field("ID"), entity.Details.Select(x => DQExpression.Value(x.ID)).ToArray()))); + session.ExecuteNonQuery(delete); + } } } diff --git a/ButcherFactory.Form/ButcherFactory.Form.csproj b/ButcherFactory.Form/ButcherFactory.Form.csproj index b63a21f..d79ade9 100644 --- a/ButcherFactory.Form/ButcherFactory.Form.csproj +++ b/ButcherFactory.Form/ButcherFactory.Form.csproj @@ -38,11 +38,15 @@ False ..\..\..\tsref\Debug\BwpClientPrint.dll + + ..\..\WinFormControl\HidLibrary\bin\Release\HidLibrary.dll + + @@ -68,6 +72,12 @@ CarcassSaleOutForm.cs + + Form + + + CarcassSaleOutReadForm.cs + Component @@ -276,6 +286,9 @@ CarcassSaleOutForm.cs + + CarcassSaleOutReadForm.cs + FormTemplate.cs diff --git a/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.Designer.cs b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.Designer.cs new file mode 100644 index 0000000..645e341 --- /dev/null +++ b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.Designer.cs @@ -0,0 +1,1214 @@ +namespace ButcherFactory.CarcassSaleOut2_ +{ + partial class CarcassSaleOutReadForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = 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(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + this.panel4 = new System.Windows.Forms.Panel(); + this.panel6 = new System.Windows.Forms.Panel(); + this.carNumberLabel = new WinFormControl.ULabel(); + this.uLabel8 = new WinFormControl.ULabel(); + this.uLabel9 = new WinFormControl.ULabel(); + this.customerLabel = new WinFormControl.ULabel(); + this.uLabel10 = new WinFormControl.ULabel(); + this.billIDLabel = new WinFormControl.ULabel(); + this.addressLabel = new WinFormControl.ULabel(); + this.uLabel7 = new WinFormControl.ULabel(); + this.panel5 = new System.Windows.Forms.Panel(); + this.productBatchSelect = new System.Windows.Forms.ComboBox(); + this.uLabel2 = new WinFormControl.ULabel(); + this.uScanPanel1 = new WinFormControl.UScanPanel(); + this.weightControl1 = new ButcherFactory.Controls.WeightControl(); + this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0 = new ButcherFactory.Controls.RoundPanel(this.components); + this.panel12 = new System.Windows.Forms.Panel(); + this.backStoreCheck = new System.Windows.Forms.CheckBox(); + this.readBtn = new ButcherFactory.Controls.ColorButton(); + this.commitBtn = new ButcherFactory.Controls.ColorButton(); + this.deleteBtn = new ButcherFactory.Controls.ColorButton(); + this.fullBtn = new ButcherFactory.Controls.ColorButton(); + this.halfBtn = new ButcherFactory.Controls.ColorButton(); + this.sendGridView = new WinFormControl.UDataGridView(); + this.F_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Selected = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Image = new System.Windows.Forms.DataGridViewImageColumn(); + this.F_Idx = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_GoodsCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_InStoreWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_DiffWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.label2 = new System.Windows.Forms.Label(); + this.orderGridView = new WinFormControl.UDataGridView(); + this.D_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_SaleOutStore_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Customer_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Goods_Code = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_SSecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_SNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_DiffNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.label1 = new System.Windows.Forms.Label(); + this.panel7 = new System.Windows.Forms.Panel(); + this.panel11 = new System.Windows.Forms.Panel(); + this.goodsFinishBtn = new ButcherFactory.Controls.ColorButton(); + this.weightRecordBtn = new ButcherFactory.Controls.ColorButton(); + this.unFinishBtn = new ButcherFactory.Controls.ColorButton(); + this.alreadyViewBtn = new ButcherFactory.Controls.ColorButton(); + this.panel10 = new System.Windows.Forms.Panel(); + this.mainGridView = new WinFormControl.UDataGridView(); + this.M_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_Customer_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_SendTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_DeliverGoodsLine_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.panel9 = new System.Windows.Forms.Panel(); + this.panel8 = new System.Windows.Forms.Panel(); + this.billStateBox = new WinFormControl.ULabel(); + this.deliverGoodsLineBox = new WinFormControl.ULabel(); + this.storeBox = new WinFormControl.ULabel(); + this.customerBox = new WinFormControl.ULabel(); + this.sendDateBox = new WinFormControl.ULabel(); + this.clearBtn = new ButcherFactory.Controls.ColorButton(); + this.refreshBtn = new ButcherFactory.Controls.ColorButton(); + this.uLabel5 = new WinFormControl.ULabel(); + this.uLabel6 = new WinFormControl.ULabel(); + this.uLabel4 = new WinFormControl.ULabel(); + this.uLabel3 = new WinFormControl.ULabel(); + this.uLabel1 = new WinFormControl.ULabel(); + this.roundPanel1.SuspendLayout(); + this.panel4.SuspendLayout(); + this.panel6.SuspendLayout(); + this.weightControl1.SuspendLayout(); + this.panel12.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sendGridView)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.orderGridView)).BeginInit(); + this.panel7.SuspendLayout(); + this.panel11.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).BeginInit(); + this.panel8.SuspendLayout(); + this.SuspendLayout(); + // + // roundPanel1 + // + this.roundPanel1.Controls.Add(this.panel12); + this.roundPanel1.Controls.Add(this.sendGridView); + this.roundPanel1.Controls.Add(this.label2); + this.roundPanel1.Controls.Add(this.orderGridView); + this.roundPanel1.Controls.Add(this.label1); + this.roundPanel1.Controls.Add(this.panel7); + this.roundPanel1.Controls.Add(this.panel4); + this.roundPanel1.Size = new System.Drawing.Size(1187, 583); + // + // label3 + // + this.label3.Location = new System.Drawing.Point(495, 652); + // + // panel4 + // + this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel4.Controls.Add(this.panel6); + this.panel4.Controls.Add(this.panel5); + this.panel4.Controls.Add(this.productBatchSelect); + this.panel4.Controls.Add(this.uLabel2); + this.panel4.Controls.Add(this.uScanPanel1); + this.panel4.Controls.Add(this.weightControl1); + this.panel4.Dock = System.Windows.Forms.DockStyle.Top; + this.panel4.Location = new System.Drawing.Point(0, 0); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(1187, 86); + this.panel4.TabIndex = 1; + // + // panel6 + // + this.panel6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel6.Controls.Add(this.carNumberLabel); + this.panel6.Controls.Add(this.uLabel8); + this.panel6.Controls.Add(this.uLabel9); + this.panel6.Controls.Add(this.customerLabel); + this.panel6.Controls.Add(this.uLabel10); + this.panel6.Controls.Add(this.billIDLabel); + this.panel6.Controls.Add(this.addressLabel); + this.panel6.Controls.Add(this.uLabel7); + this.panel6.Location = new System.Drawing.Point(669, 5); + this.panel6.Name = "panel6"; + this.panel6.Size = new System.Drawing.Size(502, 75); + this.panel6.TabIndex = 25; + // + // carNumberLabel + // + this.carNumberLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.carNumberLabel.BackColor = System.Drawing.Color.Transparent; + this.carNumberLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.carNumberLabel.Location = new System.Drawing.Point(315, 42); + this.carNumberLabel.Name = "carNumberLabel"; + this.carNumberLabel.Size = new System.Drawing.Size(184, 26); + this.carNumberLabel.TabIndex = 36; + this.carNumberLabel.Text = "车牌号"; + this.carNumberLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // uLabel8 + // + this.uLabel8.AutoSize = true; + this.uLabel8.BackColor = System.Drawing.Color.Transparent; + this.uLabel8.Location = new System.Drawing.Point(3, 13); + this.uLabel8.Name = "uLabel8"; + this.uLabel8.Size = new System.Drawing.Size(53, 12); + this.uLabel8.TabIndex = 29; + this.uLabel8.Text = "出库单号"; + // + // uLabel9 + // + this.uLabel9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.uLabel9.AutoSize = true; + this.uLabel9.BackColor = System.Drawing.Color.Transparent; + this.uLabel9.Location = new System.Drawing.Point(264, 49); + this.uLabel9.Name = "uLabel9"; + this.uLabel9.Size = new System.Drawing.Size(41, 12); + this.uLabel9.TabIndex = 32; + this.uLabel9.Text = "车牌号"; + // + // customerLabel + // + this.customerLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.customerLabel.BackColor = System.Drawing.Color.Transparent; + this.customerLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.customerLabel.Font = new System.Drawing.Font("宋体", 13F); + this.customerLabel.ForeColor = System.Drawing.Color.Red; + this.customerLabel.Location = new System.Drawing.Point(315, 8); + this.customerLabel.Name = "customerLabel"; + this.customerLabel.Size = new System.Drawing.Size(184, 26); + this.customerLabel.TabIndex = 35; + this.customerLabel.Text = "购货客户"; + this.customerLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // uLabel10 + // + this.uLabel10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.uLabel10.AutoSize = true; + this.uLabel10.BackColor = System.Drawing.Color.Transparent; + this.uLabel10.Location = new System.Drawing.Point(252, 14); + this.uLabel10.Name = "uLabel10"; + this.uLabel10.Size = new System.Drawing.Size(53, 12); + this.uLabel10.TabIndex = 31; + this.uLabel10.Text = "购货客户"; + // + // billIDLabel + // + this.billIDLabel.BackColor = System.Drawing.Color.Transparent; + this.billIDLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.billIDLabel.Location = new System.Drawing.Point(64, 6); + this.billIDLabel.Name = "billIDLabel"; + this.billIDLabel.Size = new System.Drawing.Size(194, 26); + this.billIDLabel.TabIndex = 33; + this.billIDLabel.Text = "出库单号"; + this.billIDLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // addressLabel + // + this.addressLabel.BackColor = System.Drawing.Color.Transparent; + this.addressLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.addressLabel.Location = new System.Drawing.Point(64, 42); + this.addressLabel.Name = "addressLabel"; + this.addressLabel.Size = new System.Drawing.Size(194, 26); + this.addressLabel.TabIndex = 34; + this.addressLabel.Text = "送货地址"; + this.addressLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // uLabel7 + // + this.uLabel7.AutoSize = true; + this.uLabel7.BackColor = System.Drawing.Color.Transparent; + this.uLabel7.Location = new System.Drawing.Point(3, 48); + this.uLabel7.Name = "uLabel7"; + this.uLabel7.Size = new System.Drawing.Size(53, 12); + this.uLabel7.TabIndex = 30; + this.uLabel7.Text = "送货地址"; + // + // panel5 + // + this.panel5.BackColor = System.Drawing.Color.DarkGray; + this.panel5.Location = new System.Drawing.Point(630, 8); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(1, 70); + this.panel5.TabIndex = 24; + // + // productBatchSelect + // + this.productBatchSelect.Font = new System.Drawing.Font("宋体", 15F); + this.productBatchSelect.FormattingEnabled = true; + this.productBatchSelect.Location = new System.Drawing.Point(365, 47); + this.productBatchSelect.Name = "productBatchSelect"; + this.productBatchSelect.Size = new System.Drawing.Size(235, 28); + this.productBatchSelect.TabIndex = 23; + // + // uLabel2 + // + this.uLabel2.AutoSize = true; + this.uLabel2.BackColor = System.Drawing.Color.Transparent; + this.uLabel2.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel2.Location = new System.Drawing.Point(303, 51); + this.uLabel2.Name = "uLabel2"; + this.uLabel2.Size = new System.Drawing.Size(69, 20); + this.uLabel2.TabIndex = 22; + this.uLabel2.Text = "批次:"; + // + // uScanPanel1 + // + this.uScanPanel1.BackColor = System.Drawing.Color.Transparent; + this.uScanPanel1.Location = new System.Drawing.Point(301, 9); + this.uScanPanel1.Name = "uScanPanel1"; + this.uScanPanel1.Size = new System.Drawing.Size(303, 32); + this.uScanPanel1.TabIndex = 21; + // + // weightControl1 + // + this.weightControl1.BackColor = System.Drawing.Color.Transparent; + this.weightControl1.Controls.Add(this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0); + this.weightControl1.Location = new System.Drawing.Point(5, 4); + this.weightControl1.Name = "weightControl1"; + this.weightControl1.Size = new System.Drawing.Size(262, 74); + this.weightControl1.TabIndex = 0; + this.weightControl1.WeightFalg = null; + // + // object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0 + // + this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0._setRoundRadius = 15; + this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0.Dock = System.Windows.Forms.DockStyle.Fill; + this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0.Location = new System.Drawing.Point(0, 0); + this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0.Margin = new System.Windows.Forms.Padding(0); + this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0.Name = "object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0"; + this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0.Size = new System.Drawing.Size(262, 74); + this.object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0.TabIndex = 0; + // + // panel12 + // + this.panel12.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); + this.panel12.Controls.Add(this.backStoreCheck); + this.panel12.Controls.Add(this.readBtn); + this.panel12.Controls.Add(this.commitBtn); + this.panel12.Controls.Add(this.deleteBtn); + this.panel12.Controls.Add(this.fullBtn); + this.panel12.Controls.Add(this.halfBtn); + this.panel12.Location = new System.Drawing.Point(517, 525); + this.panel12.Name = "panel12"; + this.panel12.Size = new System.Drawing.Size(659, 50); + this.panel12.TabIndex = 12; + // + // backStoreCheck + // + this.backStoreCheck.AutoSize = true; + this.backStoreCheck.Font = new System.Drawing.Font("宋体", 12F); + this.backStoreCheck.ForeColor = System.Drawing.Color.Red; + this.backStoreCheck.Location = new System.Drawing.Point(19, 16); + this.backStoreCheck.Name = "backStoreCheck"; + this.backStoreCheck.Size = new System.Drawing.Size(91, 20); + this.backStoreCheck.TabIndex = 36; + this.backStoreCheck.Text = "现场退货"; + this.backStoreCheck.UseVisualStyleBackColor = true; + // + // readBtn + // + this.readBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.readBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25))))); + this.readBtn.Font = new System.Drawing.Font("黑体", 12F); + this.readBtn.ForeColor = System.Drawing.Color.White; + this.readBtn.Location = new System.Drawing.Point(553, 0); + this.readBtn.Name = "readBtn"; + this.readBtn.Radius = 10; + this.readBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.readBtn.Size = new System.Drawing.Size(102, 50); + this.readBtn.TabIndex = 35; + this.readBtn.Text = "读入"; + this.readBtn.UseVisualStyleBackColor = false; + this.readBtn.Click += new System.EventHandler(this.readBtn_Click); + // + // commitBtn + // + this.commitBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.commitBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(198)))), ((int)(((byte)(58))))); + this.commitBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.commitBtn.ForeColor = System.Drawing.Color.White; + this.commitBtn.Location = new System.Drawing.Point(432, 0); + this.commitBtn.Name = "commitBtn"; + this.commitBtn.Radius = 10; + this.commitBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.commitBtn.Size = new System.Drawing.Size(102, 50); + this.commitBtn.TabIndex = 34; + this.commitBtn.Text = "提交"; + this.commitBtn.UseVisualStyleBackColor = false; + this.commitBtn.Click += new System.EventHandler(this.commitBtn_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(351, 8); + this.deleteBtn.Name = "deleteBtn"; + this.deleteBtn.Radius = 10; + this.deleteBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.deleteBtn.Size = new System.Drawing.Size(84, 35); + this.deleteBtn.TabIndex = 33; + this.deleteBtn.Text = "删除选中"; + this.deleteBtn.UseVisualStyleBackColor = false; + this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); + // + // fullBtn + // + this.fullBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.fullBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.fullBtn.ForeColor = System.Drawing.Color.White; + this.fullBtn.Location = new System.Drawing.Point(239, 8); + this.fullBtn.Name = "fullBtn"; + this.fullBtn.Radius = 10; + this.fullBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.fullBtn.Size = new System.Drawing.Size(84, 35); + this.fullBtn.TabIndex = 32; + this.fullBtn.Text = "1"; + this.fullBtn.UseVisualStyleBackColor = false; + this.fullBtn.Click += new System.EventHandler(this.fullBtn_Click); + // + // halfBtn + // + this.halfBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.halfBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.halfBtn.ForeColor = System.Drawing.Color.White; + this.halfBtn.Location = new System.Drawing.Point(127, 8); + this.halfBtn.Name = "halfBtn"; + this.halfBtn.Radius = 10; + this.halfBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.halfBtn.Size = new System.Drawing.Size(84, 35); + this.halfBtn.TabIndex = 31; + this.halfBtn.Text = "0.5"; + this.halfBtn.UseVisualStyleBackColor = false; + this.halfBtn.Click += new System.EventHandler(this.halfBtn_Click); + // + // sendGridView + // + this.sendGridView.AllowUserToAddRows = false; + this.sendGridView.AllowUserToDeleteRows = false; + this.sendGridView.AllowUserToResizeColumns = false; + this.sendGridView.AllowUserToResizeRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(228)))), ((int)(((byte)(203))))); + this.sendGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.sendGridView.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.sendGridView.BackgroundColor = System.Drawing.Color.White; + this.sendGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.sendGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + this.sendGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74))))); + dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.sendGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.sendGridView.ColumnHeadersHeight = 30; + this.sendGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.sendGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.F_ID, + this.F_Selected, + this.F_Image, + this.F_Idx, + this.F_BarCode, + this.F_GoodsCode, + this.F_Goods_Name, + this.F_Number, + this.F_InStoreWeight, + this.F_Weight, + this.F_DiffWeight, + this.F_Time}); + this.sendGridView.EnableHeadersVisualStyles = false; + this.sendGridView.Location = new System.Drawing.Point(517, 387); + this.sendGridView.MultiSelect = false; + this.sendGridView.Name = "sendGridView"; + this.sendGridView.ReadOnly = true; + this.sendGridView.RowHeadersVisible = false; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(247)))), ((int)(((byte)(240))))); + dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74))))); + this.sendGridView.RowsDefaultCellStyle = dataGridViewCellStyle8; + this.sendGridView.RowTemplate.Height = 40; + this.sendGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.sendGridView.Size = new System.Drawing.Size(659, 128); + this.sendGridView.TabIndex = 11; + this.sendGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.sendGridView_CellClick); + // + // F_ID + // + this.F_ID.DataPropertyName = "ID"; + this.F_ID.HeaderText = "ID"; + this.F_ID.Name = "F_ID"; + this.F_ID.ReadOnly = true; + this.F_ID.Visible = false; + // + // F_Selected + // + this.F_Selected.DataPropertyName = "Selected"; + this.F_Selected.HeaderText = "Selected"; + this.F_Selected.Name = "F_Selected"; + this.F_Selected.ReadOnly = true; + this.F_Selected.Visible = false; + // + // F_Image + // + this.F_Image.HeaderText = "选中"; + this.F_Image.Name = "F_Image"; + this.F_Image.ReadOnly = true; + this.F_Image.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.F_Image.Width = 50; + // + // F_Idx + // + this.F_Idx.DataPropertyName = "Idx"; + this.F_Idx.HeaderText = "序号"; + this.F_Idx.Name = "F_Idx"; + this.F_Idx.ReadOnly = true; + this.F_Idx.Width = 60; + // + // F_BarCode + // + this.F_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.F_BarCode.DataPropertyName = "ShortCode"; + this.F_BarCode.HeaderText = "存货条码"; + this.F_BarCode.MinimumWidth = 100; + this.F_BarCode.Name = "F_BarCode"; + this.F_BarCode.ReadOnly = true; + // + // F_GoodsCode + // + this.F_GoodsCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.F_GoodsCode.DataPropertyName = "Goods_Code"; + this.F_GoodsCode.HeaderText = "产品编码"; + this.F_GoodsCode.MinimumWidth = 100; + this.F_GoodsCode.Name = "F_GoodsCode"; + this.F_GoodsCode.ReadOnly = true; + // + // F_Goods_Name + // + this.F_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.F_Goods_Name.DataPropertyName = "Goods_Name"; + this.F_Goods_Name.HeaderText = "产品名称"; + this.F_Goods_Name.MinimumWidth = 100; + this.F_Goods_Name.Name = "F_Goods_Name"; + this.F_Goods_Name.ReadOnly = true; + // + // F_Number + // + this.F_Number.DataPropertyName = "Number"; + dataGridViewCellStyle3.Format = "#0.######"; + this.F_Number.DefaultCellStyle = dataGridViewCellStyle3; + this.F_Number.HeaderText = "数量"; + this.F_Number.Name = "F_Number"; + this.F_Number.ReadOnly = true; + this.F_Number.Width = 60; + // + // F_InStoreWeight + // + this.F_InStoreWeight.DataPropertyName = "InStoreWeight"; + dataGridViewCellStyle4.Format = "#0.######"; + this.F_InStoreWeight.DefaultCellStyle = dataGridViewCellStyle4; + this.F_InStoreWeight.HeaderText = "入库重量"; + this.F_InStoreWeight.Name = "F_InStoreWeight"; + this.F_InStoreWeight.ReadOnly = true; + this.F_InStoreWeight.Width = 90; + // + // F_Weight + // + this.F_Weight.DataPropertyName = "Weight"; + dataGridViewCellStyle5.Format = "#0.######"; + this.F_Weight.DefaultCellStyle = dataGridViewCellStyle5; + this.F_Weight.HeaderText = "重量"; + this.F_Weight.Name = "F_Weight"; + this.F_Weight.ReadOnly = true; + this.F_Weight.Width = 80; + // + // F_DiffWeight + // + this.F_DiffWeight.DataPropertyName = "DiffWeight"; + dataGridViewCellStyle6.Format = "#0.######"; + this.F_DiffWeight.DefaultCellStyle = dataGridViewCellStyle6; + this.F_DiffWeight.HeaderText = "差异"; + this.F_DiffWeight.Name = "F_DiffWeight"; + this.F_DiffWeight.ReadOnly = true; + this.F_DiffWeight.Width = 70; + // + // F_Time + // + this.F_Time.DataPropertyName = "Time"; + dataGridViewCellStyle7.Format = "MM.dd HH:mm:ss"; + this.F_Time.DefaultCellStyle = dataGridViewCellStyle7; + this.F_Time.HeaderText = "时间"; + this.F_Time.Name = "F_Time"; + this.F_Time.ReadOnly = true; + this.F_Time.Width = 120; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("黑体", 12F); + this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(135)))), ((int)(((byte)(69))))); + this.label2.Location = new System.Drawing.Point(522, 366); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(72, 16); + this.label2.TabIndex = 10; + this.label2.Text = "发货明细"; + // + // orderGridView + // + this.orderGridView.AllowUserToAddRows = false; + this.orderGridView.AllowUserToDeleteRows = false; + this.orderGridView.AllowUserToResizeColumns = false; + this.orderGridView.AllowUserToResizeRows = false; + dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(217)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); + this.orderGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9; + this.orderGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.orderGridView.BackgroundColor = System.Drawing.Color.White; + this.orderGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.orderGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + this.orderGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.orderGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10; + this.orderGridView.ColumnHeadersHeight = 25; + this.orderGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.orderGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.D_ID, + this.D_SaleOutStore_ID, + this.D_Customer_Name, + this.D_Goods_Code, + this.D_Goods_Name, + this.D_SecondNumber, + this.D_Number, + this.D_SSecondNumber, + this.D_SNumber, + this.D_DiffNumber}); + this.orderGridView.EnableHeadersVisualStyles = false; + this.orderGridView.Location = new System.Drawing.Point(517, 123); + this.orderGridView.MultiSelect = false; + this.orderGridView.Name = "orderGridView"; + this.orderGridView.ReadOnly = true; + this.orderGridView.RowHeadersVisible = false; + dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(243)))), ((int)(((byte)(250))))); + dataGridViewCellStyle16.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.orderGridView.RowsDefaultCellStyle = dataGridViewCellStyle16; + this.orderGridView.RowTemplate.Height = 40; + this.orderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.orderGridView.Size = new System.Drawing.Size(659, 230); + this.orderGridView.TabIndex = 9; + this.orderGridView.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.orderGridView_RowPrePaint); + // + // D_ID + // + this.D_ID.DataPropertyName = "ID"; + this.D_ID.HeaderText = "ID"; + this.D_ID.Name = "D_ID"; + this.D_ID.ReadOnly = true; + this.D_ID.Visible = false; + // + // D_SaleOutStore_ID + // + this.D_SaleOutStore_ID.DataPropertyName = "SaleOutStore_ID"; + this.D_SaleOutStore_ID.HeaderText = "单号"; + this.D_SaleOutStore_ID.Name = "D_SaleOutStore_ID"; + this.D_SaleOutStore_ID.ReadOnly = true; + this.D_SaleOutStore_ID.Width = 90; + // + // D_Customer_Name + // + this.D_Customer_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.D_Customer_Name.DataPropertyName = "Customer_Name"; + this.D_Customer_Name.HeaderText = "客户名称"; + this.D_Customer_Name.MinimumWidth = 100; + this.D_Customer_Name.Name = "D_Customer_Name"; + this.D_Customer_Name.ReadOnly = true; + // + // D_Goods_Code + // + this.D_Goods_Code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.D_Goods_Code.DataPropertyName = "Goods_Code"; + this.D_Goods_Code.HeaderText = "产品编码"; + this.D_Goods_Code.MinimumWidth = 100; + this.D_Goods_Code.Name = "D_Goods_Code"; + this.D_Goods_Code.ReadOnly = true; + // + // D_Goods_Name + // + this.D_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.D_Goods_Name.DataPropertyName = "Goods_Name"; + this.D_Goods_Name.HeaderText = "产品名称"; + this.D_Goods_Name.MinimumWidth = 100; + this.D_Goods_Name.Name = "D_Goods_Name"; + this.D_Goods_Name.ReadOnly = true; + // + // D_SecondNumber + // + this.D_SecondNumber.DataPropertyName = "SecondNumber"; + dataGridViewCellStyle11.Format = "#0.######"; + this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle11; + this.D_SecondNumber.HeaderText = "辅数量"; + this.D_SecondNumber.Name = "D_SecondNumber"; + this.D_SecondNumber.ReadOnly = true; + // + // D_Number + // + this.D_Number.DataPropertyName = "Number"; + dataGridViewCellStyle12.Format = "#0.######"; + this.D_Number.DefaultCellStyle = dataGridViewCellStyle12; + this.D_Number.HeaderText = "报价数量"; + this.D_Number.Name = "D_Number"; + this.D_Number.ReadOnly = true; + // + // D_SSecondNumber + // + this.D_SSecondNumber.DataPropertyName = "SSecondNumber"; + dataGridViewCellStyle13.Format = "#0.######"; + this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle13; + this.D_SSecondNumber.HeaderText = "配货辅数量"; + this.D_SSecondNumber.Name = "D_SSecondNumber"; + this.D_SSecondNumber.ReadOnly = true; + // + // D_SNumber + // + this.D_SNumber.DataPropertyName = "SNumber"; + dataGridViewCellStyle14.Format = "#0.######"; + this.D_SNumber.DefaultCellStyle = dataGridViewCellStyle14; + this.D_SNumber.HeaderText = "配货数量"; + this.D_SNumber.Name = "D_SNumber"; + this.D_SNumber.ReadOnly = true; + // + // D_DiffNumber + // + this.D_DiffNumber.DataPropertyName = "DiffNumber"; + dataGridViewCellStyle15.Format = "#0.######"; + this.D_DiffNumber.DefaultCellStyle = dataGridViewCellStyle15; + this.D_DiffNumber.HeaderText = "差异数量"; + this.D_DiffNumber.Name = "D_DiffNumber"; + this.D_DiffNumber.ReadOnly = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("黑体", 12F); + this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(124)))), ((int)(((byte)(222))))); + this.label1.Location = new System.Drawing.Point(522, 100); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(72, 16); + this.label1.TabIndex = 8; + this.label1.Text = "订货明细"; + // + // panel7 + // + this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.panel7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); + this.panel7.Controls.Add(this.panel11); + this.panel7.Controls.Add(this.panel10); + this.panel7.Controls.Add(this.mainGridView); + this.panel7.Controls.Add(this.panel9); + this.panel7.Controls.Add(this.panel8); + this.panel7.Location = new System.Drawing.Point(6, 100); + this.panel7.Name = "panel7"; + this.panel7.Size = new System.Drawing.Size(505, 475); + this.panel7.TabIndex = 7; + // + // panel11 + // + this.panel11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.panel11.Controls.Add(this.goodsFinishBtn); + this.panel11.Controls.Add(this.weightRecordBtn); + this.panel11.Controls.Add(this.unFinishBtn); + this.panel11.Controls.Add(this.alreadyViewBtn); + this.panel11.Location = new System.Drawing.Point(1, 397); + this.panel11.Name = "panel11"; + this.panel11.Size = new System.Drawing.Size(501, 78); + this.panel11.TabIndex = 8; + // + // goodsFinishBtn + // + this.goodsFinishBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(120)))), ((int)(((byte)(24))))); + this.goodsFinishBtn.Font = new System.Drawing.Font("黑体", 15F); + this.goodsFinishBtn.ForeColor = System.Drawing.Color.White; + this.goodsFinishBtn.Location = new System.Drawing.Point(349, 3); + this.goodsFinishBtn.Name = "goodsFinishBtn"; + this.goodsFinishBtn.Radius = 10; + this.goodsFinishBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.goodsFinishBtn.Size = new System.Drawing.Size(137, 72); + this.goodsFinishBtn.TabIndex = 31; + this.goodsFinishBtn.Text = "配货完成"; + this.goodsFinishBtn.UseVisualStyleBackColor = false; + this.goodsFinishBtn.Click += new System.EventHandler(this.goodsFinishBtn_Click); + // + // weightRecordBtn + // + this.weightRecordBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.weightRecordBtn.Font = new System.Drawing.Font("黑体", 15F); + this.weightRecordBtn.ForeColor = System.Drawing.Color.White; + this.weightRecordBtn.Location = new System.Drawing.Point(152, 3); + this.weightRecordBtn.Name = "weightRecordBtn"; + this.weightRecordBtn.Radius = 10; + this.weightRecordBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.weightRecordBtn.Size = new System.Drawing.Size(137, 72); + this.weightRecordBtn.TabIndex = 30; + this.weightRecordBtn.Text = "称重记录"; + this.weightRecordBtn.UseVisualStyleBackColor = false; + this.weightRecordBtn.Click += new System.EventHandler(this.weightRecordBtn_Click); + // + // unFinishBtn + // + this.unFinishBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25))))); + this.unFinishBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.unFinishBtn.ForeColor = System.Drawing.Color.White; + this.unFinishBtn.Location = new System.Drawing.Point(8, 43); + this.unFinishBtn.Name = "unFinishBtn"; + this.unFinishBtn.Radius = 10; + this.unFinishBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.unFinishBtn.Size = new System.Drawing.Size(84, 35); + this.unFinishBtn.TabIndex = 29; + this.unFinishBtn.Text = "撤销完毕"; + this.unFinishBtn.UseVisualStyleBackColor = false; + this.unFinishBtn.Click += new System.EventHandler(this.unFinishBtn_Click); + // + // alreadyViewBtn + // + this.alreadyViewBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222))))); + this.alreadyViewBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.alreadyViewBtn.ForeColor = System.Drawing.Color.White; + this.alreadyViewBtn.Location = new System.Drawing.Point(8, 0); + this.alreadyViewBtn.Name = "alreadyViewBtn"; + this.alreadyViewBtn.Radius = 10; + this.alreadyViewBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.alreadyViewBtn.Size = new System.Drawing.Size(84, 35); + this.alreadyViewBtn.TabIndex = 28; + this.alreadyViewBtn.Text = "已配货"; + this.alreadyViewBtn.UseVisualStyleBackColor = false; + this.alreadyViewBtn.Click += new System.EventHandler(this.alreadyViewBtn_Click); + // + // panel10 + // + this.panel10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.panel10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(210)))), ((int)(((byte)(210))))); + this.panel10.Location = new System.Drawing.Point(3, 390); + this.panel10.Name = "panel10"; + this.panel10.Size = new System.Drawing.Size(479, 1); + this.panel10.TabIndex = 7; + // + // mainGridView + // + this.mainGridView.AllowUserToAddRows = false; + this.mainGridView.AllowUserToDeleteRows = false; + this.mainGridView.AllowUserToResizeColumns = false; + this.mainGridView.AllowUserToResizeRows = false; + dataGridViewCellStyle17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(231)))), ((int)(((byte)(221)))), ((int)(((byte)(245))))); + this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle17; + this.mainGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.mainGridView.BackgroundColor = System.Drawing.Color.White; + this.mainGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.mainGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + this.mainGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; + dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222))))); + dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle18.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18; + this.mainGridView.ColumnHeadersHeight = 25; + this.mainGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.mainGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.M_ID, + this.M_Customer_Name, + this.M_SendTime, + this.M_DeliverGoodsLine_Name}); + this.mainGridView.EnableHeadersVisualStyles = false; + this.mainGridView.Location = new System.Drawing.Point(3, 140); + this.mainGridView.MultiSelect = false; + this.mainGridView.Name = "mainGridView"; + this.mainGridView.ReadOnly = true; + dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle20.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle20.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle20.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle20.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mainGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle20; + this.mainGridView.RowHeadersVisible = false; + dataGridViewCellStyle21.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(242)))), ((int)(((byte)(251))))); + dataGridViewCellStyle21.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222))))); + this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle21; + this.mainGridView.RowTemplate.Height = 50; + this.mainGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.mainGridView.Size = new System.Drawing.Size(499, 242); + this.mainGridView.TabIndex = 6; + this.mainGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mainGridView_CellClick); + // + // M_ID + // + this.M_ID.DataPropertyName = "ID"; + this.M_ID.HeaderText = "单号"; + this.M_ID.Name = "M_ID"; + this.M_ID.ReadOnly = true; + this.M_ID.Width = 90; + // + // M_Customer_Name + // + this.M_Customer_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.M_Customer_Name.DataPropertyName = "Customer_Name"; + this.M_Customer_Name.HeaderText = "客户名称"; + this.M_Customer_Name.Name = "M_Customer_Name"; + this.M_Customer_Name.ReadOnly = true; + // + // M_SendTime + // + this.M_SendTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.M_SendTime.DataPropertyName = "SendTime"; + dataGridViewCellStyle19.Format = "yyyy/MM/dd"; + this.M_SendTime.DefaultCellStyle = dataGridViewCellStyle19; + this.M_SendTime.HeaderText = "发货时间"; + this.M_SendTime.Name = "M_SendTime"; + this.M_SendTime.ReadOnly = true; + // + // M_DeliverGoodsLine_Name + // + this.M_DeliverGoodsLine_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.M_DeliverGoodsLine_Name.DataPropertyName = "DeliverGoodsLine_Name"; + this.M_DeliverGoodsLine_Name.HeaderText = "送货线路"; + this.M_DeliverGoodsLine_Name.Name = "M_DeliverGoodsLine_Name"; + this.M_DeliverGoodsLine_Name.ReadOnly = true; + // + // panel9 + // + this.panel9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(210)))), ((int)(((byte)(210))))); + this.panel9.Dock = System.Windows.Forms.DockStyle.Top; + this.panel9.Location = new System.Drawing.Point(0, 133); + this.panel9.Name = "panel9"; + this.panel9.Size = new System.Drawing.Size(505, 1); + this.panel9.TabIndex = 1; + // + // panel8 + // + this.panel8.Controls.Add(this.billStateBox); + this.panel8.Controls.Add(this.deliverGoodsLineBox); + this.panel8.Controls.Add(this.storeBox); + this.panel8.Controls.Add(this.customerBox); + this.panel8.Controls.Add(this.sendDateBox); + this.panel8.Controls.Add(this.clearBtn); + this.panel8.Controls.Add(this.refreshBtn); + this.panel8.Controls.Add(this.uLabel5); + this.panel8.Controls.Add(this.uLabel6); + this.panel8.Controls.Add(this.uLabel4); + this.panel8.Controls.Add(this.uLabel3); + this.panel8.Controls.Add(this.uLabel1); + this.panel8.Dock = System.Windows.Forms.DockStyle.Top; + this.panel8.Location = new System.Drawing.Point(0, 0); + this.panel8.Name = "panel8"; + this.panel8.Size = new System.Drawing.Size(505, 133); + this.panel8.TabIndex = 0; + // + // billStateBox + // + this.billStateBox.BackColor = System.Drawing.Color.Transparent; + this.billStateBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.billStateBox.Location = new System.Drawing.Point(340, 47); + this.billStateBox.Name = "billStateBox"; + this.billStateBox.Size = new System.Drawing.Size(148, 26); + this.billStateBox.TabIndex = 38; + this.billStateBox.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.billStateBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.queryControl_MouseDown); + // + // deliverGoodsLineBox + // + this.deliverGoodsLineBox.BackColor = System.Drawing.Color.Transparent; + this.deliverGoodsLineBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.deliverGoodsLineBox.Location = new System.Drawing.Point(340, 7); + this.deliverGoodsLineBox.Name = "deliverGoodsLineBox"; + this.deliverGoodsLineBox.Size = new System.Drawing.Size(148, 26); + this.deliverGoodsLineBox.TabIndex = 37; + this.deliverGoodsLineBox.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.deliverGoodsLineBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.queryControl_MouseDown); + // + // storeBox + // + this.storeBox.BackColor = System.Drawing.Color.Transparent; + this.storeBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.storeBox.Location = new System.Drawing.Point(73, 90); + this.storeBox.Name = "storeBox"; + this.storeBox.Size = new System.Drawing.Size(148, 26); + this.storeBox.TabIndex = 36; + this.storeBox.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.storeBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.queryControl_MouseDown); + // + // customerBox + // + this.customerBox.BackColor = System.Drawing.Color.Transparent; + this.customerBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.customerBox.Location = new System.Drawing.Point(73, 47); + this.customerBox.Name = "customerBox"; + this.customerBox.Size = new System.Drawing.Size(148, 26); + this.customerBox.TabIndex = 35; + this.customerBox.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.customerBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.queryControl_MouseDown); + // + // sendDateBox + // + this.sendDateBox.BackColor = System.Drawing.Color.Transparent; + this.sendDateBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.sendDateBox.Location = new System.Drawing.Point(73, 7); + this.sendDateBox.Name = "sendDateBox"; + this.sendDateBox.Size = new System.Drawing.Size(148, 26); + this.sendDateBox.TabIndex = 34; + this.sendDateBox.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.sendDateBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.queryControl_MouseDown); + // + // clearBtn + // + this.clearBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25))))); + this.clearBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.clearBtn.ForeColor = System.Drawing.Color.White; + this.clearBtn.Location = new System.Drawing.Point(399, 86); + this.clearBtn.Name = "clearBtn"; + this.clearBtn.Radius = 10; + this.clearBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.clearBtn.Size = new System.Drawing.Size(89, 35); + this.clearBtn.TabIndex = 28; + this.clearBtn.Text = "清除条件"; + this.clearBtn.UseVisualStyleBackColor = false; + this.clearBtn.Click += new System.EventHandler(this.clearBtn_Click); + // + // refreshBtn + // + this.refreshBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(198)))), ((int)(((byte)(58))))); + this.refreshBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.refreshBtn.ForeColor = System.Drawing.Color.White; + this.refreshBtn.Location = new System.Drawing.Point(283, 86); + this.refreshBtn.Name = "refreshBtn"; + this.refreshBtn.Radius = 10; + this.refreshBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.refreshBtn.Size = new System.Drawing.Size(84, 35); + this.refreshBtn.TabIndex = 27; + this.refreshBtn.Text = "刷新"; + this.refreshBtn.UseVisualStyleBackColor = false; + this.refreshBtn.Click += new System.EventHandler(this.refreshBtn_Click); + // + // uLabel5 + // + this.uLabel5.AutoSize = true; + this.uLabel5.BackColor = System.Drawing.Color.Transparent; + this.uLabel5.Location = new System.Drawing.Point(281, 54); + this.uLabel5.Name = "uLabel5"; + this.uLabel5.Size = new System.Drawing.Size(53, 12); + this.uLabel5.TabIndex = 20; + this.uLabel5.Text = "单据状态"; + // + // uLabel6 + // + this.uLabel6.AutoSize = true; + this.uLabel6.BackColor = System.Drawing.Color.Transparent; + this.uLabel6.Location = new System.Drawing.Point(281, 14); + this.uLabel6.Name = "uLabel6"; + this.uLabel6.Size = new System.Drawing.Size(53, 12); + this.uLabel6.TabIndex = 19; + this.uLabel6.Text = "送货线路"; + // + // uLabel4 + // + this.uLabel4.AutoSize = true; + this.uLabel4.BackColor = System.Drawing.Color.Transparent; + this.uLabel4.Location = new System.Drawing.Point(14, 97); + this.uLabel4.Name = "uLabel4"; + this.uLabel4.Size = new System.Drawing.Size(29, 12); + this.uLabel4.TabIndex = 18; + this.uLabel4.Text = "仓库"; + // + // uLabel3 + // + this.uLabel3.AutoSize = true; + this.uLabel3.BackColor = System.Drawing.Color.Transparent; + this.uLabel3.Location = new System.Drawing.Point(14, 54); + this.uLabel3.Name = "uLabel3"; + this.uLabel3.Size = new System.Drawing.Size(29, 12); + this.uLabel3.TabIndex = 17; + this.uLabel3.Text = "客户"; + // + // uLabel1 + // + this.uLabel1.AutoSize = true; + this.uLabel1.BackColor = System.Drawing.Color.Transparent; + this.uLabel1.Location = new System.Drawing.Point(14, 14); + this.uLabel1.Name = "uLabel1"; + this.uLabel1.Size = new System.Drawing.Size(53, 12); + this.uLabel1.TabIndex = 16; + this.uLabel1.Text = "发货日期"; + // + // CarcassSaleOutReadForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1212, 673); + this.ImeMode = System.Windows.Forms.ImeMode.Disable; + this.KeyPreview = true; + this.Name = "CarcassSaleOutReadForm"; + this.Text = "白条发货"; + this.roundPanel1.ResumeLayout(false); + this.roundPanel1.PerformLayout(); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + this.panel6.ResumeLayout(false); + this.panel6.PerformLayout(); + this.weightControl1.ResumeLayout(false); + this.panel12.ResumeLayout(false); + this.panel12.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sendGridView)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.orderGridView)).EndInit(); + this.panel7.ResumeLayout(false); + this.panel11.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).EndInit(); + this.panel8.ResumeLayout(false); + this.panel8.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Panel panel6; + private WinFormControl.ULabel carNumberLabel; + private WinFormControl.ULabel uLabel8; + private WinFormControl.ULabel uLabel9; + private WinFormControl.ULabel customerLabel; + private WinFormControl.ULabel uLabel10; + private WinFormControl.ULabel billIDLabel; + private WinFormControl.ULabel addressLabel; + private WinFormControl.ULabel uLabel7; + private System.Windows.Forms.Panel panel5; + private System.Windows.Forms.ComboBox productBatchSelect; + private WinFormControl.ULabel uLabel2; + private WinFormControl.UScanPanel uScanPanel1; + private Controls.WeightControl weightControl1; + private Controls.RoundPanel object_2b02d4f5_31ed_4ae1_b4eb_128aebfcb1c0; + private System.Windows.Forms.Panel panel12; + private Controls.ColorButton commitBtn; + private Controls.ColorButton deleteBtn; + private Controls.ColorButton fullBtn; + private Controls.ColorButton halfBtn; + private WinFormControl.UDataGridView sendGridView; + private System.Windows.Forms.DataGridViewTextBoxColumn F_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Selected; + private System.Windows.Forms.DataGridViewImageColumn F_Image; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Idx; + private System.Windows.Forms.DataGridViewTextBoxColumn F_BarCode; + private System.Windows.Forms.DataGridViewTextBoxColumn F_GoodsCode; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Number; + private System.Windows.Forms.DataGridViewTextBoxColumn F_InStoreWeight; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn F_DiffWeight; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Time; + private System.Windows.Forms.Label label2; + private WinFormControl.UDataGridView orderGridView; + private System.Windows.Forms.DataGridViewTextBoxColumn D_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn D_SaleOutStore_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Customer_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_Code; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn D_SecondNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Number; + private System.Windows.Forms.DataGridViewTextBoxColumn D_SSecondNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn D_SNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn D_DiffNumber; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Panel panel7; + private System.Windows.Forms.Panel panel11; + private Controls.ColorButton goodsFinishBtn; + private Controls.ColorButton weightRecordBtn; + private Controls.ColorButton unFinishBtn; + private Controls.ColorButton alreadyViewBtn; + private System.Windows.Forms.Panel panel10; + private WinFormControl.UDataGridView mainGridView; + private System.Windows.Forms.DataGridViewTextBoxColumn M_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn M_Customer_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn M_SendTime; + private System.Windows.Forms.DataGridViewTextBoxColumn M_DeliverGoodsLine_Name; + private System.Windows.Forms.Panel panel9; + private System.Windows.Forms.Panel panel8; + private WinFormControl.ULabel billStateBox; + private WinFormControl.ULabel deliverGoodsLineBox; + private WinFormControl.ULabel storeBox; + private WinFormControl.ULabel customerBox; + private WinFormControl.ULabel sendDateBox; + private Controls.ColorButton clearBtn; + private Controls.ColorButton refreshBtn; + private WinFormControl.ULabel uLabel5; + private WinFormControl.ULabel uLabel6; + private WinFormControl.ULabel uLabel4; + private WinFormControl.ULabel uLabel3; + private WinFormControl.ULabel uLabel1; + private Controls.ColorButton readBtn; + private System.Windows.Forms.CheckBox backStoreCheck; + + } +} \ No newline at end of file diff --git a/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.cs b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.cs new file mode 100644 index 0000000..9eee224 --- /dev/null +++ b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.cs @@ -0,0 +1,555 @@ +using ButcherFactory.BO; +using ButcherFactory.BO.LocalBL; +using ButcherFactory.BO.Utils; +using ButcherFactory.CarcassSaleOut_; +using ButcherFactory.Controls; +using ButcherFactory.Dialogs; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ButcherFactory.CarcassSaleOut2_ +{ + public partial class CarcassSaleOutReadForm : FormTemplate, IWithRoleForm + { + #region IWithRoleForm + public List RoleName + { + get { return new List { (short)设备类别.白条静态称发货 }; } + } + + public Form Generate() + { + return this; + } + #endregion + + BindingList saleOutStoreList; + BindingList details; + BindingList weightRecord; + Thread checkWeight; + string strErrorWeight = ""; + List errorWeight = new List(); + internal DateTime sendTime = DateTime.Today; + internal long? deliverGoodsLineID; + internal long? customerID; + internal int billState; + internal CarcassSaleOutFormConfig config; + internal long? storeID; + long? batchID; + bool already = false; + bool scanCode = true; + + public CarcassSaleOutReadForm() + { + InitializeComponent(); + this.FormClosing += delegate + { + if (checkWeight != null && checkWeight.IsAlive) + checkWeight.Abort(); + }; + //weightControl1.ReceivedValue += weightControl1_ReceivedValue; + + uScanPanel1.AfterScan += uScanPanel1_AfterScan; + productBatchSelect.SelectedIndexChanged += delegate + { + if (productBatchSelect.SelectedValue == null) + batchID = null; + else + batchID = (long)productBatchSelect.SelectedValue; + }; + + sendGridView.CellFormatting += sendGridView_CellFormatting; + } + + static Image CheckImg = System.Drawing.Image.FromFile("Images\\check.png"); + static Image UnCheckImg = System.Drawing.Image.FromFile("Images\\uCheck.png"); + + void sendGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) + { + if (e.RowIndex < 0 || e.ColumnIndex != 2) + return; + var v = (bool)sendGridView.Rows[e.RowIndex].Cells[1].Value; + e.Value = v ? CheckImg : UnCheckImg; + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + BLUtil.DeleteSaleOutStoreInfo(); + BLUtil.DeleteSaleOutStoreInfo(); + billState = 0; + billStateBox.Text = "未审核"; + sendDateBox.Text = sendTime.ToString("yyyy-MM-dd"); + + config = XmlUtil.DeserializeFromFile(); + storeID = config.Store_ID; + if (config.Store_ID.HasValue) + { + storeBox.Text = config.Store_Name; + } + if (!string.IsNullOrEmpty(config.Weight)) + { + strErrorWeight = config.Weight; + var arr = strErrorWeight.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).OrderBy(x => x); + errorWeight.AddRange(arr); + } + BindWeightRecord(); + BindProductBatch(); + } + + void BindWeightRecord() + { + weightRecord = CarcassSaleOutBL.GetUnSubmitWeightRecord(); + sendGridView.DataSource = weightRecord; + sendGridView.Refresh(); + } + + private void BindProductBatch() + { + var batchs = CarcassSaleOutBL.GetBatchFromEMS(0); + 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(); + } + + static object _lock = new object(); + //void weightControl1_ReceivedValue(decimal weight) + //{ + // lock (_lock) + // { + // this.Invoke(new Action(() => + // { + // var detail = CarcassSaleOutBL.Insert(weight); + // if (weightRecord.Any()) + // detail.Idx = weightRecord.First().Idx + 1; + // else + // detail.Idx = 1; + // weightRecord.Insert(0, detail); + // sendGridView.FirstDisplayedScrollingRowIndex = 0; + // if (!scanCode) + // AfterScan("G8536"); + // else + // sendGridView.Refresh(); + // checkWeight = new Thread(new ParameterizedThreadStart(CheckWeight)); + // checkWeight.Start(weight); + // })); + // } + //} + + void CheckWeight(object objWeight) + { + decimal weight = (decimal)objWeight; + var first = errorWeight.FirstOrDefault(x => x > weight); + if (first != 0) + WinFormControl.SoundPalyUtil.PlaySound(string.Format("Sounds\\l{0}.wav", first)); + } + + void uScanPanel1_AfterScan() + { + var barCode = uScanPanel1.TextBox.Text.Trim(); + if (!barCode.StartsWith("G") && !barCode.StartsWith("P")) + { + if (backStoreCheck.Checked) + { + if (weightRecord.Where(x => x.BarCode == barCode).Sum(x => x.IsBack ? -1 : 1) != 1) + { + if (weightRecord.Any(x => x.BarCode == barCode)) + throw new Exception("失败,条码已退库"); + throw new Exception("失败,称重记录中无该条码信息"); + } + } + else + { + if (weightRecord.Any(x => x.BarCode == barCode))//未提交队列里重复码 + throw new Exception("扫码重复"); + if (CarcassSaleOutBL.BarCodeUsed(barCode)) + throw new Exception("扫码重复"); + } + } + AfterScan(barCode); + } + + void AfterScan(string barCode) + { + if (string.IsNullOrEmpty(barCode)) + throw new Exception("条码错误"); + if (barCode.StartsWith("P")) + { + if (orderGridView.CurrentRow == null) + throw new Exception("请选择发货明细"); + var detail = new CarcassSaleOut_Detail(); + var bind = orderGridView.CurrentRow.DataBoundItem as SaleOutStore_Detail; + detail.Weight = detail.Number = bind.Number ?? 0; + detail.BarCode = barCode; + detail.BillID = bind.SaleOutStore_ID; + detail.DetailID = bind.ID; + detail.Filled = true; + detail.Goods_ID = long.Parse(barCode.TrimStart('P')); + CarcassSaleOutBL.InsertPackage(detail); + if (weightRecord.Any()) + detail.Idx = weightRecord.First().Idx + 1; + else + detail.Idx = 1; + weightRecord.Insert(0, detail); + sendGridView.FirstDisplayedScrollingRowIndex = 0; + } + else + { + var detail = CarcassSaleOutBL.ReadBarCode(barCode, batchID, backStoreCheck.Checked); + if (weightRecord.Any()) + detail.Idx = weightRecord.First().Idx + 1; + else + detail.Idx = 1; + weightRecord.Insert(0, detail); + sendGridView.FirstDisplayedScrollingRowIndex = 0; + } + WinFormControl.SoundPalyUtil.PlaySound(WinFormControl.SoundType.Click); + sendGridView.Refresh(); + } + + private void refreshBtn_Click(object sender, EventArgs e) + { + already = false; + Refersh(); + } + + private void weightRecordBtn_Click(object sender, EventArgs e) + { + if (orderGridView.CurrentRow == null) + throw new Exception("请选择配货明细"); + var detail = orderGridView.CurrentRow.DataBoundItem as SaleOutStore_Detail; + var dg = new WeightRecordDialog(details.First(x => x.ID == detail.ID), already, batchID); + dg.ShowDialog(); + if (dg.Changed) + BindOrderGrid(detail.SaleOutStore_ID); + if (dg.rolBack) + BindWeightRecord(); + } + + private void goodsFinishBtn_Click(object sender, EventArgs e) + { + if (mainGridView.CurrentRow == null) + throw new Exception("请选择要配货完成的发货单"); + var id = (long)mainGridView.CurrentRow.Cells[0].Value; + + var hasNoAssignDetail = CarcassSaleOutBL.HasNoAssignDetail(id); + if (hasNoAssignDetail) + { + if (MessageBox.Show("有未配货的明细,确认配货完成?", "配货完成确认", MessageBoxButtons.OKCancel) != DialogResult.OK) + return; + } + CarcassSaleOutBL.SetGoodsFinish(id); + AfterChangeFinishGoods(id); + MessageBox.Show("配货完成!"); + } + + private void unFinishBtn_Click(object sender, EventArgs e) + { + if (mainGridView.CurrentRow == null) + throw new Exception("请选择要撤销完毕的发货单"); + var id = (long)mainGridView.CurrentRow.Cells[0].Value; + CarcassSaleOutBL.SetGoodsUnFinish(id); + AfterChangeFinishGoods(id); + MessageBox.Show("撤销成功!"); + } + + private void AfterChangeFinishGoods(long id) + { + saleOutStoreList.Remove(saleOutStoreList.First(x => x.ID == id)); + mainGridView.Refresh(); + if (details != null) + details.Clear(); + orderGridView.Refresh(); + + billIDLabel.Text = string.Empty; + customerLabel.Text = string.Empty; + addressLabel.Text = string.Empty; + carNumberLabel.Text = string.Empty; + } + + private void commitBtn_Click(object sender, EventArgs e) + { + if (orderGridView.CurrentRow == null) + throw new Exception("请选择配货明细"); + var subList = weightRecord.Where(x => x.Selected).ToList(); + if (subList.Count() == 0) + throw new Exception("没有发货明细"); + if (subList.Any(x => !x.Filled)) + throw new Exception("有未扫码的明细"); + var detailID = (long)orderGridView.CurrentRow.Cells[0].Value; + var detail = details.First(x => x.ID == detailID); + CarcassSaleOutBL.SubmitDetails(subList, detail); + foreach (var item in subList) + weightRecord.Remove(item); + var idx = weightRecord.Count; + foreach (var item in weightRecord) + { + item.Idx = idx; + idx--; + } + + sendGridView.Refresh(); + orderGridView.Refresh(); + MessageBox.Show("提交成功!"); + } + + 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; + config.Store_Name = simpleLbl.Text; + config.Store_ID = sb.Result.Item2; + storeID = config.Store_ID; + XmlUtil.SerializerObjToFile(config); + } + break; + } + } + + 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 mainGridView_CellClick(object sender, DataGridViewCellEventArgs e) + { + var id = (long)mainGridView.CurrentRow.Cells[0].Value; + var first = saleOutStoreList.First(x => x.ID == id); + billIDLabel.Text = id.ToString(); + customerLabel.Text = first.Customer_Name; + addressLabel.Text = first.Address; + carNumberLabel.Text = first.CarNumber; + BindOrderGrid(null); + } + + void BindOrderGrid(long? detailID) + { + var id = long.Parse(billIDLabel.Text); + details = CarcassSaleOutBL.GetSaleOutStoreDetailList(id); + foreach (var item in details) + { + item.SaleOutStore_ID = id; + item.Customer_Name = customerLabel.Text; + } + orderGridView.DataSource = details; + if (detailID.HasValue) + { + foreach (DataGridViewRow row in orderGridView.Rows) + { + if ((long)row.Cells[0].Value == detailID) + { + row.Selected = true; + break; + } + } + } + else + { + if (details.Any()) + orderGridView.FirstDisplayedScrollingRowIndex = 0; + } + orderGridView.Refresh(); + } + + private void alreadyViewBtn_Click(object sender, EventArgs e) + { + already = true; + Refersh(); + } + + void Refersh() + { + commitBtn.Enabled = !already; + goodsFinishBtn.Enabled = !already; + unFinishBtn.Enabled = already; + if (details != null) + { + details.Clear(); + orderGridView.Refresh(); + } + + saleOutStoreList = CarcassSaleOutBL.GetSaleOutStoreList(sendTime, deliverGoodsLineID, customerID, billState, storeID, already); + mainGridView.DataSource = saleOutStoreList; + mainGridView.Refresh(); + } + + private void deleteBtn_Click(object sender, EventArgs e) + { + if (sendGridView.CurrentRow == null) + return; + var id = (long)sendGridView.CurrentRow.Cells[0].Value; + CarcassSaleOutBL.Delete(id); + var tag = weightRecord.First(x => x.ID == id); + weightRecord.Remove(tag); + foreach (var item in weightRecord.Where(x => x.Idx > tag.Idx)) + item.Idx -= 1; + sendGridView.Refresh(); + } + + private void orderGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) + { + DataGridViewRow dgrSingle = orderGridView.Rows[e.RowIndex]; + var v = (decimal?)dgrSingle.Cells["D_SNumber"].Value; + if (v.HasValue && v > 0) + { + dgrSingle.DefaultCellStyle.BackColor = Color.YellowGreen; + } + } + + private void sendGridView_CellClick(object sender, DataGridViewCellEventArgs e) + { + if (e.RowIndex == -1 && e.ColumnIndex == 2) + { + foreach (var item in weightRecord) + item.Selected = !item.Selected; + sendGridView.Refresh(); + return; + } + if (e.RowIndex < 0) + return; + var id = (long)sendGridView.CurrentRow.Cells[0].Value; + var first = weightRecord.First(x => x.ID == id); + first.Selected = !first.Selected; + sendGridView.Refresh(); + } + + private void halfBtn_Click(object sender, EventArgs e) + { + SetWeightNumber(0.5m); + } + + private void fullBtn_Click(object sender, EventArgs e) + { + SetWeightNumber(1); + } + + private void SetWeightNumber(decimal number) + { + if (sendGridView.CurrentRow == null) + return; + var id = (long)sendGridView.CurrentRow.Cells[0].Value; + CarcassSaleOutBL.UpdateWeightNumber(id, number); + var first = weightRecord.First(x => x.ID == id); + first.Selected = true; + first.Number = number; + sendGridView.Refresh(); + } + + private void scanCodeBtn_Click(object sender, EventArgs e) + { + scanCode = !scanCode; + //scanCodeBtn.Text = scanCode ? "扫码发货" : "自动发货"; + } + + private void readBtn_Click(object sender, EventArgs e) + { + lock (_lock) + { + var weight = weightControl1.Weight; + if (!scanCode) + { + weight -= (config.DiscontWeight ?? 0); + if (weight <= 0) + throw new Exception("重量不能为0"); + var detail = CarcassSaleOutBL.AutoFill("G8536", batchID, weight); + if (weightRecord.Any()) + detail.Idx = weightRecord.First().Idx + 1; + else + detail.Idx = 1; + weightRecord.Insert(0, detail); + sendGridView.FirstDisplayedScrollingRowIndex = 0; + } + else + { + var tags = weightRecord.Where(x => !x.Filled); + if (tags.Count() == 0) + throw new Exception("没有等待读入重量的明细"); + var ids = tags.Select(x => x.ID).ToList(); + weight -= (config.DiscontWeight * ids.Count ?? 0); + if (weight <= 0) + throw new Exception("重量不能为0"); + + var last = ids.Last(); + CarcassSaleOutBL.InsertWeight(ids, weight); + foreach (var item in tags) + { + if (item.ID == last) + item.Weight = weight; + else + item.Weight = 0; + item.Filled = true; + } + } + + sendGridView.Refresh(); + checkWeight = new Thread(new ParameterizedThreadStart(CheckWeight)); + checkWeight.Start(weight); + } + } + } +} diff --git a/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.resx b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.resx new file mode 100644 index 0000000..5e20f0d --- /dev/null +++ b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.resx @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs index d475895..5a0c85a 100644 --- a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs +++ b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs @@ -13,5 +13,7 @@ namespace ButcherFactory.CarcassSaleOut_ public string Store_Name { get; set; } public string Weight { get; set; } + + public decimal? DiscontWeight { get; set; } } } diff --git a/ButcherFactory.Form/Controls/InfoBox.cs b/ButcherFactory.Form/Controls/InfoBox.cs index cf2c227..7afa215 100644 --- a/ButcherFactory.Form/Controls/InfoBox.cs +++ b/ButcherFactory.Form/Controls/InfoBox.cs @@ -60,10 +60,10 @@ namespace ButcherFactory.Controls })); } - public static void Show(string title, string msg,Color foreColor, int closeSec = 0) + public static void Show(string title, string msg, Color foreColor, int closeSec, IWin32Window owner) { - var d = new InfoBox(title, msg,foreColor, closeSec); - d.ShowDialog(); + var d = new InfoBox(title, msg, foreColor, closeSec); + d.ShowDialog(owner); } private void button1_Click(object sender, EventArgs e) diff --git a/ButcherFactory.Form/SegmentInStore_/InStoreSummaryView.cs b/ButcherFactory.Form/SegmentInStore_/InStoreSummaryView.cs index 0726d62..963c968 100644 --- a/ButcherFactory.Form/SegmentInStore_/InStoreSummaryView.cs +++ b/ButcherFactory.Form/SegmentInStore_/InStoreSummaryView.cs @@ -18,16 +18,56 @@ namespace ButcherFactory.SegmentInStore_ public InStoreSummaryView() { InitializeComponent(); + inStoreGrid.RowPrePaint += uDataGridView1_RowPrePaint; + inStoreGrid.CellPainting += uDataGridView1_CellPainting; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); list = SegmentInStoreBL.GetInStoreSummary(); + list.Add(new SegmentInStore { Number = list.Sum(x => x.Number ?? 0), Weight = list.Sum(x => x.Weight ?? 0) }); inStoreGrid.DataSource = list; inStoreGrid.Refresh(); } + private void uDataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) + { + if (e.RowIndex == inStoreGrid.Rows.Count - 1) + { + var row = inStoreGrid.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 = inStoreGrid.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; + } + } + } + } + private void closeBtn_Click(object sender, EventArgs e) { this.Close(); diff --git a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs index 2dc09a7..bfe2b7e 100644 --- a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs +++ b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs @@ -28,36 +28,36 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle41 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle42 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle43 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle46 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle44 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle45 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle47 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle48 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle51 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle49 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle50 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle52 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); + this.barCodeBox = new System.Windows.Forms.TextBox(); + this.uLabel1 = new WinFormControl.ULabel(); this.inStoreViewBtn = new WinFormControl.NButton(); this.netStateWatch1 = new WinFormControl.NetStateWatch(); this.storeSelect = new System.Windows.Forms.ComboBox(); this.uLabel3 = new WinFormControl.ULabel(); - this.uScanPanel1 = new WinFormControl.UScanPanel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.inStoreGrid = new WinFormControl.UDataGridView(); this.I_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.I_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.I_ShortCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.I_Goods_Code = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.I_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.I_Goods_Spec = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.I_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -70,7 +70,6 @@ this.B_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_ShortCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.B_Goods_Code = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_Goods_Spec = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -78,12 +77,10 @@ this.uLabel5 = new WinFormControl.ULabel(); this.backBtn = new WinFormControl.NButton(); this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.refreshBtn = new WinFormControl.NButton(); this.unInstoreGrid = new WinFormControl.UDataGridView(); this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_ShortCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.U_Goods_Code = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Goods_Spec = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -96,6 +93,8 @@ this.E_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.E_ExceptionInfo = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uLabel4 = new WinFormControl.ULabel(); + this.clearErrorBtn = new WinFormControl.NButton(); + this.refreshBtn = new WinFormControl.NButton(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.inStoreGrid)).BeginInit(); @@ -109,23 +108,43 @@ // // panel1 // + this.panel1.Controls.Add(this.barCodeBox); + this.panel1.Controls.Add(this.uLabel1); this.panel1.Controls.Add(this.inStoreViewBtn); this.panel1.Controls.Add(this.netStateWatch1); this.panel1.Controls.Add(this.storeSelect); this.panel1.Controls.Add(this.uLabel3); - this.panel1.Controls.Add(this.uScanPanel1); this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(611, 140); + this.panel1.Size = new System.Drawing.Size(583, 140); this.panel1.TabIndex = 0; // + // barCodeBox + // + this.barCodeBox.Font = new System.Drawing.Font("宋体", 14F); + this.barCodeBox.Location = new System.Drawing.Point(83, 33); + this.barCodeBox.Name = "barCodeBox"; + this.barCodeBox.Size = new System.Drawing.Size(391, 29); + this.barCodeBox.TabIndex = 20; + // + // uLabel1 + // + this.uLabel1.AutoSize = true; + this.uLabel1.BackColor = System.Drawing.Color.Transparent; + this.uLabel1.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel1.Location = new System.Drawing.Point(16, 37); + this.uLabel1.Name = "uLabel1"; + this.uLabel1.Size = new System.Drawing.Size(69, 20); + this.uLabel1.TabIndex = 21; + this.uLabel1.Text = "条码:"; + // // inStoreViewBtn // this.inStoreViewBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); this.inStoreViewBtn.ClickColor = System.Drawing.Color.YellowGreen; this.inStoreViewBtn.Font = new System.Drawing.Font("宋体", 12F); this.inStoreViewBtn.ForeColor = System.Drawing.Color.White; - this.inStoreViewBtn.Location = new System.Drawing.Point(323, 76); + this.inStoreViewBtn.Location = new System.Drawing.Point(379, 76); this.inStoreViewBtn.Name = "inStoreViewBtn"; this.inStoreViewBtn.PlaySound = false; this.inStoreViewBtn.Size = new System.Drawing.Size(95, 45); @@ -139,7 +158,7 @@ // netStateWatch1 // this.netStateWatch1.BackColor = System.Drawing.Color.Transparent; - this.netStateWatch1.Location = new System.Drawing.Point(499, 3); + this.netStateWatch1.Location = new System.Drawing.Point(489, 3); this.netStateWatch1.Name = "netStateWatch1"; this.netStateWatch1.Size = new System.Drawing.Size(90, 39); this.netStateWatch1.TabIndex = 18; @@ -148,9 +167,9 @@ // this.storeSelect.Font = new System.Drawing.Font("宋体", 15F); this.storeSelect.FormattingEnabled = true; - this.storeSelect.Location = new System.Drawing.Point(85, 83); + this.storeSelect.Location = new System.Drawing.Point(83, 84); this.storeSelect.Name = "storeSelect"; - this.storeSelect.Size = new System.Drawing.Size(170, 28); + this.storeSelect.Size = new System.Drawing.Size(240, 28); this.storeSelect.TabIndex = 16; // // uLabel3 @@ -158,20 +177,12 @@ this.uLabel3.AutoSize = true; this.uLabel3.BackColor = System.Drawing.Color.Transparent; this.uLabel3.Font = new System.Drawing.Font("宋体", 15F); - this.uLabel3.Location = new System.Drawing.Point(23, 87); + this.uLabel3.Location = new System.Drawing.Point(16, 88); this.uLabel3.Name = "uLabel3"; this.uLabel3.Size = new System.Drawing.Size(69, 20); this.uLabel3.TabIndex = 17; this.uLabel3.Text = "仓库:"; // - // uScanPanel1 - // - this.uScanPanel1.BackColor = System.Drawing.Color.Transparent; - this.uScanPanel1.Location = new System.Drawing.Point(20, 33); - this.uScanPanel1.Name = "uScanPanel1"; - this.uScanPanel1.Size = new System.Drawing.Size(303, 32); - this.uScanPanel1.TabIndex = 9; - // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -181,7 +192,7 @@ this.groupBox1.Controls.Add(this.goodsNameLbl); this.groupBox1.Location = new System.Drawing.Point(11, 159); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(600, 434); + this.groupBox1.Size = new System.Drawing.Size(627, 434); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; // @@ -191,39 +202,38 @@ this.inStoreGrid.AllowUserToDeleteRows = false; this.inStoreGrid.AllowUserToResizeColumns = false; this.inStoreGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle37.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.inStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle37; + dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.inStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle19; this.inStoreGrid.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.inStoreGrid.BackgroundColor = System.Drawing.Color.White; this.inStoreGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle38.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle38.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.inStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle38; + dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle20.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.inStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle20; this.inStoreGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.inStoreGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.I_ID, this.I_RowIndex, this.I_ShortCode, - this.I_Goods_Code, this.I_Goods_Name, this.I_Goods_Spec, this.I_Weight, this.I_InStoreTime}); - this.inStoreGrid.Location = new System.Drawing.Point(3, 60); + this.inStoreGrid.Location = new System.Drawing.Point(3, 33); this.inStoreGrid.MultiSelect = false; this.inStoreGrid.Name = "inStoreGrid"; this.inStoreGrid.ReadOnly = true; this.inStoreGrid.RowHeadersVisible = false; - dataGridViewCellStyle41.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle41.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.inStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle41; + dataGridViewCellStyle23.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle23.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.inStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle23; this.inStoreGrid.RowTemplate.Height = 23; this.inStoreGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.inStoreGrid.Size = new System.Drawing.Size(595, 371); + this.inStoreGrid.Size = new System.Drawing.Size(618, 398); this.inStoreGrid.TabIndex = 9; // // I_ID @@ -244,26 +254,20 @@ // // I_ShortCode // - this.I_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.I_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.I_ShortCode.DataPropertyName = "ShortCode"; this.I_ShortCode.HeaderText = "条码"; + this.I_ShortCode.MinimumWidth = 120; this.I_ShortCode.Name = "I_ShortCode"; this.I_ShortCode.ReadOnly = true; - this.I_ShortCode.Width = 60; - // - // I_Goods_Code - // - this.I_Goods_Code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.I_Goods_Code.DataPropertyName = "Goods_Code"; - this.I_Goods_Code.HeaderText = "产品编号"; - this.I_Goods_Code.Name = "I_Goods_Code"; - this.I_Goods_Code.ReadOnly = true; // // I_Goods_Name // this.I_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.I_Goods_Name.DataPropertyName = "Goods_Name"; + this.I_Goods_Name.FillWeight = 110F; this.I_Goods_Name.HeaderText = "产品名称"; + this.I_Goods_Name.MinimumWidth = 120; this.I_Goods_Name.Name = "I_Goods_Name"; this.I_Goods_Name.ReadOnly = true; // @@ -278,8 +282,8 @@ // I_Weight // this.I_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle39.Format = "#0.######"; - this.I_Weight.DefaultCellStyle = dataGridViewCellStyle39; + dataGridViewCellStyle21.Format = "#0.######"; + this.I_Weight.DefaultCellStyle = dataGridViewCellStyle21; this.I_Weight.HeaderText = "重量"; this.I_Weight.Name = "I_Weight"; this.I_Weight.ReadOnly = true; @@ -287,15 +291,14 @@ // // I_InStoreTime // - this.I_InStoreTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; this.I_InStoreTime.DataPropertyName = "InStoreTime"; - dataGridViewCellStyle40.Format = "T"; - dataGridViewCellStyle40.NullValue = null; - this.I_InStoreTime.DefaultCellStyle = dataGridViewCellStyle40; + dataGridViewCellStyle22.Format = "T"; + dataGridViewCellStyle22.NullValue = null; + this.I_InStoreTime.DefaultCellStyle = dataGridViewCellStyle22; this.I_InStoreTime.HeaderText = "入库时间"; this.I_InStoreTime.Name = "I_InStoreTime"; this.I_InStoreTime.ReadOnly = true; - this.I_InStoreTime.Width = 60; + this.I_InStoreTime.Width = 110; // // goodsNameLbl // @@ -317,9 +320,9 @@ this.groupBox2.Controls.Add(this.backStoreGrid); this.groupBox2.Controls.Add(this.uLabel5); this.groupBox2.Controls.Add(this.backBtn); - this.groupBox2.Location = new System.Drawing.Point(631, 159); + this.groupBox2.Location = new System.Drawing.Point(656, 159); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(655, 241); + this.groupBox2.Size = new System.Drawing.Size(630, 241); this.groupBox2.TabIndex = 2; this.groupBox2.TabStop = false; // @@ -363,21 +366,20 @@ this.backStoreGrid.AllowUserToDeleteRows = false; this.backStoreGrid.AllowUserToResizeColumns = false; this.backStoreGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle42.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.backStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle42; + dataGridViewCellStyle24.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.backStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle24; this.backStoreGrid.BackgroundColor = System.Drawing.Color.White; this.backStoreGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle43.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle43.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle43.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle43.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.backStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle43; + dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle25.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle25.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle25.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.backStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle25; this.backStoreGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.backStoreGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.B_ID, this.B_RowIndex, this.B_ShortCode, - this.B_Goods_Code, this.B_Goods_Name, this.B_Goods_Spec, this.B_Weight, @@ -388,12 +390,12 @@ this.backStoreGrid.Name = "backStoreGrid"; this.backStoreGrid.ReadOnly = true; this.backStoreGrid.RowHeadersVisible = false; - dataGridViewCellStyle46.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle46.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.backStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle46; + dataGridViewCellStyle28.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle28.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.backStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle28; this.backStoreGrid.RowTemplate.Height = 23; this.backStoreGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.backStoreGrid.Size = new System.Drawing.Size(649, 178); + this.backStoreGrid.Size = new System.Drawing.Size(624, 178); this.backStoreGrid.TabIndex = 8; // // B_ID @@ -414,26 +416,21 @@ // // B_ShortCode // - this.B_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.B_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.B_ShortCode.DataPropertyName = "ShortCode"; + this.B_ShortCode.FillWeight = 120F; this.B_ShortCode.HeaderText = "条码"; + this.B_ShortCode.MinimumWidth = 120; this.B_ShortCode.Name = "B_ShortCode"; this.B_ShortCode.ReadOnly = true; - this.B_ShortCode.Width = 60; - // - // B_Goods_Code - // - this.B_Goods_Code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.B_Goods_Code.DataPropertyName = "Goods_Code"; - this.B_Goods_Code.HeaderText = "产品编号"; - this.B_Goods_Code.Name = "B_Goods_Code"; - this.B_Goods_Code.ReadOnly = true; // // B_Goods_Name // this.B_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.B_Goods_Name.DataPropertyName = "Goods_Name"; + this.B_Goods_Name.FillWeight = 140F; this.B_Goods_Name.HeaderText = "产品名称"; + this.B_Goods_Name.MinimumWidth = 140; this.B_Goods_Name.Name = "B_Goods_Name"; this.B_Goods_Name.ReadOnly = true; // @@ -448,24 +445,23 @@ // B_Weight // this.B_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle44.Format = "#0.######"; - this.B_Weight.DefaultCellStyle = dataGridViewCellStyle44; + dataGridViewCellStyle26.Format = "#0.######"; + this.B_Weight.DefaultCellStyle = dataGridViewCellStyle26; this.B_Weight.HeaderText = "重量"; this.B_Weight.Name = "B_Weight"; this.B_Weight.ReadOnly = true; - this.B_Weight.Width = 70; + this.B_Weight.Width = 80; // // B_ProductTime // - this.B_ProductTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; this.B_ProductTime.DataPropertyName = "ProductTime"; - dataGridViewCellStyle45.Format = "T"; - dataGridViewCellStyle45.NullValue = null; - this.B_ProductTime.DefaultCellStyle = dataGridViewCellStyle45; + dataGridViewCellStyle27.Format = "T"; + dataGridViewCellStyle27.NullValue = null; + this.B_ProductTime.DefaultCellStyle = dataGridViewCellStyle27; this.B_ProductTime.HeaderText = "生产时间"; this.B_ProductTime.Name = "B_ProductTime"; this.B_ProductTime.ReadOnly = true; - this.B_ProductTime.Width = 60; + this.B_ProductTime.Width = 110; // // uLabel5 // @@ -501,70 +497,51 @@ // this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox3.Controls.Add(this.refreshBtn); this.groupBox3.Controls.Add(this.unInstoreGrid); this.groupBox3.Controls.Add(this.uLabel6); - this.groupBox3.Location = new System.Drawing.Point(631, 421); + this.groupBox3.Location = new System.Drawing.Point(656, 428); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(655, 172); + this.groupBox3.Size = new System.Drawing.Size(630, 165); this.groupBox3.TabIndex = 3; this.groupBox3.TabStop = false; this.groupBox3.Text = "groupBox3"; // - // refreshBtn - // - this.refreshBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); - this.refreshBtn.ClickColor = System.Drawing.Color.YellowGreen; - this.refreshBtn.Font = new System.Drawing.Font("宋体", 12F); - this.refreshBtn.ForeColor = System.Drawing.Color.White; - this.refreshBtn.Location = new System.Drawing.Point(122, 11); - this.refreshBtn.Name = "refreshBtn"; - this.refreshBtn.PlaySound = false; - this.refreshBtn.Size = new System.Drawing.Size(95, 45); - this.refreshBtn.SoundType = WinFormControl.SoundType.Click; - this.refreshBtn.TabIndex = 10; - this.refreshBtn.Text = "刷新"; - this.refreshBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); - this.refreshBtn.UseVisualStyleBackColor = false; - this.refreshBtn.Click += new System.EventHandler(this.refreshBtn_Click); - // // unInstoreGrid // this.unInstoreGrid.AllowUserToAddRows = false; this.unInstoreGrid.AllowUserToDeleteRows = false; this.unInstoreGrid.AllowUserToResizeColumns = false; this.unInstoreGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle47.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.unInstoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle47; - this.unInstoreGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + dataGridViewCellStyle29.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.unInstoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle29; this.unInstoreGrid.BackgroundColor = System.Drawing.Color.White; this.unInstoreGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle48.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle48.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle48.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle48.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.unInstoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle48; + dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle30.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle30.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle30.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.unInstoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle30; this.unInstoreGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.unInstoreGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn8, this.U_RowIndex, this.U_ShortCode, - this.U_Goods_Code, this.U_Goods_Name, this.U_Goods_Spec, this.U_Weight, this.U_ProductTime}); - this.unInstoreGrid.Location = new System.Drawing.Point(3, 60); + this.unInstoreGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.unInstoreGrid.Location = new System.Drawing.Point(3, 17); this.unInstoreGrid.MultiSelect = false; this.unInstoreGrid.Name = "unInstoreGrid"; this.unInstoreGrid.ReadOnly = true; this.unInstoreGrid.RowHeadersVisible = false; - dataGridViewCellStyle51.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle51.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.unInstoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle51; + dataGridViewCellStyle33.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle33.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.unInstoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle33; this.unInstoreGrid.RowTemplate.Height = 23; this.unInstoreGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.unInstoreGrid.Size = new System.Drawing.Size(649, 109); + this.unInstoreGrid.Size = new System.Drawing.Size(624, 145); this.unInstoreGrid.TabIndex = 9; // // dataGridViewTextBoxColumn8 @@ -585,26 +562,21 @@ // // U_ShortCode // - this.U_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.U_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.U_ShortCode.DataPropertyName = "ShortCode"; + this.U_ShortCode.FillWeight = 120F; this.U_ShortCode.HeaderText = "条码"; + this.U_ShortCode.MinimumWidth = 120; this.U_ShortCode.Name = "U_ShortCode"; this.U_ShortCode.ReadOnly = true; - this.U_ShortCode.Width = 60; - // - // U_Goods_Code - // - this.U_Goods_Code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.U_Goods_Code.DataPropertyName = "Goods_Code"; - this.U_Goods_Code.HeaderText = "产品编号"; - this.U_Goods_Code.Name = "U_Goods_Code"; - this.U_Goods_Code.ReadOnly = true; // // U_Goods_Name // this.U_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.U_Goods_Name.DataPropertyName = "Goods_Name"; + this.U_Goods_Name.FillWeight = 140F; this.U_Goods_Name.HeaderText = "产品名称"; + this.U_Goods_Name.MinimumWidth = 140; this.U_Goods_Name.Name = "U_Goods_Name"; this.U_Goods_Name.ReadOnly = true; // @@ -619,24 +591,24 @@ // U_Weight // this.U_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle49.Format = "#0.######"; - this.U_Weight.DefaultCellStyle = dataGridViewCellStyle49; + dataGridViewCellStyle31.Format = "#0.######"; + this.U_Weight.DefaultCellStyle = dataGridViewCellStyle31; this.U_Weight.HeaderText = "重量"; this.U_Weight.Name = "U_Weight"; this.U_Weight.ReadOnly = true; - this.U_Weight.Width = 70; + this.U_Weight.Width = 80; // // U_ProductTime // - this.U_ProductTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; this.U_ProductTime.DataPropertyName = "ProductTime"; - dataGridViewCellStyle50.Format = "T"; - dataGridViewCellStyle50.NullValue = null; - this.U_ProductTime.DefaultCellStyle = dataGridViewCellStyle50; + dataGridViewCellStyle32.Format = "T"; + dataGridViewCellStyle32.NullValue = null; + this.U_ProductTime.DefaultCellStyle = dataGridViewCellStyle32; this.U_ProductTime.HeaderText = "生产时间"; + this.U_ProductTime.MinimumWidth = 2; this.U_ProductTime.Name = "U_ProductTime"; this.U_ProductTime.ReadOnly = true; - this.U_ProductTime.Width = 60; + this.U_ProductTime.Width = 110; // // uLabel6 // @@ -655,9 +627,9 @@ this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox4.Controls.Add(this.exceptionGrid); this.groupBox4.Controls.Add(this.uLabel4); - this.groupBox4.Location = new System.Drawing.Point(631, 16); + this.groupBox4.Location = new System.Drawing.Point(656, 16); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(655, 124); + this.groupBox4.Size = new System.Drawing.Size(630, 124); this.groupBox4.TabIndex = 4; this.groupBox4.TabStop = false; this.groupBox4.Text = "groupBox4"; @@ -668,15 +640,15 @@ this.exceptionGrid.AllowUserToDeleteRows = false; this.exceptionGrid.AllowUserToResizeColumns = false; this.exceptionGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle52.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.exceptionGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle52; + dataGridViewCellStyle34.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.exceptionGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle34; this.exceptionGrid.BackgroundColor = System.Drawing.Color.White; this.exceptionGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle53.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle53.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle53.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle53.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.exceptionGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle53; + dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle35.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle35.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle35.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.exceptionGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle35; this.exceptionGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.exceptionGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.E_ID, @@ -689,12 +661,12 @@ this.exceptionGrid.Name = "exceptionGrid"; this.exceptionGrid.ReadOnly = true; this.exceptionGrid.RowHeadersVisible = false; - dataGridViewCellStyle54.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle54.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.exceptionGrid.RowsDefaultCellStyle = dataGridViewCellStyle54; + dataGridViewCellStyle36.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle36.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.exceptionGrid.RowsDefaultCellStyle = dataGridViewCellStyle36; this.exceptionGrid.RowTemplate.Height = 23; this.exceptionGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.exceptionGrid.Size = new System.Drawing.Size(649, 104); + this.exceptionGrid.Size = new System.Drawing.Size(624, 104); this.exceptionGrid.TabIndex = 9; // // E_ID @@ -707,8 +679,8 @@ // // E_RowIndex // - this.E_RowIndex.DataPropertyName = "RowIndex"; - this.E_RowIndex.HeaderText = "序号"; + this.E_RowIndex.DataPropertyName = "ID"; + this.E_RowIndex.HeaderText = "异常号"; this.E_RowIndex.Name = "E_RowIndex"; this.E_RowIndex.ReadOnly = true; // @@ -740,12 +712,50 @@ this.uLabel4.TabIndex = 5; this.uLabel4.Text = "异常记录"; // + // clearErrorBtn + // + this.clearErrorBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.clearErrorBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.clearErrorBtn.ClickColor = System.Drawing.Color.YellowGreen; + this.clearErrorBtn.Font = new System.Drawing.Font("宋体", 12F); + this.clearErrorBtn.ForeColor = System.Drawing.Color.White; + this.clearErrorBtn.Location = new System.Drawing.Point(1191, 134); + this.clearErrorBtn.Name = "clearErrorBtn"; + this.clearErrorBtn.PlaySound = false; + this.clearErrorBtn.Size = new System.Drawing.Size(95, 32); + this.clearErrorBtn.SoundType = WinFormControl.SoundType.Click; + this.clearErrorBtn.TabIndex = 5; + this.clearErrorBtn.Text = "清理异常"; + this.clearErrorBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.clearErrorBtn.UseVisualStyleBackColor = false; + this.clearErrorBtn.Click += new System.EventHandler(this.clearErrorBtn_Click); + // + // refreshBtn + // + this.refreshBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.refreshBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.refreshBtn.ClickColor = System.Drawing.Color.YellowGreen; + this.refreshBtn.Font = new System.Drawing.Font("宋体", 12F); + this.refreshBtn.ForeColor = System.Drawing.Color.White; + this.refreshBtn.Location = new System.Drawing.Point(1191, 401); + this.refreshBtn.Name = "refreshBtn"; + this.refreshBtn.PlaySound = false; + this.refreshBtn.Size = new System.Drawing.Size(95, 32); + this.refreshBtn.SoundType = WinFormControl.SoundType.Click; + this.refreshBtn.TabIndex = 6; + this.refreshBtn.Text = "刷新"; + this.refreshBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.refreshBtn.UseVisualStyleBackColor = false; + this.refreshBtn.Click += new System.EventHandler(this.refreshBtn_Click); + // // SegmentInStoreForm // 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(1305, 611); + this.Controls.Add(this.refreshBtn); + this.Controls.Add(this.clearErrorBtn); this.Controls.Add(this.groupBox4); this.Controls.Add(this.panel1); this.Controls.Add(this.groupBox3); @@ -777,7 +787,6 @@ #endregion private System.Windows.Forms.Panel panel1; - private WinFormControl.UScanPanel uScanPanel1; private System.Windows.Forms.GroupBox groupBox1; private WinFormControl.ULabel goodsNameLbl; private System.Windows.Forms.GroupBox groupBox2; @@ -794,17 +803,17 @@ private WinFormControl.UDataGridView unInstoreGrid; private WinFormControl.UDataGridView inStoreGrid; private WinFormControl.NButton backBtn; + private WinFormControl.NButton submitBtn; + private WinFormControl.NButton deleteBtn; + private WinFormControl.NButton inStoreViewBtn; private System.Windows.Forms.DataGridViewTextBoxColumn E_ID; private System.Windows.Forms.DataGridViewTextBoxColumn E_RowIndex; private System.Windows.Forms.DataGridViewTextBoxColumn E_BarCode; private System.Windows.Forms.DataGridViewTextBoxColumn E_ExceptionInfo; - private WinFormControl.NButton submitBtn; - private WinFormControl.NButton deleteBtn; - private WinFormControl.NButton refreshBtn; + private WinFormControl.NButton clearErrorBtn; private System.Windows.Forms.DataGridViewTextBoxColumn B_ID; private System.Windows.Forms.DataGridViewTextBoxColumn B_RowIndex; private System.Windows.Forms.DataGridViewTextBoxColumn B_ShortCode; - private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Code; private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Name; private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Spec; private System.Windows.Forms.DataGridViewTextBoxColumn B_Weight; @@ -812,19 +821,19 @@ private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8; private System.Windows.Forms.DataGridViewTextBoxColumn U_RowIndex; private System.Windows.Forms.DataGridViewTextBoxColumn U_ShortCode; - private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Code; private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Name; private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Spec; private System.Windows.Forms.DataGridViewTextBoxColumn U_Weight; private System.Windows.Forms.DataGridViewTextBoxColumn U_ProductTime; - private WinFormControl.NButton inStoreViewBtn; private System.Windows.Forms.DataGridViewTextBoxColumn I_ID; private System.Windows.Forms.DataGridViewTextBoxColumn I_RowIndex; private System.Windows.Forms.DataGridViewTextBoxColumn I_ShortCode; - private System.Windows.Forms.DataGridViewTextBoxColumn I_Goods_Code; private System.Windows.Forms.DataGridViewTextBoxColumn I_Goods_Name; private System.Windows.Forms.DataGridViewTextBoxColumn I_Goods_Spec; private System.Windows.Forms.DataGridViewTextBoxColumn I_Weight; private System.Windows.Forms.DataGridViewTextBoxColumn I_InStoreTime; + private System.Windows.Forms.TextBox barCodeBox; + private WinFormControl.ULabel uLabel1; + private WinFormControl.NButton refreshBtn; } } \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs index cf5e509..b0909d6 100644 --- a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs +++ b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs @@ -14,6 +14,7 @@ using System.Windows.Forms; using ButcherFactory.Utils; using ButcherFactory.BO.LocalBL; using ButcherFactory.Controls; +using HidLibrary.Honeywell1902Series; namespace ButcherFactory.SegmentInStore_ { @@ -32,22 +33,31 @@ namespace ButcherFactory.SegmentInStore_ #endregion Thread uploadData; + Thread checkHasData; BindingList inStoreList; BindingList unInstoreList; BindingList exceptionList; BindingList backStoreList; + private static Scanner1902 _scanner; long? storeID; bool isBack = false; + public SegmentInStoreForm() { InitializeComponent(); netStateWatch1.GetConnectState = () => LoginUtil.TestConnection(500); - uScanPanel1.AfterScan += uScanPanel1_AfterScan; this.FormClosing += delegate { if (uploadData != null && uploadData.IsAlive) uploadData.Abort(); + if (checkHasData != null && checkHasData.IsAlive) + checkHasData.Abort(); + if (_scanner != null) + { + _scanner.StopListen(); + _scanner.Dispose(); + } }; storeSelect.SelectedIndexChanged += delegate @@ -63,45 +73,74 @@ namespace ButcherFactory.SegmentInStore_ protected override void OnLoad(EventArgs e) { base.OnLoad(e); + inStoreList = new BindingList(); var initTask = new Thread(LoadBind); initTask.Start(); uploadData = new Thread(UpLoadLocalData); uploadData.Start(); + + + var vid = Int32.Parse("0C2E", System.Globalization.NumberStyles.HexNumber); + var pid = Int32.Parse("0927", System.Globalization.NumberStyles.HexNumber); + _scanner = Scanner1902.Enumerate(vid, pid).FirstOrDefault(); + if (_scanner != null) + { + _scanner.DataRecieved += ScannerDataRecieved; + _scanner.StartListen(); + } + else + { + MessageBox.Show("请连接扫码枪后重新启动程序!"); + } } private void LoadBind() { + BLUtil.DeleteLocalDb(); + if (netStateWatch1.NetState) + { + BaseInfoSyncRpc.SyncBaseInfo(); + BaseInfoSyncRpc.SyncProductBatch(1); + BaseInfoSyncRpc.SyncBaseInfo(); + } this.Invoke(new Action(() => { - BLUtil.DeleteLocalDb(); - if (netStateWatch1.NetState) - { - BaseInfoSyncRpc.SyncBaseInfo(); - BaseInfoSyncRpc.SyncProductBatch(1); - BaseInfoSyncRpc.SyncBaseInfo(); - } var config = XmlUtil.DeserializeFromFile(); var m = config.StoreID; storeSelect.EBindComboBox(x => x.ID == m); BindInStoreGrid(); BindExceptionGrid(); BindBackGrid(); - BindUnInStoreGrid(); + BindUnInstall(); })); } + private void BindUnInstall() + { + unInstoreList = new BindingList(SegmentInStoreBL.GetUnInStoreList()); + unInstoreGrid.DataSource = unInstoreList; + RefreshUnInStore(); + } + + object _lockUn = new object(); + void RefreshUnInStore() + { + lock (_lockUn) + unInstoreGrid.Refresh(); + } + private void BindInStoreGrid() { inStoreList = SegmentInStoreBL.GetInStoreByStateList(0); inStoreGrid.DataSource = inStoreList; - inStoreGrid.Refresh(); + RefreshInStore(); } private void BindExceptionGrid() { - //exceptionList = SegmentInStoreBL.GetExceptionList(); - //exceptionGrid.DataSource = exceptionList; - //exceptionGrid.Refresh(); + exceptionList = SegmentInStoreBL.GetExceptionList(); + exceptionGrid.DataSource = exceptionList; + exceptionGrid.Refresh(); } private void BindBackGrid() @@ -111,73 +150,123 @@ namespace ButcherFactory.SegmentInStore_ backStoreGrid.Refresh(); } - private void BindUnInStoreGrid() - { - unInstoreList = SegmentInStoreBL.GetUnInStoreList(); - if (unInstoreList == null) - unInstoreList = new BindingList(); - unInstoreGrid.DataSource = unInstoreList; - unInstoreGrid.Refresh(); - } - private void UpLoadLocalData() { while (true) { try { - this.Invoke(new Action(() => - { - if (netStateWatch1.NetState) - SegmentInStoreBL.UploadSegmentInstoreInfo(); - })); + if (netStateWatch1.NetState) + SegmentInStoreBL.UploadSegmentInstoreInfo(); } catch { } Thread.Sleep(1000); } } - private void uScanPanel1_AfterScan() + private void ScannerDataRecieved(byte[] data) { - if (isBack) + var code = ControlsUtil.ParseCode(Encoding.ASCII.GetString(data)); + if (string.IsNullOrEmpty(code)) + return; + this.Invoke(new Action(() => { - var idx = backStoreList.Any() ? backStoreList.First().RowIndex.Value : 0; - var msg = SegmentInStoreBL.SetAsBacking(uScanPanel1.TextBox.Text, idx + 1); - if (!string.IsNullOrEmpty(msg)) + barCodeBox.Text = code; + if (isBack) { - InfoBox.Show("错误", msg, Color.Red, 2); - return; + var idx = backStoreList.Any() ? backStoreList.First().RowIndex.Value : 0; + var msg = SegmentInStoreBL.SetAsBacking(code, idx + 1); + if (!string.IsNullOrEmpty(msg)) + { + InsertExceptionInfo(code, msg); + ControlsUtil.PlanVoice(msg); + InfoBox.Show("错误", msg, Color.Red, 1, this); + return; + } + BindBackGrid(); + var fir = inStoreList.FirstOrDefault(x => x.BarCode == code); + if (fir != null) + { + inStoreList.Remove(fir); + RefreshInStore(); + } } - BindBackGrid(); - var fir = inStoreList.FirstOrDefault(x => x.BarCode == uScanPanel1.TextBox.Text); - if (fir != null) + else { - inStoreList.Remove(fir); - inStoreGrid.Refresh(); + var idx = inStoreList.Any() ? inStoreList.First().RowIndex.Value : 0; + var first = new SegmentInStore() { Store_ID = storeID, BarCode = code, RowIndex = idx + 1 }; + var msg = SegmentInStoreBL.InsertInStore(first); + if (!string.IsNullOrEmpty(msg)) + { + InsertExceptionInfo(code, msg); + ControlsUtil.PlanVoice(msg); + InfoBox.Show("错误", msg, Color.Red, 1, this); + return; + } + inStoreList.Insert(0, first); + if (inStoreList.Count > 30) + inStoreList.RemoveAt(30); + if (first.Weight == null) + { + checkHasData = new Thread(new ParameterizedThreadStart(GetInfoFromServer)); + checkHasData.Start(first); + } } + })); + } + + private void GetInfoFromServer(object obj) + { + var entity = obj as SegmentInStore; + SegmentInStoreBL.RefreshFromServer(entity); + if (entity.Weight == null) + { + this.Invoke(new Action(() => + { + var msg = "条码无效"; + InsertExceptionInfo(entity.BarCode, msg); + + SegmentInStoreBL.Delete(entity.ID); + inStoreList.Remove(entity); + ControlsUtil.PlanVoice(msg); + InfoBox.Show("错误", msg, Color.Red, 1, this); + })); } - else + this.Invoke(new Action(() => { - var idx = inStoreList.Any() ? inStoreList.First().RowIndex.Value : 0; - string msg; - var entity = SegmentInStoreBL.InsertInStore(uScanPanel1.TextBox.Text, storeID, idx + 1,out msg); - if (!string.IsNullOrEmpty(msg)) + RefreshInStore(); + var first = unInstoreList.FirstOrDefault(x => x.BarCode == entity.BarCode); + if (first != null) { - InfoBox.Show("错误", msg, Color.Red, 2); - return; + try + { + unInstoreList.Remove(first); + RefreshUnInStore(); + } + catch { } } - inStoreList.Insert(0, entity); - if (inStoreList.Count >= 30) - inStoreList.RemoveAt(30); + })); + } + + object lc = new object(); + void RefreshInStore() + { + lock (lc) inStoreGrid.Refresh(); - var f = unInstoreList.FirstOrDefault(x => x.BarCode == entity.BarCode); - if (f != null) - { - unInstoreList.Remove(f); - unInstoreGrid.Refresh(); - } - } - uScanPanel1.TextBox.Clear(); + } + + void InsertExceptionInfo(string barCode, string msg) + { + var error = new SegmentCodeError() + { + BarCode = barCode, + ExceptionInfo = msg + }; + SegmentInStoreBL.InsertSegmentCodeError(error); + exceptionList.Insert(0, error); + if (exceptionList.Count > 20) + exceptionList.RemoveAt(20); + exceptionGrid.Refresh(); } private void backBtn_Click(object sender, EventArgs e) @@ -197,9 +286,6 @@ namespace ButcherFactory.SegmentInStore_ var tag = backStoreList.First(x => x.ID == id); backStoreList.Remove(tag); backStoreGrid.Refresh(); - tag.RowIndex = unInstoreList.Any() ? unInstoreList.Last().RowIndex + 1 : 1; - unInstoreList.Add(tag); - unInstoreGrid.Refresh(); } private void submitBtn_Click(object sender, EventArgs e) @@ -212,14 +298,21 @@ namespace ButcherFactory.SegmentInStore_ backStoreGrid.Refresh(); } - private void refreshBtn_Click(object sender, EventArgs e) + private void inStoreViewBtn_Click(object sender, EventArgs e) { - BindUnInStoreGrid(); + new InStoreSummaryView().ShowDialog(); } - private void inStoreViewBtn_Click(object sender, EventArgs e) + private void clearErrorBtn_Click(object sender, EventArgs e) { - new InStoreSummaryView().ShowDialog(); + SegmentInStoreBL.ClearErrorMsg(); + exceptionList.Clear(); + exceptionGrid.Refresh(); + } + + private void refreshBtn_Click(object sender, EventArgs e) + { + BindUnInstall(); } } } diff --git a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.resx b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.resx index 3e98868..e10499e 100644 --- a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.resx +++ b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.resx @@ -120,27 +120,18 @@ True - - True - True True - - True - True True - - True - True diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs index c009416..730316c 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs @@ -28,16 +28,16 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.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(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); this.uLabel3 = new WinFormControl.ULabel(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.taskDataGrid = new WinFormControl.UDataGridView(); @@ -47,10 +47,9 @@ this.T_Last = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.GoodsLabel = new WinFormControl.ULabel(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.templateBtn = new ButcherFactory.Controls.ColorButton(); + this.msglbl = new System.Windows.Forms.Label(); this.closeBtn = new ButcherFactory.Controls.ColorButton(); this.uWeightControl1 = new ButcherFactory.Controls.WeightControl(); - this.testCkBox = new System.Windows.Forms.CheckBox(); this.barPrintCheck = new System.Windows.Forms.CheckBox(); this.uTimerLabel1 = new WinFormControl.UTimerLabel(); this.productBatchSelect = new System.Windows.Forms.ComboBox(); @@ -62,6 +61,7 @@ this.goodsSetBtn = new ButcherFactory.Controls.ColorButton(); this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.deleteBtn = new ButcherFactory.Controls.ColorButton(); this.rePrintBtn = new ButcherFactory.Controls.ColorButton(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.historyDataGrid = new WinFormControl.UDataGridView(); @@ -70,7 +70,6 @@ this.H_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.deleteBtn = new ButcherFactory.Controls.ColorButton(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.taskDataGrid)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -113,15 +112,15 @@ this.taskDataGrid.AllowUserToDeleteRows = false; this.taskDataGrid.AllowUserToResizeColumns = false; this.taskDataGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.taskDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.taskDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.taskDataGrid.BackgroundColor = System.Drawing.Color.White; this.taskDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle12.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.taskDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12; + 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.taskDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.taskDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.taskDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.T_Item, @@ -134,9 +133,9 @@ this.taskDataGrid.Name = "taskDataGrid"; this.taskDataGrid.ReadOnly = true; this.taskDataGrid.RowHeadersVisible = false; - dataGridViewCellStyle16.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.taskDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle16; + 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.taskDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle6; this.taskDataGrid.RowTemplate.Height = 23; this.taskDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.taskDataGrid.Size = new System.Drawing.Size(442, 96); @@ -153,8 +152,8 @@ // this.T_Need.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.T_Need.DataPropertyName = "Need"; - dataGridViewCellStyle13.Format = "#0.######"; - this.T_Need.DefaultCellStyle = dataGridViewCellStyle13; + dataGridViewCellStyle3.Format = "#0.######"; + this.T_Need.DefaultCellStyle = dataGridViewCellStyle3; this.T_Need.HeaderText = "订货"; this.T_Need.Name = "T_Need"; this.T_Need.ReadOnly = true; @@ -163,8 +162,8 @@ // this.T_Done.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.T_Done.DataPropertyName = "Done"; - dataGridViewCellStyle14.Format = "#0.######"; - this.T_Done.DefaultCellStyle = dataGridViewCellStyle14; + dataGridViewCellStyle4.Format = "#0.######"; + this.T_Done.DefaultCellStyle = dataGridViewCellStyle4; this.T_Done.HeaderText = "完工"; this.T_Done.Name = "T_Done"; this.T_Done.ReadOnly = true; @@ -173,8 +172,8 @@ // this.T_Last.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.T_Last.DataPropertyName = "Last"; - dataGridViewCellStyle15.Format = "#0.######"; - this.T_Last.DefaultCellStyle = dataGridViewCellStyle15; + dataGridViewCellStyle5.Format = "#0.######"; + this.T_Last.DefaultCellStyle = dataGridViewCellStyle5; this.T_Last.HeaderText = "剩余"; this.T_Last.Name = "T_Last"; this.T_Last.ReadOnly = true; @@ -203,10 +202,9 @@ // // splitContainer1.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.templateBtn); + this.splitContainer1.Panel1.Controls.Add(this.msglbl); this.splitContainer1.Panel1.Controls.Add(this.closeBtn); this.splitContainer1.Panel1.Controls.Add(this.uWeightControl1); - this.splitContainer1.Panel1.Controls.Add(this.testCkBox); this.splitContainer1.Panel1.Controls.Add(this.barPrintCheck); this.splitContainer1.Panel1.Controls.Add(this.uTimerLabel1); this.splitContainer1.Panel1.Controls.Add(this.productBatchSelect); @@ -222,19 +220,15 @@ this.splitContainer1.SplitterDistance = 87; this.splitContainer1.TabIndex = 1; // - // templateBtn + // msglbl // - this.templateBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222))))); - this.templateBtn.Font = new System.Drawing.Font("宋体", 15F); - this.templateBtn.ForeColor = System.Drawing.Color.White; - this.templateBtn.Location = new System.Drawing.Point(648, 35); - this.templateBtn.Name = "templateBtn"; - this.templateBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); - this.templateBtn.Size = new System.Drawing.Size(111, 41); - this.templateBtn.TabIndex = 23; - this.templateBtn.Text = "选择标签"; - this.templateBtn.UseVisualStyleBackColor = false; - this.templateBtn.Click += new System.EventHandler(this.templateBtn_Click); + this.msglbl.AutoSize = true; + this.msglbl.ForeColor = System.Drawing.Color.Red; + this.msglbl.Location = new System.Drawing.Point(458, 14); + this.msglbl.Name = "msglbl"; + this.msglbl.Size = new System.Drawing.Size(101, 12); + this.msglbl.TabIndex = 24; + this.msglbl.Text = "正在获取基础信息"; // // closeBtn // @@ -260,17 +254,6 @@ this.uWeightControl1.TabIndex = 17; this.uWeightControl1.WeightFalg = null; // - // testCkBox - // - this.testCkBox.AutoSize = true; - this.testCkBox.Font = new System.Drawing.Font("宋体", 15F); - this.testCkBox.Location = new System.Drawing.Point(648, 9); - this.testCkBox.Name = "testCkBox"; - this.testCkBox.Size = new System.Drawing.Size(108, 24); - this.testCkBox.TabIndex = 16; - this.testCkBox.Text = "生产测试"; - this.testCkBox.UseVisualStyleBackColor = true; - // // barPrintCheck // this.barPrintCheck.AutoSize = true; @@ -408,6 +391,21 @@ this.flowLayoutPanel1.Size = new System.Drawing.Size(640, 70); this.flowLayoutPanel1.TabIndex = 22; // + // 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(178, 129); + 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 = 23; + this.deleteBtn.Text = "删除"; + this.deleteBtn.UseVisualStyleBackColor = false; + this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); + // // rePrintBtn // this.rePrintBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222))))); @@ -441,15 +439,15 @@ this.historyDataGrid.AllowUserToDeleteRows = false; this.historyDataGrid.AllowUserToResizeColumns = false; this.historyDataGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; this.historyDataGrid.BackgroundColor = System.Drawing.Color.White; this.historyDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; this.historyDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.H_ID, @@ -463,13 +461,14 @@ this.historyDataGrid.Name = "historyDataGrid"; this.historyDataGrid.ReadOnly = true; this.historyDataGrid.RowHeadersVisible = false; - dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle10; this.historyDataGrid.RowTemplate.Height = 23; this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.historyDataGrid.Size = new System.Drawing.Size(437, 308); this.historyDataGrid.TabIndex = 2; + this.historyDataGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.historyDataGrid_CellClick); // // H_ID // @@ -506,27 +505,12 @@ // H_Weight // this.H_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle19.Format = "#0.######"; - this.H_Weight.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle9.Format = "#0.######"; + this.H_Weight.DefaultCellStyle = dataGridViewCellStyle9; this.H_Weight.HeaderText = "重量"; this.H_Weight.Name = "H_Weight"; this.H_Weight.ReadOnly = true; // - // 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(178, 129); - 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 = 23; - this.deleteBtn.Text = "删除"; - this.deleteBtn.UseVisualStyleBackColor = false; - this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); - // // SegmentProductionAutoForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -567,7 +551,6 @@ private System.Windows.Forms.DataGridViewTextBoxColumn T_Last; private WinFormControl.ULabel GoodsLabel; private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.CheckBox barPrintCheck; private WinFormControl.UTimerLabel uTimerLabel1; private System.Windows.Forms.ComboBox productBatchSelect; private System.Windows.Forms.ComboBox workUnitSelect; @@ -588,8 +571,8 @@ private Controls.ColorButton rePrintBtn; private Controls.ColorButton closeBtn; private Controls.ColorButton goodsSetBtn; - private System.Windows.Forms.CheckBox testCkBox; - private Controls.ColorButton templateBtn; private Controls.ColorButton deleteBtn; + private System.Windows.Forms.Label msglbl; + private System.Windows.Forms.CheckBox barPrintCheck; } } \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs index 4cb4cbc..4409660 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs @@ -35,6 +35,7 @@ namespace ButcherFactory.SegmentProductionAuto_ Thread uploadData; Thread checkInStoreState; + Thread initTask; BindingList historyList; Dictionary> goodsSetDic; long? batchID; @@ -47,6 +48,8 @@ namespace ButcherFactory.SegmentProductionAuto_ netStateWatch1.GetConnectState = () => LoginUtil.TestConnection(500); this.FormClosing += delegate { + if (initTask != null && initTask.IsAlive) + initTask.Abort(); if (uploadData != null && uploadData.IsAlive) uploadData.Abort(); if (checkInStoreState != null && checkInStoreState.IsAlive) @@ -79,7 +82,7 @@ namespace ButcherFactory.SegmentProductionAuto_ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - var initTask = new Thread(LoadBind); + initTask = new Thread(LoadBind); initTask.Start(); checkInStoreState = new Thread(CheckInStored); @@ -91,15 +94,46 @@ namespace ButcherFactory.SegmentProductionAuto_ void LoadBind() { - this.Invoke(new Action(() => + BLUtil.DeleteLocalDb(); + SegmentProductionBL.DeleteBefore(); + GetBasicInfo(); + } + + bool ok = false; + bool bind = false; + void GetBasicInfo() + { + while (!ok) { - BLUtil.DeleteLocalDb(); - if (netStateWatch1.NetState) + try + { + var changed = BaseInfoSyncRpc.SyncGoodsByTag(ApplyClient.分割品); + changed = BaseInfoSyncRpc.SyncBaseInfo() || changed; + changed = BaseInfoSyncRpc.SyncProductBatch(1) || changed; + ok = true; + if (changed || !bind) + BindBasicInfo(); + this.Invoke(new Action(() => + { + msglbl.Text = string.Empty; + })); + } + catch { - BaseInfoSyncRpc.SyncGoodsByTag(ApplyClient.分割品); - BaseInfoSyncRpc.SyncBaseInfo(); - BaseInfoSyncRpc.SyncProductBatch(1); + if (!bind) + { + BindBasicInfo(); + bind = true; + } } + Thread.Sleep(500); + } + } + + void BindBasicInfo() + { + this.Invoke(new Action(() => + { productBatchSelect.EBindComboBox(null, 6, "Date"); config = XmlUtil.DeserializeFromFile(); var m = config.WorkUnitID; @@ -158,20 +192,18 @@ namespace ButcherFactory.SegmentProductionAuto_ entity.WorkUnit_ID = config.WorkUnitID; entity.ProductBatch_ID = batchID.Value; entity.StandardPic = detail.StandardPic; - SegmentProductionBL.InsertAndSetGroupID(entity, batchDate.Value, testCkBox.Checked); + SegmentProductionBL.InsertAndSetGroupID(entity, batchDate.Value); entity.Goods_Code = detail.Goods_Code; entity.Goods_Name = detail.Goods_Name; entity.Goods_Spec = detail.Goods_Spec; GoodsLabel.Text = entity.Goods_Name; - if (!testCkBox.Checked) - { - historyList.Insert(0, entity); - if (historyList.Count > 30) - historyList.RemoveAt(30); - historyDataGrid.FirstDisplayedScrollingRowIndex = 0; - historyDataGrid.Rows[0].Selected = true; - historyDataGrid.Refresh(); - } + + historyList.Insert(0, entity); + if (historyList.Count > 30) + historyList.RemoveAt(30); + historyDataGrid.FirstDisplayedScrollingRowIndex = 0; + historyDataGrid.Rows[0].Selected = true; + historyDataGrid.Refresh(); if (barPrintCheck.Checked) { var template = config.Template; @@ -179,19 +211,17 @@ namespace ButcherFactory.SegmentProductionAuto_ template = detail.GoodsType == 0 ? "SegmentProductionPrint.html" : "SegmentProductionPrint1.html"; NotAuto.SegmentProductionPrint.Print(entity, batchDate, template); } - if (!testCkBox.Checked) - { - var thd = new Thread(new ParameterizedThreadStart(RefreshTask)); - thd.Start(entity); - } + var thd = new Thread(new ParameterizedThreadStart(RefreshTask)); + thd.Start(entity); } void RefreshTask(object obj) { var entity = obj as SegmentProduction; - taskDataGrid.DataSource = SegmentProductionBL.GetProductTask(batchDate ?? DateTime.Today, entity); + var list = SegmentProductionBL.GetProductTask(batchDate ?? DateTime.Today, entity); this.Invoke(new Action(() => { + taskDataGrid.DataSource = list; taskDataGrid.Refresh(); })); } @@ -234,7 +264,7 @@ namespace ButcherFactory.SegmentProductionAuto_ { if (historyList.Any()) { - var arr = historyList.Reverse().Take(20).ToList(); + var arr = historyList.Reverse().Take(20); var inStored = SegmentProductionBL.GetInStoreState(arr.Select(x => x.BarCode).ToList()); var tag = arr.Where(x => inStored.Contains(x.BarCode)); if (tag.Any()) @@ -282,22 +312,32 @@ namespace ButcherFactory.SegmentProductionAuto_ new TemplateSelector(config).ShowDialog(); } + long id = 0; private void deleteBtn_Click(object sender, EventArgs e) { - if (historyDataGrid.CurrentRow == null) + if (id == 0) + return; + var first = historyList.FirstOrDefault(x => x.ID == id); + if (first == null) return; if (MessageBox.Show("确定删除选中记录?", "删除确认", MessageBoxButtons.OKCancel) != DialogResult.OK) return; - var item = historyDataGrid.CurrentRow.DataBoundItem as SegmentProduction; - SegmentProductionBL.SetAsDelete(item.ID, item.BarCode); - historyList.Remove(item); + SegmentProductionBL.SetAsDelete(first.ID, first.BarCode); + historyList.Remove(first); historyDataGrid.DataSource = historyList; if (historyList.Any()) historyDataGrid.Rows[0].Selected = true; historyDataGrid.Refresh(); var thd = new Thread(new ParameterizedThreadStart(RefreshTask)); - thd.Start(item); + thd.Start(first); + } + + private void historyDataGrid_CellClick(object sender, DataGridViewCellEventArgs e) + { + if (historyDataGrid.CurrentRow == null) + return; + id = (long)historyDataGrid.CurrentRow.Cells["H_ID"].Value; } } } diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs index 46d881d..5b89b97 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs @@ -292,7 +292,8 @@ namespace ButcherFactory.SegmentProduction_ throw new Exception("已结束,无法删除"); if (MessageBox.Show(string.Format("确认删除{0} {1}的记录?", first.RowIndex, first.Goods_Name), "删除确认", MessageBoxButtons.OKCancel) == DialogResult.OK) { - SegmentProductionBL.Delete(id); + var item = historyDataGrid.CurrentRow.DataBoundItem as SegmentProduction; + SegmentProductionBL.SetAsDelete(item.ID, item.BarCode); unSubmitList.Remove(first); historyList.Remove(first); historyDataGrid.Refresh(); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs index 4ebe89b..0c5ec04 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs @@ -30,9 +30,14 @@ namespace ButcherFactory.SegmentProduction_ info = string.Format("重量:{0:#0.##}KG", entity.Weight); dic.Add("$Info", info); dic.Add("$Date", dt.Value.ToString("yyyy/MM/dd")); + var code = entity.BarCode; + if (code.Length > 17) + code = code.Substring(17); + dic.Add("$Code", code); var imgUrl = string.Format(IMGFILE, id); var url = string.Format(AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode); - BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 80); + BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 120); + dic.Add("$ImageUrl", imgUrl); BwpClientPrint.BwpClientWebPrint.Print(PRINTFILE + template, dic); AfterPrint(); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html index df717f7..4a69a54 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html @@ -3,7 +3,7 @@