Browse Source

修改。

master
yibo 8 years ago
parent
commit
e850f14408
33 changed files with 937 additions and 1531 deletions
  1. +6
    -2
      BO/BO.csproj
  2. +19
    -0
      BO/BO/BackRpcObj.cs
  3. +2
    -0
      BO/BO/Bill/GradeAndWeight/GradeAndWeight.cs
  4. +3
    -3
      BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs
  5. +32
    -0
      BO/BO/Bill/WeightBill/HouseAndSanctionEdit.cs
  6. +25
    -0
      BO/BO/Bill/WeightBill/HouseAndSanctionList.cs
  7. +9
    -52
      BO/BO/Bill/WeightBill/WeightBill.cs
  8. +35
    -0
      BO/BO/Bill/WeightBill/WeightBillList.cs
  9. +0
    -2
      BO/BO/Bill/WeightBill/WeightBill_Detail.cs
  10. +0
    -2
      BO/BO/Bill/WeightBill/WeightBill_FarmerDetail.cs
  11. +0
    -2
      BO/BO/Bill/WeightBill/WeightBill_HouseDetail.cs
  12. +0
    -2
      BO/BO/Bill/WeightBill/WeightBill_SanctionDetail.cs
  13. +1
    -8
      BO/BO/SyncBase.cs
  14. +0
    -22
      BO/BO/SyncBill.cs
  15. +1
    -1
      BO/Utils/AfterLoginUtil.cs
  16. +5
    -5
      BO/Utils/BillRpc/GradeAndWeightRpc.cs
  17. +43
    -0
      BO/Utils/BillRpc/HouseAndSanctionRpc.cs
  18. +43
    -320
      BO/Utils/BillRpc/WeightBillRpc.cs
  19. +7
    -7
      BWP.WinFormControl/UComboBox.cs
  20. +1
    -1
      ButcherWeight/WeightContext.cs
  21. +339
    -379
      ButcherWeight/WeightForm.Designer.cs
  22. +42
    -90
      ButcherWeight/WeightForm.cs
  23. +0
    -12
      ButcherWeight/WeightForm.resx
  24. +12
    -72
      ButcherWeight/WeightFormWeightPart.cs
  25. +158
    -158
      QualityAndOrder/QualityOrderForm.Designer.cs
  26. +52
    -49
      QualityAndOrder/QualityOrderForm.cs
  27. +1
    -1
      QualityAndOrder/QualityOrderForm.resx
  28. +1
    -1
      QualityAndOrder/QualityOrderFormForTab2.cs
  29. BIN
      Setup/Release/Setup.msi
  30. +1
    -1
      WeighAndGrading/GradeContext.cs
  31. +80
    -277
      WeighAndGrading/GradeFrom.Designer.cs
  32. +16
    -59
      WeighAndGrading/GradeFrom.cs
  33. +3
    -3
      WeighAndGrading/GradeFrom.resx

+ 6
- 2
BO/BO.csproj View File

@ -53,16 +53,22 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BO\BackRpcObj.cs" />
<Compile Include="BO\Bill\GradeAndWeight\GradeAndWeight.cs" />
<Compile Include="BO\Bill\GradeAndWeight\GradeAndWeight_Detail.cs" />
<Compile Include="BO\Bill\OrderDetail\NeedOrderEntity.cs" />
<Compile Include="BO\Bill\OrderDetail\OrderDetail.cs" />
<Compile Include="BO\Bill\SecondOrder\SecondOrder.cs" />
<Compile Include="BO\Bill\SecondOrder\SecondOrder_Detail.cs" />
<Compile Include="BO\Bill\WeightBill\HouseAndSanctionEdit.cs" />
<Compile Include="BO\Bill\WeightBill\HouseAndSanctionList.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBillList.cs" />
<Compile Include="BO\Bill\WeightBill\WeightDetail.cs" />
<Compile Include="BO\SyncBase.cs" />
<Compile Include="CTuple.cs" />
<Compile Include="Utils\AfterLoginUtil.cs" />
<Compile Include="Utils\BillRpc\GradeAndWeightRpc.cs" />
<Compile Include="Utils\BillRpc\HouseAndSanctionRpc.cs" />
<Compile Include="Utils\BillRpc\OrderDetailRpc.cs" />
<Compile Include="Utils\BillRpc\SecondOrderRpc.cs" />
<Compile Include="Utils\ButcherAppContext.cs" />
@ -71,8 +77,6 @@
<Compile Include="BO\Bill\WeightBill\WeightBill_FarmerDetail.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBill_HouseDetail.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBill_SanctionDetail.cs" />
<Compile Include="BO\SyncBase.cs" />
<Compile Include="BO\SyncBill.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils\BaseInfoRpcUtil.cs" />
<Compile Include="Utils\BillRpc\WeightBillRpc.cs" />


+ 19
- 0
BO/BO/BackRpcObj.cs View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BO.BO
{
public class BackRpcObj
{
public long ID { get; set; }
public string Flag { get; set; }
private List<BackRpcObj> _detailBack = new List<BackRpcObj>();
public List<BackRpcObj> DetailBack { get { return _detailBack; } set { _detailBack = value; } }
}
}

+ 2
- 0
BO/BO/Bill/GradeAndWeight/GradeAndWeight.cs View File

@ -12,6 +12,8 @@ namespace BO.BO.Bill
public int Order { get; set; }
public short Technics { get; set; }
public string Technics_Name { get; set; }
public int Number { get; set; }


+ 3
- 3
BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs View File

@ -10,11 +10,11 @@ namespace BO.BO.Bill
{
public long ID { get; set; }
public int Index { get; set; }
public long OrderDetail_ID { get; set; }
public int? Order { get; set; }
public int Index { get; set; }
public DateTime Date { get; set; }
public short Technics { get; set; }


+ 32
- 0
BO/BO/Bill/WeightBill/HouseAndSanctionEdit.cs View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BO.BO
{
public class HouseAndSanctionEdit
{
public long ID { get; set; }
public int? Number { get; set; }
public long? HogGrade_ID { get; set; }
#region 获取的时候不赋值,只负责接收
public string HogGrade_Name { get; set; }
public long? Inspector_ID { get; set; }
public string Inspector_Name { get; set; }
#endregion
private List<WeightBill_HouseDetail> _houseDetails = new List<WeightBill_HouseDetail>();
public List<WeightBill_HouseDetail> HouseDetails { get { return _houseDetails; } set { _houseDetails = value; } }
private List<WeightBill_SanctionDetail> _sanctionDetails = new List<WeightBill_SanctionDetail>();
public List<WeightBill_SanctionDetail> SanctionDetails { get { return _sanctionDetails; } set { _sanctionDetails = value; } }
}
}

+ 25
- 0
BO/BO/Bill/WeightBill/HouseAndSanctionList.cs View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BO.BO
{
public class HouseAndSanctionList
{
public long ID { get; set; }
public long? B3ID { get; set; }
public string Employee_Name { get; set; }
public string Supplier_Name { get; set; }
public int? Number { get; set; }
public string HouseNames { get; set; }
public bool AlreadyHouse { get { return !string.IsNullOrEmpty(HouseNames); } }
}
}

+ 9
- 52
BO/BO/Bill/WeightBill/WeightBill.cs View File

@ -9,8 +9,14 @@ using TSingSoft.WebPluginFramework;
namespace BO.BO
{
[Serializable]
public class WeightBill : SyncBill
public class WeightBill
{
public long ID { get; set; }
public long? B3ID { get; set; }
public string Creator { get; set; }
public long? AccountingUnit_ID { get; set; }
public long? Department_ID { get; set; }
@ -76,59 +82,10 @@ namespace BO.BO
public string Remark { get; set; }
public bool AlreadyHouse { get; set; }
private List<WeightBill_Detail> _details = new List<WeightBill_Detail>();
public List<WeightBill_Detail> Details { get { return _details; } }
public int Number { get { return _details.Sum(x => (x.Number ?? 0)); } }
public decimal Weight { get { return _details.Sum(x => (x.Weight ?? 0)); } }
public List<WeightBill_Detail> Details { get { return _details; } set { _details = value; } }
private List<WeightBill_FarmerDetail> _farmerDetails = new List<WeightBill_FarmerDetail>();
public List<WeightBill_FarmerDetail> FarmerDetails { get { return _farmerDetails; } }
public string FarmerNames
{
get
{
if (_farmerDetails.Any()) return string.Join(",", _farmerDetails.Select(x => x.Farmer_Name));
return null;
}
}
private List<WeightBill_HouseDetail> _houseDetails = new List<WeightBill_HouseDetail>();
public List<WeightBill_HouseDetail> HouseDetails { get { return _houseDetails; } }
public string HouseNames
{
get
{
if (_houseDetails.Any()) return string.Join(",", _houseDetails.Select(x => x.LiveColonyHouse_Name));
return null;
}
}
public int? HouseNumber { get { if (_houseDetails.Any()) return _houseDetails.Sum(x => (x.Number ?? 0)); return null; } }
private List<WeightBill_SanctionDetail> _sanctionDetails = new List<WeightBill_SanctionDetail>();
public List<WeightBill_SanctionDetail> SanctionDetails { get { return _sanctionDetails; } }
public int SanctionNumber { get { return _sanctionDetails.Sum(x => (x.Number ?? 0)); } }
public int? FirstWeightNumber { get; set; }
public bool FinishWeight
{
get
{
if (Details.Any())
{
var first = Details.First();
return first.MaoWeight.HasValue && first.PiWeight.HasValue;
}
return false;
}
}
public List<WeightBill_FarmerDetail> FarmerDetails { get { return _farmerDetails; } set { _farmerDetails = value; } }
}
}

+ 35
- 0
BO/BO/Bill/WeightBill/WeightBillList.cs View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BO.BO
{
public class WeightBillList
{
public long ID { get; set; }
public long? B3ID { get; set; }
public string Car_Name { get; set; }
public string Supplier_Name { get; set; }
public string Employee_Name { get; set; }
public string PurchaseType_Name { get; set; }
public int? Number { get; set; }
public decimal? Weight { get; set; }
public string HouseNames { get; set; }
public int? SanctionNumber { get; set; }
public string Remark { get; set; }
public bool FinishWeight { get; set; }
}
}

+ 0
- 2
BO/BO/Bill/WeightBill/WeightBill_Detail.cs View File

@ -11,8 +11,6 @@ namespace BO.BO
{
public long WeightBill_ID { get; set; }
public int Index { get; set; }
public int? Number { get; set; }
public decimal? PiWeight { get; set; }


+ 0
- 2
BO/BO/Bill/WeightBill/WeightBill_FarmerDetail.cs View File

@ -11,8 +11,6 @@ namespace BO.BO
{
public long WeightBill_ID { get; set; }
public int Index { get; set; }
public long? Farmer_ID { get; set; }
public string Farmer_Name { get; set; }


+ 0
- 2
BO/BO/Bill/WeightBill/WeightBill_HouseDetail.cs View File

@ -11,8 +11,6 @@ namespace BO.BO
{
public long WeightBill_ID { get; set; }
public int Index { get; set; }
public long? LiveColonyHouse_ID { get; set; }
public string LiveColonyHouse_Name { get; set; }


+ 0
- 2
BO/BO/Bill/WeightBill/WeightBill_SanctionDetail.cs View File

@ -11,8 +11,6 @@ namespace BO.BO
{
public long WeightBill_ID { get; set; }
public int Index { get; set; }
/// <summary>
/// 异常奖罚配置
/// </summary>


+ 1
- 8
BO/BO/SyncBase.cs View File

@ -6,19 +6,12 @@ using System.Threading.Tasks;
namespace BO.BO
{
[Serializable]
public abstract class SyncBase
{
public long ID { get; set; }
/// <summary>
/// 对应B3ID
/// </summary>
public long? B3ID { get; set; }
public int Index { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public bool DeleteState { get; set; }
}
}

+ 0
- 22
BO/BO/SyncBill.cs View File

@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BO.BO
{
[Serializable]
public class SyncBill : SyncBase
{
/// <summary>
/// 单据创建人用户名
/// </summary>
public string Creator { get; set; }
/// <summary>
/// 单据是否完整可以上传
/// </summary>
public bool FinishCreate { get; set; }
}
}

+ 1
- 1
BO/Utils/AfterLoginUtil.cs View File

@ -26,7 +26,7 @@ namespace BO.Utils
//#if !debug
// static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>(){new Tuple<string,string>("排宰员",@"ButcherOrder"),
//new Tuple<string,string>("过磅员",@"ButcherWeight"),
// new Tuple<string,string>("验质员",@"QualityAndOrder"),new Tuple<string,string>("定级员",@"WeighAndGrading")};
// new Tuple<string,string>("验质员",@"QualityAndOrder"),new Tuple<string,string>("定级员",@"WeighAndGrading")};
//#endif


+ 5
- 5
BO/Utils/BillRpc/GradeAndWeightRpc.cs View File

@ -20,18 +20,18 @@ namespace BO.Utils.BillRpc
return serializer.Deserialize<List<GradeAndWeight>>(result);
}
public static List<GradeAndWeight_Detail> GetDetails(DateTime startDate, DateTime endDate, int? order, int type)
public static List<GradeAndWeight_Detail> GetDetails(DateTime date, int top = 15)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/GetDetailsList";
var result = RpcFacade.Call<string>(method, startDate, endDate, order, type);
var result = RpcFacade.Call<string>(method, date, top);
result = result.ESerializeDateTime();
return serializer.Deserialize<List<GradeAndWeight_Detail>>(result);
}
public static void InsertOrInsertDetail(GradeAndWeight_Detail detail)
public static void UpdateOrInsertDetail(GradeAndWeight_Detail detail, bool fillTechnics = false)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/InsertOrInsertDetail";
detail.ID = RpcFacade.Call<long>(method, serializer.Serialize(detail));
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/UpdateOrInsertDetail";
detail.ID = RpcFacade.Call<long>(method, serializer.Serialize(detail), fillTechnics);
}
public static void UpdateLivestock(long id, long liveStockID, string liveStockName)


+ 43
- 0
BO/Utils/BillRpc/HouseAndSanctionRpc.cs View File

@ -0,0 +1,43 @@
using BO.BO;
using Forks.JsonRpc.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
namespace BO.Utils.BillRpc
{
public static class HouseAndSanctionRpc
{
static JavaScriptSerializer serializer = new JavaScriptSerializer();
public static List<HouseAndSanctionList> GetHouseAndSanctionList(DateTime date)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/HouseAndSanctionRpc/GetHouseAndSanctionList";
var json = RpcFacade.Call<string>(method, date);
return serializer.Deserialize<List<HouseAndSanctionList>>(json);
}
public static void UpdateInsertHouseAndSanction(HouseAndSanctionEdit bo)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/HouseAndSanctionRpc/UpdateInsertHouseAndSanction";
bo.Inspector_ID = ButcherAppContext.Context.UserConfig.Employee_ID;
bo.Inspector_Name = ButcherAppContext.Context.UserConfig.Employee_Name;
RpcFacade.Call<int>(method, serializer.Serialize(bo));
}
public static int GetDetailTotalNumber(DateTime date)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/HouseAndSanctionRpc/GetDetailTotalNumber";
return RpcFacade.Call<int>(method, date);
}
public static HouseAndSanctionEdit GetHouseAndSanctionDetail(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/HouseAndSanctionRpc/GetHouseAndSanctionDetail";
var obj = RpcFacade.Call<string>(method, id);
return serializer.Deserialize<HouseAndSanctionEdit>(obj);
}
}
}

+ 43
- 320
BO/Utils/BillRpc/WeightBillRpc.cs View File

@ -13,125 +13,55 @@ namespace BO.Utils.BillRpc
public static class WeightBillRpc
{
static JavaScriptSerializer serializer = new JavaScriptSerializer();
public static bool Send(WeightBill bo, List<WeightDetail> weightRecord)
public static List<WeightBillList> GetWeightBillList(long? carID, long? supplierID)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/UploadBill";
var obj = new RpcObject("/MainSystem/B3ClientService/BO/WeightBill");
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetWeightBillList";
var obj = RpcFacade.Call<string>(method, DateTime.Today, carID, supplierID);
return serializer.Deserialize<List<WeightBillList>>(obj);
}
public static WeightBill Load(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/Load";
var obj = RpcFacade.Call<string>(method, id);
obj = obj.ESerializeDateTime();
return serializer.Deserialize<WeightBill>(obj);
}
public static bool UpdateOrInsert(WeightBill bo, List<WeightDetail> weightRecord)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/UpdateOrInsert";
if (bo.ID == 0)
{
bo.Creator = ButcherAppContext.Context.UserConfig.UserName;
bo.AccountingUnit_ID = ButcherAppContext.Context.UserConfig.AccountingUnit_ID;
bo.Department_ID = ButcherAppContext.Context.UserConfig.Department_ID;
}
obj.Set("Creator", bo.Creator);
obj.Set("AccountingUnit_ID", bo.AccountingUnit_ID);
obj.Set("Department_ID", bo.Department_ID);
//base
obj.Set("ID", bo.ID);
//bill
obj.Set("FinishCreate", bo.FinishCreate);
obj.Set("ModifyTime", DateTime.Now);
//bill
obj.Set("Employee_ID", bo.Employee_ID);
obj.Set("Employee_Name", bo.Employee_Name);
obj.Set("WeighTime", bo.WeighTime);
obj.Set("Supplier_ID", bo.Supplier_ID);
obj.Set("Supplier_Name", bo.Supplier_Name);
obj.Set("Zone_ID", bo.Zone_ID);
obj.Set("Zone_Name", bo.Zone_Name);
obj.Set("PurchaseType_ID", bo.PurchaseType_ID);
obj.Set("PurchaseType_Name", bo.PurchaseType_Name);
obj.Set("Car_ID", bo.Car_ID);
obj.Set("Car_Name", bo.Car_Name);
obj.Set("LiveVarieties_ID", bo.LiveVarieties_ID);
obj.Set("LiveVarieties_Name", bo.LiveVarieties_Name);
obj.Set("HogGrade_ID", bo.HogGrade_ID);
obj.Set("HogGrade_Name", bo.HogGrade_Name);
obj.Set("ShackWeight", bo.ShackWeight);
obj.Set("ShackPrice", bo.ShackPrice);
obj.Set("JingJianFee", bo.JingJianFee);
obj.Set("DiscontMoney", bo.DiscontMoney);
obj.Set("AnimalTestNumber", bo.AnimalTestNumber);
obj.Set("AnimalTestDate", bo.AnimalTestDate);
obj.Set("AnimalTestMan", bo.AnimalTestMan);
obj.Set("Remark", bo.Remark);
//obj.Set("Inspector_ID", bo.Inspector_ID);
//obj.Set("Inspector_Name", bo.Inspector_Name);
const string detailErtPath = "/MainSystem/B3ClientService/BO/WeightBill_Detail";
var details = new ManyList(detailErtPath);
foreach (var detail in bo.Details)
{
var objDetail = new RpcObject(detailErtPath);
objDetail.Set("ID", detail.ID);
objDetail.Set("B3ID", detail.B3ID);
objDetail.Set("DeleteState", detail.DeleteState);
objDetail.Set("WeightBill_ID", detail.WeightBill_ID);
objDetail.Set("Index", detail.Index);
objDetail.Set("MaoWeight", detail.MaoWeight);
objDetail.Set("PiWeight", detail.PiWeight);
objDetail.Set("Weight", detail.Weight);
objDetail.Set("Number", detail.Number);
details.Add(objDetail);
}
obj.Set("Details", details);
const string farmerDetailErtPath = "/MainSystem/B3ClientService/BO/WeightBill_FarmerDetail";
var farmerDetils = new ManyList(farmerDetailErtPath);
foreach (var detail in bo.FarmerDetails)
{
var objDetail = new RpcObject(farmerDetailErtPath);
objDetail.Set("ID", detail.ID);
objDetail.Set("B3ID", detail.B3ID);
objDetail.Set("DeleteState", detail.DeleteState);
objDetail.Set("WeightBill_ID", detail.WeightBill_ID);
objDetail.Set("Index", detail.Index);
objDetail.Set("Farmer_ID", detail.Farmer_ID);
objDetail.Set("Farmer_Name", detail.Farmer_Name);
objDetail.Set("Number", detail.Number);
objDetail.Set("Weight", detail.Weight);
farmerDetils.Add(objDetail);
}
obj.Set("FarmerDetails", farmerDetils);
var s = serializer.Serialize(weightRecord);
var result = RpcFacade.Call<RpcObject>(method, obj, s);
if (bo.ID == 0)
bo.ID = result.Get<long>("ID");
var detailReturns = result.Get<List<RpcObject>>("DetailBack");
foreach (var d in detailReturns)
var json = RpcFacade.Call<string>(method, serializer.Serialize(bo), s);
var result = serializer.Deserialize<BackRpcObj>(json);
bo.ID = result.ID;
foreach (var d in result.DetailBack)
{
var dFlag = d.Get<string>("Flag");
switch (dFlag)
switch (d.Flag)
{
case "Details":
var rdetails = d.Get<List<RpcObject>>("DetailBack");
foreach (var rd in rdetails)
foreach (var rd in d.DetailBack)
{
var idx = Convert.ToInt32(rd.Get<string>("Flag"));
var first = bo.Details.First(x => x.Index == idx);
if (first.ID == 0)
{
first.ID = rd.Get<long>("ID");
first.WeightBill_ID = bo.ID;
}
var idx = Convert.ToInt32(rd.Flag);
var first = bo.Details.First(x => !x.DeleteState && x.Index == idx);
first.ID = rd.ID;
first.WeightBill_ID = bo.ID;
}
break;
case "FarmerDetails":
var rfarmerDetails = d.Get<List<RpcObject>>("DetailBack");
foreach (var rd in rfarmerDetails)
foreach (var rd in d.DetailBack)
{
var idx = Convert.ToInt32(rd.Get<string>("Flag"));
var first = bo.FarmerDetails.First(x => x.Index == idx);
if (first.ID == 0)
{
first.ID = rd.Get<long>("ID");
first.WeightBill_ID = bo.ID;
}
var idx = Convert.ToInt32(rd.Flag);
var first = bo.FarmerDetails.First(x => !x.DeleteState && x.Index == idx);
first.ID = rd.ID;
first.WeightBill_ID = bo.ID;
}
break;
}
@ -140,232 +70,25 @@ namespace BO.Utils.BillRpc
return true;
}
public static bool Delete(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/DeleteBill";
return RpcFacade.Call<bool>(method, id);
}
public static List<WeightBill> GetWeightBillList(long? carID, long? supplierID)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetWeightBillList";
var list = RpcFacade.Call<List<RpcObject>>(method, DateTime.Today, carID, supplierID);
var result = new List<WeightBill>();
foreach (var obj in list)
{
var entity = new WeightBill();
result.Add(entity);
entity.Creator = obj.Get<string>("Creator");
entity.AccountingUnit_ID = obj.Get<long?>("AccountingUnit_ID");
entity.Department_ID = obj.Get<long?>("Department_ID");
entity.ID = obj.Get<long>("ID");
entity.B3ID = obj.Get<long?>("B3ID");
entity.DeleteState = false;
entity.FinishCreate = obj.Get<bool>("FinishCreate");
entity.Employee_ID = obj.Get<long?>("Employee_ID");
entity.Employee_Name = obj.Get<string>("Employee_Name");
entity.WeighTime = obj.Get<DateTime?>("WeighTime");
entity.Supplier_ID = obj.Get<long?>("Supplier_ID");
entity.Supplier_Name = obj.Get<string>("Supplier_Name");
entity.Zone_ID = obj.Get<long?>("Zone_ID");
entity.Zone_Name = obj.Get<string>("Zone_Name");
entity.PurchaseType_ID = obj.Get<short?>("PurchaseType_ID");
entity.PurchaseType_Name = obj.Get<string>("PurchaseType_Name");
entity.Car_ID = obj.Get<long?>("Car_ID");
entity.Car_Name = obj.Get<string>("Car_Name");
entity.LiveVarieties_ID = obj.Get<long?>("LiveVarieties_ID");
entity.LiveVarieties_Name = obj.Get<string>("LiveVarieties_Name");
entity.HogGrade_ID = obj.Get<long?>("HogGrade_ID");
entity.HogGrade_Name = obj.Get<string>("HogGrade_Name");
entity.ShackWeight = obj.Get<decimal?>("ShackWeight");
entity.ShackPrice = obj.Get<decimal?>("ShackPrice");
entity.JingJianFee = obj.Get<decimal?>("JingJianFee");
entity.DiscontMoney = obj.Get<decimal?>("DiscontMoney");
entity.AnimalTestNumber = obj.Get<string>("AnimalTestNumber");
entity.AnimalTestDate = obj.Get<DateTime?>("AnimalTestDate");
entity.AnimalTestMan = obj.Get<string>("AnimalTestMan");
entity.Remark = obj.Get<string>("Remark");
entity.Inspector_ID = obj.Get<long?>("Inspector_ID");
entity.Inspector_Name = obj.Get<string>("Inspector_Name");
var details = obj.Get<ManyList>("Details");
foreach (var detail in details)
{
var d = new WeightBill_Detail();
d.DeleteState = detail.Get<bool>("DeleteState");
if (d.DeleteState)
continue;
entity.Details.Add(d);
d.ID = detail.Get<long>("ID");
d.B3ID = detail.Get<long?>("B3ID");
d.Index = detail.Get<int>("Index");
d.MaoWeight = detail.Get<decimal?>("MaoWeight");
d.PiWeight = detail.Get<decimal?>("PiWeight");
d.Number = detail.Get<int?>("Number");
d.Weight = detail.Get<decimal?>("Weight");
d.WeightBill_ID = detail.Get<long>("WeightBill_ID");
}
var farmers = obj.Get<ManyList>("FarmerDetails");
foreach (var detail in farmers)
{
var d = new WeightBill_FarmerDetail();
d.DeleteState = detail.Get<bool>("DeleteState");
if (d.DeleteState)
continue;
entity.FarmerDetails.Add(d);
d.ID = detail.Get<long>("ID");
d.B3ID = detail.Get<long?>("B3ID");
d.Index = detail.Get<int>("Index");
d.Farmer_ID = detail.Get<long?>("Farmer_ID");
d.Farmer_Name = detail.Get<string>("Farmer_Name");
d.Number = detail.Get<int?>("Number");
d.WeightBill_ID = detail.Get<long>("WeightBill_ID");
}
}
return result;
}
public static List<WeightBill> GetUnHousedBill(DateTime date)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetNoHouseInfoWeightBills";
var list = RpcFacade.Call<List<RpcObject>>(method, date);
var result = new List<WeightBill>();
foreach (var obj in list)
{
var entity = new WeightBill();
result.Add(entity);
var bill = obj.Get<RpcObject>("Bill");
entity.ID = bill.Get<long>("ID");
entity.B3ID = bill.Get<long?>("B3ID");
entity.Employee_Name = bill.Get<string>("Employee_Name");
entity.Supplier_Name = bill.Get<string>("Supplier_Name");
entity.AlreadyHouse = bill.Get<bool>("AlreadyHouse");
entity.FirstWeightNumber = bill.Get<int?>("FirstWeightNumber");
var details = obj.Get<List<RpcObject>>("Detail");
//明细接收的数据不全,所以不能全量保存.
foreach (var detail in details)
{
var d = new WeightBill_HouseDetail();
entity.HouseDetails.Add(d);
d.LiveColonyHouse_Name = detail.Get<string>("LiveColonyHouse_Name");
}
}
return result;
}
public static int UpdateInsertHouseAndSanctionInfo(WeightBill bo)
public static List<WeightDetail> GetWeightRecord(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/UpdateInsertWeightBillHouseDetail";
var obj = new RpcObject("/MainSystem/B3ClientService/BO/WeightBill");
obj.Set("ID", bo.ID);
obj.Set("HogGrade_ID", bo.HogGrade_ID);
obj.Set("HogGrade_Name", bo.HogGrade_Name);
obj.Set("AlreadyHouse", bo.AlreadyHouse);
obj.Set("FirstWeightNumber", bo.FirstWeightNumber);
obj.Set("Inspector_ID", ButcherAppContext.Context.UserConfig.Employee_ID);
obj.Set("Inspector_Name", ButcherAppContext.Context.UserConfig.Employee_Name);
const string houseErtPath = "/MainSystem/B3ClientService/BO/WeightBill_HouseDetail";
var houseDetails = new ManyList(houseErtPath);
foreach (var detail in bo.HouseDetails)
{
var objDetail = new RpcObject(houseErtPath);
objDetail.Set("WeightBill_ID", detail.WeightBill_ID);
objDetail.Set("Index", detail.Index);
objDetail.Set("LiveColonyHouse_ID", detail.LiveColonyHouse_ID);
objDetail.Set("LiveColonyHouse_Name", detail.LiveColonyHouse_Name);
objDetail.Set("Number", detail.Number);
houseDetails.Add(objDetail);
}
obj.Set("HouseDetails", houseDetails);
const string sanctionsErtPath = "/MainSystem/B3ClientService/BO/WeightBill_SanctionDetail";
var sanctionDetails = new ManyList(sanctionsErtPath);
foreach (var detail in bo.SanctionDetails)
{
var objDetail = new RpcObject(sanctionsErtPath);
objDetail.Set("WeightBill_ID", detail.WeightBill_ID);
objDetail.Set("Index", detail.Index);
objDetail.Set("Sanction_ID", detail.Sanction_ID);
objDetail.Set("AbnormalItem_ID", detail.AbnormalItem_ID);
objDetail.Set("AbnormalItem_Name", detail.AbnormalItem_Name);
objDetail.Set("Number", detail.Number);
sanctionDetails.Add(objDetail);
}
obj.Set("SanctionDetails", sanctionDetails);
return RpcFacade.Call<int>(method, obj);
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetWeightRecord";
var obj = RpcFacade.Call<string>(method, id);
obj = obj.ESerializeDateTime();
return serializer.Deserialize<List<WeightDetail>>(obj);
}
public static int GetDetailTotalNumber(DateTime date)
public static bool Delete(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetDetailTotalNumber";
return RpcFacade.Call<int>(method, date);
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/DeleteBill";
return RpcFacade.Call<bool>(method, id);
}
public static List<Tuple<long?, long?>> SyncBillB3Ids(List<long?> ids)
public static List<CTuple<long, long>> SyncBillB3Ids(List<long?> ids)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/SyncBillB3Ids";
return RpcFacade.Call<List<Tuple<long?, long?>>>(method, ids.ToArray());
}
public static List<Tuple<long?, long?>> SyncWeightDetailB3Ids(List<long?> ids)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/SyncWeightDetailB3Ids";
return RpcFacade.Call<List<Tuple<long?, long?>>>(method, ids);
}
public static List<Tuple<long?, long?>> SyncFarmerDetailB3Ids(List<long?> ids)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/SyncFarmerDetailB3Ids";
return RpcFacade.Call<List<Tuple<long?, long?>>>(method, ids);
}
public static List<Tuple<long?, long?, int?>> SyncWeightDetailFirstNumber(List<long?> ids)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/SyncWeightDetailFirstNumber";
return RpcFacade.Call<List<Tuple<long?, long?, int?>>>(method, ids);
}
public static WeightBill GetWeightBillOnHousePage(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetWeightBillOnHousePage";
var obj = RpcFacade.Call<RpcObject>(method, id);
var entity = new WeightBill();
var bill = obj.Get<RpcObject>("Bill");
entity.FirstWeightNumber = bill.Get<int?>("FirstWeightNumber");
entity.HogGrade_ID = bill.Get<long?>("HogGrade_ID");
var details = obj.Get<List<RpcObject>>("Detail");
//明细接收的数据不全,所以不能全量保存.
foreach (var detail in details)
{
var d = new WeightBill_HouseDetail();
entity.HouseDetails.Add(d);
d.ID = detail.Get<long>("ID");
d.LiveColonyHouse_ID = detail.Get<long?>("LiveColonyHouse_ID");
}
var sanctionDetail = obj.Get<List<RpcObject>>("SanctionDetail");
//明细接收的数据不全,所以不能全量保存.
foreach (var detail in sanctionDetail)
{
var d = new WeightBill_SanctionDetail();
entity.SanctionDetails.Add(d);
d.ID = detail.Get<long>("ID");
d.AbnormalItem_ID = detail.Get<long?>("AbnormalItem_ID");
d.Number = detail.Get<int?>("Number");
}
return entity;
}
public static List<WeightDetail> GetWeightRecord(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetWeightRecord";
var obj = RpcFacade.Call<string>(method, id);
obj = obj.ESerializeDateTime();
return serializer.Deserialize<List<WeightDetail>>(obj);
var json = RpcFacade.Call<string>(method, ids.ToArray());
return serializer.Deserialize<List<CTuple<long, long>>>(json);
}
}
}

+ 7
- 7
BWP.WinFormControl/UComboBox.cs View File

@ -18,13 +18,13 @@ namespace BWP.WinFormControl
this.DropDown += (sender, de) =>
{
CRefreshItems();
if (string.IsNullOrEmpty(this.Text))
return;
//if (string.IsNullOrEmpty(this.Text))
// return;
if (_enableTopItem && Items.Count > 1)
this.SelectedIndex = 1;
else if (!_enableTopItem && Items.Count > 0)
this.SelectedIndex = 0;
//if (_enableTopItem && Items.Count > 1)
// this.SelectedIndex = 1;
//else if (!_enableTopItem && Items.Count > 0)
// this.SelectedIndex = 0;
SelectionStart = Text.Length;
};
this.SelectedIndexChanged += (sender, e) =>
@ -150,7 +150,7 @@ namespace BWP.WinFormControl
}
}
private WordPair _selectedObj = new WordPair();
private WordPair _selectedObj = null;
protected override void OnDropDown(EventArgs e)
{


+ 1
- 1
ButcherWeight/WeightContext.cs View File

@ -15,7 +15,7 @@ namespace ButcherWeight
private static string loginConfigPath = @"C:\BwpB3Project\src\B3ButcherManageClient\ButcherManageClient\bin\Debug\WeightSetting.xml";
//#endif
//#if !debug
// private static string loginConfigPath = Application.StartupPath + "\\WeightSetting.xml";
//private static string loginConfigPath = Application.StartupPath + "\\WeightSetting.xml";
//#endif
private static WeightSetting _config;
public static WeightSetting Config


+ 339
- 379
ButcherWeight/WeightForm.Designer.cs View File

@ -36,9 +36,6 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = 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 dataGridViewCellStyle8 = 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 dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
@ -49,6 +46,9 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = 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 dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
this.panel1 = new System.Windows.Forms.Panel();
this.enableCheckBox = new System.Windows.Forms.CheckBox();
this.weightSet = new System.Windows.Forms.Button();
@ -99,70 +99,66 @@
this.panel3 = new System.Windows.Forms.Panel();
this.farmerSelect = new BWP.WinFormControl.UComboBox();
this.farmerGrid = new System.Windows.Forms.DataGridView();
this.label3 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.weightGrid = new System.Windows.Forms.DataGridView();
this.panel4 = new System.Windows.Forms.Panel();
this.houseGird = new System.Windows.Forms.DataGridView();
this.abnormalGrid = new System.Windows.Forms.DataGridView();
this.billGrid = new System.Windows.Forms.DataGridView();
this.M_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_FinishWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Car_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Employee_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_PurchaseType_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_SanctionNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label15 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.panel5 = new System.Windows.Forms.Panel();
this.weightLabel = new System.Windows.Forms.Label();
this.weightSerialPort = new System.IO.Ports.SerialPort(this.components);
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.queryBtn = new System.Windows.Forms.Button();
this.qSupplierSelect = new BWP.WinFormControl.UComboBox();
this.qCarSelect = new BWP.WinFormControl.UComboBox();
this.farmerMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.farmerDelete = new System.Windows.Forms.ToolStripMenuItem();
this.viewDetailBtn = new System.Windows.Forms.Button();
this.F_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_Farmer_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_Farmer_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label3 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.weightGrid = new System.Windows.Forms.DataGridView();
this.D_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_MaoWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_PiWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel4 = new System.Windows.Forms.Panel();
this.houseGird = new System.Windows.Forms.DataGridView();
this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_LiveColonyHouse_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_LiveColonyHouse_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.abnormalGrid = new System.Windows.Forms.DataGridView();
this.S_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_Sanction_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_AbnormalItem_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_AbnormalItem_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.billGrid = new System.Windows.Forms.DataGridView();
this.label15 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.panel5 = new System.Windows.Forms.Panel();
this.weightLabel = new System.Windows.Forms.Label();
this.weightSerialPort = new System.IO.Ports.SerialPort(this.components);
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.queryBtn = new System.Windows.Forms.Button();
this.qSupplierSelect = new BWP.WinFormControl.UComboBox();
this.qCarSelect = new BWP.WinFormControl.UComboBox();
this.farmerMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.farmerDelete = new System.Windows.Forms.ToolStripMenuItem();
this.viewDetailBtn = new System.Windows.Forms.Button();
this.M_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_FinishWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Car_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Employee_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_PurchaseType_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_SanctionNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.panel3.SuspendLayout();
@ -777,7 +773,6 @@
this.farmerGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.farmerGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.F_ID,
this.F_B3ID,
this.F_WeightBill_ID,
this.F_Farmer_ID,
this.F_Index,
@ -796,63 +791,6 @@
this.farmerGrid.TabIndex = 8;
this.farmerGrid.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.farmerGrid_CellMouseDown);
//
// F_ID
//
this.F_ID.DataPropertyName = "ID";
this.F_ID.HeaderText = "ID";
this.F_ID.Name = "F_ID";
this.F_ID.Visible = false;
//
// F_B3ID
//
this.F_B3ID.DataPropertyName = "B3ID";
this.F_B3ID.HeaderText = "B3ID";
this.F_B3ID.Name = "F_B3ID";
this.F_B3ID.Visible = false;
//
// F_WeightBill_ID
//
this.F_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.F_WeightBill_ID.HeaderText = "WeightBill_ID";
this.F_WeightBill_ID.Name = "F_WeightBill_ID";
this.F_WeightBill_ID.Visible = false;
//
// F_Farmer_ID
//
this.F_Farmer_ID.DataPropertyName = "Farmer_ID";
this.F_Farmer_ID.HeaderText = "Farmer_ID";
this.F_Farmer_ID.Name = "F_Farmer_ID";
this.F_Farmer_ID.Visible = false;
//
// F_Index
//
this.F_Index.DataPropertyName = "Index";
this.F_Index.HeaderText = "序号";
this.F_Index.Name = "F_Index";
this.F_Index.ReadOnly = true;
this.F_Index.Width = 80;
//
// F_Farmer_Name
//
this.F_Farmer_Name.DataPropertyName = "Farmer_Name";
this.F_Farmer_Name.HeaderText = "养殖户";
this.F_Farmer_Name.Name = "F_Farmer_Name";
this.F_Farmer_Name.ReadOnly = true;
this.F_Farmer_Name.Width = 120;
//
// F_Number
//
this.F_Number.DataPropertyName = "Number";
this.F_Number.HeaderText = "头数";
this.F_Number.Name = "F_Number";
this.F_Number.Width = 80;
//
// F_Weight
//
this.F_Weight.DataPropertyName = "Weight";
this.F_Weight.HeaderText = "重量";
this.F_Weight.Name = "F_Weight";
//
// label3
//
this.label3.AutoSize = true;
@ -894,7 +832,6 @@
this.weightGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.weightGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.D_ID,
this.D_B3ID,
this.D_WeightBill_ID,
this.D_Index,
this.D_Number,
@ -912,72 +849,6 @@
this.weightGrid.Size = new System.Drawing.Size(400, 90);
this.weightGrid.TabIndex = 0;
//
// D_ID
//
this.D_ID.DataPropertyName = "ID";
this.D_ID.HeaderText = "ID";
this.D_ID.Name = "D_ID";
this.D_ID.Visible = false;
//
// D_B3ID
//
this.D_B3ID.DataPropertyName = "B3ID";
this.D_B3ID.HeaderText = "B3ID";
this.D_B3ID.Name = "D_B3ID";
this.D_B3ID.Visible = false;
//
// D_WeightBill_ID
//
this.D_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.D_WeightBill_ID.HeaderText = "WeightBill_ID";
this.D_WeightBill_ID.Name = "D_WeightBill_ID";
this.D_WeightBill_ID.Visible = false;
//
// D_Index
//
this.D_Index.DataPropertyName = "Index";
this.D_Index.HeaderText = "序号";
this.D_Index.Name = "D_Index";
this.D_Index.ReadOnly = true;
this.D_Index.Width = 55;
//
// D_Number
//
this.D_Number.DataPropertyName = "Number";
this.D_Number.HeaderText = "头数";
this.D_Number.Name = "D_Number";
this.D_Number.Width = 75;
//
// D_MaoWeight
//
this.D_MaoWeight.DataPropertyName = "MaoWeight";
dataGridViewCellStyle6.Format = "#0.######";
this.D_MaoWeight.DefaultCellStyle = dataGridViewCellStyle6;
this.D_MaoWeight.HeaderText = "毛重";
this.D_MaoWeight.Name = "D_MaoWeight";
this.D_MaoWeight.ReadOnly = true;
this.D_MaoWeight.Width = 88;
//
// D_PiWeight
//
this.D_PiWeight.DataPropertyName = "PiWeight";
dataGridViewCellStyle7.Format = "#0.######";
this.D_PiWeight.DefaultCellStyle = dataGridViewCellStyle7;
this.D_PiWeight.HeaderText = "皮重";
this.D_PiWeight.Name = "D_PiWeight";
this.D_PiWeight.ReadOnly = true;
this.D_PiWeight.Width = 88;
//
// D_Weight
//
this.D_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle8.Format = "#0.######";
this.D_Weight.DefaultCellStyle = dataGridViewCellStyle8;
this.D_Weight.HeaderText = "重量";
this.D_Weight.Name = "D_Weight";
this.D_Weight.ReadOnly = true;
this.D_Weight.Width = 88;
//
// panel4
//
this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -1008,7 +879,6 @@
this.houseGird.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.houseGird.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.H_ID,
this.H_B3ID,
this.H_WeightBill_ID,
this.H_LiveColonyHouse_ID,
this.H_Index,
@ -1025,57 +895,6 @@
this.houseGird.Size = new System.Drawing.Size(400, 90);
this.houseGird.TabIndex = 1;
//
// H_ID
//
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "ID";
this.H_ID.Name = "H_ID";
this.H_ID.Visible = false;
//
// H_B3ID
//
this.H_B3ID.DataPropertyName = "B3ID";
this.H_B3ID.HeaderText = "B3ID";
this.H_B3ID.Name = "H_B3ID";
this.H_B3ID.Visible = false;
//
// H_WeightBill_ID
//
this.H_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.H_WeightBill_ID.HeaderText = "WeightBill_ID";
this.H_WeightBill_ID.Name = "H_WeightBill_ID";
this.H_WeightBill_ID.Visible = false;
//
// H_LiveColonyHouse_ID
//
this.H_LiveColonyHouse_ID.DataPropertyName = "LiveColonyHouse_ID";
this.H_LiveColonyHouse_ID.HeaderText = "LiveColonyHouse_ID";
this.H_LiveColonyHouse_ID.Name = "H_LiveColonyHouse_ID";
this.H_LiveColonyHouse_ID.Visible = false;
//
// H_Index
//
this.H_Index.DataPropertyName = "Index";
this.H_Index.HeaderText = "序号";
this.H_Index.Name = "H_Index";
this.H_Index.ReadOnly = true;
this.H_Index.Width = 80;
//
// H_LiveColonyHouse_Name
//
this.H_LiveColonyHouse_Name.DataPropertyName = "LiveColonyHouse_Name";
this.H_LiveColonyHouse_Name.HeaderText = "圈舍";
this.H_LiveColonyHouse_Name.Name = "H_LiveColonyHouse_Name";
this.H_LiveColonyHouse_Name.ReadOnly = true;
this.H_LiveColonyHouse_Name.Width = 150;
//
// H_Number
//
this.H_Number.DataPropertyName = "Number";
this.H_Number.HeaderText = "入圈头数";
this.H_Number.Name = "H_Number";
this.H_Number.Width = 130;
//
// abnormalGrid
//
this.abnormalGrid.AllowUserToAddRows = false;
@ -1097,7 +916,6 @@
this.abnormalGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.abnormalGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.S_ID,
this.S_B3ID,
this.S_WeightBill_ID,
this.S_Sanction_ID,
this.S_AbnormalItem_ID,
@ -1115,64 +933,7 @@
this.abnormalGrid.Size = new System.Drawing.Size(400, 237);
this.abnormalGrid.TabIndex = 1;
//
// S_ID
//
this.S_ID.DataPropertyName = "ID";
this.S_ID.HeaderText = "ID";
this.S_ID.Name = "S_ID";
this.S_ID.Visible = false;
//
// S_B3ID
//
this.S_B3ID.DataPropertyName = "B3ID";
this.S_B3ID.HeaderText = "B3ID";
this.S_B3ID.Name = "S_B3ID";
this.S_B3ID.Visible = false;
//
// S_WeightBill_ID
//
this.S_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.S_WeightBill_ID.HeaderText = "WeightBill_ID";
this.S_WeightBill_ID.Name = "S_WeightBill_ID";
this.S_WeightBill_ID.Visible = false;
//
// S_Sanction_ID
//
this.S_Sanction_ID.DataPropertyName = "Sanction_ID";
this.S_Sanction_ID.HeaderText = "Sanction_ID";
this.S_Sanction_ID.Name = "S_Sanction_ID";
this.S_Sanction_ID.Visible = false;
//
// S_AbnormalItem_ID
//
this.S_AbnormalItem_ID.HeaderText = "AbnormalItem_ID";
this.S_AbnormalItem_ID.Name = "S_AbnormalItem_ID";
this.S_AbnormalItem_ID.Visible = false;
//
// S_Index
//
this.S_Index.DataPropertyName = "Index";
this.S_Index.HeaderText = "序号";
this.S_Index.Name = "S_Index";
this.S_Index.ReadOnly = true;
this.S_Index.Width = 80;
//
// S_AbnormalItem_Name
//
this.S_AbnormalItem_Name.DataPropertyName = "AbnormalItem_Name";
this.S_AbnormalItem_Name.HeaderText = "异常项目";
this.S_AbnormalItem_Name.Name = "S_AbnormalItem_Name";
this.S_AbnormalItem_Name.ReadOnly = true;
this.S_AbnormalItem_Name.Width = 150;
//
// S_Number
//
this.S_Number.DataPropertyName = "Number";
this.S_Number.HeaderText = "头数";
this.S_Number.Name = "S_Number";
this.S_Number.Width = 130;
//
// billGrid
// billGrid
//
this.billGrid.AllowUserToAddRows = false;
this.billGrid.AllowUserToDeleteRows = false;
@ -1217,6 +978,102 @@
this.billGrid.TabIndex = 0;
this.billGrid.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.billGrid_CellDoubleClick);
//
// M_ID
//
this.M_ID.DataPropertyName = "ID";
this.M_ID.HeaderText = "ID";
this.M_ID.Name = "M_ID";
this.M_ID.ReadOnly = true;
this.M_ID.Visible = false;
//
// M_FinishWeight
//
this.M_FinishWeight.DataPropertyName = "FinishWeight";
this.M_FinishWeight.HeaderText = "FinishWeight";
this.M_FinishWeight.Name = "M_FinishWeight";
this.M_FinishWeight.ReadOnly = true;
this.M_FinishWeight.Visible = false;
//
// M_B3ID
//
this.M_B3ID.DataPropertyName = "B3ID";
this.M_B3ID.HeaderText = "过磅单号";
this.M_B3ID.Name = "M_B3ID";
this.M_B3ID.ReadOnly = true;
//
// M_Car_Name
//
this.M_Car_Name.DataPropertyName = "Car_Name";
this.M_Car_Name.HeaderText = "车辆";
this.M_Car_Name.Name = "M_Car_Name";
this.M_Car_Name.ReadOnly = true;
this.M_Car_Name.Width = 120;
//
// M_Supplier_Name
//
this.M_Supplier_Name.DataPropertyName = "Supplier_Name";
this.M_Supplier_Name.HeaderText = "供应商";
this.M_Supplier_Name.Name = "M_Supplier_Name";
this.M_Supplier_Name.ReadOnly = true;
this.M_Supplier_Name.Width = 120;
//
// M_Employee_Name
//
this.M_Employee_Name.DataPropertyName = "Employee_Name";
this.M_Employee_Name.HeaderText = "业务员";
this.M_Employee_Name.Name = "M_Employee_Name";
this.M_Employee_Name.ReadOnly = true;
this.M_Employee_Name.Width = 110;
//
// M_PurchaseType_Name
//
this.M_PurchaseType_Name.DataPropertyName = "PurchaseType_Name";
this.M_PurchaseType_Name.HeaderText = "收购类型";
this.M_PurchaseType_Name.Name = "M_PurchaseType_Name";
this.M_PurchaseType_Name.ReadOnly = true;
this.M_PurchaseType_Name.Width = 110;
//
// M_Number
//
this.M_Number.DataPropertyName = "Number";
this.M_Number.HeaderText = "收购头数";
this.M_Number.Name = "M_Number";
this.M_Number.ReadOnly = true;
this.M_Number.Width = 110;
//
// M_Weight
//
this.M_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle18.Format = "#0.######";
this.M_Weight.DefaultCellStyle = dataGridViewCellStyle18;
this.M_Weight.HeaderText = "收购重量";
this.M_Weight.Name = "M_Weight";
this.M_Weight.ReadOnly = true;
this.M_Weight.Width = 120;
//
// M_HouseNames
//
this.M_HouseNames.DataPropertyName = "HouseNames";
this.M_HouseNames.HeaderText = "圈舍";
this.M_HouseNames.Name = "M_HouseNames";
this.M_HouseNames.ReadOnly = true;
this.M_HouseNames.Width = 180;
//
// M_SanctionNumber
//
this.M_SanctionNumber.DataPropertyName = "SanctionNumber";
this.M_SanctionNumber.HeaderText = "异常明细";
this.M_SanctionNumber.Name = "M_SanctionNumber";
this.M_SanctionNumber.ReadOnly = true;
//
// M_Remark
//
this.M_Remark.DataPropertyName = "Remark";
this.M_Remark.HeaderText = "摘要";
this.M_Remark.Name = "M_Remark";
this.M_Remark.ReadOnly = true;
this.M_Remark.Width = 130;
//
// label15
//
this.label15.AutoSize = true;
@ -1352,101 +1209,208 @@
this.viewDetailBtn.UseVisualStyleBackColor = true;
this.viewDetailBtn.Click += new System.EventHandler(this.viewDetailBtn_Click);
//
// M_ID
// F_ID
//
this.M_ID.DataPropertyName = "ID";
this.M_ID.HeaderText = "ID";
this.M_ID.Name = "M_ID";
this.M_ID.ReadOnly = true;
this.M_ID.Visible = false;
this.F_ID.DataPropertyName = "ID";
this.F_ID.HeaderText = "ID";
this.F_ID.Name = "F_ID";
this.F_ID.Visible = false;
//
// M_FinishWeight
// F_WeightBill_ID
//
this.M_FinishWeight.DataPropertyName = "FinishWeight";
this.M_FinishWeight.HeaderText = "FinishWeight";
this.M_FinishWeight.Name = "M_FinishWeight";
this.M_FinishWeight.ReadOnly = true;
this.M_FinishWeight.Visible = false;
this.F_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.F_WeightBill_ID.HeaderText = "WeightBill_ID";
this.F_WeightBill_ID.Name = "F_WeightBill_ID";
this.F_WeightBill_ID.Visible = false;
//
// M_B3ID
// F_Farmer_ID
//
this.M_B3ID.DataPropertyName = "B3ID";
this.M_B3ID.HeaderText = "过磅单号";
this.M_B3ID.Name = "M_B3ID";
this.M_B3ID.ReadOnly = true;
this.F_Farmer_ID.DataPropertyName = "Farmer_ID";
this.F_Farmer_ID.HeaderText = "Farmer_ID";
this.F_Farmer_ID.Name = "F_Farmer_ID";
this.F_Farmer_ID.Visible = false;
//
// M_Car_Name
// F_Index
//
this.M_Car_Name.DataPropertyName = "Car_Name";
this.M_Car_Name.HeaderText = "车辆";
this.M_Car_Name.Name = "M_Car_Name";
this.M_Car_Name.ReadOnly = true;
this.M_Car_Name.Width = 120;
this.F_Index.DataPropertyName = "Index";
this.F_Index.HeaderText = "序号";
this.F_Index.Name = "F_Index";
this.F_Index.ReadOnly = true;
this.F_Index.Width = 80;
//
// M_Supplier_Name
// F_Farmer_Name
//
this.M_Supplier_Name.DataPropertyName = "Supplier_Name";
this.M_Supplier_Name.HeaderText = "供应商";
this.M_Supplier_Name.Name = "M_Supplier_Name";
this.M_Supplier_Name.ReadOnly = true;
this.M_Supplier_Name.Width = 120;
this.F_Farmer_Name.DataPropertyName = "Farmer_Name";
this.F_Farmer_Name.HeaderText = "养殖户";
this.F_Farmer_Name.Name = "F_Farmer_Name";
this.F_Farmer_Name.ReadOnly = true;
this.F_Farmer_Name.Width = 120;
//
// M_Employee_Name
// F_Number
//
this.M_Employee_Name.DataPropertyName = "Employee_Name";
this.M_Employee_Name.HeaderText = "业务员";
this.M_Employee_Name.Name = "M_Employee_Name";
this.M_Employee_Name.ReadOnly = true;
this.M_Employee_Name.Width = 110;
this.F_Number.DataPropertyName = "Number";
this.F_Number.HeaderText = "头数";
this.F_Number.Name = "F_Number";
this.F_Number.Width = 80;
//
// M_PurchaseType_Name
// F_Weight
//
this.M_PurchaseType_Name.DataPropertyName = "PurchaseType_Name";
this.M_PurchaseType_Name.HeaderText = "收购类型";
this.M_PurchaseType_Name.Name = "M_PurchaseType_Name";
this.M_PurchaseType_Name.ReadOnly = true;
this.M_PurchaseType_Name.Width = 110;
this.F_Weight.DataPropertyName = "Weight";
this.F_Weight.HeaderText = "重量";
this.F_Weight.Name = "F_Weight";
//
// M_Number
// D_ID
//
this.M_Number.DataPropertyName = "Number";
this.M_Number.HeaderText = "收购头数";
this.M_Number.Name = "M_Number";
this.M_Number.ReadOnly = true;
this.M_Number.Width = 110;
this.D_ID.DataPropertyName = "ID";
this.D_ID.HeaderText = "ID";
this.D_ID.Name = "D_ID";
this.D_ID.Visible = false;
//
// M_Weight
// D_WeightBill_ID
//
this.M_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle18.Format = "#0.######";
this.M_Weight.DefaultCellStyle = dataGridViewCellStyle18;
this.M_Weight.HeaderText = "收购重量";
this.M_Weight.Name = "M_Weight";
this.M_Weight.ReadOnly = true;
this.M_Weight.Width = 120;
this.D_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.D_WeightBill_ID.HeaderText = "WeightBill_ID";
this.D_WeightBill_ID.Name = "D_WeightBill_ID";
this.D_WeightBill_ID.Visible = false;
//
// M_HouseNames
// D_Index
//
this.M_HouseNames.DataPropertyName = "HouseNames";
this.M_HouseNames.HeaderText = "圈舍";
this.M_HouseNames.Name = "M_HouseNames";
this.M_HouseNames.ReadOnly = true;
this.M_HouseNames.Width = 180;
this.D_Index.DataPropertyName = "Index";
this.D_Index.HeaderText = "序号";
this.D_Index.Name = "D_Index";
this.D_Index.ReadOnly = true;
this.D_Index.Width = 55;
//
// M_SanctionNumber
// D_Number
//
this.M_SanctionNumber.DataPropertyName = "SanctionNumber";
this.M_SanctionNumber.HeaderText = "异常明细";
this.M_SanctionNumber.Name = "M_SanctionNumber";
this.M_SanctionNumber.ReadOnly = true;
this.D_Number.DataPropertyName = "Number";
this.D_Number.HeaderText = "头数";
this.D_Number.Name = "D_Number";
this.D_Number.Width = 75;
//
// M_Remark
// D_MaoWeight
//
this.M_Remark.DataPropertyName = "Remark";
this.M_Remark.HeaderText = "摘要";
this.M_Remark.Name = "M_Remark";
this.M_Remark.ReadOnly = true;
this.M_Remark.Width = 130;
this.D_MaoWeight.DataPropertyName = "MaoWeight";
dataGridViewCellStyle6.Format = "#0.######";
this.D_MaoWeight.DefaultCellStyle = dataGridViewCellStyle6;
this.D_MaoWeight.HeaderText = "毛重";
this.D_MaoWeight.Name = "D_MaoWeight";
this.D_MaoWeight.ReadOnly = true;
this.D_MaoWeight.Width = 88;
//
// D_PiWeight
//
this.D_PiWeight.DataPropertyName = "PiWeight";
dataGridViewCellStyle7.Format = "#0.######";
this.D_PiWeight.DefaultCellStyle = dataGridViewCellStyle7;
this.D_PiWeight.HeaderText = "皮重";
this.D_PiWeight.Name = "D_PiWeight";
this.D_PiWeight.ReadOnly = true;
this.D_PiWeight.Width = 88;
//
// D_Weight
//
this.D_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle8.Format = "#0.######";
this.D_Weight.DefaultCellStyle = dataGridViewCellStyle8;
this.D_Weight.HeaderText = "重量";
this.D_Weight.Name = "D_Weight";
this.D_Weight.ReadOnly = true;
this.D_Weight.Width = 88;
//
// H_ID
//
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "ID";
this.H_ID.Name = "H_ID";
this.H_ID.Visible = false;
//
// H_WeightBill_ID
//
this.H_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.H_WeightBill_ID.HeaderText = "WeightBill_ID";
this.H_WeightBill_ID.Name = "H_WeightBill_ID";
this.H_WeightBill_ID.Visible = false;
//
// H_LiveColonyHouse_ID
//
this.H_LiveColonyHouse_ID.DataPropertyName = "LiveColonyHouse_ID";
this.H_LiveColonyHouse_ID.HeaderText = "LiveColonyHouse_ID";
this.H_LiveColonyHouse_ID.Name = "H_LiveColonyHouse_ID";
this.H_LiveColonyHouse_ID.Visible = false;
//
// H_Index
//
this.H_Index.DataPropertyName = "Index";
this.H_Index.HeaderText = "序号";
this.H_Index.Name = "H_Index";
this.H_Index.ReadOnly = true;
this.H_Index.Width = 80;
//
// H_LiveColonyHouse_Name
//
this.H_LiveColonyHouse_Name.DataPropertyName = "LiveColonyHouse_Name";
this.H_LiveColonyHouse_Name.HeaderText = "圈舍";
this.H_LiveColonyHouse_Name.Name = "H_LiveColonyHouse_Name";
this.H_LiveColonyHouse_Name.ReadOnly = true;
this.H_LiveColonyHouse_Name.Width = 150;
//
// H_Number
//
this.H_Number.DataPropertyName = "Number";
this.H_Number.HeaderText = "入圈头数";
this.H_Number.Name = "H_Number";
this.H_Number.Width = 130;
//
// S_ID
//
this.S_ID.DataPropertyName = "ID";
this.S_ID.HeaderText = "ID";
this.S_ID.Name = "S_ID";
this.S_ID.Visible = false;
//
// S_WeightBill_ID
//
this.S_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.S_WeightBill_ID.HeaderText = "WeightBill_ID";
this.S_WeightBill_ID.Name = "S_WeightBill_ID";
this.S_WeightBill_ID.Visible = false;
//
// S_Sanction_ID
//
this.S_Sanction_ID.DataPropertyName = "Sanction_ID";
this.S_Sanction_ID.HeaderText = "Sanction_ID";
this.S_Sanction_ID.Name = "S_Sanction_ID";
this.S_Sanction_ID.Visible = false;
//
// S_AbnormalItem_ID
//
this.S_AbnormalItem_ID.HeaderText = "AbnormalItem_ID";
this.S_AbnormalItem_ID.Name = "S_AbnormalItem_ID";
this.S_AbnormalItem_ID.Visible = false;
//
// S_Index
//
this.S_Index.DataPropertyName = "Index";
this.S_Index.HeaderText = "序号";
this.S_Index.Name = "S_Index";
this.S_Index.ReadOnly = true;
this.S_Index.Width = 80;
//
// S_AbnormalItem_Name
//
this.S_AbnormalItem_Name.DataPropertyName = "AbnormalItem_Name";
this.S_AbnormalItem_Name.HeaderText = "异常项目";
this.S_AbnormalItem_Name.Name = "S_AbnormalItem_Name";
this.S_AbnormalItem_Name.ReadOnly = true;
this.S_AbnormalItem_Name.Width = 150;
//
// S_Number
//
this.S_Number.DataPropertyName = "Number";
this.S_Number.HeaderText = "头数";
this.S_Number.Name = "S_Number";
this.S_Number.Width = 130;
//
// WeightForm
//
@ -1546,21 +1510,6 @@
private System.Windows.Forms.Label label1;
private BWP.WinFormControl.UComboBox farmerSelect;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.DataGridViewTextBoxColumn H_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_B3ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_LiveColonyHouse_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn H_LiveColonyHouse_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn S_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_B3ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_Sanction_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn S_Number;
private System.Windows.Forms.Button createBtn;
private System.Windows.Forms.Button exitBtn;
private System.Windows.Forms.Button deleteBtn;
@ -1575,25 +1524,9 @@
private BWP.WinFormControl.UComboBox qSupplierSelect;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button queryBtn;
private System.Windows.Forms.DataGridViewTextBoxColumn F_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn F_B3ID;
private System.Windows.Forms.DataGridViewTextBoxColumn F_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Weight;
private System.Windows.Forms.ContextMenuStrip farmerMenu;
private System.Windows.Forms.ToolStripMenuItem farmerDelete;
private System.Windows.Forms.Button viewDetailBtn;
private System.Windows.Forms.DataGridViewTextBoxColumn D_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_B3ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn D_MaoWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn D_PiWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Weight;
private System.Windows.Forms.TextBox discontInput;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox jingjianInput;
@ -1610,5 +1543,32 @@
private System.Windows.Forms.DataGridViewTextBoxColumn M_HouseNames;
private System.Windows.Forms.DataGridViewTextBoxColumn M_SanctionNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Remark;
private System.Windows.Forms.DataGridViewTextBoxColumn F_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn F_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn D_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn D_MaoWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn D_PiWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn H_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_LiveColonyHouse_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn H_LiveColonyHouse_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn S_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_Sanction_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn S_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn S_Number;
}
}

+ 42
- 90
ButcherWeight/WeightForm.cs View File

@ -31,10 +31,17 @@ namespace ButcherWeight
private delegate void InvokeHandler();
bool mainIsRun = false;
private List<WeightBillList> dmoList;
private WeightBill Dmo = new WeightBill();
private List<WeightBill_FarmerDetail> _farmerDetails = new List<WeightBill_FarmerDetail>();
private List<WeightBill_Detail> _details = new List<WeightBill_Detail>();
private List<WeightBill_FarmerDetail> _fDelete = new List<WeightBill_FarmerDetail>();
private List<WeightDetail> weightRecord = new List<WeightDetail>();
public WeightForm()
{
InitializeComponent();
Control.CheckForIllegalCrossThreadCalls = false;
supplierSelect.Init("BaseInfoRpc/GetSupplierList");
purchaseTypeSelect.Init("BaseInfoRpc/GetPurchaseTypeList");
carSelect.Init("BaseInfoRpc/GetCarList");
@ -57,7 +64,7 @@ namespace ButcherWeight
abnormalGrid.AutoGenerateColumns = false;
BindWeightBill();
mainIsRun = true;
var syncThread = new Thread(SyncTask) { IsBackground = true };
var syncThread = new Thread(SyncTask);
syncThread.Start();
this.FormClosing += delegate
{
@ -89,85 +96,16 @@ namespace ButcherWeight
}
}
}
var detailChange = SyncWeightDetailFirstNumber();
if (changed || detailChange)
if (changed)
{
this.Invoke(new InvokeHandler(delegate()
{
billGrid.Refresh();
}));
}
var details = new List<WeightBill_Detail>();
var farms = new List<WeightBill_FarmerDetail>();
foreach (var dmo in dmoList)
{
details.AddRange(dmo.Details.Where(x => x.B3ID == null));
farms.AddRange(dmo.FarmerDetails.Where(x => x.B3ID == null));
}
if (details.Any())
{
var dids = details.Select(x => (long?)x.ID).ToList();
var result2 = WeightBillRpc.SyncWeightDetailB3Ids(dids);
foreach (var item in result2)
{
var first = details.FirstOrDefault(x => x.ID == item.Item1);
if (first != null)
{
first.B3ID = item.Item2;
}
}
}
if (farms.Any())
{
var dids = farms.Select(x => (long?)x.ID).ToList();
var result2 = WeightBillRpc.SyncFarmerDetailB3Ids(dids);
foreach (var item in result2)
{
var first = details.FirstOrDefault(x => x.ID == item.Item1);
if (first != null)
{
first.B3ID = item.Item2;
}
}
}
}
}
bool SyncWeightDetailFirstNumber()
{
var details = new List<WeightBill_Detail>();
foreach (var item in dmoList)
{
if (item.Details.Any())
details.Add(item.Details.First());
}
if (details.Any())
{
var result = WeightBillRpc.SyncWeightDetailFirstNumber(details.Select(x => (long?)x.ID).ToList());
bool change = false;
foreach (var item in result)
{
var first = details.First(x => x.ID == item.Item2);
if (first.Number != item.Item3)
{
first.Number = item.Item3;
if (!change)
change = true;
if (first.WeightBill_ID == Dmo.ID)
{
_details.First(x => x.ID == first.ID).Number = first.Number;
weightGrid.DataSource = _details;
weightGrid.Refresh();
}
}
}
return change;
}
return false;
}
void BindWeightBill()
{
billGrid.DataSource = dmoList.OrderByDescending(x => x.ID).OrderBy(x => x.FinishWeight).ToList();
@ -179,13 +117,6 @@ namespace ButcherWeight
billGrid.Refresh();
}
private List<WeightBill> dmoList = new List<WeightBill>();
private WeightBill Dmo = new WeightBill();
private List<WeightBill_FarmerDetail> _farmerDetails = new List<WeightBill_FarmerDetail>();
private List<WeightBill_Detail> _details = new List<WeightBill_Detail>();
private List<WeightBill_FarmerDetail> _fDelete = new List<WeightBill_FarmerDetail>();
private List<WeightDetail> weightRecord = new List<WeightDetail>();
private void exitBtn_Click(object sender, EventArgs e)
{
if (enableCheckBox.Checked)
@ -207,18 +138,37 @@ namespace ButcherWeight
Dmo.FarmerDetails.AddRange(_farmerDetails.ToList());
Dmo.FarmerDetails.AddRange(_fDelete.ToList());
var isNew = Dmo.ID == 0;
var send = weightRecord.Where(x => x.Delete || x.ID == 0).ToList();
var result = WeightBillRpc.Send(Dmo, send);
var result = WeightBillRpc.UpdateOrInsert(Dmo, send);
weightRecord.Clear();
if (isNew)
dmoList.Add(Dmo);
UpdateOrInsertList();
BindWeightBill();
if (result)
MessageBox.Show("保存成功!");
AppToUI();
}
void UpdateOrInsertList()
{
var entity = dmoList.FirstOrDefault(x => x.ID == Dmo.ID);
if (entity == null)
{
entity = new WeightBillList();
entity.ID = Dmo.ID;
entity.B3ID = Dmo.B3ID;
dmoList.Add(entity);
}
entity.Car_Name = Dmo.Car_Name;
entity.Supplier_Name = Dmo.Supplier_Name;
entity.Employee_Name = Dmo.Employee_Name;
entity.PurchaseType_Name = Dmo.PurchaseType_Name;
var detail = Dmo.Details.First();
entity.Number = detail.Number;
entity.Weight = detail.Weight;
entity.Remark = Dmo.Remark;
entity.FinishWeight = detail.MaoWeight.HasValue && detail.PiWeight.HasValue;
}
private void createBtn_Click(object sender, EventArgs e)
{
Dmo = new WeightBill();
@ -398,19 +348,19 @@ namespace ButcherWeight
hogGradeSelect.Fill(Dmo.HogGrade_Name, Dmo.HogGrade_ID.ToString());
if (Dmo.ShackWeight.HasValue)
penWeightInput.Text = Dmo.ShackWeight.Value.ToString();
penWeightInput.Text = Dmo.ShackWeight.Value.ToString("#0.######");
if (Dmo.ShackPrice.HasValue)
penPriceInput.Text = Dmo.ShackPrice.Value.ToString();
penPriceInput.Text = Dmo.ShackPrice.Value.ToString("#0.######");
if (Dmo.ShackMoney.HasValue)
penMoneyInput.Text = Dmo.ShackMoney.Value.ToString();
penMoneyInput.Text = Dmo.ShackMoney.Value.ToString("#0.######");
if (Dmo.JingJianFee.HasValue)
jingjianInput.Text = Dmo.JingJianFee.Value.ToString();
jingjianInput.Text = Dmo.JingJianFee.Value.ToString("#0.######");
if (Dmo.DiscontMoney.HasValue)
discontInput.Text = Dmo.DiscontMoney.Value.ToString();
discontInput.Text = Dmo.DiscontMoney.Value.ToString("#0.######");
if (!string.IsNullOrEmpty(Dmo.AnimalTestNumber))
testCardNumberInput.Text = Dmo.AnimalTestNumber;
@ -426,6 +376,7 @@ namespace ButcherWeight
_farmerDetails = Dmo.FarmerDetails.Where(x => !x.DeleteState).ToList();
_details = Dmo.Details.ToList();
_fDelete.Clear();
weightRecord.Clear();
if (_farmerDetails.Any())
@ -463,7 +414,7 @@ namespace ButcherWeight
return;
var id = Convert.ToInt64(billGrid.CurrentRow.Cells["M_ID"].Value);
Dmo = dmoList.First(x => x.ID == id);
Dmo = WeightBillRpc.Load(id);
AppToUI();
}
@ -478,7 +429,8 @@ namespace ButcherWeight
WeightBillRpc.Delete(Dmo.ID);
if (dmoList.Any(x => x.ID == Dmo.ID))
{
dmoList.Remove(Dmo);
var idx = dmoList.FindIndex(x => x.ID == Dmo.ID);
dmoList.RemoveAt(idx);
BindWeightBill();
}
createBtn_Click(sender, e);


+ 0
- 12
ButcherWeight/WeightForm.resx View File

@ -120,9 +120,6 @@
<metadata name="F_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_B3ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_WeightBill_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -144,9 +141,6 @@
<metadata name="D_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_B3ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_WeightBill_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -168,9 +162,6 @@
<metadata name="H_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_B3ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_WeightBill_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -189,9 +180,6 @@
<metadata name="S_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="S_B3ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="S_WeightBill_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>


+ 12
- 72
ButcherWeight/WeightFormWeightPart.cs View File

@ -14,26 +14,11 @@ namespace ButcherWeight
partial class WeightForm
{
private IDataFormat _dataFormat;
private Thread _inQueryThread, _outQueryThread;
private Thread _inQueryThread;
private bool _mainProcessIsRun;
readonly StringBuilder _dataStrBuilder = new StringBuilder();
readonly ConcurrentQueue<string> _dataQueue = new ConcurrentQueue<string>();
private const int WmUpdDisplayMessage = 0x0500 + 2;
private string _displayValue;
private int _mainHandle;
int MainHandle
{
get
{
if (_mainHandle == 0)
{
_mainHandle = WinApiSendMessage.FindWindow(null, this.Text);
}
return _mainHandle;
}
}
void OpenSerialPort()
{
@ -85,9 +70,6 @@ namespace ButcherWeight
{
_inQueryThread = new Thread(InQuery);
_inQueryThread.Start();
_outQueryThread = new Thread(OutQuery);
_outQueryThread.Start();
}
string format = "{0:0.00}";
@ -117,7 +99,17 @@ namespace ButcherWeight
else if (c == _dataFormat.Endchar || _dataStrBuilder.Length == _dataFormat.DataLength - 1)
{
_dataStrBuilder.Append(c);
_dataQueue.Enqueue(_dataStrBuilder.ToString());
bool isStatic;
string str;
if (_dataFormat.ParseAscii(_dataStrBuilder.ToString(), out str, out isStatic))
{
if (string.IsNullOrEmpty(str))
str = "0";
this.Invoke(new InvokeHandler(delegate()
{
_displayValue = string.Format(format, decimal.Parse(str));
}));
}
_dataStrBuilder.Clear();
}
else if (_dataStrBuilder.Length != 0)
@ -128,40 +120,6 @@ namespace ButcherWeight
}
}
private void OutQuery()
{
while (_mainProcessIsRun)
{
try
{
bool isStatic;
string str;
string subStr;
if (!_dataQueue.TryDequeue(out subStr))
{
Thread.Sleep(1);
continue;
}
// 解析接受的端口数据
if (_dataFormat.ParseAscii(subStr, out str, out isStatic))
{
if (string.IsNullOrEmpty(str))
str = "0";
_displayValue = string.Format(format, decimal.Parse(str));
WinApiSendMessage.SendMessage(MainHandle, WmUpdDisplayMessage, 0, 0);
}
}
catch (Exception)
{
Thread.Sleep(1000);
continue;
}
Thread.Sleep(1);
}
}
void DisableWeight()
{
_mainProcessIsRun = false;
@ -172,10 +130,6 @@ namespace ButcherWeight
{
_inQueryThread.Abort();
}
if (_outQueryThread.IsAlive)
{
_outQueryThread.Abort();
}
if (weightSerialPort.IsOpen)
weightSerialPort.Close();
}
@ -204,19 +158,5 @@ namespace ButcherWeight
}
set { weightLabel.Text = string.Format(format, value); }
}
protected override void DefWndProc(ref Message m)
{
switch (m.Msg)
{
case WmUpdDisplayMessage:
weightLabel.Text = string.Format(format, decimal.Parse(_displayValue));
break;
default:
base.DefWndProc(ref m);
break;
}
}
}
}

+ 158
- 158
QualityAndOrder/QualityOrderForm.Designer.cs View File

@ -69,13 +69,6 @@
this.label1 = new System.Windows.Forms.Label();
this.keyBoardPanel = new System.Windows.Forms.FlowLayoutPanel();
this.weightBillGrid = new BWP.WinFormControl.UDataGridView();
this.W_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_AlreadyHouse = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Employee_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_FirstWeightNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.syncBtn = new System.Windows.Forms.Button();
this.testTimeInput = new BWP.WinFormControl.UDatePicker();
this.label20 = new System.Windows.Forms.Label();
@ -90,6 +83,17 @@
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.preOrderGrid = new BWP.WinFormControl.UDataGridView();
this.P_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Show = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_AlreadyNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_LastNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_WeighTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_OKBtn = new System.Windows.Forms.DataGridViewButtonColumn();
this.P_Hidden = new System.Windows.Forms.DataGridViewButtonColumn();
this.orderGrid = new BWP.WinFormControl.UDataGridView();
this.O_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.O_IsHurryButcher = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -103,17 +107,13 @@
this.tab2SyncBtn = new System.Windows.Forms.Button();
this.tab2DateSelect = new BWP.WinFormControl.UDatePicker();
this.label4 = new System.Windows.Forms.Label();
this.P_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Show = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_AlreadyNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_LastNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_WeighTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P_OKBtn = new System.Windows.Forms.DataGridViewButtonColumn();
this.P_Hidden = new System.Windows.Forms.DataGridViewButtonColumn();
this.W_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_AlreadyHouse = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Employee_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.W_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.panel1.SuspendLayout();
@ -465,7 +465,7 @@
this.W_B3ID,
this.W_Employee_Name,
this.W_Supplier_Name,
this.W_FirstWeightNumber,
this.W_Number,
this.W_HouseNames});
this.weightBillGrid.Location = new System.Drawing.Point(25, 77);
this.weightBillGrid.MultiSelect = false;
@ -480,61 +480,6 @@
this.weightBillGrid.TabIndex = 34;
this.weightBillGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.weightBillGrid_CellClick);
//
// W_ID
//
this.W_ID.DataPropertyName = "ID";
this.W_ID.HeaderText = "ID";
this.W_ID.Name = "W_ID";
this.W_ID.ReadOnly = true;
this.W_ID.Visible = false;
//
// W_AlreadyHouse
//
this.W_AlreadyHouse.DataPropertyName = "AlreadyHouse";
this.W_AlreadyHouse.HeaderText = "AlreadyHouse";
this.W_AlreadyHouse.Name = "W_AlreadyHouse";
this.W_AlreadyHouse.ReadOnly = true;
this.W_AlreadyHouse.Visible = false;
//
// W_B3ID
//
this.W_B3ID.DataPropertyName = "B3ID";
this.W_B3ID.HeaderText = "磅单号";
this.W_B3ID.Name = "W_B3ID";
this.W_B3ID.ReadOnly = true;
this.W_B3ID.Width = 80;
//
// W_Employee_Name
//
this.W_Employee_Name.DataPropertyName = "Employee_Name";
this.W_Employee_Name.HeaderText = "业务员";
this.W_Employee_Name.Name = "W_Employee_Name";
this.W_Employee_Name.ReadOnly = true;
this.W_Employee_Name.Width = 80;
//
// W_Supplier_Name
//
this.W_Supplier_Name.DataPropertyName = "Supplier_Name";
this.W_Supplier_Name.HeaderText = "供应商";
this.W_Supplier_Name.Name = "W_Supplier_Name";
this.W_Supplier_Name.ReadOnly = true;
//
// W_FirstWeightNumber
//
this.W_FirstWeightNumber.DataPropertyName = "FirstWeightNumber";
this.W_FirstWeightNumber.HeaderText = "头数";
this.W_FirstWeightNumber.Name = "W_FirstWeightNumber";
this.W_FirstWeightNumber.ReadOnly = true;
this.W_FirstWeightNumber.Width = 65;
//
// W_HouseNames
//
this.W_HouseNames.DataPropertyName = "HouseNames";
this.W_HouseNames.HeaderText = "圈舍";
this.W_HouseNames.Name = "W_HouseNames";
this.W_HouseNames.ReadOnly = true;
this.W_HouseNames.Width = 105;
//
// syncBtn
//
this.syncBtn.Font = new System.Drawing.Font("宋体", 15F);
@ -732,6 +677,97 @@
this.preOrderGrid.TabIndex = 38;
this.preOrderGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.preOrderGrid_CellClick);
//
// P_WeightBill_ID
//
this.P_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.P_WeightBill_ID.HeaderText = "WeightBill_ID";
this.P_WeightBill_ID.Name = "P_WeightBill_ID";
this.P_WeightBill_ID.ReadOnly = true;
this.P_WeightBill_ID.Visible = false;
//
// P_Show
//
this.P_Show.DataPropertyName = "Show";
this.P_Show.HeaderText = "Show";
this.P_Show.Name = "P_Show";
this.P_Show.ReadOnly = true;
this.P_Show.Visible = false;
//
// P_B3ID
//
this.P_B3ID.DataPropertyName = "B3ID";
this.P_B3ID.HeaderText = "磅单号";
this.P_B3ID.Name = "P_B3ID";
this.P_B3ID.ReadOnly = true;
this.P_B3ID.Width = 80;
//
// P_Supplier_Name
//
this.P_Supplier_Name.DataPropertyName = "Supplier_Name";
this.P_Supplier_Name.HeaderText = "供应商";
this.P_Supplier_Name.Name = "P_Supplier_Name";
this.P_Supplier_Name.ReadOnly = true;
this.P_Supplier_Name.Width = 80;
//
// P_HouseNames
//
this.P_HouseNames.DataPropertyName = "HouseNames";
this.P_HouseNames.HeaderText = "圈舍";
this.P_HouseNames.Name = "P_HouseNames";
this.P_HouseNames.ReadOnly = true;
this.P_HouseNames.Width = 95;
//
// P_Number
//
this.P_Number.DataPropertyName = "Number";
this.P_Number.HeaderText = "总头数";
this.P_Number.Name = "P_Number";
this.P_Number.ReadOnly = true;
this.P_Number.Width = 80;
//
// P_AlreadyNumber
//
this.P_AlreadyNumber.DataPropertyName = "AlreadyNumber";
this.P_AlreadyNumber.HeaderText = "已排";
this.P_AlreadyNumber.Name = "P_AlreadyNumber";
this.P_AlreadyNumber.ReadOnly = true;
this.P_AlreadyNumber.Width = 65;
//
// P_LastNumber
//
this.P_LastNumber.DataPropertyName = "LastNumber";
this.P_LastNumber.HeaderText = "剩余";
this.P_LastNumber.Name = "P_LastNumber";
this.P_LastNumber.ReadOnly = true;
this.P_LastNumber.Width = 65;
//
// P_WeighTime
//
this.P_WeighTime.DataPropertyName = "WeighTime";
this.P_WeighTime.HeaderText = "过磅时间";
this.P_WeighTime.Name = "P_WeighTime";
this.P_WeighTime.ReadOnly = true;
this.P_WeighTime.Width = 105;
//
// P_OKBtn
//
this.P_OKBtn.HeaderText = "排宰";
this.P_OKBtn.Name = "P_OKBtn";
this.P_OKBtn.ReadOnly = true;
this.P_OKBtn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.P_OKBtn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.P_OKBtn.Text = "排宰";
this.P_OKBtn.UseColumnTextForButtonValue = true;
this.P_OKBtn.Width = 85;
//
// P_Hidden
//
this.P_Hidden.HeaderText = "隐藏";
this.P_Hidden.Name = "P_Hidden";
this.P_Hidden.ReadOnly = true;
this.P_Hidden.Text = "隐藏";
this.P_Hidden.Width = 85;
//
// orderGrid
//
this.orderGrid.AllowUserToAddRows = false;
@ -881,96 +917,60 @@
this.label4.TabIndex = 35;
this.label4.Text = "日期:";
//
// P_WeightBill_ID
//
this.P_WeightBill_ID.DataPropertyName = "WeightBill_ID";
this.P_WeightBill_ID.HeaderText = "WeightBill_ID";
this.P_WeightBill_ID.Name = "P_WeightBill_ID";
this.P_WeightBill_ID.ReadOnly = true;
this.P_WeightBill_ID.Visible = false;
//
// P_Show
//
this.P_Show.DataPropertyName = "Show";
this.P_Show.HeaderText = "Show";
this.P_Show.Name = "P_Show";
this.P_Show.ReadOnly = true;
this.P_Show.Visible = false;
//
// P_B3ID
//
this.P_B3ID.DataPropertyName = "B3ID";
this.P_B3ID.HeaderText = "磅单号";
this.P_B3ID.Name = "P_B3ID";
this.P_B3ID.ReadOnly = true;
this.P_B3ID.Width = 80;
//
// P_Supplier_Name
//
this.P_Supplier_Name.DataPropertyName = "Supplier_Name";
this.P_Supplier_Name.HeaderText = "供应商";
this.P_Supplier_Name.Name = "P_Supplier_Name";
this.P_Supplier_Name.ReadOnly = true;
this.P_Supplier_Name.Width = 80;
//
// P_HouseNames
// W_ID
//
this.P_HouseNames.DataPropertyName = "HouseNames";
this.P_HouseNames.HeaderText = "圈舍";
this.P_HouseNames.Name = "P_HouseNames";
this.P_HouseNames.ReadOnly = true;
this.P_HouseNames.Width = 95;
this.W_ID.DataPropertyName = "ID";
this.W_ID.HeaderText = "ID";
this.W_ID.Name = "W_ID";
this.W_ID.ReadOnly = true;
this.W_ID.Visible = false;
//
// P_Number
// W_AlreadyHouse
//
this.P_Number.DataPropertyName = "Number";
this.P_Number.HeaderText = "总头数";
this.P_Number.Name = "P_Number";
this.P_Number.ReadOnly = true;
this.P_Number.Width = 80;
this.W_AlreadyHouse.DataPropertyName = "AlreadyHouse";
this.W_AlreadyHouse.HeaderText = "AlreadyHouse";
this.W_AlreadyHouse.Name = "W_AlreadyHouse";
this.W_AlreadyHouse.ReadOnly = true;
this.W_AlreadyHouse.Visible = false;
//
// P_AlreadyNumber
// W_B3ID
//
this.P_AlreadyNumber.DataPropertyName = "AlreadyNumber";
this.P_AlreadyNumber.HeaderText = "已排";
this.P_AlreadyNumber.Name = "P_AlreadyNumber";
this.P_AlreadyNumber.ReadOnly = true;
this.P_AlreadyNumber.Width = 65;
this.W_B3ID.DataPropertyName = "B3ID";
this.W_B3ID.HeaderText = "磅单号";
this.W_B3ID.Name = "W_B3ID";
this.W_B3ID.ReadOnly = true;
this.W_B3ID.Width = 80;
//
// P_LastNumber
// W_Employee_Name
//
this.P_LastNumber.DataPropertyName = "LastNumber";
this.P_LastNumber.HeaderText = "剩余";
this.P_LastNumber.Name = "P_LastNumber";
this.P_LastNumber.ReadOnly = true;
this.P_LastNumber.Width = 65;
this.W_Employee_Name.DataPropertyName = "Employee_Name";
this.W_Employee_Name.HeaderText = "业务员";
this.W_Employee_Name.Name = "W_Employee_Name";
this.W_Employee_Name.ReadOnly = true;
this.W_Employee_Name.Width = 80;
//
// P_WeighTime
// W_Supplier_Name
//
this.P_WeighTime.DataPropertyName = "WeighTime";
this.P_WeighTime.HeaderText = "过磅时间";
this.P_WeighTime.Name = "P_WeighTime";
this.P_WeighTime.ReadOnly = true;
this.P_WeighTime.Width = 105;
this.W_Supplier_Name.DataPropertyName = "Supplier_Name";
this.W_Supplier_Name.HeaderText = "供应商";
this.W_Supplier_Name.Name = "W_Supplier_Name";
this.W_Supplier_Name.ReadOnly = true;
//
// P_OKBtn
// W_Number
//
this.P_OKBtn.HeaderText = "排宰";
this.P_OKBtn.Name = "P_OKBtn";
this.P_OKBtn.ReadOnly = true;
this.P_OKBtn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.P_OKBtn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.P_OKBtn.Text = "排宰";
this.P_OKBtn.UseColumnTextForButtonValue = true;
this.P_OKBtn.Width = 85;
this.W_Number.DataPropertyName = "Number";
this.W_Number.HeaderText = "头数";
this.W_Number.Name = "W_Number";
this.W_Number.ReadOnly = true;
this.W_Number.Width = 65;
//
// P_Hidden
// W_HouseNames
//
this.P_Hidden.HeaderText = "隐藏";
this.P_Hidden.Name = "P_Hidden";
this.P_Hidden.ReadOnly = true;
this.P_Hidden.Text = "隐藏";
this.P_Hidden.Width = 85;
this.W_HouseNames.DataPropertyName = "HouseNames";
this.W_HouseNames.HeaderText = "圈舍";
this.W_HouseNames.Name = "W_HouseNames";
this.W_HouseNames.ReadOnly = true;
this.W_HouseNames.Width = 105;
//
// QualityOrderForm
//
@ -1057,13 +1057,6 @@
private System.Windows.Forms.DataGridViewButtonColumn O_OKBtn;
private System.Windows.Forms.DataGridViewButtonColumn O_HurryBtn;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.DataGridViewTextBoxColumn W_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn W_AlreadyHouse;
private System.Windows.Forms.DataGridViewTextBoxColumn W_B3ID;
private System.Windows.Forms.DataGridViewTextBoxColumn W_Employee_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn W_Supplier_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn W_FirstWeightNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn W_HouseNames;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.RadioButton showHidden;
private System.Windows.Forms.RadioButton showAvailable;
@ -1079,6 +1072,13 @@
private System.Windows.Forms.DataGridViewTextBoxColumn P_WeighTime;
private System.Windows.Forms.DataGridViewButtonColumn P_OKBtn;
private System.Windows.Forms.DataGridViewButtonColumn P_Hidden;
private System.Windows.Forms.DataGridViewTextBoxColumn W_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn W_AlreadyHouse;
private System.Windows.Forms.DataGridViewTextBoxColumn W_B3ID;
private System.Windows.Forms.DataGridViewTextBoxColumn W_Employee_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn W_Supplier_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn W_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn W_HouseNames;


+ 52
- 49
QualityAndOrder/QualityOrderForm.cs View File

@ -34,7 +34,8 @@ namespace QualityAndOrder
List<Tuple<string, string>> hogGradeList;
List<HouseSplitEntity> houseList;
List<SanctionSplit3Part> sanctionList;
List<WeightBill> weightBills;
List<HouseAndSanctionList> weightBills;
HouseAndSanctionEdit Dmo;
Thread syncThread;
readonly Color btnSelectForeColor = Color.FromArgb(255, 255, 255);
readonly Color btnSelectBackColor = Color.FromArgb(66, 163, 218);
@ -44,9 +45,7 @@ namespace QualityAndOrder
public QualityOrderForm()
{
InitializeComponent();
Control.CheckForIllegalCrossThreadCalls = false;
testTimeInput.Date = DateTime.Today;
syncBtn.Focus();
this.uTabControl1.Selected += (sender, e) =>
{
this.Text = e.TabPage.Text;
@ -65,7 +64,8 @@ namespace QualityAndOrder
numberBox.LostFocus += (sender, e) => { flag = 1; };
sanctionGrid.GotFocus += (sender, e) => { flag = 2; };
syncThread = new Thread(SyncTask) { IsBackground = true };
syncThread = new Thread(SyncTask);
syncThread.Start();
this.FormClosing += delegate
{
if (syncThread.IsAlive)
@ -73,7 +73,6 @@ namespace QualityAndOrder
if (tb2SyncThread != null && tb2SyncThread.IsAlive)
tb2SyncThread.Abort();
};
syncThread.Start();
Tab2Init();
}
@ -82,8 +81,11 @@ namespace QualityAndOrder
{
while (true)
{
BindNumberLabel();
Thread.Sleep(2000);
this.Invoke(new InvokeHandler(delegate()
{
BindNumberLabel();
}));
}
}
@ -334,23 +336,20 @@ namespace QualityAndOrder
private void commitBtn_Click(object sender, EventArgs e)
{
var entity = GetHouseDataFromUI();
entity.AlreadyHouse = true;
var result = WeightBillRpc.UpdateInsertHouseAndSanctionInfo(entity);
if (result == 1)
{
MessageBox.Show("提交成功");
BindWeightBillGrid();
BindNumberLabel();
ResetTab1Controls();
}
else
MessageBox.Show("结果", "提交失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
GetDataFromUI();
HouseAndSanctionRpc.UpdateInsertHouseAndSanction(Dmo);
var entity = weightBills.First(x => x.ID == Dmo.ID);
entity.HouseNames = string.Join(",", Dmo.HouseDetails.Select(x => x.LiveColonyHouse_Name));
entity.Number = Dmo.Number;
Dmo = null;
BindWeightBillGrid();
BindNumberLabel();
ResetTab1Controls();
}
private void syncBtn_Click(object sender, EventArgs e)
{
weightBills = WeightBillRpc.GetUnHousedBill(testTimeInput.Date.Value);
weightBills = HouseAndSanctionRpc.GetHouseAndSanctionList(testTimeInput.Date.Value);
BindWeightBillGrid();
//BindNumberLabel();
//tab1SyncThread = new Thread(StartQuery) { IsBackground = true };
@ -369,51 +368,56 @@ namespace QualityAndOrder
// weightBills = WeightBillRpc.GetUnHousedBill(testTimeInput.Date.Value);
// BindWeightBillGrid();
// }));
// BindNumberLabel();
// Thread.Sleep(10000);
// }
//}
void BindNumberLabel()
{
var inHouseNumber = WeightBillRpc.GetDetailTotalNumber(testTimeInput.Date.Value);
var inHouseNumber = HouseAndSanctionRpc.GetDetailTotalNumber(testTimeInput.Date.Value);
inHouseNumberLabel.Text = string.Format("{0}", inHouseNumber);
}
WeightBill GetHouseDataFromUI()
void GetDataFromUI()
{
if (weightBillGrid.CurrentRow == null)
throw new Exception("请选择需要处理的记录");
var entity = weightBillGrid.CurrentRow.DataBoundItem as WeightBill;
if (Dmo == null)
{
if (weightBillGrid.CurrentRow == null)
throw new Exception("请选择需要处理的记录");
Dmo = new HouseAndSanctionEdit();
Dmo.ID = (long)weightBillGrid.CurrentRow.Cells["W_ID"].Value;
}
else
{
Dmo.HouseDetails.Clear();
Dmo.SanctionDetails.Clear();
}
if (string.IsNullOrEmpty(numberBox.Text))
throw new Exception("数量不能为空");
if (currentBtn == null)
throw new Exception("请选等级");
if (houseSelectedBtn.Count == 0)
throw new Exception("请选择圈舍");
entity.HouseDetails.Clear();
foreach (var btn in houseSelectedBtn)
{
var house = btn.Tag as Tuple<string, string>;
var houseDetail = new WeightBill_HouseDetail() { WeightBill_ID = entity.ID, LiveColonyHouse_ID = long.Parse(house.Item1), LiveColonyHouse_Name = house.Item2 };
entity.HouseDetails.Add(houseDetail);
houseDetail.Index = entity.HouseDetails.Max(x => x.Index) + 1;
var houseDetail = new WeightBill_HouseDetail() { WeightBill_ID = Dmo.ID, LiveColonyHouse_ID = long.Parse(house.Item1), LiveColonyHouse_Name = house.Item2 };
Dmo.HouseDetails.Add(houseDetail);
houseDetail.Index = Dmo.HouseDetails.Max(x => x.Index) + 1;
}
var gradeTag = currentBtn.Tag as Tuple<string, string>;
entity.HogGrade_ID = long.Parse(gradeTag.Item1);
entity.HogGrade_Name = gradeTag.Item2;
entity.FirstWeightNumber = int.Parse(numberBox.Text);
entity.SanctionDetails.Clear();
Dmo.HogGrade_ID = long.Parse(gradeTag.Item1);
Dmo.HogGrade_Name = gradeTag.Item2;
Dmo.Number = int.Parse(numberBox.Text);
foreach (DataGridViewRow row in sanctionGrid.Rows)
{
var tag = row.DataBoundItem as SanctionSplit3Part;
if (tag.Number1.HasValue)
{
var detail = new WeightBill_SanctionDetail();
entity.SanctionDetails.Add(detail);
detail.WeightBill_ID = entity.ID;
detail.Index = entity.SanctionDetails.Max(x => x.Index) + 1;
Dmo.SanctionDetails.Add(detail);
detail.WeightBill_ID = Dmo.ID;
detail.Index = Dmo.SanctionDetails.Max(x => x.Index) + 1;
detail.Sanction_ID = tag.Sanction_ID1;
detail.AbnormalItem_ID = tag.AbnormalItem_ID1;
detail.AbnormalItem_Name = tag.AbnormalItem_Name1;
@ -422,9 +426,9 @@ namespace QualityAndOrder
if (tag.Number2.HasValue)
{
var detail = new WeightBill_SanctionDetail();
entity.SanctionDetails.Add(detail);
detail.WeightBill_ID = entity.ID;
detail.Index = entity.SanctionDetails.Max(x => x.Index) + 1;
Dmo.SanctionDetails.Add(detail);
detail.WeightBill_ID = Dmo.ID;
detail.Index = Dmo.SanctionDetails.Max(x => x.Index) + 1;
detail.Sanction_ID = tag.Sanction_ID2;
detail.AbnormalItem_ID = tag.AbnormalItem_ID2;
detail.AbnormalItem_Name = tag.AbnormalItem_Name2;
@ -433,16 +437,15 @@ namespace QualityAndOrder
if (tag.Number3.HasValue)
{
var detail = new WeightBill_SanctionDetail();
entity.SanctionDetails.Add(detail);
detail.WeightBill_ID = entity.ID;
detail.Index = entity.SanctionDetails.Max(x => x.Index) + 1;
Dmo.SanctionDetails.Add(detail);
detail.WeightBill_ID = Dmo.ID;
detail.Index = Dmo.SanctionDetails.Max(x => x.Index) + 1;
detail.Sanction_ID = tag.Sanction_ID3;
detail.AbnormalItem_ID = tag.AbnormalItem_ID3;
detail.AbnormalItem_Name = tag.AbnormalItem_Name3;
detail.Number = tag.Number3;
}
}
return entity;
}
void ResetTab1Controls()
@ -472,18 +475,18 @@ namespace QualityAndOrder
void Tab1AppToUI()
{
var id = Convert.ToInt64(weightBillGrid.CurrentRow.Cells["W_ID"].Value);
var entity = WeightBillRpc.GetWeightBillOnHousePage(id);
Dmo = HouseAndSanctionRpc.GetHouseAndSanctionDetail(id);
numberBox.Text = string.Empty;
if (entity.HogGrade_ID.HasValue)
if (Dmo.HogGrade_ID.HasValue)
{
var first = hogGradeBtn.FirstOrDefault(x => x.Name == "_" + entity.HogGrade_ID);
var first = hogGradeBtn.FirstOrDefault(x => x.Name == "_" + Dmo.HogGrade_ID);
if (first != null)
{
currentBtn = first;
SetBtnChecked(currentBtn);
}
}
foreach (var item in entity.HouseDetails)
foreach (var item in Dmo.HouseDetails)
{
var first = houseBtn.FirstOrDefault(x => x.Name == "_" + item.LiveColonyHouse_ID);
if (first != null)
@ -492,7 +495,7 @@ namespace QualityAndOrder
houseSelectedBtn.Add(first);
}
}
foreach (var item in entity.SanctionDetails)
foreach (var item in Dmo.SanctionDetails)
{
var first = sanctionList.FirstOrDefault(x => x.AbnormalItem_ID1 == item.AbnormalItem_ID);
if (first != null)


+ 1
- 1
QualityAndOrder/QualityOrderForm.resx View File

@ -168,7 +168,7 @@
<metadata name="W_Supplier_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="W_FirstWeightNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="W_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="W_HouseNames.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">


+ 1
- 1
QualityAndOrder/QualityOrderFormForTab2.cs View File

@ -81,7 +81,7 @@ namespace QualityAndOrder
BindOrderGrid();
if (tb2SyncThread == null)
{
tb2SyncThread = new Thread(Tab2SyncB3ID) { IsBackground = true };
tb2SyncThread = new Thread(Tab2SyncB3ID);
tb2SyncThread.Start();
}
}


BIN
Setup/Release/Setup.msi View File


+ 1
- 1
WeighAndGrading/GradeContext.cs View File

@ -15,7 +15,7 @@ namespace WeighAndGrading
private static string loginConfigPath = @"C:\BwpB3Project\src\B3ButcherManageClient\ButcherManageClient\bin\Debug\GradeConfig.xml";
//#endif
//#if !debug
// private static string loginConfigPath = Application.StartupPath + "\\GradeConfig.xml";
//private static string loginConfigPath = Application.StartupPath + "\\GradeConfig.xml";
//#endif
private static GradeConfig _config;
public static GradeConfig Config


+ 80
- 277
WeighAndGrading/GradeFrom.Designer.cs View File

@ -31,10 +31,10 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.label1 = new System.Windows.Forms.Label();
this.syncBtn = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
@ -48,29 +48,7 @@
this.mbPanel = new System.Windows.Forms.FlowLayoutPanel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.label12 = new System.Windows.Forms.Label();
this.queryPanel = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.endDataInput = new BWP.WinFormControl.UDatePicker();
this.beginDateInput = new BWP.WinFormControl.UDatePicker();
this.panel2 = new System.Windows.Forms.Panel();
this.maoRadio = new System.Windows.Forms.RadioButton();
this.tangRadio = new System.Windows.Forms.RadioButton();
this.allRadio = new System.Windows.Forms.RadioButton();
this.orderInput = new BWP.WinFormControl.UTextBoxWithPad();
this.label9 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.queryBtn = new System.Windows.Forms.Button();
this.saiXuanBtn = new System.Windows.Forms.Button();
this.historyGrid = new BWP.WinFormControl.UDataGridView();
this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Order = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Technics = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Time = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.enableWeight = new System.Windows.Forms.CheckBox();
this.isPrintCheckBox = new System.Windows.Forms.CheckBox();
this.printBtn = new System.Windows.Forms.Button();
@ -84,7 +62,15 @@
this.stateLabel = new System.Windows.Forms.Label();
this.modifyPanel = new System.Windows.Forms.Panel();
this.cancelBtn = new System.Windows.Forms.Button();
this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Technics = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Time = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Technics = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Finish = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Order = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.D_Technics_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -94,8 +80,6 @@
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.queryPanel.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.historyGrid)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
@ -211,9 +195,6 @@
// groupBox3
//
this.groupBox3.Controls.Add(this.label12);
this.groupBox3.Controls.Add(this.queryPanel);
this.groupBox3.Controls.Add(this.queryBtn);
this.groupBox3.Controls.Add(this.saiXuanBtn);
this.groupBox3.Controls.Add(this.historyGrid);
this.groupBox3.Location = new System.Drawing.Point(826, 175);
this.groupBox3.Name = "groupBox3";
@ -232,167 +213,6 @@
this.label12.TabIndex = 32;
this.label12.Text = "记录";
//
// queryPanel
//
this.queryPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.queryPanel.Controls.Add(this.label3);
this.queryPanel.Controls.Add(this.endDataInput);
this.queryPanel.Controls.Add(this.beginDateInput);
this.queryPanel.Controls.Add(this.panel2);
this.queryPanel.Controls.Add(this.orderInput);
this.queryPanel.Controls.Add(this.label9);
this.queryPanel.Controls.Add(this.label6);
this.queryPanel.Controls.Add(this.label8);
this.queryPanel.Location = new System.Drawing.Point(23, 85);
this.queryPanel.Name = "queryPanel";
this.queryPanel.Size = new System.Drawing.Size(391, 172);
this.queryPanel.TabIndex = 26;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("宋体", 15F);
this.label3.Location = new System.Drawing.Point(13, 120);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(109, 20);
this.label3.TabIndex = 12;
this.label3.Text = "屠宰时间:";
//
// endDataInput
//
this.endDataInput.BackColor = System.Drawing.Color.White;
this.endDataInput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.endDataInput.Date = new System.DateTime(2017, 9, 5, 0, 0, 0, 0);
this.endDataInput.Font = new System.Drawing.Font("宋体", 15F);
this.endDataInput.Location = new System.Drawing.Point(265, 115);
this.endDataInput.Name = "endDataInput";
this.endDataInput.Size = new System.Drawing.Size(117, 30);
this.endDataInput.TabIndex = 11;
this.endDataInput.Text = "2017/9/5";
this.endDataInput.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.endDataInput.Type = BWP.WinFormControl.DateTimeType.Date;
//
// beginDateInput
//
this.beginDateInput.BackColor = System.Drawing.Color.White;
this.beginDateInput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.beginDateInput.Date = new System.DateTime(2017, 9, 5, 0, 0, 0, 0);
this.beginDateInput.Font = new System.Drawing.Font("宋体", 15F);
this.beginDateInput.Location = new System.Drawing.Point(124, 115);
this.beginDateInput.Name = "beginDateInput";
this.beginDateInput.Size = new System.Drawing.Size(117, 30);
this.beginDateInput.TabIndex = 10;
this.beginDateInput.Text = "2017/9/5";
this.beginDateInput.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.beginDateInput.Type = BWP.WinFormControl.DateTimeType.Date;
//
// panel2
//
this.panel2.Controls.Add(this.maoRadio);
this.panel2.Controls.Add(this.tangRadio);
this.panel2.Controls.Add(this.allRadio);
this.panel2.Location = new System.Drawing.Point(114, 62);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(268, 31);
this.panel2.TabIndex = 9;
//
// maoRadio
//
this.maoRadio.AutoSize = true;
this.maoRadio.Font = new System.Drawing.Font("宋体", 14F);
this.maoRadio.Location = new System.Drawing.Point(199, 5);
this.maoRadio.Name = "maoRadio";
this.maoRadio.Size = new System.Drawing.Size(65, 23);
this.maoRadio.TabIndex = 11;
this.maoRadio.TabStop = true;
this.maoRadio.Text = "毛剥";
this.maoRadio.UseVisualStyleBackColor = true;
//
// tangRadio
//
this.tangRadio.AutoSize = true;
this.tangRadio.Font = new System.Drawing.Font("宋体", 15F);
this.tangRadio.Location = new System.Drawing.Point(98, 4);
this.tangRadio.Name = "tangRadio";
this.tangRadio.Size = new System.Drawing.Size(67, 24);
this.tangRadio.TabIndex = 10;
this.tangRadio.TabStop = true;
this.tangRadio.Text = "烫褪";
this.tangRadio.UseVisualStyleBackColor = true;
//
// allRadio
//
this.allRadio.AutoSize = true;
this.allRadio.Font = new System.Drawing.Font("宋体", 14F);
this.allRadio.Location = new System.Drawing.Point(8, 5);
this.allRadio.Name = "allRadio";
this.allRadio.Size = new System.Drawing.Size(65, 23);
this.allRadio.TabIndex = 9;
this.allRadio.TabStop = true;
this.allRadio.Text = "全部";
this.allRadio.UseVisualStyleBackColor = true;
//
// orderInput
//
this.orderInput.Font = new System.Drawing.Font("宋体", 15F);
this.orderInput.Location = new System.Drawing.Point(124, 17);
this.orderInput.Name = "orderInput";
this.orderInput.Size = new System.Drawing.Size(117, 30);
this.orderInput.TabIndex = 1;
this.orderInput.Type = BWP.WinFormControl.UTextBoxWithPad.TextBoxType.Number;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Font = new System.Drawing.Font("宋体", 15F);
this.label9.Location = new System.Drawing.Point(13, 69);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(69, 20);
this.label9.TabIndex = 0;
this.label9.Text = "工艺:";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("宋体", 15F);
this.label6.Location = new System.Drawing.Point(13, 20);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(109, 20);
this.label6.TabIndex = 0;
this.label6.Text = "屠宰顺序:";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("宋体", 15F);
this.label8.Location = new System.Drawing.Point(244, 121);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(19, 20);
this.label8.TabIndex = 5;
this.label8.Text = "-";
//
// queryBtn
//
this.queryBtn.Font = new System.Drawing.Font("宋体", 15F);
this.queryBtn.Location = new System.Drawing.Point(245, 36);
this.queryBtn.Name = "queryBtn";
this.queryBtn.Size = new System.Drawing.Size(102, 43);
this.queryBtn.TabIndex = 5;
this.queryBtn.Text = "查询";
this.queryBtn.UseVisualStyleBackColor = true;
this.queryBtn.Click += new System.EventHandler(this.queryBtn_Click);
//
// saiXuanBtn
//
this.saiXuanBtn.Font = new System.Drawing.Font("宋体", 15F);
this.saiXuanBtn.Location = new System.Drawing.Point(98, 36);
this.saiXuanBtn.Name = "saiXuanBtn";
this.saiXuanBtn.Size = new System.Drawing.Size(102, 43);
this.saiXuanBtn.TabIndex = 4;
this.saiXuanBtn.Text = "筛选";
this.saiXuanBtn.UseVisualStyleBackColor = true;
this.saiXuanBtn.Click += new System.EventHandler(this.saiXuanBtn_Click);
//
// historyGrid
//
this.historyGrid.AllowUserToAddRows = false;
@ -415,12 +235,11 @@
this.H_ID,
this.H_Livestock_ID,
this.H_Index,
this.H_Order,
this.H_Technics,
this.H_Livestock_Name,
this.H_Weight,
this.H_Time});
this.historyGrid.Location = new System.Drawing.Point(6, 92);
this.historyGrid.Location = new System.Drawing.Point(6, 36);
this.historyGrid.MultiSelect = false;
this.historyGrid.Name = "historyGrid";
this.historyGrid.ReadOnly = true;
@ -429,74 +248,10 @@
this.historyGrid.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.historyGrid.RowTemplate.Height = 40;
this.historyGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.historyGrid.Size = new System.Drawing.Size(426, 571);
this.historyGrid.Size = new System.Drawing.Size(426, 627);
this.historyGrid.TabIndex = 0;
this.historyGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.historyGrid_CellClick);
//
// H_ID
//
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "ID";
this.H_ID.Name = "H_ID";
this.H_ID.ReadOnly = true;
this.H_ID.Visible = false;
//
// H_Livestock_ID
//
this.H_Livestock_ID.HeaderText = "Livestock_ID";
this.H_Livestock_ID.Name = "H_Livestock_ID";
this.H_Livestock_ID.ReadOnly = true;
this.H_Livestock_ID.Visible = false;
//
// H_Index
//
this.H_Index.DataPropertyName = "Index";
this.H_Index.HeaderText = "序号";
this.H_Index.Name = "H_Index";
this.H_Index.ReadOnly = true;
this.H_Index.Width = 65;
//
// H_Order
//
this.H_Order.DataPropertyName = "Order";
this.H_Order.HeaderText = "顺序";
this.H_Order.Name = "H_Order";
this.H_Order.ReadOnly = true;
this.H_Order.Width = 65;
//
// H_Technics
//
this.H_Technics.DataPropertyName = "Technics_Name";
this.H_Technics.HeaderText = "工艺";
this.H_Technics.Name = "H_Technics";
this.H_Technics.ReadOnly = true;
this.H_Technics.Width = 65;
//
// H_Livestock_Name
//
this.H_Livestock_Name.DataPropertyName = "Livestock_Name";
this.H_Livestock_Name.HeaderText = "级别";
this.H_Livestock_Name.Name = "H_Livestock_Name";
this.H_Livestock_Name.ReadOnly = true;
this.H_Livestock_Name.Width = 90;
//
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle3.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle3;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
this.H_Weight.Width = 65;
//
// H_Time
//
this.H_Time.DataPropertyName = "Time";
this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true;
//
// enableWeight
//
this.enableWeight.AutoCheck = false;
@ -583,6 +338,7 @@
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.D_OrderDetail_ID,
this.D_Technics,
this.D_Finish,
this.D_Order,
this.D_Technics_Name,
@ -590,6 +346,7 @@
this.D_Already,
this.D_FinishBtn});
this.dataGridView.Location = new System.Drawing.Point(12, 175);
this.dataGridView.MultiSelect = false;
this.dataGridView.Name = "dataGridView";
this.dataGridView.ReadOnly = true;
this.dataGridView.RowHeadersVisible = false;
@ -646,7 +403,7 @@
this.stateLabel.Name = "stateLabel";
this.stateLabel.Size = new System.Drawing.Size(289, 20);
this.stateLabel.TabIndex = 35;
this.stateLabel.Text = "您正在修改等级为 1000 的等级";
this.stateLabel.Text = "您正在修改序号为 1000 的等级";
//
// modifyPanel
//
@ -671,6 +428,63 @@
this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click);
//
// H_ID
//
this.H_ID.DataPropertyName = "ID";
this.H_ID.HeaderText = "ID";
this.H_ID.Name = "H_ID";
this.H_ID.ReadOnly = true;
this.H_ID.Visible = false;
//
// H_Livestock_ID
//
this.H_Livestock_ID.HeaderText = "Livestock_ID";
this.H_Livestock_ID.Name = "H_Livestock_ID";
this.H_Livestock_ID.ReadOnly = true;
this.H_Livestock_ID.Visible = false;
//
// H_Index
//
this.H_Index.DataPropertyName = "Index";
this.H_Index.HeaderText = "序号";
this.H_Index.Name = "H_Index";
this.H_Index.ReadOnly = true;
this.H_Index.Width = 65;
//
// H_Technics
//
this.H_Technics.DataPropertyName = "Technics_Name";
this.H_Technics.HeaderText = "工艺";
this.H_Technics.Name = "H_Technics";
this.H_Technics.ReadOnly = true;
this.H_Technics.Width = 65;
//
// H_Livestock_Name
//
this.H_Livestock_Name.DataPropertyName = "Livestock_Name";
this.H_Livestock_Name.HeaderText = "级别";
this.H_Livestock_Name.Name = "H_Livestock_Name";
this.H_Livestock_Name.ReadOnly = true;
this.H_Livestock_Name.Width = 90;
//
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle3.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle3;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
this.H_Weight.Width = 70;
//
// H_Time
//
this.H_Time.DataPropertyName = "Time";
this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true;
this.H_Time.Width = 110;
//
// D_OrderDetail_ID
//
this.D_OrderDetail_ID.DataPropertyName = "OrderDetail_ID";
@ -679,6 +493,14 @@
this.D_OrderDetail_ID.ReadOnly = true;
this.D_OrderDetail_ID.Visible = false;
//
// D_Technics
//
this.D_Technics.DataPropertyName = "Technics";
this.D_Technics.HeaderText = "Technics";
this.D_Technics.Name = "D_Technics";
this.D_Technics.ReadOnly = true;
this.D_Technics.Visible = false;
//
// D_Finish
//
this.D_Finish.DataPropertyName = "Finish";
@ -755,16 +577,11 @@
this.Name = "GradeFrom";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "称重定级";
this.Load += new System.EventHandler(this.GradeFrom_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.queryPanel.ResumeLayout(false);
this.queryPanel.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.historyGrid)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
@ -796,24 +613,10 @@
private System.Windows.Forms.Button printBtn;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label lblChengZhong;
private System.Windows.Forms.Panel queryPanel;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label12;
private BWP.WinFormControl.UTextBoxWithPad orderInput;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Button queryBtn;
private System.Windows.Forms.Button saiXuanBtn;
private BWP.WinFormControl.UDataGridView historyGrid;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.RadioButton maoRadio;
private System.Windows.Forms.RadioButton tangRadio;
private System.Windows.Forms.RadioButton allRadio;
private BWP.WinFormControl.UDatePicker beginDateInput;
private BWP.WinFormControl.UDatePicker endDataInput;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button closeBtn;
private System.Windows.Forms.Button configBtn;
private System.Windows.Forms.Label stateLabel;
@ -822,12 +625,12 @@
private System.Windows.Forms.DataGridViewTextBoxColumn H_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Livestock_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Order;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Technics;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Livestock_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Time;
private System.Windows.Forms.DataGridViewTextBoxColumn D_OrderDetail_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Technics;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Finish;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Order;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Technics_Name;


+ 16
- 59
WeighAndGrading/GradeFrom.cs View File

@ -46,14 +46,13 @@ namespace WeighAndGrading
readonly StringBuilder _dataStrBuilder = new StringBuilder();
readonly ConcurrentQueue<string> _dataQueue = new ConcurrentQueue<string>();
private const int WmUpdDisplayMessage = 0x0500 + 2;
private string _displayValue;
#endregion
public GradeFrom()
{
InitializeComponent();
butcherTimeInput.Date = beginDateInput.Date = endDataInput.Date = DateTime.Today;
butcherTimeInput.Date = DateTime.Today;
dataGridView.AutoGenerateColumns = false;
dataGridView.DataSource = null;
historyGrid.AutoGenerateColumns = false;
@ -104,48 +103,6 @@ namespace WeighAndGrading
}
}
bool queryPanelShow = false;
private void saiXuanBtn_Click(object sender, EventArgs e)
{
if (queryPanelShow)
Animate.AnimateWindow(queryPanel.Handle, 200, Animate.AW_HIDE + Animate.AW_VER_NEGATIVE);
else
Animate.AnimateWindow(queryPanel.Handle, 200, Animate.AW_SLIDE + Animate.AW_VER_POSITIVE);
queryPanelShow = !queryPanelShow;
}
private void queryBtn_Click(object sender, EventArgs e)
{
if (queryPanelShow)
{
Animate.AnimateWindow(queryPanel.Handle, 200, Animate.AW_HIDE + Animate.AW_VER_NEGATIVE);
queryPanelShow = !queryPanelShow;
}
int? order = null;
if (!string.IsNullOrEmpty(orderInput.Text))
{
int v;
if (int.TryParse(orderInput.Text, out v))
order = v;
}
int type = -1;
if (tangRadio.Checked)
type = 0;
else if (maoRadio.Checked)
type = 1;
details = GradeAndWeightRpc.GetDetails(beginDateInput.Date.Value, beginDateInput.Date.Value, order, type);
historyGrid.DataSource = null;
if (details.Any())
historyGrid.DataSource = details;
historyGrid.Refresh();
}
private void GradeFrom_Load(object sender, EventArgs e)
{
queryPanel.Hide();
}
private void closeBtn_Click(object sender, EventArgs e)
{
this.Close();
@ -157,7 +114,7 @@ namespace WeighAndGrading
list = GradeAndWeightRpc.GetGradeAndWeightList(date);
BindDataGrid();
dataGridView.Refresh();
details = GradeAndWeightRpc.GetDetails(date, date, null, -1);
details = GradeAndWeightRpc.GetDetails(date, 15);
BindDetailGrid();
if (details.Any())
maxIndex = details.First().Index;
@ -395,12 +352,12 @@ namespace WeighAndGrading
{
tempList.TryDequeue(out first);
first.OrderDetail_ID = currentRow.OrderDetail_ID;
first.Order = currentRow.Order;
first.Date = butcherTimeInput.Date.Value;
first.Livestock_ID = livestock.Item1;
first.Livestock_Name = livestock.Item2;
first.Technics = livestock.Item3;
first.Technics_Name = livestock.Item3 == 0 ? "烫褪" : "毛剥";
GradeAndWeightRpc.InsertOrInsertDetail(first);
first.Technics_Name = tech;
GradeAndWeightRpc.UpdateOrInsertDetail(first, true);
historyGrid.Refresh();
}
else//add
@ -409,15 +366,16 @@ namespace WeighAndGrading
var entity = new GradeAndWeight_Detail();
entity.Index = maxIndex;
entity.OrderDetail_ID = currentRow.OrderDetail_ID;
entity.Order = currentRow.Order;
entity.Date = butcherTimeInput.Date.Value;
entity.Livestock_ID = livestock.Item1;
entity.Livestock_Name = livestock.Item2;
entity.Technics = livestock.Item3;
entity.Technics_Name = livestock.Item3 == 0 ? "烫褪" : "毛剥";
entity.Technics_Name = tech;
entity.Time = DateTime.Now;
if (details.Count == 15)
details.RemoveAt(14);
details.Insert(0, entity);
GradeAndWeightRpc.InsertOrInsertDetail(entity);
GradeAndWeightRpc.UpdateOrInsertDetail(entity, true);
tempList.Enqueue(entity);
BindDetailGrid();
}
@ -438,7 +396,7 @@ namespace WeighAndGrading
{
tempList.TryDequeue(out first);
first.Weight = weight;
GradeAndWeightRpc.InsertOrInsertDetail(first);
GradeAndWeightRpc.UpdateOrInsertDetail(first);
historyGrid.Refresh();
}
else//add
@ -448,8 +406,10 @@ namespace WeighAndGrading
entity.Index = maxIndex;
entity.Weight = weight;
entity.Time = DateTime.Now;
if (details.Count == 15)
details.RemoveAt(14);
details.Insert(0, entity);
GradeAndWeightRpc.InsertOrInsertDetail(entity);
GradeAndWeightRpc.UpdateOrInsertDetail(entity);
tempList.Enqueue(entity);
BindDetailGrid();
}
@ -511,12 +471,9 @@ namespace WeighAndGrading
if (entity.Finish)
return;
entity.Finish = true;
short technics = 1;
if (entity.Technics_Name == "烫褪")
technics = 0;
GradeAndWeightRpc.SetGradeFinish(entity.OrderDetail_ID, technics);
GradeAndWeightRpc.SetGradeFinish(entity.OrderDetail_ID, entity.Technics);
BindDataGrid();
if (technics == 0)
if (entity.Technics == 0)
{
FindRowSetSelected(maoEntity);
tangEntity = null;


+ 3
- 3
WeighAndGrading/GradeFrom.resx View File

@ -126,9 +126,6 @@
<metadata name="H_Index.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_Order.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_Technics.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -144,6 +141,9 @@
<metadata name="D_OrderDetail_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_Technics.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_Finish.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>


Loading…
Cancel
Save