diff --git a/BO/BO.csproj b/BO/BO.csproj index 6f5f4d6..2589ded 100644 --- a/BO/BO.csproj +++ b/BO/BO.csproj @@ -44,6 +44,7 @@ + @@ -51,11 +52,14 @@ + - + + + diff --git a/BO/BO/Bill/WeightBill/WeightBill.cs b/BO/BO/Bill/WeightBill/WeightBill.cs index 4d529f7..5b15ed4 100644 --- a/BO/BO/Bill/WeightBill/WeightBill.cs +++ b/BO/BO/Bill/WeightBill/WeightBill.cs @@ -1,49 +1,65 @@ -using System; +using Forks.EnterpriseServices.DomainObjects2; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using TSingSoft.WebPluginFramework; namespace BO.BO { - public class WeightBill + [Serializable] + public class WeightBill : SyncBill { - public string CreaterName { get; set; } + public long? AccountingUnit_ID { get; set; } + + public long? Department_ID { get; set; } + + public long? Employee_ID { get; set; } + + public string Employee_Name { get; set; } + + public DateTime? WeighTime { get; set; } + public long? Supplier_ID { get; set; } public string Supplier_Name { get; set; } + public long? Zone_ID { get; set; } + + public string Zone_Name { get; set; } + public short? PurchaseType_ID { get; set; } public string PurchaseType_Name { get; set; } - public DateTime? WeightTime { get; set; } - public long? Car_ID { get; set; } public string Car_Name { get; set; } - public long? Livestock_ID { get; set; } + public long? LiveVarieties_ID { get; set; } - public string Livestock_Name { get; set; } - - public long? Employee_ID { get; set; } - - public string Employee_Name { get; set; } + public string LiveVarieties_Name { get; set; } public long? HogGrade_ID { get; set; } public string HogGrade_Name { get; set; } - public long? Zone_ID { get; set; } - - public string Zone_Name { get; set; } - - public decimal? PenWeight { get; set; } + public decimal? ShackWeight { get; set; } - public decimal? PenPrice { get; set; } + public decimal? ShackPrice { get; set; } - public decimal? PenMoney { get; set; } + [NonDmoProperty] + public decimal? ShackMoney + { + get + { + var v = ShackPrice * ShackWeight; + if (v.HasValue) + return decimal.Round(v.Value, 2); + return null; + } + } public string AnimalTestNumber { get; set; } @@ -51,13 +67,47 @@ namespace BO.BO public string AnimalTestMan { get; set; } + public long? Inspector_ID { get; set; } + + public string Inspector_Name { get; set; } + public string Remark { get; set; } - public long? Inspector_ID { get; set; } - public long? Inspector_Name { get; set; } + private List _details = new List(); + public List 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)); } } + + private List _farmerDetails = new List(); + public List FarmerDetails { get { return _farmerDetails; } } + + public string FarmerNames + { + get + { + if (_farmerDetails.Any()) return string.Join(",", _farmerDetails.Select(x => x.Farmer_Name)); + return null; + } + } + + private List _houseDetails = new List(); + public List HouseDetails { get { return _houseDetails; } } + + public string HouseNames + { + get + { + if (_houseDetails.Any()) return string.Join(",", _houseDetails.Select(x => x.LiveColonyHouse_Name)); + return null; + } + } + + private List _sanctionDetails = new List(); + public List SanctionDetails { get { return _sanctionDetails; } } - // List _farmerDetails = new List(); - //public List FarmerDetails { get { return _farmerDetails; } } + public int SanctionNumber { get { return _sanctionDetails.Sum(x => (x.Number ?? 0)); } } } } diff --git a/BO/BO/Bill/WeightBill/WeightBill_AbnormalDetail.cs b/BO/BO/Bill/WeightBill/WeightBill_AbnormalDetail.cs deleted file mode 100644 index 493c08a..0000000 --- a/BO/BO/Bill/WeightBill/WeightBill_AbnormalDetail.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BO.BO -{ - public class WeightBill_AbnormalDetail - { - } -} diff --git a/BO/BO/Bill/WeightBill/WeightBill_Detail.cs b/BO/BO/Bill/WeightBill/WeightBill_Detail.cs index f174074..2546166 100644 --- a/BO/BO/Bill/WeightBill/WeightBill_Detail.cs +++ b/BO/BO/Bill/WeightBill/WeightBill_Detail.cs @@ -6,7 +6,19 @@ using System.Threading.Tasks; namespace BO.BO { - public class WeightBill_Detail + [Serializable] + public class WeightBill_Detail : SyncBase { + public long WeightBill_ID { get; set; } + + public int Index { get; set; } + + public int? Number { get; set; } + + public decimal? PiWeight { get; set; } + + public decimal? MaoWeight { get; set; } + + public decimal? Weight { get; set; } } } diff --git a/BO/BO/Bill/WeightBill/WeightBill_FarmerDetail.cs b/BO/BO/Bill/WeightBill/WeightBill_FarmerDetail.cs index 8847e98..e29b24e 100644 --- a/BO/BO/Bill/WeightBill/WeightBill_FarmerDetail.cs +++ b/BO/BO/Bill/WeightBill/WeightBill_FarmerDetail.cs @@ -6,8 +6,11 @@ using System.Threading.Tasks; namespace BO.BO { - public class WeightBill_FarmerDetail + [Serializable] + public class WeightBill_FarmerDetail : SyncBase { + public long WeightBill_ID { get; set; } + public int Index { get; set; } public long? Farmer_ID { get; set; } diff --git a/BO/BO/Bill/WeightBill/WeightBill_HouseDetail.cs b/BO/BO/Bill/WeightBill/WeightBill_HouseDetail.cs index ed895df..0a22406 100644 --- a/BO/BO/Bill/WeightBill/WeightBill_HouseDetail.cs +++ b/BO/BO/Bill/WeightBill/WeightBill_HouseDetail.cs @@ -6,7 +6,17 @@ using System.Threading.Tasks; namespace BO.BO { - public class WeightBill_HouseDetail + [Serializable] + public class WeightBill_HouseDetail : SyncBase { + public long WeightBill_ID { get; set; } + + public int Index { get; set; } + + public long? LiveColonyHouse_ID { get; set; } + + public long? LiveColonyHouse_Name { get; set; } + + public int? Number { get; set; } } } diff --git a/BO/BO/Bill/WeightBill/WeightBill_SanctionDetail.cs b/BO/BO/Bill/WeightBill/WeightBill_SanctionDetail.cs new file mode 100644 index 0000000..3f6377a --- /dev/null +++ b/BO/BO/Bill/WeightBill/WeightBill_SanctionDetail.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BO.BO +{ + [Serializable] + public class WeightBill_SanctionDetail : SyncBase + { + public long WeightBill_ID { get; set; } + + public int Index { get; set; } + + /// + /// 异常奖罚配置 + /// + public long? Sanction_ID { get; set; } + + /// + /// 异常项目ID + /// + public long? AbnormalItem_ID { get; set; } + + /// + /// 异常项目名称 + /// + public long? AbnormalItem_Name { get; set; } + + public int? Number { get; set; } + } +} diff --git a/BO/BO/SyncBase.cs b/BO/BO/SyncBase.cs new file mode 100644 index 0000000..ea43261 --- /dev/null +++ b/BO/BO/SyncBase.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BO.BO +{ + [Serializable] + public abstract class SyncBase + { + public long ID { get; set; } + + /// + /// 对应B3ID + /// + public long? B3ID { get; set; } + + /// + /// 删除状态 + /// + public bool DeleteState { get; set; } + } +} diff --git a/BO/BO/SyncBill.cs b/BO/BO/SyncBill.cs new file mode 100644 index 0000000..138fcf7 --- /dev/null +++ b/BO/BO/SyncBill.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BO.BO +{ + [Serializable] + public class SyncBill : SyncBase + { + /// + /// 单据创建人用户名 + /// + public string Creator { get; set; } + + /// + /// 单据是否完整可以上传 + /// + public bool FinishCreate { get; set; } + } +} diff --git a/BO/Utils/BillRpc/WeightBillRpc.cs b/BO/Utils/BillRpc/WeightBillRpc.cs index 9980562..24dec2e 100644 --- a/BO/Utils/BillRpc/WeightBillRpc.cs +++ b/BO/Utils/BillRpc/WeightBillRpc.cs @@ -15,32 +15,192 @@ namespace BO.Utils.BillRpc { const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/UploadBill"; var obj = new RpcObject("/MainSystem/B3ClientService/BO/WeightBill"); - obj.Set("CreaterName", bo.CreaterName); + if (bo.ID == 0) + { + obj.Set("Creator", ButcherAppContext.Context.UserConfig.UserName); + obj.Set("AccountingUnit_ID", ButcherAppContext.Context.UserConfig.AccountingUnit_ID); + obj.Set("Department_ID", ButcherAppContext.Context.UserConfig.Department_ID); + } + else + { + 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); + obj.Set("B3ID", bo.B3ID); + obj.Set("DeleteState", bo.DeleteState); + + //bill + obj.Set("FinishCreate", bo.FinishCreate); + obj.Set("Sync", false); + 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("WeightTime", bo.WeightTime); obj.Set("Car_ID", bo.Car_ID); obj.Set("Car_Name", bo.Car_Name); - obj.Set("Livestock_ID", bo.Livestock_ID); - obj.Set("Livestock_Name", bo.Livestock_Name); - obj.Set("Employee_ID", bo.Employee_ID); - obj.Set("Employee_Name", bo.Employee_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("Zone_ID", bo.Zone_ID); - obj.Set("Zone_Name", bo.Zone_Name); - obj.Set("PenWeight", bo.PenWeight); - obj.Set("PenPrice", bo.PenPrice); - obj.Set("PenMoney", bo.PenMoney); + obj.Set("ShackWeight", bo.ShackWeight); + obj.Set("ShackPrice", bo.ShackPrice); 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); + farmerDetils.Add(objDetail); + } + + obj.Set("FarmerDetails", farmerDetils); + + var result = RpcFacade.Call(method, obj); + bo.ID = result.Get("ID"); + var detailReturns = result.Get>("DetailBack"); + var rDetails = detailReturns[0].Get>("DetailBack"); + foreach (var item in rDetails) + { + var idx = Convert.ToInt32(item.Get("Flag")); + bo.Details.First(x => x.Index == idx).ID = item.Get("ID"); + } + var rFarmerDetails = detailReturns[1].Get>("DetailBack"); + foreach (var item in rFarmerDetails) + { + var idx = Convert.ToInt32(item.Get("Flag")); + bo.FarmerDetails.First(x => x.Index == idx).ID = item.Get("ID"); + } + + return true; + } + + public static bool Delete(long id) + { + const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/DeleteBill"; + return RpcFacade.Call(method, id); + } + + public static List GetWeightBillList() + { + const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetWeightBillList"; + var list = RpcFacade.Call>(method, DateTime.Today); + var result = new List(); + foreach (var obj in list) + { + var entity = new WeightBill(); + result.Add(entity); + entity.Creator = obj.Get("Creator"); + entity.AccountingUnit_ID = obj.Get("AccountingUnit_ID"); + entity.Department_ID = obj.Get("Department_ID"); + entity.ID = obj.Get("ID"); + entity.B3ID = obj.Get("B3ID"); + entity.DeleteState = false; + entity.FinishCreate = obj.Get("FinishCreate"); + entity.Employee_ID = obj.Get("Employee_ID"); + entity.Employee_Name = obj.Get("Employee_Name"); + entity.WeighTime = obj.Get("WeighTime"); + entity.Supplier_ID = obj.Get("Supplier_ID"); + entity.Supplier_Name = obj.Get("Supplier_Name"); + entity.Zone_ID = obj.Get("Zone_ID"); + entity.Zone_Name = obj.Get("Zone_Name"); + entity.PurchaseType_ID = obj.Get("PurchaseType_ID"); + entity.PurchaseType_Name = obj.Get("PurchaseType_Name"); + entity.Car_ID = obj.Get("Car_ID"); + entity.Car_Name = obj.Get("Car_Name"); + entity.LiveVarieties_ID = obj.Get("LiveVarieties_ID"); + entity.LiveVarieties_Name = obj.Get("LiveVarieties_Name"); + entity.HogGrade_ID = obj.Get("HogGrade_ID"); + entity.HogGrade_Name = obj.Get("HogGrade_Name"); + entity.ShackWeight = obj.Get("ShackWeight"); + entity.ShackPrice = obj.Get("ShackPrice"); + entity.AnimalTestNumber = obj.Get("AnimalTestNumber"); + entity.AnimalTestDate = obj.Get("AnimalTestDate"); + entity.AnimalTestMan = obj.Get("AnimalTestMan"); + entity.Remark = obj.Get("Remark"); + entity.Inspector_ID = obj.Get("Inspector_ID"); + entity.Inspector_Name = obj.Get("Inspector_Name"); + var details = obj.Get("Details"); + foreach (var detail in details) + { + var d = new WeightBill_Detail(); + d.DeleteState = detail.Get("DeleteState"); + if (d.DeleteState) + continue; + entity.Details.Add(d); + d.ID = detail.Get("ID"); + d.B3ID = detail.Get("B3ID"); + d.Index = detail.Get("Index"); + d.MaoWeight = detail.Get("MaoWeight"); + d.PiWeight = detail.Get("PiWeight"); + d.Number = detail.Get("Number"); + d.Weight = detail.Get("Weight"); + d.WeightBill_ID = detail.Get("WeightBill_ID"); + } - return RpcFacade.Call(method, obj); + var farmers = obj.Get("FarmerDetails"); + foreach (var detail in farmers) + { + var d = new WeightBill_FarmerDetail(); + d.DeleteState = detail.Get("DeleteState"); + if (d.DeleteState) + continue; + entity.FarmerDetails.Add(d); + d.ID = detail.Get("ID"); + d.B3ID = detail.Get("B3ID"); + d.Index = detail.Get("Index"); + d.Farmer_ID = detail.Get("Farmer_ID"); + d.Farmer_Name = detail.Get("Farmer_Name"); + d.Number = detail.Get("Number"); + d.WeightBill_ID = detail.Get("WeightBill_ID"); + } + } + return result; } } } diff --git a/ButcherManageClient/AppContext.cs b/BO/Utils/ButcherAppContext.cs similarity index 72% rename from ButcherManageClient/AppContext.cs rename to BO/Utils/ButcherAppContext.cs index ee2d7cb..d79120c 100644 --- a/ButcherManageClient/AppContext.cs +++ b/BO/Utils/ButcherAppContext.cs @@ -7,9 +7,9 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace ButcherManageClient +namespace BO.Utils { - public class AppContext + public class ButcherAppContext { private static string loginConfigPath = Application.StartupPath + "\\Config.xml"; public ServerUrlConfig UrlConfig @@ -24,13 +24,13 @@ namespace ButcherManageClient set; } - private AppContext() + private ButcherAppContext() { UrlConfig = new ServerUrlConfig(); UserConfig = new LoginUserInfo(); } - public static AppContext Context + public static ButcherAppContext Context { get { @@ -40,16 +40,16 @@ namespace ButcherManageClient } } - private static AppContext _appContext; - static AppContext CreateAppContext() + private static ButcherAppContext _appContext; + static ButcherAppContext CreateAppContext() { - var config = new AppContext(); + var config = new ButcherAppContext(); if (!File.Exists(loginConfigPath)) { XmlUtil.SerializerObjToFile(config, loginConfigPath); } else - config = XmlUtil.DeserializeFromFile(loginConfigPath); + config = XmlUtil.DeserializeFromFile(loginConfigPath); return config; } diff --git a/BWP.WinFormControl/UComboBox.cs b/BWP.WinFormControl/UComboBox.cs index 906097b..189eef5 100644 --- a/BWP.WinFormControl/UComboBox.cs +++ b/BWP.WinFormControl/UComboBox.cs @@ -120,6 +120,11 @@ namespace BWP.WinFormControl this.SelectedItem = new WordPair(displayValue, phyValue); } + public void Clear() + { + this.SelectedItem = null; + } + public bool IsEmpty { get { return SelectedValue == null; } diff --git a/ButcherManageClient/ButcherManageClient.csproj b/ButcherManageClient/ButcherManageClient.csproj index 9a4126b..6051e89 100644 --- a/ButcherManageClient/ButcherManageClient.csproj +++ b/ButcherManageClient/ButcherManageClient.csproj @@ -61,7 +61,6 @@ - Form diff --git a/ButcherManageClient/Login.cs b/ButcherManageClient/Login.cs index c8c41da..3ecf207 100644 --- a/ButcherManageClient/Login.cs +++ b/ButcherManageClient/Login.cs @@ -21,16 +21,16 @@ namespace ButcherManageClient { if (rpcFacadeInited) return; - if (string.IsNullOrEmpty(AppContext.Context.UrlConfig.ServerUrl)) + if (string.IsNullOrEmpty(ButcherAppContext.Context.UrlConfig.ServerUrl)) throw new Exception("请先设置服务器地址"); - RpcFacade.Init(AppContext.Context.UrlConfig.ServerUrl, "B3ButcherManageClient"); + RpcFacade.Init(ButcherAppContext.Context.UrlConfig.ServerUrl, "B3ButcherManageClient"); rpcFacadeInited = true; } public Login() { InitializeComponent(); - userNameTxt.Text = AppContext.Context.UserConfig.UserName; + userNameTxt.Text = ButcherAppContext.Context.UserConfig.UserName; pwdTxt.Text = "123"; } @@ -49,8 +49,8 @@ namespace ButcherManageClient IniteRpcFacade(); await Task.Factory.StartNew(() => RpcFacade.Login(username, pwd)); - LoginRpcUtil.FillUserEmpInfo(username, AppContext.Context.UserConfig); - AppContext.Context.Save(); + LoginRpcUtil.FillUserEmpInfo(username, ButcherAppContext.Context.UserConfig); + ButcherAppContext.Context.Save(); var form = AfterLoginUtil.CreateForm("_1"); if (form == null) throw new Exception("权限不符"); diff --git a/ButcherManageClient/SettingForm.cs b/ButcherManageClient/SettingForm.cs index 2e4e5cc..5ab7a14 100644 --- a/ButcherManageClient/SettingForm.cs +++ b/ButcherManageClient/SettingForm.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using BO.Utils; namespace ButcherManageClient { @@ -15,7 +16,7 @@ namespace ButcherManageClient public SettingForm() { InitializeComponent(); - uTextBoxWithPad1.Text = AppContext.Context.UrlConfig.ServerUrl; + uTextBoxWithPad1.Text = ButcherAppContext.Context.UrlConfig.ServerUrl; } private void cancelBtn_Click(object sender, EventArgs e) @@ -25,8 +26,8 @@ namespace ButcherManageClient private void saveBtn_Click(object sender, EventArgs e) { - AppContext.Context.UrlConfig.ServerUrl = this.uTextBoxWithPad1.Text.Trim(); - AppContext.Context.Save(); + ButcherAppContext.Context.UrlConfig.ServerUrl = this.uTextBoxWithPad1.Text.Trim(); + ButcherAppContext.Context.Save(); MessageBox.Show("设置保存成功!"); } } diff --git a/ButcherWeight/WeightForm.Designer.cs b/ButcherWeight/WeightForm.Designer.cs index 59a7f37..212973f 100644 --- a/ButcherWeight/WeightForm.Designer.cs +++ b/ButcherWeight/WeightForm.Designer.cs @@ -28,14 +28,39 @@ /// private void InitializeComponent() { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.commitBtn = new System.Windows.Forms.Button(); this.readPiBtn = new System.Windows.Forms.Button(); this.readMaoBtn = new System.Windows.Forms.Button(); + this.weightControl = new BWP.WinFormControl.WeightControl(); this.panel2 = new System.Windows.Forms.Panel(); + this.zoneSelect = new BWP.WinFormControl.UComboBox(); + this.hogGradeSelect = new BWP.WinFormControl.UComboBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); + this.employeeSelect = new BWP.WinFormControl.UComboBox(); + this.carSelect = new BWP.WinFormControl.UComboBox(); + this.liveVarietiesSelect = new BWP.WinFormControl.UComboBox(); + this.purchaseTypeSelect = new BWP.WinFormControl.UComboBox(); + this.supplierSelect = new BWP.WinFormControl.UComboBox(); this.testManInput = new System.Windows.Forms.TextBox(); + this.testTimeInput = new BWP.WinFormControl.UDatePicker(); + this.weightTimeSelect = new BWP.WinFormControl.UDatePicker(); this.label19 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label(); @@ -57,39 +82,18 @@ this.label7 = new System.Windows.Forms.Label(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.panel3 = new System.Windows.Forms.Panel(); + this.farmerSelect = new BWP.WinFormControl.UComboBox(); this.label3 = new System.Windows.Forms.Label(); this.farmerGrid = new System.Windows.Forms.DataGridView(); - this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.label18 = new System.Windows.Forms.Label(); this.weightGrid = new System.Windows.Forms.DataGridView(); - this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.panel4 = new System.Windows.Forms.Panel(); this.houseGird = new System.Windows.Forms.DataGridView(); - this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.panel5 = new System.Windows.Forms.Panel(); this.panel8 = new System.Windows.Forms.Panel(); this.abnormalGrid = new System.Windows.Forms.DataGridView(); - this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.panel6 = new System.Windows.Forms.Panel(); this.billGrid = new System.Windows.Forms.DataGridView(); - this.Column13 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column14 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column15 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column16 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column17 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column18 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column19 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column20 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column21 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column22 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.panel7 = new System.Windows.Forms.Panel(); this.exitBtn = new System.Windows.Forms.Button(); this.deleteBtn = new System.Windows.Forms.Button(); @@ -99,17 +103,46 @@ this.label15 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label(); this.label17 = new System.Windows.Forms.Label(); - this.farmerSelect = new BWP.WinFormControl.UComboBox(); - this.zoneSelect = new BWP.WinFormControl.UComboBox(); - this.hogGradeSelect = new BWP.WinFormControl.UComboBox(); - this.employeeSelect = new BWP.WinFormControl.UComboBox(); - this.carSelect = new BWP.WinFormControl.UComboBox(); - this.liveVarietiesSelect = new BWP.WinFormControl.UComboBox(); - this.purchaseTypeSelect = new BWP.WinFormControl.UComboBox(); - this.supplierSelect = new BWP.WinFormControl.UComboBox(); - this.testTimeInput = new BWP.WinFormControl.UDatePicker(); - this.weightTimeSelect = new BWP.WinFormControl.UDatePicker(); - this.weightControl = new BWP.WinFormControl.WeightControl(); + 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.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.M_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_Zone_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_FarmerNames = 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.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.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.panel1.SuspendLayout(); this.panel2.SuspendLayout(); this.panel3.SuspendLayout(); @@ -170,6 +203,14 @@ this.readMaoBtn.UseVisualStyleBackColor = true; this.readMaoBtn.Click += new System.EventHandler(this.readMaoBtn_Click); // + // weightControl + // + this.weightControl.Location = new System.Drawing.Point(0, 0); + this.weightControl.Margin = new System.Windows.Forms.Padding(5); + this.weightControl.Name = "weightControl"; + this.weightControl.Size = new System.Drawing.Size(155, 94); + this.weightControl.TabIndex = 0; + // // panel2 // this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -210,6 +251,32 @@ this.panel2.Size = new System.Drawing.Size(1251, 170); this.panel2.TabIndex = 2; // + // zoneSelect + // + this.zoneSelect.CodeArgs = null; + this.zoneSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.zoneSelect.EnableTopItem = true; + this.zoneSelect.Font = new System.Drawing.Font("宋体", 14F); + this.zoneSelect.FormattingEnabled = true; + this.zoneSelect.Location = new System.Drawing.Point(348, 129); + this.zoneSelect.Name = "zoneSelect"; + this.zoneSelect.Range = 10; + this.zoneSelect.Size = new System.Drawing.Size(135, 30); + this.zoneSelect.TabIndex = 37; + // + // hogGradeSelect + // + this.hogGradeSelect.CodeArgs = null; + this.hogGradeSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.hogGradeSelect.EnableTopItem = true; + this.hogGradeSelect.Font = new System.Drawing.Font("宋体", 14F); + this.hogGradeSelect.FormattingEnabled = true; + this.hogGradeSelect.Location = new System.Drawing.Point(103, 129); + this.hogGradeSelect.Name = "hogGradeSelect"; + this.hogGradeSelect.Range = 10; + this.hogGradeSelect.Size = new System.Drawing.Size(135, 30); + this.hogGradeSelect.TabIndex = 36; + // // label2 // this.label2.AutoSize = true; @@ -230,6 +297,71 @@ this.label1.TabIndex = 34; this.label1.Text = "毛猪等级"; // + // employeeSelect + // + this.employeeSelect.CodeArgs = null; + this.employeeSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.employeeSelect.EnableTopItem = true; + this.employeeSelect.Font = new System.Drawing.Font("宋体", 14F); + this.employeeSelect.FormattingEnabled = true; + this.employeeSelect.Location = new System.Drawing.Point(348, 88); + this.employeeSelect.Name = "employeeSelect"; + this.employeeSelect.Range = 10; + this.employeeSelect.Size = new System.Drawing.Size(135, 30); + this.employeeSelect.TabIndex = 33; + // + // carSelect + // + this.carSelect.CodeArgs = null; + this.carSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.carSelect.EnableTopItem = true; + this.carSelect.Font = new System.Drawing.Font("宋体", 14F); + this.carSelect.FormattingEnabled = true; + this.carSelect.Location = new System.Drawing.Point(348, 49); + this.carSelect.Name = "carSelect"; + this.carSelect.Range = 10; + this.carSelect.Size = new System.Drawing.Size(135, 30); + this.carSelect.TabIndex = 32; + // + // liveVarietiesSelect + // + this.liveVarietiesSelect.CodeArgs = null; + this.liveVarietiesSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.liveVarietiesSelect.EnableTopItem = true; + this.liveVarietiesSelect.Font = new System.Drawing.Font("宋体", 14F); + this.liveVarietiesSelect.FormattingEnabled = true; + this.liveVarietiesSelect.Location = new System.Drawing.Point(103, 88); + this.liveVarietiesSelect.Name = "liveVarietiesSelect"; + this.liveVarietiesSelect.Range = 10; + this.liveVarietiesSelect.Size = new System.Drawing.Size(135, 30); + this.liveVarietiesSelect.TabIndex = 31; + // + // purchaseTypeSelect + // + this.purchaseTypeSelect.CodeArgs = null; + this.purchaseTypeSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.purchaseTypeSelect.EnableTopItem = true; + this.purchaseTypeSelect.Font = new System.Drawing.Font("宋体", 14F); + this.purchaseTypeSelect.FormattingEnabled = true; + this.purchaseTypeSelect.Location = new System.Drawing.Point(348, 8); + this.purchaseTypeSelect.Name = "purchaseTypeSelect"; + this.purchaseTypeSelect.Range = 10; + this.purchaseTypeSelect.Size = new System.Drawing.Size(135, 30); + this.purchaseTypeSelect.TabIndex = 30; + // + // supplierSelect + // + this.supplierSelect.CodeArgs = null; + this.supplierSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.supplierSelect.EnableTopItem = true; + this.supplierSelect.Font = new System.Drawing.Font("宋体", 14F); + this.supplierSelect.FormattingEnabled = true; + this.supplierSelect.Location = new System.Drawing.Point(103, 8); + this.supplierSelect.Name = "supplierSelect"; + this.supplierSelect.Range = 10; + this.supplierSelect.Size = new System.Drawing.Size(135, 30); + this.supplierSelect.TabIndex = 29; + // // testManInput // this.testManInput.Font = new System.Drawing.Font("宋体", 14F); @@ -238,6 +370,34 @@ this.testManInput.Size = new System.Drawing.Size(135, 29); this.testManInput.TabIndex = 28; // + // testTimeInput + // + this.testTimeInput.BackColor = System.Drawing.Color.White; + this.testTimeInput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.testTimeInput.Date = new System.DateTime(2017, 9, 7, 0, 0, 0, 0); + this.testTimeInput.Font = new System.Drawing.Font("宋体", 15F); + this.testTimeInput.Location = new System.Drawing.Point(1100, 51); + this.testTimeInput.Name = "testTimeInput"; + this.testTimeInput.Size = new System.Drawing.Size(135, 30); + this.testTimeInput.TabIndex = 27; + this.testTimeInput.Text = "2017/09/07"; + this.testTimeInput.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.testTimeInput.Type = BWP.WinFormControl.DateTimeType.Date; + // + // weightTimeSelect + // + this.weightTimeSelect.BackColor = System.Drawing.Color.White; + this.weightTimeSelect.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.weightTimeSelect.Date = new System.DateTime(2017, 9, 7, 13, 57, 53, 0); + this.weightTimeSelect.Font = new System.Drawing.Font("宋体", 9F); + this.weightTimeSelect.Location = new System.Drawing.Point(103, 49); + this.weightTimeSelect.Name = "weightTimeSelect"; + this.weightTimeSelect.Size = new System.Drawing.Size(135, 30); + this.weightTimeSelect.TabIndex = 26; + this.weightTimeSelect.Text = "2017/09/07 13:57:53"; + this.weightTimeSelect.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.weightTimeSelect.Type = BWP.WinFormControl.DateTimeType.DateTime; + // // label19 // this.label19.AutoSize = true; @@ -455,6 +615,20 @@ this.panel3.Size = new System.Drawing.Size(402, 219); this.panel3.TabIndex = 3; // + // farmerSelect + // + this.farmerSelect.CodeArgs = null; + this.farmerSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.farmerSelect.EnableTopItem = true; + this.farmerSelect.Font = new System.Drawing.Font("宋体", 12F); + this.farmerSelect.FormattingEnabled = true; + this.farmerSelect.Location = new System.Drawing.Point(190, 91); + this.farmerSelect.Name = "farmerSelect"; + this.farmerSelect.Range = 10; + this.farmerSelect.Size = new System.Drawing.Size(135, 27); + this.farmerSelect.TabIndex = 38; + this.farmerSelect.SelectedIndexChanged += new System.EventHandler(this.farmerSelect_SelectedIndexChanged); + // // label3 // this.label3.AutoSize = true; @@ -468,35 +642,42 @@ // farmerGrid // this.farmerGrid.AllowUserToAddRows = false; - this.farmerGrid.AllowUserToDeleteRows = false; - this.farmerGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.farmerGrid.AllowUserToResizeColumns = false; + this.farmerGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.Silver; + this.farmerGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.farmerGrid.BackgroundColor = System.Drawing.Color.White; + this.farmerGrid.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.SingleHorizontal; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.farmerGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.farmerGrid.ColumnHeadersHeight = 24; + this.farmerGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.farmerGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Column4, - this.Column5, - this.Column6}); + this.F_ID, + this.F_B3ID, + this.F_WeightBill_ID, + this.F_Farmer_ID, + this.F_Index, + this.F_Farmer_Name, + this.F_Number}); this.farmerGrid.Location = new System.Drawing.Point(0, 119); + this.farmerGrid.MultiSelect = false; this.farmerGrid.Name = "farmerGrid"; + this.farmerGrid.RowHeadersVisible = false; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.DodgerBlue; + this.farmerGrid.RowsDefaultCellStyle = dataGridViewCellStyle3; + this.farmerGrid.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Empty; this.farmerGrid.RowTemplate.Height = 23; + this.farmerGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.farmerGrid.Size = new System.Drawing.Size(400, 98); this.farmerGrid.TabIndex = 8; // - // Column4 - // - this.Column4.HeaderText = "序号"; - this.Column4.Name = "Column4"; - this.Column4.ReadOnly = true; - // - // Column5 - // - this.Column5.HeaderText = "养殖户"; - this.Column5.Name = "Column5"; - this.Column5.ReadOnly = true; - // - // Column6 - // - this.Column6.HeaderText = "头数"; - this.Column6.Name = "Column6"; - // // label18 // this.label18.AutoSize = true; @@ -511,35 +692,44 @@ // weightGrid // this.weightGrid.AllowUserToAddRows = false; - this.weightGrid.AllowUserToDeleteRows = false; - this.weightGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.weightGrid.AllowUserToResizeColumns = false; + this.weightGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.Silver; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.Empty; + this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + this.weightGrid.BackgroundColor = System.Drawing.Color.White; + this.weightGrid.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.SingleHorizontal; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; + this.weightGrid.ColumnHeadersHeight = 24; + this.weightGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.weightGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Column1, - this.Column2, - this.Column3}); + this.D_ID, + this.D_B3ID, + this.D_WeightBill_ID, + this.D_Index, + this.D_Number, + this.D_MaoWeight, + this.D_PiWeight, + this.D_Weight}); this.weightGrid.Location = new System.Drawing.Point(0, 0); + this.weightGrid.MultiSelect = false; this.weightGrid.Name = "weightGrid"; + this.weightGrid.RowHeadersVisible = false; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.DodgerBlue; + this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle6; + this.weightGrid.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Empty; this.weightGrid.RowTemplate.Height = 23; + this.weightGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.weightGrid.Size = new System.Drawing.Size(400, 90); this.weightGrid.TabIndex = 0; // - // Column1 - // - this.Column1.HeaderText = "序号"; - this.Column1.Name = "Column1"; - this.Column1.ReadOnly = true; - // - // Column2 - // - this.Column2.HeaderText = "头数"; - this.Column2.Name = "Column2"; - // - // Column3 - // - this.Column3.HeaderText = "重量"; - this.Column3.Name = "Column3"; - this.Column3.ReadOnly = true; - // // panel4 // this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -553,34 +743,42 @@ // this.houseGird.AllowUserToAddRows = false; this.houseGird.AllowUserToDeleteRows = false; - this.houseGird.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.houseGird.AllowUserToResizeColumns = false; + this.houseGird.AllowUserToResizeRows = false; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.Silver; + this.houseGird.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; + this.houseGird.BackgroundColor = System.Drawing.Color.White; + this.houseGird.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.SingleHorizontal; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.houseGird.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; + this.houseGird.ColumnHeadersHeight = 24; + this.houseGird.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.houseGird.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Column7, - this.Column8, - this.Column9}); + this.H_ID, + this.H_B3ID, + this.H_WeightBill_ID, + this.H_LiveColonyHouse_ID, + this.H_Index, + this.H_LiveColonyHouse_Name, + this.H_Number}); this.houseGird.Location = new System.Drawing.Point(0, 0); + this.houseGird.MultiSelect = false; this.houseGird.Name = "houseGird"; + this.houseGird.RowHeadersVisible = false; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.DodgerBlue; + this.houseGird.RowsDefaultCellStyle = dataGridViewCellStyle9; + this.houseGird.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Empty; this.houseGird.RowTemplate.Height = 23; + this.houseGird.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.houseGird.Size = new System.Drawing.Size(400, 90); this.houseGird.TabIndex = 1; // - // Column7 - // - this.Column7.HeaderText = "序号"; - this.Column7.Name = "Column7"; - this.Column7.ReadOnly = true; - // - // Column8 - // - this.Column8.HeaderText = "圈舍"; - this.Column8.Name = "Column8"; - this.Column8.ReadOnly = true; - // - // Column9 - // - this.Column9.HeaderText = "入圈头数"; - this.Column9.Name = "Column9"; - // // panel5 // this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -603,34 +801,42 @@ // this.abnormalGrid.AllowUserToAddRows = false; this.abnormalGrid.AllowUserToDeleteRows = false; - this.abnormalGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.abnormalGrid.AllowUserToResizeColumns = false; + this.abnormalGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.Silver; + this.abnormalGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10; + this.abnormalGrid.BackgroundColor = System.Drawing.Color.White; + this.abnormalGrid.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.SingleHorizontal; + dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.abnormalGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11; + this.abnormalGrid.ColumnHeadersHeight = 24; + this.abnormalGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.abnormalGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Column10, - this.Column11, - this.Column12}); + this.S_ID, + this.S_B3ID, + this.S_WeightBill_ID, + this.S_Sanction_ID, + this.S_AbnormalItem_ID, + this.S_Index, + this.S_AbnormalItem_Name, + this.S_Number}); this.abnormalGrid.Location = new System.Drawing.Point(0, 0); + this.abnormalGrid.MultiSelect = false; this.abnormalGrid.Name = "abnormalGrid"; + this.abnormalGrid.RowHeadersVisible = false; + dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.DodgerBlue; + this.abnormalGrid.RowsDefaultCellStyle = dataGridViewCellStyle12; this.abnormalGrid.RowTemplate.Height = 23; + this.abnormalGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.abnormalGrid.Size = new System.Drawing.Size(400, 90); this.abnormalGrid.TabIndex = 1; // - // Column10 - // - this.Column10.HeaderText = "序号"; - this.Column10.Name = "Column10"; - this.Column10.ReadOnly = true; - // - // Column11 - // - this.Column11.HeaderText = "异常项目"; - this.Column11.Name = "Column11"; - this.Column11.ReadOnly = true; - // - // Column12 - // - this.Column12.HeaderText = "头数"; - this.Column12.Name = "Column12"; - // // panel6 // this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -644,85 +850,46 @@ // this.billGrid.AllowUserToAddRows = false; this.billGrid.AllowUserToDeleteRows = false; - this.billGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.billGrid.AllowUserToResizeColumns = false; + this.billGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle13.BackColor = System.Drawing.Color.Silver; + this.billGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13; + this.billGrid.BackgroundColor = System.Drawing.Color.White; + this.billGrid.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.SingleHorizontal; + dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.billGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14; + this.billGrid.ColumnHeadersHeight = 24; + this.billGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.billGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Column13, - this.Column14, - this.Column15, - this.Column16, - this.Column17, - this.Column18, - this.Column19, - this.Column20, - this.Column21, - this.Column22}); + this.M_ID, + this.M_B3ID, + this.M_Supplier_Name, + this.M_Zone_Name, + this.M_FarmerNames, + this.M_PurchaseType_Name, + this.M_Number, + this.M_Weight, + this.M_HouseNames, + this.M_SanctionNumber}); this.billGrid.Location = new System.Drawing.Point(0, 0); + this.billGrid.MultiSelect = false; this.billGrid.Name = "billGrid"; this.billGrid.ReadOnly = true; + this.billGrid.RowHeadersVisible = false; + dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.DodgerBlue; + this.billGrid.RowsDefaultCellStyle = dataGridViewCellStyle15; + this.billGrid.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Empty; this.billGrid.RowTemplate.Height = 23; + this.billGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.billGrid.Size = new System.Drawing.Size(1250, 234); this.billGrid.TabIndex = 0; // - // Column13 - // - this.Column13.HeaderText = "过磅单号"; - this.Column13.Name = "Column13"; - this.Column13.ReadOnly = true; - // - // Column14 - // - this.Column14.HeaderText = "供应商"; - this.Column14.Name = "Column14"; - this.Column14.ReadOnly = true; - // - // Column15 - // - this.Column15.HeaderText = "来源地"; - this.Column15.Name = "Column15"; - this.Column15.ReadOnly = true; - // - // Column16 - // - this.Column16.HeaderText = "收购类型"; - this.Column16.Name = "Column16"; - this.Column16.ReadOnly = true; - // - // Column17 - // - this.Column17.HeaderText = "收购头数"; - this.Column17.Name = "Column17"; - this.Column17.ReadOnly = true; - // - // Column18 - // - this.Column18.HeaderText = "收购重量"; - this.Column18.Name = "Column18"; - this.Column18.ReadOnly = true; - // - // Column19 - // - this.Column19.HeaderText = "圈舍"; - this.Column19.Name = "Column19"; - this.Column19.ReadOnly = true; - // - // Column20 - // - this.Column20.HeaderText = "建议工艺"; - this.Column20.Name = "Column20"; - this.Column20.ReadOnly = true; - // - // Column21 - // - this.Column21.HeaderText = "异常明细"; - this.Column21.Name = "Column21"; - this.Column21.ReadOnly = true; - // - // Column22 - // - this.Column22.HeaderText = "养殖户"; - this.Column22.Name = "Column22"; - this.Column22.ReadOnly = true; - // // panel7 // this.panel7.Controls.Add(this.exitBtn); @@ -819,146 +986,304 @@ this.label17.TabIndex = 8; this.label17.Text = "异常明细"; // - // farmerSelect + // F_ID // - this.farmerSelect.CodeArgs = null; - this.farmerSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.farmerSelect.EnableTopItem = true; - this.farmerSelect.Font = new System.Drawing.Font("宋体", 13F); - this.farmerSelect.FormattingEnabled = true; - this.farmerSelect.Location = new System.Drawing.Point(190, 91); - this.farmerSelect.Name = "farmerSelect"; - this.farmerSelect.Range = 10; - this.farmerSelect.Size = new System.Drawing.Size(135, 28); - this.farmerSelect.TabIndex = 38; - this.farmerSelect.SelectedIndexChanged += new System.EventHandler(this.farmerSelect_SelectedIndexChanged); + this.F_ID.DataPropertyName = "ID"; + this.F_ID.HeaderText = "ID"; + this.F_ID.Name = "F_ID"; + this.F_ID.Visible = false; // - // zoneSelect + // F_B3ID // - this.zoneSelect.CodeArgs = null; - this.zoneSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.zoneSelect.EnableTopItem = true; - this.zoneSelect.Font = new System.Drawing.Font("宋体", 14F); - this.zoneSelect.FormattingEnabled = true; - this.zoneSelect.Location = new System.Drawing.Point(348, 129); - this.zoneSelect.Name = "zoneSelect"; - this.zoneSelect.Range = 10; - this.zoneSelect.Size = new System.Drawing.Size(135, 30); - this.zoneSelect.TabIndex = 37; + this.F_B3ID.DataPropertyName = "B3ID"; + this.F_B3ID.HeaderText = "B3ID"; + this.F_B3ID.Name = "F_B3ID"; + this.F_B3ID.Visible = false; // - // hogGradeSelect + // F_WeightBill_ID // - this.hogGradeSelect.CodeArgs = null; - this.hogGradeSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.hogGradeSelect.EnableTopItem = true; - this.hogGradeSelect.Font = new System.Drawing.Font("宋体", 14F); - this.hogGradeSelect.FormattingEnabled = true; - this.hogGradeSelect.Location = new System.Drawing.Point(103, 129); - this.hogGradeSelect.Name = "hogGradeSelect"; - this.hogGradeSelect.Range = 10; - this.hogGradeSelect.Size = new System.Drawing.Size(135, 30); - this.hogGradeSelect.TabIndex = 36; + 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; // - // employeeSelect + // F_Farmer_ID // - this.employeeSelect.CodeArgs = null; - this.employeeSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.employeeSelect.EnableTopItem = true; - this.employeeSelect.Font = new System.Drawing.Font("宋体", 14F); - this.employeeSelect.FormattingEnabled = true; - this.employeeSelect.Location = new System.Drawing.Point(348, 88); - this.employeeSelect.Name = "employeeSelect"; - this.employeeSelect.Range = 10; - this.employeeSelect.Size = new System.Drawing.Size(135, 30); - this.employeeSelect.TabIndex = 33; + 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; // - // carSelect + // F_Index // - this.carSelect.CodeArgs = null; - this.carSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.carSelect.EnableTopItem = true; - this.carSelect.Font = new System.Drawing.Font("宋体", 14F); - this.carSelect.FormattingEnabled = true; - this.carSelect.Location = new System.Drawing.Point(348, 49); - this.carSelect.Name = "carSelect"; - this.carSelect.Range = 10; - this.carSelect.Size = new System.Drawing.Size(135, 30); - this.carSelect.TabIndex = 32; + 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; // - // liveVarietiesSelect + // F_Farmer_Name // - this.liveVarietiesSelect.CodeArgs = null; - this.liveVarietiesSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.liveVarietiesSelect.EnableTopItem = true; - this.liveVarietiesSelect.Font = new System.Drawing.Font("宋体", 14F); - this.liveVarietiesSelect.FormattingEnabled = true; - this.liveVarietiesSelect.Location = new System.Drawing.Point(103, 88); - this.liveVarietiesSelect.Name = "liveVarietiesSelect"; - this.liveVarietiesSelect.Range = 10; - this.liveVarietiesSelect.Size = new System.Drawing.Size(135, 30); - this.liveVarietiesSelect.TabIndex = 31; + 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 = 150; // - // purchaseTypeSelect + // F_Number // - this.purchaseTypeSelect.CodeArgs = null; - this.purchaseTypeSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.purchaseTypeSelect.EnableTopItem = true; - this.purchaseTypeSelect.Font = new System.Drawing.Font("宋体", 14F); - this.purchaseTypeSelect.FormattingEnabled = true; - this.purchaseTypeSelect.Location = new System.Drawing.Point(348, 8); - this.purchaseTypeSelect.Name = "purchaseTypeSelect"; - this.purchaseTypeSelect.Range = 10; - this.purchaseTypeSelect.Size = new System.Drawing.Size(135, 30); - this.purchaseTypeSelect.TabIndex = 30; + this.F_Number.DataPropertyName = "Number"; + this.F_Number.HeaderText = "头数"; + this.F_Number.Name = "F_Number"; + this.F_Number.Width = 130; // - // supplierSelect + // D_ID // - this.supplierSelect.CodeArgs = null; - this.supplierSelect.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.supplierSelect.EnableTopItem = true; - this.supplierSelect.Font = new System.Drawing.Font("宋体", 14F); - this.supplierSelect.FormattingEnabled = true; - this.supplierSelect.Location = new System.Drawing.Point(103, 8); - this.supplierSelect.Name = "supplierSelect"; - this.supplierSelect.Range = 10; - this.supplierSelect.Size = new System.Drawing.Size(135, 30); - this.supplierSelect.TabIndex = 29; + this.D_ID.DataPropertyName = "ID"; + this.D_ID.HeaderText = "ID"; + this.D_ID.Name = "D_ID"; + this.D_ID.Visible = false; // - // testTimeInput + // D_B3ID // - this.testTimeInput.BackColor = System.Drawing.Color.White; - this.testTimeInput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.testTimeInput.Date = new System.DateTime(2017, 9, 6, 0, 0, 0, 0); - this.testTimeInput.Font = new System.Drawing.Font("宋体", 15F); - this.testTimeInput.Location = new System.Drawing.Point(1100, 51); - this.testTimeInput.Name = "testTimeInput"; - this.testTimeInput.Size = new System.Drawing.Size(135, 30); - this.testTimeInput.TabIndex = 27; - this.testTimeInput.Text = "2017/09/06"; - this.testTimeInput.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.testTimeInput.Type = BWP.WinFormControl.DateTimeType.Date; + this.D_B3ID.DataPropertyName = "B3ID"; + this.D_B3ID.HeaderText = "B3ID"; + this.D_B3ID.Name = "D_B3ID"; + this.D_B3ID.Visible = false; // - // weightTimeSelect + // D_WeightBill_ID // - this.weightTimeSelect.BackColor = System.Drawing.Color.White; - this.weightTimeSelect.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.weightTimeSelect.Date = new System.DateTime(2017, 9, 6, 20, 46, 44, 0); - this.weightTimeSelect.Font = new System.Drawing.Font("宋体", 9F); - this.weightTimeSelect.Location = new System.Drawing.Point(103, 49); - this.weightTimeSelect.Name = "weightTimeSelect"; - this.weightTimeSelect.Size = new System.Drawing.Size(135, 30); - this.weightTimeSelect.TabIndex = 26; - this.weightTimeSelect.Text = "2017/09/06 20:46:44"; - this.weightTimeSelect.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.weightTimeSelect.Type = BWP.WinFormControl.DateTimeType.DateTime; + 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; // - // weightControl + // D_Index // - this.weightControl.Location = new System.Drawing.Point(0, 0); - this.weightControl.Margin = new System.Windows.Forms.Padding(5); - this.weightControl.Name = "weightControl"; - this.weightControl.Size = new System.Drawing.Size(155, 94); - this.weightControl.TabIndex = 0; + 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"; + 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"; + 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"; + this.D_Weight.HeaderText = "重量"; + this.D_Weight.Name = "D_Weight"; + this.D_Weight.ReadOnly = true; + this.D_Weight.Width = 88; + // + // 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_B3ID + // + this.M_B3ID.DataPropertyName = "B3ID"; + this.M_B3ID.HeaderText = "过磅单号"; + this.M_B3ID.Name = "M_B3ID"; + this.M_B3ID.ReadOnly = true; + this.M_B3ID.Width = 110; + // + // 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 = 150; + // + // M_Zone_Name + // + this.M_Zone_Name.DataPropertyName = "Zone_Name"; + this.M_Zone_Name.HeaderText = "来源地"; + this.M_Zone_Name.Name = "M_Zone_Name"; + this.M_Zone_Name.ReadOnly = true; + this.M_Zone_Name.Width = 130; + // + // M_FarmerNames + // + this.M_FarmerNames.DataPropertyName = "FarmerNames"; + this.M_FarmerNames.HeaderText = "养殖户"; + this.M_FarmerNames.Name = "M_FarmerNames"; + this.M_FarmerNames.ReadOnly = true; + this.M_FarmerNames.Width = 130; + // + // 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 = 130; + // + // 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 = 130; + // + // M_Weight + // + this.M_Weight.DataPropertyName = "Weight"; + this.M_Weight.HeaderText = "收购重量"; + this.M_Weight.Name = "M_Weight"; + this.M_Weight.ReadOnly = true; + this.M_Weight.Width = 130; + // + // 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 = 200; + // + // M_SanctionNumber + // + this.M_SanctionNumber.DataPropertyName = "SanctionNumber"; + this.M_SanctionNumber.HeaderText = "异常明细"; + this.M_SanctionNumber.Name = "M_SanctionNumber"; + this.M_SanctionNumber.ReadOnly = true; + this.M_SanctionNumber.Width = 130; + // + // 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; + // + // 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; // // WeightForm // @@ -1032,34 +1357,12 @@ private System.Windows.Forms.Button refreshBtn; private System.Windows.Forms.Button printBtn; private System.Windows.Forms.DataGridView farmerGrid; - private System.Windows.Forms.DataGridViewTextBoxColumn Column4; - private System.Windows.Forms.DataGridViewTextBoxColumn Column5; - private System.Windows.Forms.DataGridViewTextBoxColumn Column6; private System.Windows.Forms.Label label18; private System.Windows.Forms.DataGridView weightGrid; - private System.Windows.Forms.DataGridViewTextBoxColumn Column1; - private System.Windows.Forms.DataGridViewTextBoxColumn Column2; - private System.Windows.Forms.DataGridViewTextBoxColumn Column3; private System.Windows.Forms.DataGridView houseGird; - private System.Windows.Forms.DataGridViewTextBoxColumn Column7; - private System.Windows.Forms.DataGridViewTextBoxColumn Column8; - private System.Windows.Forms.DataGridViewTextBoxColumn Column9; private System.Windows.Forms.Panel panel8; private System.Windows.Forms.DataGridView abnormalGrid; - private System.Windows.Forms.DataGridViewTextBoxColumn Column10; - private System.Windows.Forms.DataGridViewTextBoxColumn Column11; - private System.Windows.Forms.DataGridViewTextBoxColumn Column12; private System.Windows.Forms.DataGridView billGrid; - private System.Windows.Forms.DataGridViewTextBoxColumn Column13; - private System.Windows.Forms.DataGridViewTextBoxColumn Column14; - private System.Windows.Forms.DataGridViewTextBoxColumn Column15; - private System.Windows.Forms.DataGridViewTextBoxColumn Column16; - private System.Windows.Forms.DataGridViewTextBoxColumn Column17; - private System.Windows.Forms.DataGridViewTextBoxColumn Column18; - private System.Windows.Forms.DataGridViewTextBoxColumn Column19; - private System.Windows.Forms.DataGridViewTextBoxColumn Column20; - private System.Windows.Forms.DataGridViewTextBoxColumn Column21; - private System.Windows.Forms.DataGridViewTextBoxColumn Column22; private System.Windows.Forms.Label label15; private System.Windows.Forms.Label label16; private System.Windows.Forms.Label label17; @@ -1084,5 +1387,45 @@ private System.Windows.Forms.Label label1; private BWP.WinFormControl.UComboBox farmerSelect; private System.Windows.Forms.Label label3; + 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 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.DataGridViewTextBoxColumn M_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn M_B3ID; + private System.Windows.Forms.DataGridViewTextBoxColumn M_Supplier_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn M_Zone_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn M_FarmerNames; + private System.Windows.Forms.DataGridViewTextBoxColumn M_PurchaseType_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn M_Number; + private System.Windows.Forms.DataGridViewTextBoxColumn M_Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn M_HouseNames; + private System.Windows.Forms.DataGridViewTextBoxColumn M_SanctionNumber; + 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; } } \ No newline at end of file diff --git a/ButcherWeight/WeightForm.cs b/ButcherWeight/WeightForm.cs index b5f4c03..7436007 100644 --- a/ButcherWeight/WeightForm.cs +++ b/ButcherWeight/WeightForm.cs @@ -16,6 +16,18 @@ namespace ButcherWeight { public partial class WeightForm : Form, IAfterLogin { + #region IAfterLogin Member + public string RoleName + { + get { return "_1"; } + } + + public Form Generate() + { + return this; + } + #endregion + public WeightForm() { InitializeComponent(); @@ -27,19 +39,14 @@ namespace ButcherWeight hogGradeSelect.Init("BaseInfoRpc/GetHogGradeList"); zoneSelect.Init("BaseInfoRpc/GetZoneList"); farmerSelect.Init("BaseInfoRpc/GetFarmerList"); + farmerSelect.EnableTopItem = false; + weightTimeSelect.Date = DateTime.Now; + testTimeInput.Date = DateTime.Now; + dmoList = WeightBillRpc.GetWeightBillList(); } - #region IAfterLogin Member - public string RoleName - { - get { return "_1"; } - } - - public Form Generate() - { - return this; - } - #endregion + private List dmoList = new List(); + private WeightBill Dmo = new WeightBill(); private void exitBtn_Click(object sender, EventArgs e) { @@ -49,9 +56,9 @@ namespace ButcherWeight private void commitBtn_Click(object sender, EventArgs e) { GetFromUI(); - //var result = WeightBillRpc.Send(Dmo); - //if (result) - // MessageBox.Show("保存成功!"); + var result = WeightBillRpc.Send(Dmo); + if (result) + MessageBox.Show("保存成功!"); } private void readMaoBtn_Click(object sender, EventArgs e) @@ -66,25 +73,46 @@ namespace ButcherWeight private void farmerSelect_SelectedIndexChanged(object sender, EventArgs e) { - + if (farmerSelect.IsEmpty) + return; + var detail = new WeightBill_FarmerDetail(); + detail.Farmer_ID = farmerSelect.LongValue.Value; + if (Dmo.FarmerDetails.Any(x => x.Farmer_ID == detail.Farmer_ID)) + return; + detail.Farmer_Name = farmerSelect.DisplayValue; + Dmo.FarmerDetails.Add(detail); + detail.Index = Dmo.FarmerDetails.Max(x => x.Index) + 1; + detail.WeightBill_ID = Dmo.ID; + + farmerSelect.Clear(); } - WeightBill _dmo = new WeightBill() { CreaterName = AppContext.Context.UserConfig.UserName }; - WeightBill Dmo { get { return _dmo; } } - void GetFromUI() { + if (!employeeSelect.IsEmpty) + { + Dmo.Employee_ID = long.Parse(employeeSelect.Value); + Dmo.Employee_Name = employeeSelect.DisplayValue; + } + Dmo.WeighTime = weightTimeSelect.Date; + if (!supplierSelect.IsEmpty) { Dmo.Supplier_ID = long.Parse(supplierSelect.Value); Dmo.Supplier_Name = supplierSelect.DisplayValue; } + + if (!zoneSelect.IsEmpty) + { + Dmo.Zone_ID = long.Parse(zoneSelect.Value); + Dmo.Zone_Name = zoneSelect.DisplayValue; + } + if (!purchaseTypeSelect.IsEmpty) { Dmo.PurchaseType_ID = short.Parse(purchaseTypeSelect.Value); Dmo.PurchaseType_Name = purchaseTypeSelect.DisplayValue; } - Dmo.WeightTime = weightTimeSelect.Date; if (!carSelect.IsEmpty) { Dmo.Car_ID = long.Parse(carSelect.Value); @@ -92,80 +120,78 @@ namespace ButcherWeight } if (!liveVarietiesSelect.IsEmpty) { - Dmo.Livestock_ID = long.Parse(liveVarietiesSelect.Value); - Dmo.Livestock_Name = liveVarietiesSelect.DisplayValue; - } - if (!employeeSelect.IsEmpty) - { - Dmo.Employee_ID = long.Parse(employeeSelect.Value); - Dmo.Employee_Name = employeeSelect.DisplayValue; + Dmo.LiveVarieties_ID = long.Parse(liveVarietiesSelect.Value); + Dmo.LiveVarieties_Name = liveVarietiesSelect.DisplayValue; } + if (!hogGradeSelect.IsEmpty) { Dmo.HogGrade_ID = long.Parse(hogGradeSelect.Value); Dmo.HogGrade_Name = hogGradeSelect.DisplayValue; } - if (!zoneSelect.IsEmpty) - { - Dmo.Zone_ID = long.Parse(zoneSelect.Value); - Dmo.Zone_Name = zoneSelect.DisplayValue; - } + if (!string.IsNullOrEmpty(penWeightInput.Text)) { decimal pw = 0; if (!decimal.TryParse(penWeightInput.Text.Trim(), out pw)) throw new Exception("棚前重量输入错误"); - Dmo.PenWeight = pw; + Dmo.ShackWeight = pw; } if (!string.IsNullOrEmpty(penPriceInput.Text)) { decimal pp = 0; if (!decimal.TryParse(penPriceInput.Text.Trim(), out pp)) throw new Exception("棚前单价输入错误"); - Dmo.PenPrice = pp; + Dmo.ShackPrice = pp; } - Dmo.PenMoney = Dmo.PenPrice * Dmo.PenWeight; if (!string.IsNullOrEmpty(testCardNumberInput.Text)) Dmo.AnimalTestNumber = testCardNumberInput.Text; + if (!string.IsNullOrEmpty(testTimeInput.Text)) Dmo.AnimalTestDate = testTimeInput.Date; + if (!string.IsNullOrEmpty(testManInput.Text)) Dmo.AnimalTestMan = testManInput.Text; + if (!string.IsNullOrEmpty(remarkInput.Text)) Dmo.Remark = remarkInput.Text; } void AppToUI() { + ResetControl(); + if (Dmo.Employee_ID.HasValue) + employeeSelect.Fill(Dmo.Employee_Name, Dmo.Employee_ID.ToString()); + + if (Dmo.WeighTime.HasValue) + weightTimeSelect.Date = Dmo.WeighTime; + if (Dmo.Supplier_ID.HasValue) supplierSelect.Fill(Dmo.Supplier_Name, Dmo.Supplier_ID.ToString()); + + if (Dmo.Zone_ID.HasValue) + zoneSelect.Fill(Dmo.Zone_Name, Dmo.Zone_ID.ToString()); + if (Dmo.PurchaseType_ID.HasValue) purchaseTypeSelect.Fill(Dmo.PurchaseType_Name, Dmo.PurchaseType_ID.ToString()); - weightTimeSelect.Date = Dmo.WeightTime.Value; - Dmo.WeightTime = weightTimeSelect.Date; if (Dmo.Car_ID.HasValue) carSelect.Fill(Dmo.Car_Name, Dmo.Car_ID.ToString()); - if (Dmo.Livestock_ID.HasValue) - liveVarietiesSelect.Fill(Dmo.Livestock_Name, Dmo.Livestock_ID.ToString()); - - if (Dmo.Employee_ID.HasValue) - employeeSelect.Fill(Dmo.Employee_Name, Dmo.Employee_ID.ToString()); + if (Dmo.LiveVarieties_ID.HasValue) + liveVarietiesSelect.Fill(Dmo.LiveVarieties_Name, Dmo.LiveVarieties_ID.ToString()); if (Dmo.HogGrade_ID.HasValue) hogGradeSelect.Fill(Dmo.HogGrade_Name, Dmo.HogGrade_ID.ToString()); - if (Dmo.Zone_ID.HasValue) - zoneSelect.Fill(Dmo.Zone_Name, Dmo.Zone_ID.ToString()); - if (Dmo.PenWeight.HasValue) - penWeightInput.Text = Dmo.PenWeight.Value.ToString(); + if (Dmo.ShackWeight.HasValue) + penWeightInput.Text = Dmo.ShackWeight.Value.ToString(); - if (Dmo.PenPrice.HasValue) - penPriceInput.Text = Dmo.PenPrice.Value.ToString(); + if (Dmo.ShackPrice.HasValue) + penPriceInput.Text = Dmo.ShackPrice.Value.ToString(); - if (Dmo.PenMoney.HasValue) - penMoneyInput.Text = Dmo.PenMoney.Value.ToString(); + if (Dmo.ShackMoney.HasValue) + penMoneyInput.Text = Dmo.ShackMoney.Value.ToString(); if (!string.IsNullOrEmpty(Dmo.AnimalTestNumber)) testCardNumberInput.Text = Dmo.AnimalTestNumber; @@ -179,5 +205,25 @@ namespace ButcherWeight if (!string.IsNullOrEmpty(Dmo.Remark)) remarkInput.Text = Dmo.Remark; } + + void ResetControl() + { + employeeSelect.Clear(); + weightTimeSelect.Date = null; + supplierSelect.Clear(); + zoneSelect.Clear(); + purchaseTypeSelect.Clear(); + carSelect.Clear(); + liveVarietiesSelect.Clear(); + hogGradeSelect.Clear(); + penWeightInput.Text = null; + penPriceInput.Text = null; + penMoneyInput.Text = null; + testCardNumberInput.Text = null; + testTimeInput.Date = null; + testManInput.Text = null; + remarkInput.Text = null; + + } } } \ No newline at end of file diff --git a/ButcherWeight/WeightForm.resx b/ButcherWeight/WeightForm.resx index c29d096..c8f2207 100644 --- a/ButcherWeight/WeightForm.resx +++ b/ButcherWeight/WeightForm.resx @@ -117,136 +117,124 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - - True - - - True - - - True - - - True - - + True \ No newline at end of file