Browse Source

分割完善

master
wugang 8 years ago
parent
commit
2916569258
14 changed files with 589 additions and 172 deletions
  1. +2
    -1
      BO/LocalDmoSession.cs
  2. +12
    -0
      ButcherManageClient/ButcherManageClient.csproj
  3. +14
    -0
      ButcherManageClient/SettingForm.Designer.cs
  4. +60
    -0
      ButcherManageClient/SettingForm.cs
  5. +40
    -0
      SegmentationWeight/DropDownSets.cs
  6. +16
    -0
      SegmentationWeight/ProductTask.cs
  7. +20
    -10
      SegmentationWeight/Rpc/Dto/SegmentationWeightRecord.cs
  8. +20
    -0
      SegmentationWeight/Rpc/Dto/SegmentationWeightRecordDto.cs
  9. +65
    -5
      SegmentationWeight/Rpc/SegmentationWeightRecordRpc.cs
  10. +14
    -0
      SegmentationWeight/SegmentationWeight.csproj
  11. +174
    -96
      SegmentationWeight/SegmentationWeightForm.Designer.cs
  12. +150
    -47
      SegmentationWeight/SegmentationWeightForm.cs
  13. +1
    -4
      SegmentationWeight/SegmentationWeightForm.resx
  14. +1
    -9
      TrunksIousOutInStore/LocalSyncBO/TrunksIousOutInStoreRecord.cs

+ 2
- 1
BO/LocalDmoSession.cs View File

@ -43,7 +43,7 @@ namespace BO
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="detail"></param>
public static void Insert<T>(T detail) where T : LocalSyncBase
public static long Insert<T>(T detail) where T : LocalSyncBase
{
using (var session = LocalDmoSession.New())
{
@ -52,6 +52,7 @@ namespace BO
session.Insert(detail);
session.Commit();
}
return detail.ID;
}
/// <summary>


+ 12
- 0
ButcherManageClient/ButcherManageClient.csproj View File

@ -39,10 +39,18 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\AutoMapper.dll</HintPath>
</Reference>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Forks.EnterpriseServices.dll</HintPath>
</Reference>
<Reference Include="Forks.JsonRpc.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\BwpB3Project\tsref\Debug\Forks.JsonRpc.Client.dll</HintPath>
</Reference>
<Reference Include="Forks.Utils, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Forks.Utils.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
@ -110,6 +118,10 @@
<Project>{a782b23e-be6d-4f51-b5cb-5cd259ba97cc}</Project>
<Name>BWP.WinFormControl</Name>
</ProjectReference>
<ProjectReference Include="..\SegmentationWeight\SegmentationWeight.csproj">
<Project>{f06032a9-bc6c-4123-947b-ef078fab7a74}</Project>
<Name>SegmentationWeight</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="libs\AutoMapper.dll" />


+ 14
- 0
ButcherManageClient/SettingForm.Designer.cs View File

@ -36,6 +36,7 @@
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtOutAddress = new System.Windows.Forms.TextBox();
this.btnUpdate = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// cancelBtn
@ -116,6 +117,17 @@
this.txtOutAddress.Size = new System.Drawing.Size(363, 26);
this.txtOutAddress.TabIndex = 10;
//
// btnUpdate
//
this.btnUpdate.Font = new System.Drawing.Font("宋体", 20F);
this.btnUpdate.Location = new System.Drawing.Point(390, 245);
this.btnUpdate.Name = "btnUpdate";
this.btnUpdate.Size = new System.Drawing.Size(81, 53);
this.btnUpdate.TabIndex = 6;
this.btnUpdate.Text = "升级";
this.btnUpdate.UseVisualStyleBackColor = true;
this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
//
// SettingForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -127,6 +139,7 @@
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.uTextBoxWithPad1);
this.Controls.Add(this.label1);
@ -148,5 +161,6 @@
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtOutAddress;
private System.Windows.Forms.Button btnUpdate;
}
}

+ 60
- 0
ButcherManageClient/SettingForm.cs View File

@ -3,12 +3,18 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using BO.Utils;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.JsonRpc.Client;
using Forks.Utils;
using Forks.Utils.Data;
using TSingSoft.WebPluginFramework;
namespace ButcherManageClient
{
@ -45,5 +51,59 @@ namespace ButcherManageClient
RpcFacade.ReInit(ButcherAppContext.Context.UrlConfig.ServerUrl);
MessageBox.Show("设置保存成功!");
}
private void btnUpdate_Click(object sender, EventArgs e)
{
using (ISqlUtil sqlUtil = new SqlUtil(offlineSqlConInput.Text.Trim()))
{
var boTypes = GetTypes();
Dmo.UpdateTables(sqlUtil, boTypes);
}
MessageBox.Show("升级成功");
}
List<string> NeedUpdateDbDll()
{
var list=new List<string>();
list.Add("SegmentationWeight.dll");
list.Add("TrunksIousOutInStore.dll");
return list;
}
private IEnumerable<Type> GetTypes()
{
var startuppath = Application.StartupPath;
DirectoryInfo fdir = new DirectoryInfo(startuppath);
var needList = NeedUpdateDbDll();
foreach (FileInfo file in fdir.GetFiles("*.dll"))
{
if (!needList.Contains(file.Name))
{
continue;
}
var asm = Assembly.LoadFile(file.FullName);
foreach (var t in asm.GetExportedTypes())
{
if (t.IsAbstract)
{
continue;
}
if (t.IsClass && IsMapTable(t))
{
yield return t;
}
}
}
}
public static bool IsMapTable(Type t)
{
var attr = ReflectionUtil.GetAttribute<MapToTableAttribute>(t);
if (attr == null)
{
return false;
}
return true;
}
}
}

+ 40
- 0
SegmentationWeight/DropDownSets.cs View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SegmentationWeight
{
public class DropDownSets
{
public static readonly string = "车间";
public static readonly string = "单元";
public static readonly string = "批次";
public DropDownSets()
{
Details=new List<DropDownSet>();
}
public List<DropDownSet> Details { get; set; }
}
public class DropDownSet
{
public DropDownSet()
{
Details=new List<DropDownSet_Detail>();
}
public string Name { get; set; }
public List<DropDownSet_Detail> Details { get; set; }
}
public class DropDownSet_Detail
{
public long ID { get; set; }
public string Name { get; set; }
public string Code { get; set; }
}
}

+ 16
- 0
SegmentationWeight/ProductTask.cs View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SegmentationWeight
{
public class ProductTask
{
public long Goods_ID { get; set; }
public string Goods_Name { get; set; }
public decimal Number { get; set; }
public decimal SecondNumber { get; set; }
}
}

+ 20
- 10
SegmentationWeight/Rpc/Dto/SegmentationWeightRecord.cs View File

@ -3,24 +3,34 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using BO.BO;
using Forks.EnterpriseServices.DomainObjects2;
using Newtonsoft.Json;
namespace SegmentationWeight.Rpc.Dto
{
public class SegmentationWeightRecord
[Serializable]
[MapToTable("SegmentationWeightRecord")]
public class SegmentationWeightRecord: LocalSyncBase
{
public long ID { get; set; }
public string BarCode { get; set; }//条码
public long Goods_ID { get; set; }
public string Goods_Name { get; set; }
public string Goods_Spec { get; set; }
public decimal PiWeight { get; set; }//皮重
public decimal MaoWeight { get; set; }//毛重
public decimal JingWeight { get; set; }//净重
public decimal Weight { get; set; }//皮重
public string CardBarCode{ get; set; }//放产品的车的条码
public string BiaoShi { get; set; }//用来记录那个工作台或者哪台触摸屏做的
public string BiaoShi { get; set; }
public override string GetDtoJson()
{
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<SegmentationWeightRecord, SegmentationWeightRecordDto>();
});
var mapper = config.CreateMapper();
var dto = mapper.Map<SegmentationWeightRecordDto>(this);
dto.Client_ID = this.ID;
return JsonConvert.SerializeObject(dto);
}
}
}

+ 20
- 0
SegmentationWeight/Rpc/Dto/SegmentationWeightRecordDto.cs View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BO.BO.Dtos;
namespace SegmentationWeight.Rpc.Dto
{
public class SegmentationWeightRecordDto: SyncBaseDto
{
public string BarCode { get; set; }//条码
public long Goods_ID { get; set; }
public string Goods_Name { get; set; }
public string Goods_Spec { get; set; }
public decimal Weight { get; set; }//皮重
public string CardBarCode { get; set; }//放产品的车的条码
public string BiaoShi { get; set; }
}
}

+ 65
- 5
SegmentationWeight/Rpc/SegmentationWeightRecordRpc.cs View File

@ -3,19 +3,79 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BO;
using BO.BO.Bill;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.JsonRpc.Client;
using Newtonsoft.Json;
using SegmentationWeight.Rpc.Dto;
namespace SegmentationWeight.Rpc
{
public class SegmentationWeightRecordRpc
public class SegmentationWeightRecordRpc : SyncToServerBase<SegmentationWeightRecord>
{
public static long Insert(SegmentationWeightRecord record)
// 定义一个静态变量来保存类的实例
private static SegmentationWeightRecordRpc uniqueInstance;
// 定义一个标识确保线程同步
private static readonly object locker = new object();
// 定义私有构造函数,使外界不能创建该类实例
private SegmentationWeightRecordRpc()
{
}
/// <summary>
/// 定义公有方法提供一个全局访问点,同时你也可以定义公有属性来提供全局访问点
/// </summary>
/// <returns></returns>
public static SegmentationWeightRecordRpc GetInstance()
{
// 当第一个线程运行到这里时,此时会对locker对象 "加锁",
// 当第二个线程运行该方法时,首先检测到locker对象为"加锁"状态,该线程就会挂起等待第一个线程解锁
// lock语句运行完之后(即线程运行完之后)会对该对象"解锁"
// 双重锁定只需要一句判断就可以了
if (uniqueInstance == null)
{
lock (locker)
{
// 如果类的实例不存在则创建,否则直接返回
if (uniqueInstance == null)
{
uniqueInstance = new SegmentationWeightRecordRpc();
}
}
}
return uniqueInstance;
}
protected override string InsertRpcUrl
{
get { return "/MainSystem/B3ClientService/Rpcs/BillRpc/SegmentationWeightRecordRpc/Insert"; }
}
protected override string UpdateRpcUrl
{
get { return "/MainSystem/B3ClientService/Rpcs/BillRpc/SegmentationWeightRecordRpc/Update"; }
}
protected override string DeleteRpcUrl
{
get { return "/MainSystem/B3ClientService/Rpcs/BillRpc/SegmentationWeightRecordRpc/Delete"; }
}
public static int GetTodayTotalCount(DateTime date)
{
var json = JsonConvert.SerializeObject(record);
var id = RpcFacade.Call<long>("/MainSystem/B3ClientService/Rpcs/BillRpc/SegmentationWeightRecordRpc/Insert", json);
return id;
var query = new DQueryDom(new JoinAlias(typeof(SegmentationWeightRecord)));
query.Columns.Add(DQSelectColumn.Count());
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("CreateTime",date.Date));
query.Where.Conditions.Add(DQCondition.LessThan("CreateTime",date.Date.AddDays(1)));;
using (var session = LocalDmoSession.New())
{
return Convert.ToInt32(session.ExecuteScalar(query));
}
}
}
}

+ 14
- 0
SegmentationWeight/SegmentationWeight.csproj View File

@ -30,10 +30,21 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoMapper">
<HintPath>..\TrunksIousOutInStore\bin\Debug\AutoMapper.dll</HintPath>
</Reference>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Forks.EnterpriseServices.dll</HintPath>
</Reference>
<Reference Include="Forks.JsonRpc.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Forks.JsonRpc.Client.dll</HintPath>
</Reference>
<Reference Include="Forks.Utils, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Forks.Utils.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.0.3.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Newtonsoft.Json.dll</HintPath>
@ -50,8 +61,11 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DropDownSets.cs" />
<Compile Include="ProductTask.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rpc\Dto\SegmentationWeightRecord.cs" />
<Compile Include="Rpc\Dto\SegmentationWeightRecordDto.cs" />
<Compile Include="Rpc\SegmentationWeightRecordRpc.cs" />
<Compile Include="SegmentationWeightContext.cs" />
<Compile Include="SegmentationWeightForm.cs">


+ 174
- 96
SegmentationWeight/SegmentationWeightForm.Designer.cs View File

@ -28,25 +28,27 @@
/// </summary>
private void InitializeComponent()
{
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 dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel();
this.btnGoodsSet = new System.Windows.Forms.Button();
this.panel3 = new System.Windows.Forms.Panel();
this.cbxBatch = new System.Windows.Forms.ComboBox();
this.cbxWorkUnit = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.cbxWorkShop = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.enableWeight = new System.Windows.Forms.CheckBox();
this.panel2 = new System.Windows.Forms.Panel();
this.lblChengZhong = new System.Windows.Forms.Label();
this.btnWeightSet = new System.Windows.Forms.Button();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.btnGoodsSet = new System.Windows.Forms.Button();
this.flpGoods = new System.Windows.Forms.FlowLayoutPanel();
this.flpClass = new System.Windows.Forms.FlowLayoutPanel();
this.uDataGridView1 = new BWP.WinFormControl.UDataGridView();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
@ -54,11 +56,16 @@
this.lblGoodsName = new System.Windows.Forms.Label();
this.lblNumber = new System.Windows.Forms.Label();
this.lblWeight = new System.Windows.Forms.Label();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.panel1.SuspendLayout();
this.panel3.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
@ -85,32 +92,90 @@
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(1041, 587);
this.splitContainer1.SplitterDistance = 99;
this.splitContainer1.SplitterDistance = 110;
this.splitContainer1.SplitterWidth = 1;
this.splitContainer1.TabIndex = 0;
//
// panel1
//
this.panel1.Controls.Add(this.panel3);
this.panel1.Controls.Add(this.enableWeight);
this.panel1.Controls.Add(this.panel2);
this.panel1.Controls.Add(this.btnWeightSet);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1039, 97);
this.panel1.Size = new System.Drawing.Size(1039, 108);
this.panel1.TabIndex = 2;
//
// btnGoodsSet
//
this.btnGoodsSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnGoodsSet.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGoodsSet.Location = new System.Drawing.Point(416, 16);
this.btnGoodsSet.Name = "btnGoodsSet";
this.btnGoodsSet.Size = new System.Drawing.Size(95, 50);
this.btnGoodsSet.TabIndex = 34;
this.btnGoodsSet.Text = "产品设置";
this.btnGoodsSet.UseVisualStyleBackColor = true;
this.btnGoodsSet.Click += new System.EventHandler(this.btnGoodsSet_Click);
// panel3
//
this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.panel3.Controls.Add(this.cbxBatch);
this.panel3.Controls.Add(this.cbxWorkUnit);
this.panel3.Controls.Add(this.label6);
this.panel3.Controls.Add(this.label5);
this.panel3.Controls.Add(this.cbxWorkShop);
this.panel3.Controls.Add(this.label4);
this.panel3.Location = new System.Drawing.Point(805, 4);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(231, 100);
this.panel3.TabIndex = 34;
//
// cbxBatch
//
this.cbxBatch.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbxBatch.FormattingEnabled = true;
this.cbxBatch.Location = new System.Drawing.Point(78, 73);
this.cbxBatch.Name = "cbxBatch";
this.cbxBatch.Size = new System.Drawing.Size(121, 20);
this.cbxBatch.TabIndex = 39;
this.cbxBatch.SelectedIndexChanged += new System.EventHandler(this.cbxBatch_SelectedIndexChanged);
//
// cbxWorkUnit
//
this.cbxWorkUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbxWorkUnit.FormattingEnabled = true;
this.cbxWorkUnit.Location = new System.Drawing.Point(78, 40);
this.cbxWorkUnit.Name = "cbxWorkUnit";
this.cbxWorkUnit.Size = new System.Drawing.Size(121, 20);
this.cbxWorkUnit.TabIndex = 40;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(31, 77);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(41, 12);
this.label6.TabIndex = 36;
this.label6.Text = "批次:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(31, 43);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(41, 12);
this.label5.TabIndex = 37;
this.label5.Text = "单元:";
//
// cbxWorkShop
//
this.cbxWorkShop.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbxWorkShop.FormattingEnabled = true;
this.cbxWorkShop.Location = new System.Drawing.Point(79, 7);
this.cbxWorkShop.Name = "cbxWorkShop";
this.cbxWorkShop.Size = new System.Drawing.Size(121, 20);
this.cbxWorkShop.TabIndex = 41;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(31, 11);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(41, 12);
this.label4.TabIndex = 38;
this.label4.Text = "车间:";
//
// enableWeight
//
@ -173,11 +238,23 @@
//
this.splitContainer2.Panel2.Controls.Add(this.uDataGridView1);
this.splitContainer2.Panel2.Controls.Add(this.tableLayoutPanel1);
this.splitContainer2.Size = new System.Drawing.Size(1041, 487);
this.splitContainer2.Size = new System.Drawing.Size(1041, 476);
this.splitContainer2.SplitterDistance = 517;
this.splitContainer2.SplitterWidth = 1;
this.splitContainer2.TabIndex = 0;
//
// btnGoodsSet
//
this.btnGoodsSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnGoodsSet.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGoodsSet.Location = new System.Drawing.Point(416, 16);
this.btnGoodsSet.Name = "btnGoodsSet";
this.btnGoodsSet.Size = new System.Drawing.Size(95, 50);
this.btnGoodsSet.TabIndex = 34;
this.btnGoodsSet.Text = "产品设置";
this.btnGoodsSet.UseVisualStyleBackColor = true;
this.btnGoodsSet.Click += new System.EventHandler(this.btnGoodsSet_Click);
//
// flpGoods
//
this.flpGoods.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -186,7 +263,7 @@
this.flpGoods.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flpGoods.Location = new System.Drawing.Point(4, 87);
this.flpGoods.Name = "flpGoods";
this.flpGoods.Size = new System.Drawing.Size(507, 395);
this.flpGoods.Size = new System.Drawing.Size(507, 384);
this.flpGoods.TabIndex = 1;
//
// flpClass
@ -205,89 +282,48 @@
this.uDataGridView1.AllowUserToDeleteRows = false;
this.uDataGridView1.AllowUserToResizeColumns = false;
this.uDataGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.uDataGridView1.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.,
this.,
this.,
this.,
this.});
this.});
this.uDataGridView1.Location = new System.Drawing.Point(3, 108);
this.uDataGridView1.MultiSelect = false;
this.uDataGridView1.Name = "uDataGridView1";
this.uDataGridView1.ReadOnly = true;
this.uDataGridView1.RowHeadersVisible = false;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle6;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle3;
this.uDataGridView1.RowTemplate.Height = 23;
this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.uDataGridView1.Size = new System.Drawing.Size(533, 374);
this.uDataGridView1.Size = new System.Drawing.Size(515, 363);
this.uDataGridView1.TabIndex = 1;
//
// 序号
//
this..DataPropertyName = "ID";
this..HeaderText = "序号";
this..Name = "序号";
this..ReadOnly = true;
this..Width = 80;
//
// 条码
//
this..DataPropertyName = "BarCode";
this..HeaderText = "条码";
this..Name = "条码";
this..ReadOnly = true;
//
// 产品
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this..DataPropertyName = "Goods_Name";
this..HeaderText = "产品";
this..MinimumWidth = 100;
this..Name = "产品";
this..ReadOnly = true;
//
// 净重
//
this..DataPropertyName = "JingWeight";
this..HeaderText = "净重";
this..Name = "净重";
this..ReadOnly = true;
this..Width = 80;
//
// 毛重
//
this..DataPropertyName = "MaoWeight";
this..HeaderText = "毛重";
this..Name = "毛重";
this..ReadOnly = true;
this..Width = 80;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 65.90909F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 34.09091F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 106F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 58.15603F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 41.84397F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 124F));
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label2, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.label3, 2, 0);
@ -299,7 +335,7 @@
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 53.57143F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 46.42857F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(529, 98);
this.tableLayoutPanel1.Size = new System.Drawing.Size(515, 98);
this.tableLayoutPanel1.TabIndex = 0;
//
// label1
@ -309,7 +345,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.Location = new System.Drawing.Point(4, 1);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(270, 50);
this.label1.Size = new System.Drawing.Size(219, 50);
this.label1.TabIndex = 0;
this.label1.Text = "产品";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -319,9 +355,9 @@
this.label2.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.label2.Location = new System.Drawing.Point(281, 1);
this.label2.Location = new System.Drawing.Point(230, 1);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(136, 50);
this.label2.Size = new System.Drawing.Size(155, 50);
this.label2.TabIndex = 0;
this.label2.Text = "数量";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -331,9 +367,9 @@
this.label3.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.label3.Location = new System.Drawing.Point(424, 1);
this.label3.Location = new System.Drawing.Point(392, 1);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(101, 50);
this.label3.Size = new System.Drawing.Size(119, 50);
this.label3.TabIndex = 0;
this.label3.Text = "重量";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -345,7 +381,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.lblGoodsName.Location = new System.Drawing.Point(4, 52);
this.lblGoodsName.Name = "lblGoodsName";
this.lblGoodsName.Size = new System.Drawing.Size(270, 45);
this.lblGoodsName.Size = new System.Drawing.Size(219, 45);
this.lblGoodsName.TabIndex = 0;
this.lblGoodsName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
@ -354,9 +390,9 @@
this.lblNumber.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.lblNumber.Location = new System.Drawing.Point(281, 52);
this.lblNumber.Location = new System.Drawing.Point(230, 52);
this.lblNumber.Name = "lblNumber";
this.lblNumber.Size = new System.Drawing.Size(136, 45);
this.lblNumber.Size = new System.Drawing.Size(155, 45);
this.lblNumber.TabIndex = 0;
this.lblNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
@ -365,12 +401,46 @@
this.lblWeight.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.lblWeight.Location = new System.Drawing.Point(424, 52);
this.lblWeight.Location = new System.Drawing.Point(392, 52);
this.lblWeight.Name = "lblWeight";
this.lblWeight.Size = new System.Drawing.Size(101, 45);
this.lblWeight.Size = new System.Drawing.Size(119, 45);
this.lblWeight.TabIndex = 0;
this.lblWeight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// 序号
//
this..DataPropertyName = "ID";
this..HeaderText = "序号";
this..Name = "序号";
this..ReadOnly = true;
this..Width = 80;
//
// 条码
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
this..DataPropertyName = "BarCode";
this..HeaderText = "条码";
this..Name = "条码";
this..ReadOnly = true;
this..Width = 65;
//
// 产品
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this..DataPropertyName = "Goods_Name";
this..HeaderText = "产品";
this..MinimumWidth = 100;
this..Name = "产品";
this..ReadOnly = true;
//
// 重量
//
this..DataPropertyName = "Weight";
this..HeaderText = "重量";
this..Name = "重量";
this..ReadOnly = true;
this..Width = 80;
//
// SegmentationWeightForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -389,6 +459,8 @@
this.splitContainer1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.splitContainer2.Panel1.ResumeLayout(false);
@ -421,10 +493,16 @@
private System.Windows.Forms.Label lblNumber;
private System.Windows.Forms.Label lblWeight;
private BWP.WinFormControl.UDataGridView uDataGridView1;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.ComboBox cbxBatch;
private System.Windows.Forms.ComboBox cbxWorkUnit;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox cbxWorkShop;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
}
}

+ 150
- 47
SegmentationWeight/SegmentationWeightForm.cs View File

@ -10,8 +10,12 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using BO;
using BO.Utils;
using BO.Utils.BillRpc;
using BWP.WinFormControl.WeightDataFormat;
using Forks.JsonRpc.Client;
using Newtonsoft.Json;
using SegmentationWeight.Rpc;
using SegmentationWeight.Rpc.Dto;
@ -19,7 +23,11 @@ namespace SegmentationWeight
{
public partial class SegmentationWeightForm : Form,IAfterLogin
{
private readonly string mDropDownSetsFileName = "DropDownSets.xml";
private DropDownSets mDropDownSets;
private List<ProductTask> mProductTasks;
private readonly string mProductTasksFileName = "ProductTasks.xml";
#region weightNeed
SerialPort weightPort;
@ -47,7 +55,115 @@ namespace SegmentationWeight
// if (syncToServer != null && syncToServer.IsAlive)
// syncToServer.Abort();
};
InitCombox();
InitPlanGoodsNumber();
}
private void cbxBatch_SelectedIndexChanged(object sender, EventArgs e)
{
InitPlanGoodsNumber();
}
private void InitPlanGoodsNumber()
{
if (LoginRpcUtil.TestConnection(1000))
{
var json = RpcFacade.Call<string>("/MainSystem/B3ClientService/Rpcs/BillRpc/ProductTaskRpc/GetListByBatch", cbxBatch.Text);
mProductTasks = JsonConvert.DeserializeObject<List<ProductTask>>(json);
XmlUtil.SerializerObjToFile(mProductTasks,mProductTasksFileName);
}
else
{
mProductTasks = XmlUtil.DeserializeFromFile<List<ProductTask>>(mProductTasksFileName);
}
}
private void InitCombox()
{
if (LoginRpcUtil.TestConnection(500))
{
mDropDownSets = GetmDropDownSets();
XmlUtil.SerializerObjToFile(mDropDownSets, mDropDownSetsFileName);
}
else
{
mDropDownSets = XmlUtil.DeserializeFromFile<DropDownSets>(mDropDownSetsFileName);
}
var shop = mDropDownSets.Details.FirstOrDefault(x => x.Name == DropDownSets.);
if (shop != null)
{
cbxWorkShop.DataSource = shop.Details;
cbxWorkShop.DisplayMember = "Name";
cbxWorkShop.ValueMember = "ID";
}
var unit = mDropDownSets.Details.FirstOrDefault(x => x.Name == DropDownSets.);
if (unit != null)
{
cbxWorkUnit.DataSource = unit.Details;
cbxWorkUnit.DisplayMember = "Name";
cbxWorkUnit.ValueMember = "Code";
}
var batch = mDropDownSets.Details.FirstOrDefault(x => x.Name == DropDownSets.);
if (batch != null)
{
cbxBatch.DataSource = batch.Details;
cbxBatch.DisplayMember = "Name";
cbxBatch.ValueMember = "ID";
}
}
private DropDownSets GetmDropDownSets()
{
var sets=new DropDownSets();
var wrokUnitSet = GetWrokUnitSet();
var wrokShopSet = GetWrokShopSet();
var productBatchSet = GetProductBatchSet();
sets.Details.Add(wrokUnitSet);
sets.Details.Add(wrokShopSet);
sets.Details.Add(productBatchSet);
return sets;
}
private DropDownSet GetProductBatchSet()
{
var json = RpcFacade.Call<string>("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/GetProductBatchList");
var set = new DropDownSet();
set.Name = DropDownSets.;
foreach (var detail in JsonConvert.DeserializeObject<List<DropDownSet_Detail>>(json))
{
set.Details.Add(detail);
}
return set;
}
private DropDownSet GetWrokShopSet()
{
var json = RpcFacade.Call<string>("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/GetWorkShopList");
var set = new DropDownSet();
set.Name = DropDownSets.;
foreach (var detail in JsonConvert.DeserializeObject<List<DropDownSet_Detail>>(json))
{
set.Details.Add(detail);
}
return set;
}
private DropDownSet GetWrokUnitSet()
{
var json = RpcFacade.Call<string>("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/GetWorkUnitList");
var set = new DropDownSet();
set.Name = DropDownSets.;
foreach (var detail in JsonConvert.DeserializeObject<List<DropDownSet_Detail>>(json))
{
set.Details.Add(detail);
}
return set;
}
#region weightNeed
void OpenSerialPort()
{
@ -339,77 +455,62 @@ namespace SegmentationWeight
{
var btn = sender as Button;
var set = btn.Tag as SegmentationWeightGoodSet;
//todo 打印条码 要判断误差
var weight = 100m;
//添加记录
var record = GetRecordBySet(set,weight);
var id=SegmentationWeightRecordRpc.Insert(record);
var record = GetRecordBySet(set);
var id=LocalDmoSession.Insert(record);
record.ID = id;
mWeightRecords.Add(record);
RefreshUi();
var entity = CreatePrintEntity("5号里脊肉");
var entity = CreatePrintEntity(record);
SegmentationWeightPrint.Print(entity);
}
PrintEntity CreatePrintEntity(string goodsName)
PrintEntity CreatePrintEntity(SegmentationWeightRecord record)
{
var entity = new PrintEntity();
entity.AccountingUnit_Name = "青岛万福集团股份有限公司";
entity.Goods_Name = goodsName;
entity.Goods_Name = record.Goods_Name;
entity.Date = DateTime.Today;
entity.Checker = "";
entity.Checker = "001";
entity.StoreCondition = "0-4℃";
entity.Place = "青岛莱西市";
entity.Place = "青岛莱西市珠海路5号";
entity.TelNumber = "0532-88488888";
int maxindex=0;
// if (index == null)
// {
//// maxindex = LocalGradeAndWeightBL.GetTodayTotalCount(butcherTimeInput.Date.Value);
// maxindex++;
// }
// else
// {
// maxindex = index.Value;
// }
string indexCode = maxindex.ToString("D6");
entity.BarCode = string.Format("WF{0}{1:00000}", DateTime.Today.ToString("yyyyMMdd"), indexCode);
entity._2DQRCode = string.Format(ButcherAppContext.Context.UrlConfig.OutAddress + "?code={0}&name={1}", entity.BarCode, goodsName);
entity.BarCode = record.BarCode;
entity._2DQRCode = string.Format(ButcherAppContext.Context.UrlConfig.OutAddress + "?code=", entity.BarCode);
return entity;
}
private SegmentationWeightRecord GetRecordBySet(SegmentationWeightGoodSet set,decimal maoWeight)
private SegmentationWeightRecord GetRecordBySet(SegmentationWeightGoodSet set)
{
var unitValue = cbxWorkUnit.SelectedValue.ToString();
if (string.IsNullOrWhiteSpace(unitValue))
{
throw new Exception("请选择工作单元");
}
var record=new SegmentationWeightRecord();
record.Goods_ID = set.Goods_ID;
record.BarCode = "";//todo 条码规则
string liushuihao = GetLiuShuiHao();
record.BarCode = "A26091201"+DateTime.Today.ToString("yyyyMMdd")+cbxWorkUnit.SelectedValue+ liushuihao;
record.Goods_Name = set.Goods_Name;
record.Goods_Spec = set.Goods_Spec;
record.BiaoShi = "";//todo 标识
record.MaoWeight = maoWeight;
record.PiWeight = 10;
record.BiaoShi = cbxWorkUnit.Text;
var weight = Convert.ToDecimal(lblChengZhong.Text);
record.Weight = weight;
record.CardBarCode = ""; //
// record.JingWeight = record.MaoWeight - record.PiWeight;
return record;
}
if (set.Goods_MainUnitRatio > 0)
{
record.JingWeight = set.Goods_MainUnitRatio;
}
else
private int globleLiuShuiHao = 0;
private string GetLiuShuiHao()
{
if (globleLiuShuiHao == 0)
{
record.JingWeight = record.MaoWeight - record.PiWeight;
globleLiuShuiHao = SegmentationWeightRecordRpc.GetTodayTotalCount(DateTime.Today);
}
record.CardBarCode = "车条码"; //todo
return record;
globleLiuShuiHao++;
string indexCode = globleLiuShuiHao.ToString("D5");
return indexCode;
}
void RefreshUi()
@ -420,7 +521,7 @@ namespace SegmentationWeight
}
lblGoodsName.Text = mWeightRecords.First().Goods_Name;
lblNumber.Text = mWeightRecords.Count.ToString();
lblWeight.Text = mWeightRecords.Sum(x => x.JingWeight).ToString();
lblWeight.Text = mWeightRecords.Sum(x => x.Weight).ToString();
uDataGridView1.DataSource = mWeightRecords;
}
@ -436,5 +537,7 @@ namespace SegmentationWeight
var form=new WeightSettingFrom();
form.ShowDialog();
}
}
}

+ 1
- 4
SegmentationWeight/SegmentationWeightForm.resx View File

@ -126,10 +126,7 @@
<metadata name="产品.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="净重.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="毛重.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="重量.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

+ 1
- 9
TrunksIousOutInStore/LocalSyncBO/TrunksIousOutInStoreRecord.cs View File

@ -38,13 +38,5 @@ namespace TrunksIousOutInStore.LocalSyncBO
}
}
public class CarcassStatus
{
public static readonly string = "胴体称重";
public static readonly string = "入预冷库";
public static readonly string = "分割领用";
public static readonly string = "入销售库";
public static readonly string = "销售出库";
}
}

Loading…
Cancel
Save