Browse Source

调整。

master
yibo 7 years ago
parent
commit
7cfeef8349
11 changed files with 803 additions and 310 deletions
  1. +2
    -0
      ButcherFactory.BO/Base/ExtensionObj.cs
  2. +2
    -0
      ButcherFactory.BO/Bill/CarcassTakeOut.cs
  3. +1
    -0
      ButcherFactory.BO/ButcherFactory.BO.csproj
  4. +55
    -27
      ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs
  5. +252
    -0
      ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs
  6. +4
    -4
      ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs
  7. +188
    -180
      ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs
  8. +172
    -7
      ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs
  9. +3
    -0
      ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.resx
  10. +3
    -3
      ButcherFactory.Login/Program.cs
  11. +121
    -89
      ButcherFactorySolution/ButcherFactorySolution.vdproj

+ 2
- 0
ButcherFactory.BO/Base/ExtensionObj.cs View File

@ -15,5 +15,7 @@ namespace ButcherFactory.BO
public decimal? DecimalExt1 { get; set; }
public string StringExt1 { get; set; }
public string StringExt2 { get; set; }
}
}

+ 2
- 0
ButcherFactory.BO/Bill/CarcassTakeOut.cs View File

@ -33,5 +33,7 @@ namespace ButcherFactory.BO
public string Goods_Name { get; set; }
public long? GroupID { get; set; }
public bool Submited { get; set; }
}
}

+ 1
- 0
ButcherFactory.BO/ButcherFactory.BO.csproj View File

@ -71,6 +71,7 @@
<Compile Include="Bill\CarcassInStore.cs" />
<Compile Include="LocalBL\BaseInfoBL.cs" />
<Compile Include="LocalBL\CarcassInStoreBL.cs" />
<Compile Include="LocalBL\CarcassTakeOutBL.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rpcs\BaseInfoSyncRpc.cs" />
<Compile Include="Utils\AppContext.cs" />


+ 55
- 27
ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs View File

@ -20,18 +20,28 @@ namespace ButcherFactory.BO.LocalBL
static Dictionary<long, string> _goodsNames = new Dictionary<long, string>();
public static List<CarcassInStore> DoWithPadData(long? workUnitID, long? batchID)
{
var json = RpcFacade.Call<string>(RpcPath + "GetUnSyncPadData");
var data = JsonConvert.DeserializeObject<List<PadCarcassInStore>>(json);
var list = new List<CarcassInStore>();
if (data.Count == 0)
return list;
try
{
var json = RpcFacade.Call<string>(RpcPath + "GetUnSyncPadData");
var data = JsonConvert.DeserializeObject<List<PadCarcassInStore>>(json);
var list = new List<CarcassInStore>();
if (data.Count == 0)
return list;
var goodsBarCode = data.Select(x => new Tuple<long, string>(x.Goods_ID, x.BarCode));
list = InsertOrUpdate(workUnitID, batchID, goodsBarCode, true);
var goodsBarCode = data.Select(x => new Tuple<long, string>(x.Goods_ID, x.BarCode));
list = InsertOrUpdate(workUnitID, batchID, goodsBarCode, true);
var backInfo = data.Select(x => new ExtensionObj { LongExt1 = x.ID, DecimalExt1 = x.RowVersion });
RpcFacade.Call<int>(RpcPath + "SetPadDataSync", JsonConvert.SerializeObject(backInfo));
return list;
var backInfo = data.Select(x => new ExtensionObj { LongExt1 = x.ID, DecimalExt1 = x.RowVersion });
RpcFacade.Call<int>(RpcPath + "SetPadDataSync", JsonConvert.SerializeObject(backInfo));
return list;
}
catch
{
#if DEBUG
throw;
#endif
return new List<CarcassInStore>();
}
}
public static List<CarcassInStore> InsertOrUpdate(long? workUnitID, long? batchID, long goodsID, string barCode)
@ -178,18 +188,28 @@ namespace ButcherFactory.BO.LocalBL
public static List<ExtensionObj> GetBeforeWeight(IEnumerable<string> codeList)
{
var json = RpcFacade.Call<string>(RpcPath + "GetWeightInfo", codeList);
var list = JsonConvert.DeserializeObject<List<ExtensionObj>>(json);
if (list.Any())
try
{
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
var json = RpcFacade.Call<string>(RpcPath + "GetWeightInfo", codeList);
var list = JsonConvert.DeserializeObject<List<ExtensionObj>>(json);
if (list.Any())
{
foreach (var item in list)
SaveWeightInDB(item, session);
session.Commit();
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
{
foreach (var item in list)
SaveWeightInDB(item, session);
session.Commit();
}
}
return list;
}
catch
{
#if DEBUG
throw;
#endif
return new List<ExtensionObj>();
}
return list;
}
static void SaveWeightInDB(ExtensionObj obj, IDmoSession session)
@ -202,17 +222,25 @@ namespace ButcherFactory.BO.LocalBL
public static void UploadCarcassInfo()
{
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
try
{
var needUpload = GetUnSyncData(session);
if (needUpload.Count == 0)
return;
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
{
var needUpload = GetUnSyncData(session);
if (needUpload.Count == 0)
return;
var json = JsonConvert.SerializeObject(needUpload);
RpcFacade.Call<int>(RpcPath + "UploadCarcassInfo", json);
foreach (var item in needUpload)
SetLocalAsSyncd(item, session);
session.Commit();
var json = JsonConvert.SerializeObject(needUpload);
RpcFacade.Call<int>(RpcPath + "UploadCarcassInfo", json);
foreach (var item in needUpload)
SetLocalAsSyncd(item, session);
session.Commit();
}
}
catch {
#if DEBUG
throw;
#endif
}
}


+ 252
- 0
ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs View File

@ -0,0 +1,252 @@
using ButcherFactory.BO.Utils;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using Forks.JsonRpc.Client;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ButcherFactory.BO.LocalBL
{
public static class CarcassTakeOutBL
{
const string RpcPath = @"/MainSystem/B3ClientService/Rpcs/CarcassTakeOutRpc/";
public static CarcassTakeOut InsertOrUpdate(long? workUnitID, string barCode, out bool isNew)
{
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
{
var entity = GetEntityByBarCode(barCode, session);
if (entity == null)
{
entity = new CarcassTakeOut();
entity.WorkUnit_ID = workUnitID;
entity.BarCode = barCode;
entity.UserID = AppContext.Worker.ID;
session.Insert(entity);
isNew = true;
}
else
{
if (entity.WorkUnit_ID != workUnitID)
Update(entity.ID, session, new Tuple<string, object>("WorkUnit_ID", workUnitID));
isNew = false;
}
session.Commit();
return entity;
}
}
private static CarcassTakeOut GetEntityByBarCode(string barCode, IDmoSession session)
{
var query = new DQueryDom(new JoinAlias(typeof(CarcassTakeOut)));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("WorkUnit_ID"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("BarCode", barCode), DQCondition.EQ("Delete", false)));
var item = query.EExecuteScalar<long, long?>();
if (item == null)
return null;
return new CarcassTakeOut() { ID = item.Item1, WorkUnit_ID = item.Item2 };
}
static void Update(long id, IDmoSession session, params Tuple<string, object>[] updates)
{
var update = new DQUpdateDom(typeof(CarcassTakeOut));
update.Where.Conditions.Add(DQCondition.EQ("ID", id));
foreach (var item in updates)
update.Columns.Add(new DQUpdateColumn(item.Item1, item.Item2));
update.Columns.Add(new DQUpdateColumn("Sync", false));
update.Columns.Add(new DQUpdateColumn("RowVersion", DQExpression.Add(DQExpression.Field("RowVersion"), DQExpression.Value(1))));
session.ExecuteNonQuery(update);
}
public static void Delete(long id)
{
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
{
Update(id, session, new Tuple<string, object>("Delete", true));
session.Commit();
}
}
public static BindingList<CarcassTakeOut> GetLocalDataWithState(bool history)
{
var query = new DQueryDom(new JoinAlias(typeof(CarcassTakeOut)));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("BarCode"));
query.Columns.Add(DQSelectColumn.Field("Goods_Name"));
query.Columns.Add(DQSelectColumn.Field("BeforeWeight"));
query.Columns.Add(DQSelectColumn.Field("Weight"));
if (history)
query.Range = SelectRange.Top(30);
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", history), DQCondition.EQ("Delete", false)));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true));
var result = new BindingList<CarcassTakeOut>();
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
{
using (var reader = session.ExecuteReader(query))
{
while (reader.Read())
{
var entity = new CarcassTakeOut();
result.Add(entity);
entity.ID = (long)reader[0];
entity.BarCode = (string)reader[1];
entity.Goods_Name = (string)reader[2];
entity.BeforeWeight = (decimal?)reader[3];
entity.Weight = (decimal?)reader[4];
}
}
}
return result;
}
public static void SetWeight(IEnumerable<long> ids, decimal weight)
{
var id = ids.Max();
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
{
Update(id, session, new Tuple<string, object>("GroupID", id), new Tuple<string, object>("Weight", weight));
GroupUpdate(ids.Where(x => x != id), session, new Tuple<string, object>("GroupID", id), new Tuple<string, object>("Weight", 0));
}
}
static void GroupUpdate(IEnumerable<long> ids, IDmoSession session, params Tuple<string, object>[] updates)
{
if (ids.Count() == 0)
return;
var update = new DQUpdateDom(typeof(CarcassTakeOut));
update.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), ids.Select(x => DQExpression.Value(x)).ToArray()));
foreach (var item in updates)
update.Columns.Add(new DQUpdateColumn(item.Item1, item.Item2));
update.Columns.Add(new DQUpdateColumn("Sync", false));
update.Columns.Add(new DQUpdateColumn("RowVersion", DQExpression.Add(DQExpression.Field("RowVersion"), DQExpression.Value(1))));
session.ExecuteNonQuery(update);
}
public static void Submit(IEnumerable<long> ids)
{
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
{
GroupUpdate(ids, session, new Tuple<string, object>("Submited", true));
session.Commit();
}
}
public static List<ExtensionObj> GetBeforeInfo(IEnumerable<string> codeList)
{
try
{
var json = RpcFacade.Call<string>(RpcPath + "GetBeforeInfo", codeList);
var list = JsonConvert.DeserializeObject<List<ExtensionObj>>(json);
if (list.Any())
{
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
{
foreach (var item in list)
SaveBeforeInfoInDB(item, session);
session.Commit();
}
}
return list;
}
catch
{
#if DEBUG
throw;
#endif
return new List<ExtensionObj>(); }
}
private static void SaveBeforeInfoInDB(ExtensionObj obj, IDmoSession session)
{
var update = new DQUpdateDom(typeof(CarcassTakeOut));
update.Where.Conditions.Add(DQCondition.EQ("BarCode", obj.StringExt1));
update.Columns.Add(new DQUpdateColumn("Goods_ID", obj.LongExt1));
update.Columns.Add(new DQUpdateColumn("BeforeWeight", obj.DecimalExt1));
session.ExecuteNonQuery(update);
}
public static void UploadCarcassInfo()
{
try
{
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection))
{
var needUpload = GetUnSyncData(session);
if (needUpload.Count == 0)
return;
var json = JsonConvert.SerializeObject(needUpload);
RpcFacade.Call<int>(RpcPath + "UploadCarcassInfo", json);
foreach (var item in needUpload)
SetLocalAsSyncd(item, session);
session.Commit();
}
}
catch {
#if DEBUG
throw;
#endif
}
}
static List<CarcassTakeOutObj> GetUnSyncData(IDmoSession session)
{
var query = new DQueryDom(new JoinAlias(typeof(CarcassTakeOut)));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("RowVersion"));
query.Columns.Add(DQSelectColumn.Field("BarCode"));
query.Columns.Add(DQSelectColumn.Field("UserID"));
query.Columns.Add(DQSelectColumn.Field("WorkUnit_ID"));
query.Columns.Add(DQSelectColumn.Field("Weight"));
query.Columns.Add(DQSelectColumn.Field("CreateTime"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", true), DQCondition.EQ("Sync", false)));
query.Range = SelectRange.Top(10);
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID"));
var upload = new List<CarcassTakeOutObj>();
using (var reader = session.ExecuteReader(query))
{
while (reader.Read())
{
var obj = new CarcassTakeOutObj();
obj.ID = (long)reader[0];
obj.RowVersion = (int)reader[1];
obj.BarCode = (string)reader[2];
obj.TakeOutWorker_ID = (long)reader[3];
obj.WorkUnit_ID = (long?)reader[4];
obj.Weight = (decimal)reader[5];
obj.Time = (DateTime)reader[6];
upload.Add(obj);
}
}
return upload;
}
static void SetLocalAsSyncd(CarcassTakeOutObj obj, IDmoSession session)
{
var update = new DQUpdateDom(typeof(CarcassTakeOut));
update.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("ID", obj.ID), DQCondition.EQ("RowVersion", obj.RowVersion)));
update.Columns.Add(new DQUpdateColumn("Sync", true));
update.EExecute();
}
}
class CarcassTakeOutObj
{
public long ID { get; set; }
public int RowVersion { get; set; }
public string BarCode { get; set; }
public long? TakeOutWorker_ID { get; set; }
public long? WorkUnit_ID { get; set; }
public decimal? Weight { get; set; }
public DateTime? Time { get; set; }
}
}

+ 4
- 4
ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs View File

@ -225,7 +225,7 @@ namespace ButcherFactory.CarcassInStore_
}
}
void GetBeforeWeight(object obj)
void GetBeforeWeight()
{
while (true)
{
@ -235,7 +235,7 @@ namespace ButcherFactory.CarcassInStore_
{
if (netStateWatch1.NetState)
{
var list = needSubmitedList.Where(x => x.BeforeWeight == null).Take(5);
var list = historyList.Where(x => x.BeforeWeight == null).Take(5);
if (list.Any())
{
var back = CarcassInStoreBL.GetBeforeWeight(list.Select(x => x.BarCode));
@ -243,7 +243,7 @@ namespace ButcherFactory.CarcassInStore_
{
foreach (var item in back)
list.First(x => x.BarCode == item.StringExt1).BeforeWeight = item.DecimalExt1;
needSubmitGrid.Refresh();
historyDataGrid.Refresh();
}
}
}
@ -253,7 +253,7 @@ namespace ButcherFactory.CarcassInStore_
}
}
void UpLoadLocalData(object obj)
void UpLoadLocalData()
{
while (true)
{


+ 188
- 180
ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs View File

@ -28,18 +28,19 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CarcassTakeOutForm));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = 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 dataGridViewCellStyle5 = 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 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 dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
this.workUnitSelect = new System.Windows.Forms.ComboBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.closeBtn = new WinFormControl.UButton();
this.uTimerLabel1 = new WinFormControl.UTimerLabel();
this.uScanPanel1 = new WinFormControl.UScanPanel();
this.netStateWatch1 = new WinFormControl.NetStateWatch();
@ -47,23 +48,23 @@
this.uLabel1 = new WinFormControl.ULabel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.historyDataGrid = new WinFormControl.UDataGridView();
this.uLabel4 = new WinFormControl.ULabel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.needSubmitGrid = new WinFormControl.UDataGridView();
this.uLabel3 = new WinFormControl.ULabel();
this.closeBtn = new WinFormControl.UButton();
this.submitBtn = new WinFormControl.UButton();
this.deleteBtn = new WinFormControl.UButton();
this.readBtn = new WinFormControl.UButton();
this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
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.H_BeforeWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uLabel4 = new WinFormControl.ULabel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.readBtn = new WinFormControl.UButton();
this.deleteBtn = new WinFormControl.UButton();
this.submitBtn = new WinFormControl.UButton();
this.needSubmitGrid = new WinFormControl.UDataGridView();
this.U_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_BeforeWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uLabel3 = new WinFormControl.ULabel();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@ -114,6 +115,27 @@
this.splitContainer1.SplitterDistance = 86;
this.splitContainer1.TabIndex = 1;
//
// closeBtn
//
this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.closeBtn.AsClicked = false;
this.closeBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("closeBtn.BackgroundImage")));
this.closeBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.closeBtn.FlatAppearance.BorderSize = 0;
this.closeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.closeBtn.Font = new System.Drawing.Font("宋体", 15F);
this.closeBtn.ForeColor = System.Drawing.Color.Black;
this.closeBtn.Location = new System.Drawing.Point(1046, 7);
this.closeBtn.Name = "closeBtn";
this.closeBtn.PlaySound = false;
this.closeBtn.Size = new System.Drawing.Size(111, 34);
this.closeBtn.SoundType = WinFormControl.SoundType.Click;
this.closeBtn.TabIndex = 10;
this.closeBtn.Text = "关 闭";
this.closeBtn.UseVisualStyleBackColor = true;
this.closeBtn.WithStataHode = false;
this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click);
//
// uTimerLabel1
//
this.uTimerLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -185,35 +207,78 @@
this.historyDataGrid.AllowUserToDeleteRows = false;
this.historyDataGrid.AllowUserToResizeColumns = false;
this.historyDataGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle14;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.historyDataGrid.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle15.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15;
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.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.historyDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.H_ID,
this.H_BarCode,
this.H_Goods_Name,
this.H_Weight,
this.H_BeforeWeight});
this.H_BeforeWeight,
this.H_Weight});
this.historyDataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.historyDataGrid.Location = new System.Drawing.Point(5, 19);
this.historyDataGrid.MultiSelect = false;
this.historyDataGrid.Name = "historyDataGrid";
this.historyDataGrid.ReadOnly = true;
this.historyDataGrid.RowHeadersVisible = false;
dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle18;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle5;
this.historyDataGrid.RowTemplate.Height = 23;
this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.historyDataGrid.Size = new System.Drawing.Size(1130, 230);
this.historyDataGrid.TabIndex = 2;
//
// H_ID
//
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "序号";
this.H_ID.Name = "H_ID";
this.H_ID.ReadOnly = true;
//
// H_BarCode
//
this.H_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.H_BarCode.DataPropertyName = "BarCode";
this.H_BarCode.HeaderText = "条码";
this.H_BarCode.Name = "H_BarCode";
this.H_BarCode.ReadOnly = true;
//
// H_Goods_Name
//
this.H_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.H_Goods_Name.DataPropertyName = "Goods_Name";
this.H_Goods_Name.HeaderText = "产品名称";
this.H_Goods_Name.Name = "H_Goods_Name";
this.H_Goods_Name.ReadOnly = true;
//
// H_BeforeWeight
//
this.H_BeforeWeight.DataPropertyName = "BeforeWeight";
dataGridViewCellStyle3.Format = "#0.######";
this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle3;
this.H_BeforeWeight.HeaderText = "入库重量";
this.H_BeforeWeight.Name = "H_BeforeWeight";
this.H_BeforeWeight.ReadOnly = true;
this.H_BeforeWeight.Width = 150;
//
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle4.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle4;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
this.H_Weight.Width = 150;
//
// uLabel4
//
this.uLabel4.AutoSize = true;
@ -241,117 +306,8 @@
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
//
// needSubmitGrid
//
this.needSubmitGrid.AllowUserToAddRows = false;
this.needSubmitGrid.AllowUserToDeleteRows = false;
this.needSubmitGrid.AllowUserToResizeColumns = false;
this.needSubmitGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10;
this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle11.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11;
this.needSubmitGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.U_ID,
this.U_BarCode,
this.U_Goods_Name,
this.U_BeforeWeight});
this.needSubmitGrid.Dock = System.Windows.Forms.DockStyle.Bottom;
this.needSubmitGrid.Location = new System.Drawing.Point(5, 62);
this.needSubmitGrid.MultiSelect = false;
this.needSubmitGrid.Name = "needSubmitGrid";
this.needSubmitGrid.ReadOnly = true;
this.needSubmitGrid.RowHeadersVisible = false;
dataGridViewCellStyle13.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle13.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle13;
this.needSubmitGrid.RowTemplate.Height = 23;
this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.needSubmitGrid.Size = new System.Drawing.Size(1130, 159);
this.needSubmitGrid.TabIndex = 1;
//
// uLabel3
//
this.uLabel3.AutoSize = true;
this.uLabel3.BackColor = System.Drawing.Color.White;
this.uLabel3.Font = new System.Drawing.Font("宋体", 13F);
this.uLabel3.Location = new System.Drawing.Point(8, 0);
this.uLabel3.Name = "uLabel3";
this.uLabel3.Size = new System.Drawing.Size(80, 18);
this.uLabel3.TabIndex = 0;
this.uLabel3.Text = "领料明细";
//
// closeBtn
//
this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.closeBtn.AsClicked = false;
this.closeBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("closeBtn.BackgroundImage")));
this.closeBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.closeBtn.FlatAppearance.BorderSize = 0;
this.closeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.closeBtn.Font = new System.Drawing.Font("宋体", 15F);
this.closeBtn.ForeColor = System.Drawing.Color.Black;
this.closeBtn.Location = new System.Drawing.Point(1046, 7);
this.closeBtn.Name = "closeBtn";
this.closeBtn.PlaySound = false;
this.closeBtn.Size = new System.Drawing.Size(111, 34);
this.closeBtn.SoundType = WinFormControl.SoundType.Click;
this.closeBtn.TabIndex = 10;
this.closeBtn.Text = "关 闭";
this.closeBtn.UseVisualStyleBackColor = true;
this.closeBtn.WithStataHode = false;
this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click);
//
// submitBtn
//
this.submitBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.submitBtn.AsClicked = false;
this.submitBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("submitBtn.BackgroundImage")));
this.submitBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.submitBtn.FlatAppearance.BorderSize = 0;
this.submitBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.submitBtn.Font = new System.Drawing.Font("宋体", 15F);
this.submitBtn.ForeColor = System.Drawing.Color.Black;
this.submitBtn.Location = new System.Drawing.Point(11, 20);
this.submitBtn.Name = "submitBtn";
this.submitBtn.PlaySound = false;
this.submitBtn.Size = new System.Drawing.Size(111, 34);
this.submitBtn.SoundType = WinFormControl.SoundType.Click;
this.submitBtn.TabIndex = 11;
this.submitBtn.Text = "提 交";
this.submitBtn.UseVisualStyleBackColor = true;
this.submitBtn.WithStataHode = false;
this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click);
//
// deleteBtn
//
this.deleteBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.deleteBtn.AsClicked = false;
this.deleteBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("deleteBtn.BackgroundImage")));
this.deleteBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.deleteBtn.FlatAppearance.BorderSize = 0;
this.deleteBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.deleteBtn.Font = new System.Drawing.Font("宋体", 15F);
this.deleteBtn.ForeColor = System.Drawing.Color.Black;
this.deleteBtn.Location = new System.Drawing.Point(140, 20);
this.deleteBtn.Name = "deleteBtn";
this.deleteBtn.PlaySound = false;
this.deleteBtn.Size = new System.Drawing.Size(111, 34);
this.deleteBtn.SoundType = WinFormControl.SoundType.Click;
this.deleteBtn.TabIndex = 12;
this.deleteBtn.Text = "删 除";
this.deleteBtn.UseVisualStyleBackColor = true;
this.deleteBtn.WithStataHode = false;
this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click);
//
// readBtn
//
this.readBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.readBtn.AsClicked = false;
this.readBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("readBtn.BackgroundImage")));
this.readBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
@ -370,48 +326,80 @@
this.readBtn.WithStataHode = false;
this.readBtn.Click += new System.EventHandler(this.readBtn_Click);
//
// H_ID
//
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "序号";
this.H_ID.Name = "H_ID";
this.H_ID.ReadOnly = true;
//
// H_BarCode
//
this.H_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.H_BarCode.DataPropertyName = "BarCode";
this.H_BarCode.HeaderText = "条码";
this.H_BarCode.Name = "H_BarCode";
this.H_BarCode.ReadOnly = true;
//
// H_Goods_Name
// deleteBtn
//
this.H_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.H_Goods_Name.DataPropertyName = "Goods_Name";
this.H_Goods_Name.HeaderText = "产品名称";
this.H_Goods_Name.Name = "H_Goods_Name";
this.H_Goods_Name.ReadOnly = true;
this.deleteBtn.AsClicked = false;
this.deleteBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("deleteBtn.BackgroundImage")));
this.deleteBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.deleteBtn.FlatAppearance.BorderSize = 0;
this.deleteBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.deleteBtn.Font = new System.Drawing.Font("宋体", 15F);
this.deleteBtn.ForeColor = System.Drawing.Color.Black;
this.deleteBtn.Location = new System.Drawing.Point(140, 20);
this.deleteBtn.Name = "deleteBtn";
this.deleteBtn.PlaySound = false;
this.deleteBtn.Size = new System.Drawing.Size(111, 34);
this.deleteBtn.SoundType = WinFormControl.SoundType.Click;
this.deleteBtn.TabIndex = 12;
this.deleteBtn.Text = "删 除";
this.deleteBtn.UseVisualStyleBackColor = true;
this.deleteBtn.WithStataHode = false;
this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click);
//
// H_Weight
// submitBtn
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle16.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle16;
this.H_Weight.HeaderText = "领用重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
this.H_Weight.Width = 200;
this.submitBtn.AsClicked = false;
this.submitBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("submitBtn.BackgroundImage")));
this.submitBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214)))));
this.submitBtn.FlatAppearance.BorderSize = 0;
this.submitBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.submitBtn.Font = new System.Drawing.Font("宋体", 15F);
this.submitBtn.ForeColor = System.Drawing.Color.Black;
this.submitBtn.Location = new System.Drawing.Point(11, 20);
this.submitBtn.Name = "submitBtn";
this.submitBtn.PlaySound = false;
this.submitBtn.Size = new System.Drawing.Size(111, 34);
this.submitBtn.SoundType = WinFormControl.SoundType.Click;
this.submitBtn.TabIndex = 11;
this.submitBtn.Text = "提 交";
this.submitBtn.UseVisualStyleBackColor = true;
this.submitBtn.WithStataHode = false;
this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click);
//
// H_BeforeWeight
// needSubmitGrid
//
this.H_BeforeWeight.DataPropertyName = "BeforeWeight";
dataGridViewCellStyle17.Format = "#0.######";
this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle17;
this.H_BeforeWeight.HeaderText = "入库重量";
this.H_BeforeWeight.Name = "H_BeforeWeight";
this.H_BeforeWeight.ReadOnly = true;
this.H_BeforeWeight.Width = 200;
this.needSubmitGrid.AllowUserToAddRows = false;
this.needSubmitGrid.AllowUserToDeleteRows = false;
this.needSubmitGrid.AllowUserToResizeColumns = false;
this.needSubmitGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6;
this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle7.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.needSubmitGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.U_ID,
this.U_BarCode,
this.U_Goods_Name,
this.U_BeforeWeight,
this.U_Weight});
this.needSubmitGrid.Dock = System.Windows.Forms.DockStyle.Bottom;
this.needSubmitGrid.Location = new System.Drawing.Point(5, 62);
this.needSubmitGrid.MultiSelect = false;
this.needSubmitGrid.Name = "needSubmitGrid";
this.needSubmitGrid.ReadOnly = true;
this.needSubmitGrid.RowHeadersVisible = false;
dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle9;
this.needSubmitGrid.RowTemplate.Height = 23;
this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.needSubmitGrid.Size = new System.Drawing.Size(1130, 159);
this.needSubmitGrid.TabIndex = 1;
//
// U_ID
//
@ -439,12 +427,31 @@
// U_BeforeWeight
//
this.U_BeforeWeight.DataPropertyName = "BeforeWeight";
dataGridViewCellStyle12.Format = "#0.######";
this.U_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle12;
dataGridViewCellStyle8.Format = "#0.######";
this.U_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle8;
this.U_BeforeWeight.HeaderText = "入库重量";
this.U_BeforeWeight.Name = "U_BeforeWeight";
this.U_BeforeWeight.ReadOnly = true;
this.U_BeforeWeight.Width = 200;
this.U_BeforeWeight.Width = 150;
//
// U_Weight
//
this.U_Weight.DataPropertyName = "Weight";
this.U_Weight.HeaderText = "重量";
this.U_Weight.Name = "U_Weight";
this.U_Weight.ReadOnly = true;
this.U_Weight.Width = 150;
//
// uLabel3
//
this.uLabel3.AutoSize = true;
this.uLabel3.BackColor = System.Drawing.Color.White;
this.uLabel3.Font = new System.Drawing.Font("宋体", 13F);
this.uLabel3.Location = new System.Drawing.Point(8, 0);
this.uLabel3.Name = "uLabel3";
this.uLabel3.Size = new System.Drawing.Size(80, 18);
this.uLabel3.TabIndex = 0;
this.uLabel3.Text = "领料明细";
//
// CarcassTakeOutForm
//
@ -493,12 +500,13 @@
private System.Windows.Forms.DataGridViewTextBoxColumn H_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_BarCode;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn H_BeforeWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn U_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn U_BarCode;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn U_BeforeWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Weight;
}
}

+ 172
- 7
ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs View File

@ -1,4 +1,6 @@
using ButcherFactory.BO;
using ButcherFactory.BO.LocalBL;
using ButcherFactory.BO.Rpcs;
using ButcherFactory.BO.Utils;
using System;
using System.Collections.Generic;
@ -7,26 +9,163 @@ using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using ButcherFactory.Utils;
namespace ButcherFactory.CarcassTakeOut_
{
public partial class CarcassTakeOutForm : Form, IWithRoleForm
{
#region IWithRoleForm
public List<short> RoleName
{
get { return new List<short> { (short). }; }
}
public Form Generate()
{
return this;
}
#endregion
Thread syncBeforeInfo;
Thread uploadData;
BindingList<CarcassTakeOut> needSubmitedList;
BindingList<CarcassTakeOut> historyList;
long? workUnitID;
public CarcassTakeOutForm()
{
InitializeComponent();
netStateWatch1.GetConnectState = () => LoginUtil.TestConnection(500);
uScanPanel1.AfterScan += uScanPanel1_AfterScan;
workUnitSelect.SelectedIndexChanged += delegate
{
if (workUnitSelect.SelectedValue == null)
workUnitID = null;
else
workUnitID = (long)workUnitSelect.SelectedValue;
};
this.FormClosing += delegate
{
if (syncBeforeInfo != null && syncBeforeInfo.IsAlive)
syncBeforeInfo.Abort();
if (uploadData != null && uploadData.IsAlive)
uploadData.Abort();
};
}
public List<short> RoleName
protected override void OnLoad(EventArgs e)
{
get { return new List<short> { (short). }; }
base.OnLoad(e);
var initTask = new Thread(LoadBind);
initTask.Start();
syncBeforeInfo = new Thread(GetBeforeInfo);
syncBeforeInfo.Start();
uploadData = new Thread(UpLoadLocalData);
uploadData.Start();
}
public Form Generate()
private void LoadBind()
{
return this;
this.Invoke(new Action(() =>
{
if (netStateWatch1.NetState)
{
BaseInfoSyncRpc.SyncGoodsByTag(ApplyClient.);
BaseInfoSyncRpc.SyncBaseInfo<WorkUnit>();
}
workUnitSelect.EBindComboBox<WorkUnit>();
BindGrid();
}));
}
void BindGrid()
{
needSubmitedList = CarcassTakeOutBL.GetLocalDataWithState(false);
needSubmitGrid.DataSource = needSubmitedList;
needSubmitGrid.Refresh();
historyList = CarcassTakeOutBL.GetLocalDataWithState(true);
historyDataGrid.DataSource = historyList;
historyDataGrid.Refresh();
}
private void GetBeforeInfo()
{
while (true)
{
if (this.IsHandleCreated)
{
this.Invoke(new Action(() =>
{
if (netStateWatch1.NetState)
{
bool ff = true;
var list = needSubmitedList.Where(x => x.BeforeWeight == null).Take(5);
if (!list.Any())
{
list = historyList.Where(x => x.BeforeWeight == null).Take(5);
ff = false;
}
if (list.Any())
{
var back = CarcassTakeOutBL.GetBeforeInfo(list.Select(x => x.BarCode));
if (back.Any())
{
foreach (var item in back)
{
var f = list.First(x => x.BarCode == item.StringExt1);
f.BeforeWeight = item.DecimalExt1;
f.Goods_Name = item.StringExt2;
}
if (ff)
needSubmitGrid.Refresh();
else
historyDataGrid.Refresh();
}
}
}
}));
}
Thread.Sleep(2000);
}
}
private void UpLoadLocalData()
{
while (true)
{
if (this.IsHandleCreated)
{
this.Invoke(new Action(() =>
{
if (netStateWatch1.NetState)
CarcassTakeOutBL.UploadCarcassInfo();
}));
}
Thread.Sleep(2000);
}
}
void uScanPanel1_AfterScan()
{
var bar = uScanPanel1.TextBox.Text.Trim();
if (string.IsNullOrEmpty(bar))
throw new Exception("请先扫码");
if (bar.Length != 23)
throw new Exception("条码格式不正确");
bool isNew;
var entity = CarcassTakeOutBL.InsertOrUpdate(workUnitID, bar,out isNew);
if (isNew)
{
needSubmitedList.Add(entity);
needSubmitGrid.Refresh();
}
}
private void closeBtn_Click(object sender, EventArgs e)
@ -36,17 +175,43 @@ namespace ButcherFactory.CarcassTakeOut_
private void submitBtn_Click(object sender, EventArgs e)
{
var arrs = needSubmitedList.Where(x => x.Weight.HasValue);
CarcassTakeOutBL.Submit(arrs.Select(x => x.ID));
foreach (var item in arrs)
{
historyList.Add(item);
needSubmitedList.Remove(item);
}
historyDataGrid.Refresh();
needSubmitGrid.Refresh();
}
private void deleteBtn_Click(object sender, EventArgs e)
{
var tag = needSubmitGrid.SelectedRows.Cast<CarcassTakeOut>().FirstOrDefault();
if (tag!=null)
{
CarcassTakeOutBL.Delete(tag.ID);
needSubmitedList.Remove(tag);
needSubmitGrid.Refresh();
}
}
private void readBtn_Click(object sender, EventArgs e)
{
var tags = needSubmitedList.Where(x => x.Weight == null);
if(tags.Any())
return;
CarcassTakeOutBL.SetWeight(tags.Select(x => x.ID), uWeightControl1.Weight);
var id = tags.Max(x=>x.ID);
foreach (var item in tags)
{
if (item.ID == id)
item.Weight = uWeightControl1.Weight;
else
item.Weight = 0;
}
needSubmitGrid.Refresh();
}
}
}

+ 3
- 0
ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.resx View File

@ -150,4 +150,7 @@
KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII=
</value>
</data>
<metadata name="U_Weight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

+ 3
- 3
ButcherFactory.Login/Program.cs View File

@ -49,7 +49,7 @@ namespace ButcherFactory.Login
// LogUtil.WriteError(e);
SoundPalyUtil.PlaySound(SoundType.Error);
UMessageBox.Show("错误:" + e.Message + " \n详细信息:" + e.StackTrace);
MessageBox.Show("错误:" + e.Message + " \n详细信息:" + e.StackTrace);
//UMessageBox.Show("错误:" + e.Message );
}
}
@ -69,7 +69,7 @@ namespace ButcherFactory.Login
err = ex.Message;
}
SoundPalyUtil.PlaySound(SoundType.Error);
UMessageBox.Show("错误:" + ex.Message + " \n详细信息:" + ex.StackTrace);
MessageBox.Show("错误:" + ex.Message + " \n详细信息:" + ex.StackTrace);
// UMessageBox.Show("错误:" + err);
}
@ -83,7 +83,7 @@ namespace ButcherFactory.Login
err = ex.Message;
}
SoundPalyUtil.PlaySound(SoundType.Error);
UMessageBox.Show("错误:" + ex.Message + " \n详细信息:" + ex.StackTrace);
MessageBox.Show("错误:" + ex.Message + " \n详细信息:" + ex.StackTrace);
//UMessageBox.Show("错误:" + err);
}
}


+ 121
- 89
ButcherFactorySolution/ButcherFactorySolution.vdproj View File

@ -21,32 +21,32 @@
}
"Entry"
{
"MsmKey" = "8:_0F5E9869CD634524B5A3066FC1D1D93E"
"OwnerKey" = "8:_UNDEFINED"
"MsmKey" = "8:_01E56548E879FA791BE1522C98562ED5"
"OwnerKey" = "8:_48F4C977267B436F8DD1B5D0D47494BE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_3E728084E6413DC3E740199EBCA6CF15"
"OwnerKey" = "8:_48F4C977267B436F8DD1B5D0D47494BE"
"MsmKey" = "8:_01E56548E879FA791BE1522C98562ED5"
"OwnerKey" = "8:_BF905506D35441369705E8C12149682E"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_3E728084E6413DC3E740199EBCA6CF15"
"OwnerKey" = "8:_852C321FF9974F7FB469AF2E4898FC99"
"MsmKey" = "8:_0F5E9869CD634524B5A3066FC1D1D93E"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_4083346C24A7D8470DB4B61D58809784"
"MsmKey" = "8:_3E728084E6413DC3E740199EBCA6CF15"
"OwnerKey" = "8:_48F4C977267B436F8DD1B5D0D47494BE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_4083346C24A7D8470DB4B61D58809784"
"OwnerKey" = "8:_852C321FF9974F7FB469AF2E4898FC99"
"MsmKey" = "8:_3E728084E6413DC3E740199EBCA6CF15"
"OwnerKey" = "8:_BF905506D35441369705E8C12149682E"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@ -82,7 +82,7 @@
"Entry"
{
"MsmKey" = "8:_4D70C75DA5B25015E8DDBF829D234FE8"
"OwnerKey" = "8:_4083346C24A7D8470DB4B61D58809784"
"OwnerKey" = "8:_01E56548E879FA791BE1522C98562ED5"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@ -99,12 +99,6 @@
}
"Entry"
{
"MsmKey" = "8:_852C321FF9974F7FB469AF2E4898FC99"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_8D58B6FD6249E85E930D55CCE736855E"
"OwnerKey" = "8:_C1BAA40E3F5E065EA88D97DA96D5992D"
"MsmSig" = "8:_UNDEFINED"
@ -112,13 +106,13 @@
"Entry"
{
"MsmKey" = "8:_8D58B6FD6249E85E930D55CCE736855E"
"OwnerKey" = "8:_4083346C24A7D8470DB4B61D58809784"
"OwnerKey" = "8:_48F4C977267B436F8DD1B5D0D47494BE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_8D58B6FD6249E85E930D55CCE736855E"
"OwnerKey" = "8:_48F4C977267B436F8DD1B5D0D47494BE"
"OwnerKey" = "8:_01E56548E879FA791BE1522C98562ED5"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@ -141,8 +135,14 @@
}
"Entry"
{
"MsmKey" = "8:_BF905506D35441369705E8C12149682E"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_C1BAA40E3F5E065EA88D97DA96D5992D"
"OwnerKey" = "8:_4083346C24A7D8470DB4B61D58809784"
"OwnerKey" = "8:_01E56548E879FA791BE1522C98562ED5"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@ -178,7 +178,7 @@
"Entry"
{
"MsmKey" = "8:_D75F76D9C28EDCFD7454D52CBB18C6E9"
"OwnerKey" = "8:_4083346C24A7D8470DB4B61D58809784"
"OwnerKey" = "8:_01E56548E879FA791BE1522C98562ED5"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@ -196,31 +196,25 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_D32656229814B10B3981022C6BAE7B85"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_852C321FF9974F7FB469AF2E4898FC99"
"OwnerKey" = "8:_48F4C977267B436F8DD1B5D0D47494BE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_4083346C24A7D8470DB4B61D58809784"
"OwnerKey" = "8:_BF905506D35441369705E8C12149682E"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_48F4C977267B436F8DD1B5D0D47494BE"
"OwnerKey" = "8:_3E728084E6413DC3E740199EBCA6CF15"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_3E728084E6413DC3E740199EBCA6CF15"
"OwnerKey" = "8:_01E56548E879FA791BE1522C98562ED5"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@ -259,6 +253,12 @@
"OwnerKey" = "8:_8D58B6FD6249E85E930D55CCE736855E"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_D32656229814B10B3981022C6BAE7B85"
"MsmSig" = "8:_UNDEFINED"
}
}
"Configurations"
{
@ -277,6 +277,22 @@
"PrivateKeyFile" = "8:"
"TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.5"
{
"Name" = "8:Microsoft .NET Framework 4.5 (x86 and x64)"
"ProductCode" = "8:.NETFramework,Version=v4.5"
}
}
}
}
"Release"
{
@ -293,6 +309,22 @@
"PrivateKeyFile" = "8:"
"TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.5"
{
"Name" = "8:Microsoft .NET Framework 4.5 (x86 and x64)"
"ProductCode" = "8:.NETFramework,Version=v4.5"
}
}
}
}
}
"Deployable"
@ -342,12 +374,23 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0F5E9869CD634524B5A3066FC1D1D93E"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_01E56548E879FA791BE1522C98562ED5"
{
"SourcePath" = "8:..\\..\\WinFormControl\\WinFormControl\\Sounds\\shotSucc.wav"
"TargetName" = "8:shotSucc.wav"
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:ButcherFactory.BO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_01E56548E879FA791BE1522C98562ED5"
{
"Name" = "8:ButcherFactory.BO.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:ButcherFactory.BO.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_6866532246094A308566729453EB35CA"
"Folder" = "8:_A4535DAA71C54DC088A3FA09FCED8C88"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
@ -359,26 +402,15 @@
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_3E728084E6413DC3E740199EBCA6CF15"
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0F5E9869CD634524B5A3066FC1D1D93E"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:WinFormControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_3E728084E6413DC3E740199EBCA6CF15"
{
"Name" = "8:WinFormControl.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:WinFormControl.dll"
"TargetName" = "8:"
"SourcePath" = "8:..\\..\\WinFormControl\\WinFormControl\\Sounds\\shotSucc.wav"
"TargetName" = "8:shotSucc.wav"
"Tag" = "8:"
"Folder" = "8:_A4535DAA71C54DC088A3FA09FCED8C88"
"Folder" = "8:_6866532246094A308566729453EB35CA"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
@ -390,23 +422,23 @@
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_4083346C24A7D8470DB4B61D58809784"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_3E728084E6413DC3E740199EBCA6CF15"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:ButcherFactory.BO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:WinFormControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_4083346C24A7D8470DB4B61D58809784"
"_3E728084E6413DC3E740199EBCA6CF15"
{
"Name" = "8:ButcherFactory.BO.dll"
"Name" = "8:WinFormControl.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:ButcherFactory.BO.dll"
"SourcePath" = "8:WinFormControl.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_A4535DAA71C54DC088A3FA09FCED8C88"
@ -526,37 +558,6 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_852C321FF9974F7FB469AF2E4898FC99"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:ButcherFactory.Form, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_852C321FF9974F7FB469AF2E4898FC99"
{
"Name" = "8:ButcherFactory.Form.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:..\\ButcherFactory.Form\\bin\\Release\\ButcherFactory.Form.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_A4535DAA71C54DC088A3FA09FCED8C88"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_8D58B6FD6249E85E930D55CCE736855E"
{
"AssemblyRegister" = "3:1"
@ -639,6 +640,37 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_BF905506D35441369705E8C12149682E"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:ButcherFactory.Form, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_BF905506D35441369705E8C12149682E"
{
"Name" = "8:ButcherFactory.Form.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:..\\ButcherFactory.Form\\bin\\Debug\\ButcherFactory.Form.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_A4535DAA71C54DC088A3FA09FCED8C88"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_C1BAA40E3F5E065EA88D97DA96D5992D"
{
"AssemblyRegister" = "3:1"
@ -851,7 +883,7 @@
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:青花瓷屠宰车间管理"
"ProductCode" = "8:{8D06A3CB-94E1-40DF-BF89-0A822D5302EF}"
"PackageCode" = "8:{FA051330-B50B-4787-9CC1-799F243197BA}"
"PackageCode" = "8:{A2A9D804-4034-474C-A42C-8F9A41BD2ABB}"
"UpgradeCode" = "8:{D5614731-239C-49A6-8F35-DB6F5D8E8A8C}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
@ -1414,7 +1446,7 @@
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_48F4C977267B436F8DD1B5D0D47494BE"
{
"SourcePath" = "8:..\\ButcherFactory.Login\\obj\\Release\\ButcherFactory.Login.exe"
"SourcePath" = "8:..\\ButcherFactory.Login\\obj\\Debug\\ButcherFactory.Login.exe"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_A4535DAA71C54DC088A3FA09FCED8C88"


Loading…
Cancel
Save