| @ -0,0 +1,44 @@ | |||
| using BWP.Web.Actions; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Text; | |||
| namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ | |||
| { | |||
| public class CustomPrintAction : PrintActionBase | |||
| { | |||
| public CustomPrintAction() | |||
| : this("", "打印") | |||
| { | |||
| } | |||
| public CustomPrintAction(string printPage, string text) : base(printPage, text) | |||
| { | |||
| Url = printPage; | |||
| } | |||
| private string mUrl; | |||
| public string Url | |||
| { | |||
| get { return mUrl; } | |||
| set { mUrl = value; } | |||
| } | |||
| public override string GetClientExecutionReference() | |||
| { | |||
| return OnBeforeClientClick + "preventEventDefault(event);Print('" + Url + "')"; | |||
| } | |||
| public override bool Enabled | |||
| { | |||
| get | |||
| { | |||
| if (string.IsNullOrEmpty(Url)) | |||
| return false; | |||
| else | |||
| return true; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,46 @@ | |||
| using BWP.Web.Actions; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Text; | |||
| namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ | |||
| { | |||
| public class CustomPriviewAction : PreviewAction | |||
| { | |||
| public CustomPriviewAction() | |||
| : this("","预览") | |||
| { | |||
| } | |||
| public CustomPriviewAction(string printPage, string text) : base(printPage, text) | |||
| { | |||
| Url = printPage; | |||
| } | |||
| private string mUrl; | |||
| public string Url | |||
| { | |||
| get { return mUrl; } | |||
| set { mUrl = value; } | |||
| } | |||
| public override string GetClientExecutionReference() | |||
| { | |||
| return OnBeforeClientClick + "preventEventDefault(event);Preview('" + Url + "')"; | |||
| } | |||
| public override bool Enabled | |||
| { | |||
| get | |||
| { | |||
| if (string.IsNullOrEmpty(Url)) | |||
| return false; | |||
| else | |||
| return true ; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,233 @@ | |||
| using BWP.B3Frameworks; | |||
| using BWP.B3Frameworks.BO; | |||
| using BWP.B3Frameworks.BO.MoneyTemplate; | |||
| using BWP.B3Frameworks.BO.NamedValueTemplate; | |||
| using BWP.B3Frameworks.Utils; | |||
| using BWP.B3QingDaoWanFu.BO; | |||
| using BWP.B3Sale.BO; | |||
| using BWP.B3Sale.Utils; | |||
| using BWP.B3UnitedInfos; | |||
| using BWP.B3UnitedInfos.BO; | |||
| using BWP.Web.Layout; | |||
| using BWP.Web.Pages.B3Sale.Reports; | |||
| using BWP.Web.Utils; | |||
| using BWP.Web.WebControls; | |||
| using Forks.EnterpriseServices.DataForm; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.EnterpriseServices.SqlDoms; | |||
| using Forks.Utils; | |||
| using System; | |||
| using System.Collections; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Web.UI.HtmlControls; | |||
| using System.Web.UI.WebControls; | |||
| using TSingSoft.WebControls2; | |||
| using TSingSoft.WebControls2.DFGrids; | |||
| using TSingSoft.WebControls2.QBELinks; | |||
| using TSingSoft.WebPluginFramework; | |||
| using TSingSoft.WebPluginFramework.Controls; | |||
| using TSingSoft.WebPluginFramework.Exports; | |||
| namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ | |||
| { | |||
| public class SaleOutStoreSimpleAnayse:DFBrowseGridReportPage | |||
| { | |||
| protected override string Caption | |||
| { | |||
| get { return "万福销售出库分析"; } | |||
| } | |||
| protected override bool EnableExcelExport | |||
| { | |||
| get | |||
| { | |||
| return true; | |||
| } | |||
| } | |||
| //已经查询 | |||
| private object SearchFlag | |||
| { | |||
| set | |||
| { | |||
| ViewState["SearchFlag"] = value; | |||
| } | |||
| get | |||
| { | |||
| return ViewState["SearchFlag"]; | |||
| } | |||
| } | |||
| private QueryResult GetQueryResult(LoadArguments arg) | |||
| { | |||
| var data = new DFDataTableEditor().Load(arg); | |||
| return new QueryResult(data.TotalCount, data.Data.Rows, data.Data.Columns, arg.SumColumns.Any() ? data.Data.SumRow : null); | |||
| } | |||
| protected override string AccessRoleName | |||
| { | |||
| get { return "B3QingDaoWanFu.报表.销售出库分析"; } | |||
| } | |||
| protected override bool EnableQueryPanel | |||
| { | |||
| get | |||
| { | |||
| return false; | |||
| } | |||
| } | |||
| readonly DFInfo _mainInfo = DFInfo.Get(typeof(SaleOutStore)); | |||
| readonly DFInfo _detailInfo = DFInfo.Get(typeof(SaleOutStore_Detail)); | |||
| private CustomPriviewAction previewAction; | |||
| private CustomPrintAction printAction; | |||
| private DFChoiceBox deliverLineInput; | |||
| private DFNamedValueInput<单据状态> billStateInput; | |||
| protected override void InitForm(HtmlForm form) | |||
| { | |||
| var group = new ButtonGroup(); | |||
| previewAction = new CustomPriviewAction(); | |||
| printAction = new CustomPrintAction(); | |||
| if (SearchFlag != null) | |||
| { | |||
| printAction.Url = "SaleOutStoreSimpleAnaysePrint.aspx"; | |||
| previewAction.Url = "SaleOutStoreSimpleAnaysePrint.aspx"; | |||
| } | |||
| var billReportSelect = new BillReportSelectAction(PrintUtil.GetTemplateFile(PluginName, "SaleOutStoreSimpleAnaysePrint.xml")); | |||
| group.Actions.Add(previewAction); | |||
| group.Actions.Add(printAction); | |||
| group.Actions.Add(billReportSelect); | |||
| var hPanel = new HLayoutPanel(); | |||
| hPanel.Add(group); | |||
| form.Controls.Add(hPanel); | |||
| base.InitForm(form); | |||
| } | |||
| protected override void AddQueryControls(VLayoutPanel vPanel) | |||
| { | |||
| var layout = new LayoutManager("Main", _mainInfo); | |||
| layout.Add("DeliverGoodsLine_ID", mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(deliverLineInput = QueryCreator.DFChoiceBoxEnableMultiSelection(_mainInfo.Fields["DeliverGoodsLine_ID"], B3SaleDataSources.送货线路), s => long.Parse(s)), "DeliverGoodsLine_ID")); | |||
| layout["DeliverGoodsLine_ID"].NotAutoAddToContainer = true; | |||
| layout.Add("LoadTime", QueryCreator.TimeRange(_mainInfo.Fields["LoadTime"], mQueryContainer, "MinLoadTime", "MaxLoadTime")); | |||
| var state = mQueryContainer.Add(billStateInput = QueryCreator.一般单据状态(_mainInfo.Fields["BillState"], true, false, true, true), "BillState"); | |||
| ((ChoiceBox)state).Value = 单据状态.已审核.Value.ToString() + "|"; | |||
| state.DisplayValue = "已审核;"; | |||
| state.EnableInputArgument = true; | |||
| layout.Add("BillState", state); | |||
| layout.Add("OrderDate", QueryCreator.TimeRange(_mainInfo.Fields["OrderDate"], mQueryContainer, "MinOrderDate", "MaxOrderDate")); | |||
| var config = layout.CreateDefaultConfig(4); | |||
| config.Expand = false; | |||
| var section = mPageLayoutManager.AddSection("查询条件", "查询条件"); | |||
| section.ApplyLayout(layout, config, mPageLayoutManager, _mainInfo); | |||
| section.SetDisplayName("DeliverGoodsLine_ID", "送货线路"); | |||
| section.SetDisplayName("LoadTime", "发货时间"); | |||
| section.SetDisplayName("BillState", "单据状态"); | |||
| section.SetDisplayName("OrderDate", "订货时间"); | |||
| vPanel.Add(layout.CreateLayout(), new VLayoutOption(HorizontalAlign.Left)); | |||
| } | |||
| private Dictionary<string, string> fieldInfo = new Dictionary<string, string>() { {"Customer_Name", "购货客户" }, { "Goods_Name", "存货名称" },{ "Goods_Spec", "存货规格" }, { "Order_Detail_UnitNum", "订单数量" } }; | |||
| protected override void PrepareData() | |||
| { | |||
| base.PrepareData(); | |||
| var maxLoad = mQueryContainer.GetControl<DFDateTimeInput>("MaxLoadTime"); | |||
| var minLoad = mQueryContainer.GetControl<DFDateTimeInput>("MinLoadTime"); | |||
| var maxOrder = mQueryContainer.GetControl<DFDateTimeInput>("MaxOrderDate"); | |||
| var minOrder = mQueryContainer.GetControl<DFDateTimeInput>("MinOrderDate"); | |||
| var info = new SaleOutStorePrintInfo(); | |||
| if (!maxLoad.IsEmpty) | |||
| { | |||
| info.MaxLoadTime = maxLoad.Date; | |||
| } | |||
| if (!maxOrder.IsEmpty) | |||
| { | |||
| info.MaxOrderDate = maxOrder.Date; | |||
| } | |||
| if (!minLoad.IsEmpty) | |||
| { | |||
| info.MinLoadTime = minLoad.Date; | |||
| } | |||
| if (!minOrder.IsEmpty) | |||
| { | |||
| info.MinOrderDate = minOrder.Date; | |||
| } | |||
| info.BillStates = string.Join("|", billStateInput.GetValues().Select(x => x.Value)); | |||
| info.DeliverGoodsLines = deliverLineInput.Value; | |||
| info.Save(); | |||
| printAction.Url = "SaleOutStoreSimpleAnaysePrint.aspx"; | |||
| previewAction.Url = "SaleOutStoreSimpleAnaysePrint.aspx"; | |||
| SearchFlag = "1"; | |||
| } | |||
| protected override DQueryDom GetQueryDom() | |||
| { | |||
| var dom = base.GetQueryDom(); | |||
| var root = dom.From.RootSource.Alias; | |||
| var detail = JoinAlias.Create("detail"); | |||
| dom.Where.Conditions.Add(DQCondition.EQ(root, "Domain_ID", DomainContext.Current.ID)); | |||
| OrganizationUtil.AddOrganizationLimit(dom, typeof(SaleOutStore)); | |||
| foreach (var item in fieldInfo) | |||
| { | |||
| switch (item.Key) | |||
| { | |||
| case "Customer_Name": | |||
| dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(root, item.Key), item.Value)); | |||
| dom.GroupBy.Expressions.Add(DQExpression.Field(root, item.Key)); | |||
| break; | |||
| case "Goods_Name": | |||
| case "Goods_Spec": | |||
| dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(detail, item.Key), item.Value)); | |||
| dom.GroupBy.Expressions.Add(DQExpression.Field(detail, item.Key)); | |||
| break; | |||
| case "Order_Detail_UnitNum": | |||
| dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(detail, item.Key)), item.Value)); | |||
| SumColumnIndexs.Add(dom.Columns.Count - 1); | |||
| break; | |||
| default: | |||
| break; | |||
| } | |||
| } | |||
| return dom; | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,48 @@ | |||
| <?xml version="1.0" encoding="utf-8" ?> | |||
| <Select xmlns="urn:XDQuery"> | |||
| <Columns> | |||
| </Columns> | |||
| <From> | |||
| <Join type="Left"> | |||
| <DmoClass class="BWP.B3Sale.BO.SaleOutStore, B3Sale"/> | |||
| <DmoClass class="BWP.B3Sale.BO.SaleOutStore_Detail, B3Sale" alias="detail"/> | |||
| <Condition> | |||
| <EQ> | |||
| <Field name="ID"/> | |||
| <Field name="SaleOutStore_ID" alias="detail"/> | |||
| </EQ> | |||
| </Condition> | |||
| </Join> | |||
| </From> | |||
| <Where> | |||
| <And> | |||
| <QBEIn> | |||
| <Field name="BillState"/> | |||
| <QBE paramName ="BillState"/> | |||
| </QBEIn> | |||
| <GreaterThanOrEqual> | |||
| <Field name="OrderDate"/> | |||
| <QBE paramName="MinOrderDate" /> | |||
| </GreaterThanOrEqual> | |||
| <LessThanOrEqual> | |||
| <Field name="OrderDate"/> | |||
| <QBE paramName="MaxOrderDate"/> | |||
| </LessThanOrEqual> | |||
| <GreaterThanOrEqual> | |||
| <Field name="LoadTime"/> | |||
| <QBE paramName="MinLoadTime" /> | |||
| </GreaterThanOrEqual> | |||
| <LessThanOrEqual> | |||
| <Field name="LoadTime"/> | |||
| <QBE paramName="MaxLoadTime"/> | |||
| </LessThanOrEqual> | |||
| <QBEIn> | |||
| <Field name="DeliverGoodsLine_ID"/> | |||
| <QBE paramName="DeliverGoodsLine_ID"/> | |||
| </QBEIn> | |||
| </And> | |||
| </Where> | |||
| </Select> | |||
| @ -0,0 +1,332 @@ | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Web.UI; | |||
| using System.Web.UI.HtmlControls; | |||
| using TSingSoft.WebControls2; | |||
| using TSingSoft.WebControls2.BillReports; | |||
| using TSingSoft.WebPluginFramework; | |||
| using WebUnit = System.Web.UI.WebControls.Unit; | |||
| using Forks.EnterpriseServices.BusinessInterfaces; | |||
| using Forks.EnterpriseServices.DataForm; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.EnterpriseServices.SqlDoms; | |||
| using Forks.Utils; | |||
| using Forks.Utils.IO; | |||
| using System.Collections.Generic; | |||
| using System.Collections; | |||
| using System.IO; | |||
| using BWP.B3QingDaoWanFu.BO; | |||
| using BWP.B3Sale.BO; | |||
| using BWP.B3Frameworks; | |||
| using BWP.B3Frameworks.Utils; | |||
| using System; | |||
| namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ | |||
| { | |||
| class SaleOutStoreSimpleAnaysePrint : PrintPageBase | |||
| { | |||
| private Control CreateReport() | |||
| { | |||
| var result = new TemplateBillReport(); | |||
| var parameters = new Dictionary<string, object>(); | |||
| parameters.Add("$CurrentUserName", BLContext.User.Name); | |||
| AddParameters(parameters); | |||
| var autoAdd = new Dictionary<string, object>(); | |||
| foreach (KeyValuePair<string, object> pair in parameters) | |||
| { | |||
| if (pair.Value != null && pair.Value is ICollection) | |||
| { | |||
| string newKey = pair.Key + "_RecordCount"; | |||
| if (!parameters.ContainsKey(newKey)) | |||
| autoAdd.Add(newKey, ((ICollection)pair.Value).Count); | |||
| } | |||
| else if (pair.Value != null && pair.Value is LoadArguments) | |||
| { | |||
| string newKey = pair.Key + "_RecordCount"; | |||
| if (!parameters.ContainsKey(newKey)) | |||
| { | |||
| var loadArguments = new LoadArguments(((LoadArguments)pair.Value).DQuery.Clone() as DQueryDom); | |||
| loadArguments.DQuery.Range = SelectRange.Top(0); | |||
| var adapater = new DFDataAdapter(loadArguments); | |||
| var table = adapater.PagedFill(); | |||
| autoAdd.Add(newKey, table.TotalCount); | |||
| } | |||
| } | |||
| } | |||
| foreach (KeyValuePair<string, object> pair in autoAdd) | |||
| { | |||
| parameters.Add(pair.Key, pair.Value); | |||
| } | |||
| var printTemplateFile = Path.Combine(Wpf.Settings.ConfigFolder, GetTemplateFile()); | |||
| result.ParseTemplate(FS.OpenRead(printTemplateFile), parameters); | |||
| return result; | |||
| } | |||
| private string GetTemplateFile() | |||
| { | |||
| var xmlFile = Path.Combine(Wpf.Settings.ConfigFolder, "BillReports/" + "B3QingDaoWanFu" + "/" + "SaleOutStoreSimpleAnaysePrint.xml"); | |||
| var changedFile = Path.ChangeExtension(xmlFile, "chg"); | |||
| var result = string.Empty; | |||
| if (FS.FileExists(changedFile)) | |||
| { | |||
| result = changedFile; | |||
| } | |||
| else if (FS.FileExists(xmlFile)) | |||
| { | |||
| result = xmlFile; | |||
| } | |||
| else | |||
| { | |||
| return string.Empty; | |||
| } | |||
| return result.Substring(Wpf.Settings.ConfigFolder.Length + 1); | |||
| } | |||
| private void AddParameters(Dictionary<string, object> parameters) | |||
| { | |||
| parameters.Add("$Details", GetList()); | |||
| parameters.Add("$DetailsType", typeof(SaleOutStoreSimpleAnayseBo)); | |||
| } | |||
| private List<SaleOutStoreSimpleAnayseBo> GetList() | |||
| { | |||
| var list = new List<SaleOutStoreSimpleAnayseBo>(); | |||
| var query = GetQueryDom(); | |||
| using (var context = new TransactionContext()) | |||
| { | |||
| using (var reader = context.Session.ExecuteReader(query)) | |||
| { | |||
| while (reader.Read()) | |||
| { | |||
| int i = 0; | |||
| var item = new SaleOutStoreSimpleAnayseBo(); | |||
| item.Customer_Name = (string)reader[i++]; | |||
| item.Goods_Name = (string)reader[i++]; | |||
| item.Goods_Spec = (string)reader[i++]; | |||
| item.OrderNumber = (Money<decimal>?)reader[i++]; | |||
| list.Add(item); | |||
| } | |||
| } | |||
| } | |||
| return list; | |||
| } | |||
| #region | |||
| private string GetHtml() | |||
| { | |||
| var sb = new StringBuilder(); | |||
| sb.Append("<tr>"); | |||
| sb.Append("<td >存货名称</td>"); | |||
| sb.Append("<td > 计划号</td>"); | |||
| sb.Append("<td >计数规格</td>"); | |||
| sb.Append("<td >盘数</td>"); | |||
| sb.Append("<td >袋数</td>"); | |||
| sb.Append("<td >重量</td>"); | |||
| sb.Append("<td >包装模式</td>"); | |||
| sb.Append("</tr>"); | |||
| var query = GetQueryDom(); | |||
| using (var context = new TransactionContext()) | |||
| { | |||
| using (var reader = context.Session.ExecuteReader(query)) | |||
| { | |||
| while (reader.Read()) | |||
| { | |||
| int i = 0; | |||
| sb.Append("<tr>"); | |||
| sb.Append(string.Format("<td >{0}</td>", reader[i++])); | |||
| sb.Append(string.Format("<td >{0}</td>", reader[i++])); | |||
| sb.Append(string.Format("<td >{0}</td>", reader[i++])); | |||
| sb.Append(string.Format("<td >{0}</td>", reader[i++])); | |||
| sb.Append(string.Format("<td >{0}</td>", reader[i++])); | |||
| sb.Append(string.Format("<td >{0}</td>", reader[i++])); | |||
| sb.Append(string.Format("<td >{0}</td>", reader[i++])); | |||
| sb.Append("</tr>"); | |||
| } | |||
| } | |||
| } | |||
| return sb.ToString(); | |||
| } | |||
| #endregion | |||
| public SaleOutStorePrintInfo info { get; set; } | |||
| private string[] fieldInfo = new string[] { "Customer_Name", "Goods_Name", "Goods_Spec", "Order_Detail_UnitNum" }; | |||
| private DQueryDom GetQueryDom() | |||
| { | |||
| var root = new JoinAlias("__main", typeof(SaleOutStore)); | |||
| var detail = new JoinAlias("__detail", typeof(SaleOutStore_Detail)); | |||
| var dom = new DQueryDom(root); | |||
| dom.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(root, "ID", detail, "SaleOutStore_ID")); | |||
| foreach (var item in fieldInfo) | |||
| { | |||
| switch (item) | |||
| { | |||
| case "Customer_Name": | |||
| dom.Columns.Add(DQSelectColumn.Field(item, root)); | |||
| dom.GroupBy.Expressions.Add(DQExpression.Field(root, item)); | |||
| break; | |||
| case "Goods_Name": | |||
| case "Goods_Spec": | |||
| dom.Columns.Add(DQSelectColumn.Field(item, detail)); | |||
| dom.GroupBy.Expressions.Add(DQExpression.Field(detail, item)); | |||
| break; | |||
| case "Order_Detail_UnitNum": | |||
| dom.Columns.Add(DQSelectColumn.Sum( detail, item)); | |||
| break; | |||
| default: | |||
| break; | |||
| } | |||
| } | |||
| if (info != null) | |||
| { | |||
| if (info.MaxLoadTime != null) | |||
| { | |||
| dom.Where.Conditions.Add(DQCondition.LessThanOrEqual(root, "LoadTime", info.MaxLoadTime)); | |||
| } | |||
| if (info.MaxOrderDate != null) | |||
| { | |||
| dom.Where.Conditions.Add(DQCondition.LessThanOrEqual(root, "OrderDate", info.MaxOrderDate)); | |||
| } | |||
| if (info.MinLoadTime != null) | |||
| { | |||
| dom.Where.Conditions.Add(DQCondition.GreaterThanOrEqual(root, "LoadTime", info.MinLoadTime)); | |||
| } | |||
| if (info.MinOrderDate != null) | |||
| { | |||
| dom.Where.Conditions.Add(DQCondition.GreaterThanOrEqual(root, "OrderDate", info.MinOrderDate)); | |||
| } | |||
| if (!string.IsNullOrEmpty(info.BillStates)) | |||
| { | |||
| dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(root, "BillState"), info.BillStates.Split('|').Select(x=>DQExpression.Value(x)).ToArray())); | |||
| } | |||
| if (!string.IsNullOrEmpty(info.DeliverGoodsLines)) | |||
| { | |||
| dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(root, "DeliverGoodsLine_ID"), info.DeliverGoodsLines.Split('|').Select(x => DQExpression.Value(x)).ToArray())); | |||
| } | |||
| } | |||
| dom.Where.Conditions.Add(DQCondition.EQ(root, "Domain_ID", DomainContext.Current.ID)); | |||
| OrganizationUtil.AddOrganizationLimit(dom, typeof(SaleOutStore)); | |||
| return dom; | |||
| } | |||
| private bool Print | |||
| { | |||
| get { return Request.QueryString["Print"] == "1"; } | |||
| } | |||
| protected virtual bool SkipPrintBL | |||
| { | |||
| get | |||
| { | |||
| return false; | |||
| } | |||
| } | |||
| protected override void InitForm(HtmlForm form) | |||
| { | |||
| LoadQueryInfo(); | |||
| var absoluteSet = false; | |||
| form.Controls.Add(new LiteralControl(PagerBand.PageBreak)); | |||
| Control pageContainer = CreatePageContainer(CreateReport(), out absoluteSet); | |||
| form.Controls.Add(pageContainer); | |||
| } | |||
| private void LoadQueryInfo() | |||
| { | |||
| info = SaleOutStorePrintInfo.Load(); | |||
| } | |||
| private int pagesCount; | |||
| private int slipPages; | |||
| private WebUnit pageHeight = WebUnit.Empty; | |||
| private Control CreatePageContainer(Control control, out bool absoluteSet) | |||
| { | |||
| absoluteSet = false; | |||
| foreach (Control ctrl in control.Controls) | |||
| { | |||
| BillReport r = ctrl as BillReport; | |||
| if (r != null) | |||
| { | |||
| pagesCount += r.PagesCount; | |||
| if (pageHeight == WebUnit.Empty) | |||
| pageHeight = r.PageHeight; | |||
| } | |||
| } | |||
| HtmlGenericControl result = new HtmlGenericControl("div"); | |||
| result.Style[HtmlTextWriterStyle.Width] = "100%"; | |||
| result.Style[HtmlTextWriterStyle.Padding] = "0cm"; | |||
| result.Style[HtmlTextWriterStyle.BorderWidth] = "0cm"; | |||
| result.Style[HtmlTextWriterStyle.Margin] = "0cm"; | |||
| if (!pageHeight.IsEmpty) | |||
| { | |||
| result.Style[HtmlTextWriterStyle.Top] = new WebUnit((pageHeight.Value * slipPages), pageHeight.Type).ToString(); | |||
| result.Style[HtmlTextWriterStyle.Position] = "absolute"; | |||
| absoluteSet = true; | |||
| } | |||
| result.Controls.Add(control); | |||
| slipPages = pagesCount; | |||
| return result; | |||
| } | |||
| public string PrintName | |||
| { | |||
| get { return "班组包材领用测算表"; } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,71 @@ | |||
| using BWP.B3Frameworks.BO; | |||
| using Forks.EnterpriseServices; | |||
| using Forks.EnterpriseServices.BusinessInterfaces; | |||
| using Forks.EnterpriseServices.DataForm; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.EnterpriseServices.SqlDoms; | |||
| using Forks.Utils.Caching; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using TSingSoft.WebPluginFramework; | |||
| namespace BWP.B3QingDaoWanFu.BO | |||
| { | |||
| [Serializable] | |||
| [DFClass] | |||
| [LogicName("查询信息")] | |||
| public class SaleOutStorePrintInfo | |||
| { | |||
| public DateTime? MaxOrderDate { get; set; } | |||
| public DateTime? MinOrderDate { get; set; } | |||
| public DateTime? MaxLoadTime { get; set; } | |||
| public DateTime? MinLoadTime { get; set; } | |||
| public string DeliverGoodsLines { get; set; } | |||
| public string BillStates { get; set; } | |||
| private static string CreateCacheKey(Type type) | |||
| { | |||
| return string.Format("SaleOutStorePrintInfo_{0}", type.FullName); | |||
| } | |||
| public static SaleOutStorePrintInfo Load() | |||
| { | |||
| var type = typeof(SaleOutStorePrintInfo); | |||
| SaleOutStorePrintInfo result = null; | |||
| CacheManager.TryGet(CreateCacheKey(type), out result); | |||
| if (result == null) | |||
| { | |||
| result = new SaleOutStorePrintInfo(); | |||
| } | |||
| return result; | |||
| } | |||
| public void Save() | |||
| { | |||
| CacheManager.Remove(CreateCacheKey(typeof(SaleOutStorePrintInfo))); | |||
| CacheManager.Put(CreateCacheKey(typeof(SaleOutStorePrintInfo)), this); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,35 @@ | |||
| using Forks.EnterpriseServices; | |||
| using Forks.EnterpriseServices.DataForm; | |||
| using Forks.Utils; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| namespace BWP.B3QingDaoWanFu.BO | |||
| { | |||
| [LogicName("销售出库分析打印")] | |||
| [DFClass] | |||
| [Serializable] | |||
| public class SaleOutStoreSimpleAnayseBo | |||
| { | |||
| [LogicName("存货名称")] | |||
| public string Goods_Name { get; set; } | |||
| [LogicName("存货规格")] | |||
| public string Goods_Spec { get; set; } | |||
| [LogicName("购货客户")] | |||
| public string Customer_Name { get; set; } | |||
| [LogicName("订单数量")] | |||
| public Money<decimal>? OrderNumber { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| <?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> | |||
| <DFListBand collection="$Details" itemType="$DetailType" enablePaging="true" > | |||
| <Field name="Goods_Name"/> | |||
| <Field name="Customer_Name"/> | |||
| <Field name="Goods_Code"/> | |||
| <Field name="OrderNumber" sum="true"/> | |||
| </DFListBand> | |||
| </Bands> | |||
| </BillReport> | |||
| </Report> | |||
| </BillReports> | |||