Browse Source

修改。

master
yibo 8 years ago
parent
commit
f7a76e77b0
6 changed files with 177 additions and 110 deletions
  1. +1
    -0
      BO/BO.csproj
  2. +43
    -0
      BO/BO/Bill/WeightBill/PrintWeightBill.cs
  3. +8
    -0
      BO/Utils/BillRpc/WeightBillRpc.cs
  4. +4
    -0
      ButcherWeight/ButcherWeight.csproj
  5. +111
    -110
      ButcherWeight/WeightForm.Designer.cs
  6. +10
    -0
      ButcherWeight/WeightForm.cs

+ 1
- 0
BO/BO.csproj View File

@ -63,6 +63,7 @@
<Compile Include="BO\Bill\SecondOrder\SecondOrder_Detail.cs" /> <Compile Include="BO\Bill\SecondOrder\SecondOrder_Detail.cs" />
<Compile Include="BO\Bill\WeightBill\HouseAndSanctionEdit.cs" /> <Compile Include="BO\Bill\WeightBill\HouseAndSanctionEdit.cs" />
<Compile Include="BO\Bill\WeightBill\HouseAndSanctionList.cs" /> <Compile Include="BO\Bill\WeightBill\HouseAndSanctionList.cs" />
<Compile Include="BO\Bill\WeightBill\PrintWeightBill.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBillList.cs" /> <Compile Include="BO\Bill\WeightBill\WeightBillList.cs" />
<Compile Include="BO\Bill\WeightBill\WeightDetail.cs" /> <Compile Include="BO\Bill\WeightBill\WeightDetail.cs" />
<Compile Include="BO\SyncBase.cs" /> <Compile Include="BO\SyncBase.cs" />


+ 43
- 0
BO/BO/Bill/WeightBill/PrintWeightBill.cs View File

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BO.BO
{
public class PrintWeightBill
{
public long? ID { get; set; }
public string Supplier_Name { get; set; }
public DateTime WeighTime { get; set; }
public string Creator { get; set; }
public string Employee_Name { get; set; }
public string Inspector_Name { get; set; }
public string HogGrade_Name { get; set; }
public decimal? Weight { get; set; }
public int? Number { get; set; }
public string TotalDiscont { get { return string.Format("{0:#0.######}", Details.Sum(x => x.Money ?? 0)); } }
private List<PWeightBill_SanctionDetail> _details = new List<PWeightBill_SanctionDetail>();
public List<PWeightBill_SanctionDetail> Details { get { return _details; } set { _details = value; } }
}
public class PWeightBill_SanctionDetail
{
public string AbnormalItem_Name { get; set; }
public int? Number { get; set; }
public decimal? Money { get; set; }
}
}

+ 8
- 0
BO/Utils/BillRpc/WeightBillRpc.cs View File

@ -98,5 +98,13 @@ namespace BO.Utils.BillRpc
var json = RpcFacade.Call<string>(method, DateTime.Today); var json = RpcFacade.Call<string>(method, DateTime.Today);
return serializer.Deserialize<List<CTuple<long, long?, decimal?>>>(json); return serializer.Deserialize<List<CTuple<long, long?, decimal?>>>(json);
} }
public static PrintWeightBill GetPrintWeightBill(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetPrintWeightBill";
var obj = RpcFacade.Call<string>(method, id);
obj = obj.ESerializeDateTime();
return serializer.Deserialize<PrintWeightBill>(obj);
}
} }
} }

+ 4
- 0
ButcherWeight/ButcherWeight.csproj View File

@ -30,6 +30,10 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BwpClientPrint, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\BwpClientPrint.dll</HintPath>
</Reference>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL"> <Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll</HintPath> <HintPath>..\..\..\..\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll</HintPath>


+ 111
- 110
ButcherWeight/WeightForm.Designer.cs View File

@ -135,6 +135,18 @@
this.S_AbnormalItem_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.S_AbnormalItem_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.S_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.billGrid = 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_SanctionMoney = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label15 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label(); this.label17 = new System.Windows.Forms.Label();
@ -149,18 +161,6 @@
this.farmerMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.farmerMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.farmerDelete = new System.Windows.Forms.ToolStripMenuItem(); this.farmerDelete = new System.Windows.Forms.ToolStripMenuItem();
this.viewDetailBtn = new System.Windows.Forms.Button(); 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_SanctionMoney = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
this.panel3.SuspendLayout(); this.panel3.SuspendLayout();
@ -246,6 +246,7 @@
this.printBtn.TabIndex = 8; this.printBtn.TabIndex = 8;
this.printBtn.Text = "打印"; this.printBtn.Text = "打印";
this.printBtn.UseVisualStyleBackColor = true; this.printBtn.UseVisualStyleBackColor = true;
this.printBtn.Click += new System.EventHandler(this.printBtn_Click);
// //
// createBtn // createBtn
// //
@ -1191,6 +1192,104 @@
this.billGrid.TabIndex = 0; this.billGrid.TabIndex = 0;
this.billGrid.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.billGrid_CellDoubleClick); 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";
dataGridViewCellStyle19.Format = "#0.######";
this.M_Weight.DefaultCellStyle = dataGridViewCellStyle19;
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_SanctionMoney
//
this.M_SanctionMoney.DataPropertyName = "SanctionMoney";
dataGridViewCellStyle20.Format = "#0.######";
this.M_SanctionMoney.DefaultCellStyle = dataGridViewCellStyle20;
this.M_SanctionMoney.HeaderText = "异常明细";
this.M_SanctionMoney.Name = "M_SanctionMoney";
this.M_SanctionMoney.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 // label15
// //
this.label15.AutoSize = true; this.label15.AutoSize = true;
@ -1326,104 +1425,6 @@
this.viewDetailBtn.UseVisualStyleBackColor = true; this.viewDetailBtn.UseVisualStyleBackColor = true;
this.viewDetailBtn.Click += new System.EventHandler(this.viewDetailBtn_Click); this.viewDetailBtn.Click += new System.EventHandler(this.viewDetailBtn_Click);
// //
// 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";
dataGridViewCellStyle19.Format = "#0.######";
this.M_Weight.DefaultCellStyle = dataGridViewCellStyle19;
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_SanctionMoney
//
this.M_SanctionMoney.DataPropertyName = "SanctionMoney";
dataGridViewCellStyle20.Format = "#0.######";
this.M_SanctionMoney.DefaultCellStyle = dataGridViewCellStyle20;
this.M_SanctionMoney.HeaderText = "异常明细";
this.M_SanctionMoney.Name = "M_SanctionMoney";
this.M_SanctionMoney.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;
//
// WeightForm // WeightForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);


+ 10
- 0
ButcherWeight/WeightForm.cs View File

@ -2,6 +2,7 @@
using BO.Utils; using BO.Utils;
using BO.Utils.BillRpc; using BO.Utils.BillRpc;
using BWP.WinFormControl; using BWP.WinFormControl;
using BwpClientPrint.DocumentRenders;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
@ -520,5 +521,14 @@ namespace ButcherWeight
else else
penMoneyInput.Text = "0"; penMoneyInput.Text = "0";
} }
private void printBtn_Click(object sender, EventArgs e)
{
if (Dmo.ID == 0)
throw new Exception("请先保存");
var entity = WeightBillRpc.GetPrintWeightBill(Dmo.ID);
ClientPrint.BwpClientPrint print = new ClientPrint.BwpClientPrint("WeightBillPrint.xaml", entity, new DocumentRenderer());
print.PrintDirect();
}
} }
} }

Loading…
Cancel
Save