Browse Source

zz

master
robin 4 years ago
parent
commit
73cc38f0dc
3 changed files with 40 additions and 6 deletions
  1. +3
    -1
      ButcherFactory.BO/LocalBL/SegmentProductionBL.cs
  2. +19
    -0
      ButcherFactory.Form/Controls/CodePanel.cs
  3. +18
    -5
      ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs

+ 3
- 1
ButcherFactory.BO/LocalBL/SegmentProductionBL.cs View File

@ -37,7 +37,8 @@ namespace ButcherFactory.BO.LocalBL
query.Columns.Add(DQSelectColumn.Field("MainUnit"));
query.Columns.Add(DQSelectColumn.Field("TotalCode_ID"));
query.Columns.Add(DQSelectColumn.Field("TotalCode_Code"));
query.Columns.Add(DQSelectColumn.Field("CreateTime"));
query.Columns.Add(DQSelectColumn.Field("CreateTime"));
query.Columns.Add(DQSelectColumn.Field("GoodsType"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("InStored", false), DQCondition.EQ("Delete", false), DQCondition.EQ("Submited", submited)));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true));
if (submited)
@ -70,6 +71,7 @@ namespace ButcherFactory.BO.LocalBL
entity.TotalCode_ID = (long)reader[13];
entity.TotalCode_Code = (string)reader[14];
entity.CreateTime = (DateTime)reader[15];
entity.GoodsType = (short?)reader[16];
list.Add(entity);
}
}


+ 19
- 0
ButcherFactory.Form/Controls/CodePanel.cs View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ButcherFactory.BO;
namespace ButcherFactory.Controls
{
@ -26,5 +27,23 @@ namespace ButcherFactory.Controls
flowLayoutPanel1.Controls.SetChildIndex(v, 0);
}
}
internal void RemoveBar(string barCode)
{
ColorButton target = null;
foreach (ColorButton item in flowLayoutPanel1.Controls)
{
var tag = (SegmentProduction)item.Tag;
if (tag.BarCode == barCode)
{
target = item;
break;
}
}
if (target != null)
{
flowLayoutPanel1.Controls.Remove(target);
}
}
}
}

+ 18
- 5
ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs View File

@ -513,10 +513,11 @@ namespace ButcherFactory.SegmentProductionAuto_
try
{
if (netStateWatch1.NetState)
SegmentProductionBL.UploadSegmentInfo();
SegmentProductionBL.UploadSegmentInfo();
}
catch {
}
catch { }
Thread.Sleep(2000);
}
}
@ -547,13 +548,25 @@ namespace ButcherFactory.SegmentProductionAuto_
var groupByTotal = tag.GroupBy(x => x.TotalCode_ID);
foreach (var item2 in groupByTotal)
{
var d = item2.FirstOrDefault();
//鲜品不删除总码
if (d.GoodsType == 0)
{
if (_freshPanel != null)
{
foreach (var t in item2)
{
_freshPanel.RemoveBar(t.BarCode);
}
}
continue;
}
var f = codeButtons.FirstOrDefault(x => ((TotalCode)x.Tag).ID == item2.Key);
if (f != null)
{
flowLayoutPanel3.Controls.Remove(f.Parent);
codeButtons.Remove(f);
}
}
}
foreach (var item in tag)


Loading…
Cancel
Save