| @ -0,0 +1,178 @@ | |||||
| using BWP.B3SubstituteKill.BL; | |||||
| using BWP.B3SubstituteKill.BO; | |||||
| using BWP.Web.Layout; | |||||
| using BWP.Web.WebControls; | |||||
| using Forks.EnterpriseServices.DataForm; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Web.UI.WebControls; | |||||
| using TSingSoft.WebControls2; | |||||
| using Forks.Utils.Collections; | |||||
| using BWP.B3SubstituteKill.Utils; | |||||
| using BWP.B3ProduceUnitedInfos; | |||||
| namespace BWP.Web.Pages.B3SubstituteKill.Bills.SubKillButcherOrder_ | |||||
| { | |||||
| class SubKillButcherOrderEdit : DepartmentWorkFlowBillEditPage<SubKillButcherOrder, ISubKillButcherOrderBL> | |||||
| { | |||||
| protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, CustomPageLayout.PageLayoutSection pageLayoutSection) | |||||
| { | |||||
| var layoutManager = new LayoutManager("", mDFInfo, mDFContainer); | |||||
| var config = new AutoLayoutConfig(); | |||||
| config.Add("AccountingUnit_ID"); | |||||
| config.Add("Department_ID"); | |||||
| config.Add("Employee_ID"); | |||||
| config.Add("Date"); | |||||
| config.Add("Supplier_ID"); | |||||
| config.Add("Supplier_Tel"); | |||||
| config.Add("Supplier_Card_ID"); | |||||
| config.Add("Supplier_Address"); | |||||
| config.Add("Number"); | |||||
| config.Add("Weight"); | |||||
| config.Add("PriceBill_ID"); | |||||
| config.Add("Remark"); | |||||
| layoutManager.Config = config; | |||||
| pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo); | |||||
| titlePanel.Controls.Add(layoutManager.CreateLayout()); | |||||
| if (layoutManager.Contains("Supplier_ID")) | |||||
| { | |||||
| var supplierInput = layoutManager["Supplier_ID"].InputControl as DFChoiceBox; | |||||
| if (supplierInput != null) | |||||
| { | |||||
| var script = @" | |||||
| var txtValue =parseInt(__DFContainer.getValue('Supplier_ID')); | |||||
| simpleRestCall('/MainSystem/B3SubstituteKill/Rpcs/SupplierRpc/GetSupplierAndPriceBillID',[txtValue,__DFContainer.getControl('Date').value], | |||||
| function(result){ | |||||
| if(typeof(result.Address)!='undefined') | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Address',result.Address); | |||||
| } | |||||
| else | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Address',''); | |||||
| } | |||||
| if(typeof(result.Tel)!='undefined') | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Tel',result.Tel); | |||||
| } | |||||
| else | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Tel',''); | |||||
| } | |||||
| if(typeof(result.Supplier_Card_ID)!='undefined') | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Card_ID',result.Card_ID); | |||||
| } | |||||
| else | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Card_ID',''); | |||||
| } | |||||
| if(typeof(result.SupplierApply_ID)!='undefined') | |||||
| { | |||||
| __DFContainer.setValue('PriceBill_ID',result.SupplierApply_ID); | |||||
| } | |||||
| else | |||||
| { | |||||
| __DFContainer.setValue('PriceBill_ID',''); | |||||
| } | |||||
| },{ });"; | |||||
| supplierInput.OnClientSelected = script; | |||||
| } | |||||
| } | |||||
| } | |||||
| protected override void BuildBody(System.Web.UI.Control parent) | |||||
| { | |||||
| base.BuildBody(parent); | |||||
| AddDetail(parent.EAdd(new TitlePanel("排宰明细", "排宰明细"))); | |||||
| } | |||||
| DFEditGrid _detailGrid; | |||||
| private void AddDetail(TitlePanel titlePanel) | |||||
| { | |||||
| if(CanSave){ | |||||
| titlePanel.EAdd(new TSButton("新增", delegate { | |||||
| GetFromUI(); | |||||
| Dmo.Details.Add(new SubKillButcherOrder_Detail()); | |||||
| _detailGrid.DataBind(); | |||||
| })); | |||||
| } | |||||
| var editor = new DFCollectionEditor<SubKillButcherOrder_Detail>(() => Dmo.Details); | |||||
| editor.AllowDeletionFunc = () => CanSave; | |||||
| editor.CanDeleteFunc = detail => CanSave; | |||||
| editor.IsEditableFunc = (field, detail) => | |||||
| { | |||||
| if (!CanSave) | |||||
| return false; | |||||
| if (field.Name == "Number") | |||||
| return CheckDefaultRole("编辑头数"); | |||||
| if (field.Name == "Weight") | |||||
| return CheckDefaultRole("编辑重量"); | |||||
| return true; | |||||
| }; ; | |||||
| _detailGrid = titlePanel.EAdd(new DFEditGrid(editor) { Width = Unit.Percentage(100) }); | |||||
| _detailGrid.Columns.EAdd(new DFEditGridColumn<DFChoiceBox>("SubKillProductLine_ID")).InitEditControl += (sender, e) => | |||||
| { | |||||
| e.Control.DataKind = B3SubstituteKillConsts.DataSources.授权代宰生产线; | |||||
| e.Control.EnableInputArgument = true; | |||||
| e.Control.EnableTopItem = true; | |||||
| e.Control.DFDisplayField = "SubKillProductLine_Name"; | |||||
| e.Control.Width = Unit.Pixel(150); | |||||
| }; | |||||
| _detailGrid.Columns.EAdd(new DFEditGridColumn<DFChoiceBox>("SubKillFlag_Detail_ID")).InitEditControl += (sender, e) => | |||||
| { | |||||
| e.Control.DataKind = B3SubstituteKillConsts.DataSources.供应商代宰标识; | |||||
| e.Control.EnableInputArgument = true; | |||||
| e.Control.EnableTopItem = true; | |||||
| e.Control.DFDisplayField = "SubKillFlag_Detail_Name"; | |||||
| e.Control.OnBeforeDrop = "this.codeArgument=__DFContainer.getValue('Supplier_ID');"; | |||||
| e.Control.Width = Unit.Pixel(150); | |||||
| }; | |||||
| _detailGrid.Columns.EAdd(new DFEditGridColumn<DFTextBox>("Number")).InitEditControl += (sender, e) => | |||||
| { | |||||
| e.Control.Style["width"] = "120px"; | |||||
| }; | |||||
| _detailGrid.Columns.EAdd(new DFEditGridColumn<DFTextBox>("Weight")).InitEditControl += (sender, e) => | |||||
| { | |||||
| e.Control.Style["width"] = "120px"; | |||||
| }; | |||||
| _detailGrid.Columns.EAdd(new DFEditGridColumn<DFChoiceBox>("LiveColonyHouse_ID")).InitEditControl += (sender, e) => | |||||
| { | |||||
| e.Control.DataKind = B3ProduceUnitedInfosDataSources.活体圈舍; | |||||
| e.Control.EnableInputArgument = true; | |||||
| e.Control.EnableTopItem = true; | |||||
| e.Control.OnBeforeDrop = "this.codeArgument=2"; | |||||
| e.Control.DFDisplayField = "LiveColonyHouse_Name"; | |||||
| e.Control.Width = Unit.Pixel(150); | |||||
| }; | |||||
| _detailGrid.Columns.Add(new DFEditGridColumn("Content")); | |||||
| _detailGrid.ValueColumns.Add("ID"); | |||||
| var section = mPageLayoutManager.AddSection("Detail", "排宰明细"); | |||||
| titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name); | |||||
| section.ApplyLayout(_detailGrid, mPageLayoutManager, DFInfo.Get(typeof(SubKillButcherOrder_Detail))); | |||||
| } | |||||
| public override void AppToUI() | |||||
| { | |||||
| base.AppToUI(); | |||||
| _detailGrid.DataBind(); | |||||
| } | |||||
| public override void GetFromUI() | |||||
| { | |||||
| base.GetFromUI(); | |||||
| _detailGrid.GetFromUI(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,50 @@ | |||||
| using BWP.B3SubstituteKill.BL; | |||||
| using BWP.B3SubstituteKill.BO; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using TSingSoft.WebControls2; | |||||
| namespace BWP.Web.Pages.B3SubstituteKill.Bills.SubKillButcherOrder_ | |||||
| { | |||||
| class SubKillButcherOrderList : DomainBillListPage<SubKillButcherOrder, ISubKillButcherOrderBL> | |||||
| { | |||||
| protected override void AddQueryControls(VLayoutPanel vPanel) | |||||
| { | |||||
| vPanel.Add(CreateDefaultBillQueryControls((panel, config) => | |||||
| { | |||||
| config.Add("AccountingUnit_ID"); | |||||
| config.Add("Department_ID"); | |||||
| config.Add("Employee_ID"); | |||||
| config.Add("Date"); | |||||
| config.Add("Supplier_ID"); | |||||
| })); | |||||
| } | |||||
| protected override void AddDFBrowseGridColumn(DFBrowseGrid grid, string field) | |||||
| { | |||||
| base.AddDFBrowseGridColumn(grid, field); | |||||
| if (field == "BillState") | |||||
| { | |||||
| AddDFBrowseGridColumn(grid, "AccountingUnit_Name"); | |||||
| AddDFBrowseGridColumn(grid, "Department_Name"); | |||||
| AddDFBrowseGridColumn(grid, "Employee_Name"); | |||||
| AddDFBrowseGridColumn(grid, "Date"); | |||||
| AddDFBrowseGridColumn(grid, "Supplier_Name"); | |||||
| } | |||||
| } | |||||
| protected override void InitToolBar(HLayoutPanel toolbar) | |||||
| { | |||||
| base.InitToolBar(toolbar); | |||||
| if (CheckDefaultRole("数据分析", false)) | |||||
| { | |||||
| var dataAnysBtn = new TSButton() { Text = "数据分析", UseSubmitBehavior = false }; | |||||
| dataAnysBtn.OnClientClick = string.Format("OpenUrlInTopTab('{0}','数据分析');return false;", TSingSoft.WebPluginFramework.WpfPageUrl.ToGlobal(AspUtil.AddTimeStampToUrl("~/B3SubstituteKill/Reports/SubKillButcherOrderAnalyse_/SubKillButcherOrderAnalyse.aspx"))); | |||||
| toolbar.Add(dataAnysBtn); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,72 @@ | |||||
| <?xml version="1.0" encoding="utf-8" ?> | |||||
| <Select xmlns="urn:XDQuery"> | |||||
| <Columns> | |||||
| <Field name="ID"/> | |||||
| </Columns> | |||||
| <From> | |||||
| <DmoClass class="BWP.B3SubstituteKill.BO.SubKillButcherOrder, B3SubstituteKill"/> | |||||
| </From> | |||||
| <Where> | |||||
| <And> | |||||
| <EQ> | |||||
| <Field name="ID"/> | |||||
| <QBE paramName="ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="AccountingUnit_ID"/> | |||||
| <QBE paramName="AccountingUnit_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="Department_ID"/> | |||||
| <QBE paramName="Department_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="Employee_ID"/> | |||||
| <QBE paramName="Employee_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="Supplier_ID"/> | |||||
| <QBE paramName="Supplier_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="IsLocked"/> | |||||
| <QBE paramName="IsLocked"/> | |||||
| </EQ> | |||||
| <Contains> | |||||
| <Field name="Remark"/> | |||||
| <QBE paramName="Remark"/> | |||||
| </Contains> | |||||
| <Contains> | |||||
| <Field name="CreateUser_Name"/> | |||||
| <QBE paramName="CreateUser_Name"/> | |||||
| </Contains> | |||||
| <Contains> | |||||
| <Field name="CheckUser_Name"/> | |||||
| <QBE paramName="CheckUser_Name"/> | |||||
| </Contains> | |||||
| <GreaterThanOrEqual> | |||||
| <Field name="CreateTime"/> | |||||
| <QBE paramName="MinCreateTime" /> | |||||
| </GreaterThanOrEqual> | |||||
| <LessThanOrEqual> | |||||
| <Field name="CreateTime"/> | |||||
| <QBE paramName="MaxCreateTime"/> | |||||
| </LessThanOrEqual> | |||||
| <GreaterThanOrEqual> | |||||
| <Field name="Date"/> | |||||
| <QBE paramName="MinDate" /> | |||||
| </GreaterThanOrEqual> | |||||
| <LessThanOrEqual> | |||||
| <Field name="Date"/> | |||||
| <QBE paramName="MaxDate"/> | |||||
| </LessThanOrEqual> | |||||
| <EQ> | |||||
| <Field name="BillState"/> | |||||
| <QBE paramName ="BillState"/> | |||||
| </EQ> | |||||
| </And> | |||||
| </Where> | |||||
| </Select> | |||||
| @ -0,0 +1,19 @@ | |||||
| using BWP.B3SubstituteKill.BL; | |||||
| using BWP.B3SubstituteKill.BO; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace BWP.Web.Pages.B3SubstituteKill.Bills.SubKillButcherOrder_ | |||||
| { | |||||
| class SubKillButcherOrderPrint : DomainTemplatePrintPage<SubKillButcherOrder, ISubKillButcherOrderBL> | |||||
| { | |||||
| protected override void AddParameters(IDictionary<string, object> dic) | |||||
| { | |||||
| dic.Add("$ID", Dmo.ID); | |||||
| dic.Add("$Details", Dmo.Details); | |||||
| dic.Add("$DetailType", typeof(SubKillButcherOrder_Detail)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,116 @@ | |||||
| using BWP.B3Frameworks; | |||||
| using BWP.B3Frameworks.BO.NamedValueTemplate; | |||||
| using BWP.B3ProcurementInterface.Utils; | |||||
| using BWP.B3ProduceUnitedInfos; | |||||
| using BWP.B3SubstituteKill.BO; | |||||
| using BWP.B3SubstituteKill.Utils; | |||||
| using BWP.Web.Layout; | |||||
| using BWP.Web.Utils; | |||||
| using Forks.EnterpriseServices.DomainObjects2; | |||||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using TSingSoft.WebControls2; | |||||
| namespace BWP.Web.Pages.B3SubstituteKill.Reports.SubKillButcherOrderAnalyse_ | |||||
| { | |||||
| class SubKillButcherOrderAnalyse : DFBrowseGridReportPage<SubKillButcherOrder> | |||||
| { | |||||
| protected override string Caption | |||||
| { | |||||
| get { return "代宰排宰分析"; } | |||||
| } | |||||
| protected override string QueryOptionsTabName | |||||
| { | |||||
| get | |||||
| { | |||||
| return "显示字段"; | |||||
| } | |||||
| } | |||||
| protected override string AccessRoleName | |||||
| { | |||||
| get { return "B3SubstituteKill.代宰排宰.数据分析"; } | |||||
| } | |||||
| protected override void AddQueryControls(VLayoutPanel vPanel) | |||||
| { | |||||
| var layout = new LayoutManager("Main", mDFInfo, mQueryContainer); | |||||
| layout.Add("ID", new DFTextBox(mDFInfo.Fields["ID"])); | |||||
| layout.Add("AccountingUnit_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["AccountingUnit_ID"], B3FrameworksConsts.DataSources.授权会计单位全部)); | |||||
| layout.Add("Department_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["Department_ID"], B3FrameworksConsts.DataSources.授权部门全部)); | |||||
| layout.Add("Employee_ID", QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["Employee_ID"], mQueryContainer, "Employee_ID", B3FrameworksConsts.DataSources.授权员工全部)); | |||||
| layout["Employee_ID"].NotAutoAddToContainer = true; | |||||
| layout.Add("Date", QueryCreator.TimeRange(mDFInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate")); | |||||
| layout.Add("Supplier_ID", new SimpleLabel("供应商"), QueryCreator.DFChoiceBox(mDFInfo.Fields["Supplier_ID"], B3ProcurementInterfaceDataSources.供应商用于屠宰场)); | |||||
| layout.Add("LiveColonyHouse_ID", new SimpleLabel("圈舍"), QueryCreator.DFChoiceBox(mDFInfo.Fields["ID"], B3ProduceUnitedInfosDataSources.活体圈舍, "2")); | |||||
| layout.Add("SubKillProductLine_ID", new SimpleLabel("代宰生产线"), QueryCreator.DFChoiceBox(mDFInfo.Fields["ID"], B3SubstituteKillConsts.DataSources.授权代宰生产线)); | |||||
| var state = mQueryContainer.Add(QueryCreator.一般单据状态(mDFInfo.Fields["BillState"], true, false, true, true), "BillState"); | |||||
| ((ChoiceBox)state).Value = 单据状态.已审核.Value.ToString() + "|"; | |||||
| state.DisplayValue = "已审核;"; | |||||
| layout.Add("BillState", state); | |||||
| layout["BillState"].NotAutoAddToContainer = true; | |||||
| var config = new AutoLayoutConfig { Cols = 4 }; | |||||
| config.Add("ID"); | |||||
| config.Add("AccountingUnit_ID"); | |||||
| config.Add("Department_ID"); | |||||
| config.Add("Employee_ID"); | |||||
| config.Add("Date").ColSpan = 4; | |||||
| config.Add("Supplier_ID"); | |||||
| config.Add("LiveColonyHouse_ID"); | |||||
| config.Add("SubKillProductLine_ID"); | |||||
| config.Add("BillState"); | |||||
| layout.Config = config; | |||||
| vPanel.Add(layout.CreateLayout()); | |||||
| } | |||||
| ReportDisplayOptionHelper mDisplayHelper = new ReportDisplayOptionHelper(); | |||||
| protected override void AddQueryOptions(VLayoutPanel vPanel) | |||||
| { | |||||
| mDisplayHelper.AddOptionItem("单号", "bill", "ID", false); | |||||
| mDisplayHelper.AddOptionItem("会计单位", "bill", "AccountingUnit_Name", false); | |||||
| mDisplayHelper.AddOptionItem("部门", "bill", "Department_Name", false); | |||||
| mDisplayHelper.AddOptionItem("经办人", "bill", "Employee_Name", false); | |||||
| mDisplayHelper.AddOptionItem("过磅时间", "bill", "Date", false); | |||||
| mDisplayHelper.AddOptionItem("供应商", "bill", "Supplier_Name", false); | |||||
| mDisplayHelper.AddOptionItem("联系方式", "bill", "Supplier_Tel", false); | |||||
| mDisplayHelper.AddOptionItem("身份证", "bill", "Supplier_Card_ID", false); | |||||
| mDisplayHelper.AddOptionItem("地址", "bill", "Supplier_Address", false); | |||||
| mDisplayHelper.AddOptionItem("价格单号", "bill", "PriceBill_ID", false); | |||||
| mDisplayHelper.AddOptionItem("摘要", "bill", "Remark", false); | |||||
| mDisplayHelper.AddOptionItem("生产线", "detail", "SubKillProductLine_Name", false); | |||||
| mDisplayHelper.AddOptionItem("代宰标识", "detail", "SubKillFlag_Detail_Name", false); | |||||
| mDisplayHelper.AddOptionItem("头数", "detail", "Number", false, true); | |||||
| mDisplayHelper.AddOptionItem("重量", "detail", "Weight", false, true); | |||||
| mDisplayHelper.AddOptionItem("圈舍", "detail", "LiveColonyHouse_Name", false); | |||||
| mDisplayHelper.AddOptionItem("备注", "detail", "Content", false); | |||||
| AddQueryOption("选项", mDisplayHelper.GetAllDisplayNames(), mDisplayHelper.GetDefaultSelelectedDisplayNames()); | |||||
| base.AddQueryOptions(vPanel); | |||||
| } | |||||
| protected override DQueryDom GetQueryDom() | |||||
| { | |||||
| var dom = base.GetQueryDom(); | |||||
| var bill = dom.From.RootSource.Alias; | |||||
| mDisplayHelper.AddAlias("bill", JoinAlias.Create("bill")); | |||||
| var detail = JoinAlias.Create("detail"); | |||||
| mDisplayHelper.AddAlias("detail", detail); | |||||
| mDisplayHelper.AddSelectColumns(dom, (name) => OptionIsSelected("选项", name), SumColumnIndexs); | |||||
| return dom; | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,62 @@ | |||||
| <?xml version="1.0" encoding="utf-8" ?> | |||||
| <Select xmlns="urn:XDQuery"> | |||||
| <Columns> | |||||
| </Columns> | |||||
| <From> | |||||
| <Join type="Left"> | |||||
| <DmoClass class="BWP.B3SubstituteKill.BO.SubKillButcherOrder, B3SubstituteKill" alias="bill"/> | |||||
| <DmoClass class="BWP.B3SubstituteKill.BO.SubKillButcherOrder_Detail, B3SubstituteKill" alias="detail"/> | |||||
| <Condition> | |||||
| <EQ> | |||||
| <Field name="ID" alias="bill"/> | |||||
| <Field name="SubKillButcherOrder_ID" alias="detail"/> | |||||
| </EQ> | |||||
| </Condition> | |||||
| </Join> | |||||
| </From> | |||||
| <Where> | |||||
| <And> | |||||
| <EQ> | |||||
| <Field name="ID"/> | |||||
| <QBE paramName="ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="AccountingUnit_ID"/> | |||||
| <QBE paramName="AccountingUnit_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="Department_ID"/> | |||||
| <QBE paramName="Department_ID"/> | |||||
| </EQ> | |||||
| <QBEIn> | |||||
| <Field name="Employee_ID"/> | |||||
| <QBE paramName ="Employee_ID"/> | |||||
| </QBEIn> | |||||
| <GreaterThanOrEqual> | |||||
| <Field name="Date"/> | |||||
| <QBE paramName="MinDate" /> | |||||
| </GreaterThanOrEqual> | |||||
| <LessThanOrEqual> | |||||
| <Field name="Date"/> | |||||
| <QBE paramName="MaxDate"/> | |||||
| </LessThanOrEqual> | |||||
| <EQ> | |||||
| <Field name="Supplier_ID" /> | |||||
| <QBE paramName="Supplier_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="LiveColonyHouse_ID" /> | |||||
| <QBE paramName="LiveColonyHouse_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="SubKillProductLine_ID"/> | |||||
| <QBE paramName ="SubKillProductLine_ID"/> | |||||
| </EQ> | |||||
| <QBEIn> | |||||
| <Field name="BillState"/> | |||||
| <QBE paramName ="BillState"/> | |||||
| </QBEIn> | |||||
| </And> | |||||
| </Where> | |||||
| </Select> | |||||
| @ -0,0 +1,31 @@ | |||||
| using BWP.B3Frameworks.BL; | |||||
| using BWP.B3SubstituteKill.BO; | |||||
| using BWP.B3SubstituteKill.Rpcs; | |||||
| using Forks.EnterpriseServices; | |||||
| using Forks.EnterpriseServices.BusinessInterfaces; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using TSingSoft.WebPluginFramework; | |||||
| namespace BWP.B3SubstituteKill.BL | |||||
| { | |||||
| [BusinessInterface(typeof(SubKillButcherOrderBL))] | |||||
| [LogicName("代宰排宰")] | |||||
| public interface ISubKillButcherOrderBL : IDepartmentWorkFlowBillBL<SubKillButcherOrder> | |||||
| { } | |||||
| public class SubKillButcherOrderBL : DepartmentWorkFlowBillBL<SubKillButcherOrder>, ISubKillButcherOrderBL | |||||
| { | |||||
| protected override void beforeSave(SubKillButcherOrder dmo) | |||||
| { | |||||
| dmo.PriceBill_ID = null; | |||||
| if (dmo.Date.HasValue && dmo.Supplier_ID.HasValue) | |||||
| dmo.PriceBill_ID = SupplierRpc.GetPriceBillID(dmo.Supplier_ID.Value, dmo.Date.Value); | |||||
| dmo.Number = dmo.Details.Sum(x => x.Number ?? 0); | |||||
| dmo.Weight = dmo.Details.Sum(x => x.Weight.EToDecimal() ?? 0); | |||||
| base.beforeSave(dmo); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,84 @@ | |||||
| using BWP.B3Frameworks; | |||||
| using BWP.B3Frameworks.Attributes; | |||||
| using BWP.B3Frameworks.BO; | |||||
| using BWP.B3ProcurementInterface.BO; | |||||
| using BWP.B3ProcurementInterface.Utils; | |||||
| using BWP.B3SubstituteKill.Utils; | |||||
| using Forks.EnterpriseServices; | |||||
| using Forks.EnterpriseServices.DataForm; | |||||
| using Forks.EnterpriseServices.DomainObjects2; | |||||
| using Forks.Utils; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using TSingSoft.WebControls2; | |||||
| namespace BWP.B3SubstituteKill.BO | |||||
| { | |||||
| [DFClass, Serializable] | |||||
| [LogicName("代宰排宰")] | |||||
| [DmoTypeID(B3FrameworksConsts.DmoTypeIDBases.B3SubstituteKill, B3SubstituteKillConsts.DmoTypeIDOffsets.SubKillButcherOrder)] | |||||
| [EditUrl("~/B3SubstituteKill/Bills/SubKillButcherOrder_/SubKillButcherOrderEdit.aspx")] | |||||
| public class SubKillButcherOrder : DepartmentWorkFlowBill | |||||
| { | |||||
| private DateTime? date = DateTime.Now; | |||||
| [LogicName("排宰时间")] | |||||
| [DFExtProperty("WebControlType", DFEditControl.DateTimeInput)] | |||||
| [DFNotEmpty] | |||||
| public DateTime? Date | |||||
| { | |||||
| get { return date; } | |||||
| set { date = value; } | |||||
| } | |||||
| [DFDataKind(B3ProcurementInterfaceDataSources.供应商用于屠宰场)] | |||||
| [DFExtProperty(B3FrameworksConsts.DFExtProperties.DisplayField, "Supplier_Name")] | |||||
| [DFExtProperty(B3FrameworksConsts.DFExtProperties.QueryDataKind, B3ProcurementInterfaceDataSources.供应商用于屠宰场全部)] | |||||
| [DFExtProperty("WebControlType", DFEditControl.ChoiceBox)] | |||||
| [DFPrompt("供应商")] | |||||
| [DFNotEmpty] | |||||
| public long? Supplier_ID { get; set; } | |||||
| [ReferenceTo(typeof(Supplier), "Name")] | |||||
| [Join("Supplier_ID", "ID")] | |||||
| [DFPrompt("供应商")] | |||||
| public string Supplier_Name { get; set; } | |||||
| [ReferenceTo(typeof(Supplier), "Tel")] | |||||
| [Join("Supplier_ID", "ID")] | |||||
| [DFPrompt("联系方式")] | |||||
| public string Supplier_Tel { get; set; } | |||||
| [ReferenceTo(typeof(Supplier), "Card_ID")] | |||||
| [Join("Supplier_ID", "ID")] | |||||
| [DFPrompt("身份证号")] | |||||
| public string Supplier_Card_ID { get; set; } | |||||
| [ReferenceTo(typeof(Supplier), "Address")] | |||||
| [Join("Supplier_ID", "ID")] | |||||
| [DFPrompt("地址")] | |||||
| public string Supplier_Address { get; set; } | |||||
| [LogicName("代宰头数")] | |||||
| [DFExtProperty("WebControlType", DFEditControl.StaticText)] | |||||
| public int Number { get; set; } | |||||
| [LogicName("代宰重量")] | |||||
| [DFExtProperty("WebControlType", DFEditControl.StaticText)] | |||||
| public Money<decimal> Weight { get; set; } | |||||
| [LogicName("价格单号")] | |||||
| [DFExtProperty("WebControlType", DFEditControl.StaticText)] | |||||
| public long? PriceBill_ID { get; set; } | |||||
| private SubKillButcherOrder_DetailCollection _mDetails = new SubKillButcherOrder_DetailCollection(); | |||||
| [OneToMany(typeof(SubKillButcherOrder_Detail), "ID")] | |||||
| [Join("ID", "SubKillButcherOrder_ID")] | |||||
| public SubKillButcherOrder_DetailCollection Details | |||||
| { | |||||
| get { return _mDetails; } | |||||
| set { _mDetails = value; } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,56 @@ | |||||
| using BWP.B3Frameworks.BO; | |||||
| using BWP.B3ProduceUnitedInfos.BO; | |||||
| using Forks.EnterpriseServices; | |||||
| using Forks.EnterpriseServices.DataForm; | |||||
| using Forks.EnterpriseServices.DomainObjects2; | |||||
| using Forks.Utils; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace BWP.B3SubstituteKill.BO | |||||
| { | |||||
| [DFClass, Serializable, LogicName("代宰排宰_明细")] | |||||
| public class SubKillButcherOrder_Detail : Base | |||||
| { | |||||
| public long SubKillButcherOrder_ID { get; set; } | |||||
| [LogicName("生产线")] | |||||
| public long? SubKillProductLine_ID { get; set; } | |||||
| [LogicName("代宰标识")] | |||||
| public long? SubKillFlag_Detail_ID { get; set; } | |||||
| [LogicName("头数")] | |||||
| public int? Number { get; set; } | |||||
| [LogicName("重量")] | |||||
| public Money<decimal>? Weight { get; set; } | |||||
| [LogicName("圈舍")] | |||||
| public long? LiveColonyHouse_ID { get; set; } | |||||
| [LogicName("备注")] | |||||
| public string Content { get; set; } | |||||
| [ReferenceTo(typeof(SubKillProductLine), "Name")] | |||||
| [Join("SubKillProductLine_ID", "ID")] | |||||
| [LogicName("生产线")] | |||||
| public string SubKillProductLine_Name { get; set; } | |||||
| [ReferenceTo(typeof(SubKillFlag_Detail), "Name")] | |||||
| [Join("SubKillFlag_Detail_ID", "ID")] | |||||
| [LogicName("代宰标识")] | |||||
| public string SubKillFlag_Detail_Name { get; set; } | |||||
| [LogicName("圈舍")] | |||||
| [ReferenceTo(typeof(LiveColonyHouse), "Name")] | |||||
| [Join("LiveColonyHouse_ID", "ID")] | |||||
| public string LiveColonyHouse_Name { get; set; } | |||||
| } | |||||
| [Serializable] | |||||
| public class SubKillButcherOrder_DetailCollection : DmoCollection<SubKillButcherOrder_Detail> | |||||
| { } | |||||
| } | |||||
| @ -0,0 +1,37 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <BillReports xmlns="urn:BillReports" version="1.0" displayName="代宰排宰" phyName="代宰排宰"> | |||||
| <Report phyName="标准格式"> | |||||
| <BillReport xmlns="urn:BillReport" version="1" displayName="标准格式" > | |||||
| <Bands> | |||||
| <TextBand fontName="黑体" fontSize="15" align="Center">代宰排宰№$Dmo.ID</TextBand> | |||||
| <DFInfoBand object="$Dmo" cols="4"> | |||||
| <Field name="AccountingUnit_Name" lblWidth="4"/> | |||||
| <Field name="Department_Name" lblWidth="4"/> | |||||
| <Field name="Employee_Name" lblWidth="4"/> | |||||
| <Field name="Date" lblWidth="4"/> | |||||
| <Field name="Supplier_Name" lblWidth="4"/> | |||||
| <Field name="Supplier_Tel" lblWidth="4"/> | |||||
| <Field name="Supplier_Card_ID" lblWidth="4"/> | |||||
| <Field name="Supplier_Address" lblWidth="4"/> | |||||
| <Field name="Number" lblWidth="4"/> | |||||
| <Field name="Weight" lblWidth="4"/> | |||||
| <Field name="PriceBill_ID" lblWidth="4"/> | |||||
| <Field name="Remark" lblWidth="4"/> | |||||
| </DFInfoBand> | |||||
| <HtmlBand> | |||||
| <![CDATA[<h2>过磅明细</h2>]]> | |||||
| </HtmlBand> | |||||
| <DFListBand collection="$Details" itemType="$DetailType" enablePaging="true" rowsPerPage="20" > | |||||
| <LineNo header="序号"/> | |||||
| <Field name="SubKillProductLine_Name"/> | |||||
| <Field name="SubKillFlag_Detail_Name"/> | |||||
| <Field name="Number"/> | |||||
| <Field name="Weight"/> | |||||
| <Field name="LiveColonyHouse_Name"/> | |||||
| <Field name="Content"/> | |||||
| </DFListBand> | |||||
| </Bands> | |||||
| </BillReport> | |||||
| </Report> | |||||
| </BillReports> | |||||